Sfoglia il codice sorgente

Report DOMException when audio output device change fails as gUM error to callstats

master
tsareg 9 anni fa
parent
commit
5e4aa82cad
5 ha cambiato i file con 20 aggiunte e 9 eliminazioni
  1. 6
    2
      JitsiConference.js
  2. 5
    1
      JitsiMeetJS.js
  3. 2
    2
      JitsiTrackError.js
  4. 1
    1
      doc/API.md
  5. 6
    3
      modules/RTC/RTCUtils.js

+ 6
- 2
JitsiConference.js Vedi File

@@ -60,7 +60,11 @@ function JitsiConference(options) {
60 60
         this.statistics.sendGetUserMediaFailed(error);
61 61
     }.bind(this));
62 62
     JitsiMeetJS._globalOnErrorHandler.push(function(error) {
63
-        this.statistics.sendUnhandledError(error);
63
+        if (error instanceof JitsiTrackError && error.gum) {
64
+            this.statistics.sendGetUserMediaFailed(error);
65
+        } else {
66
+            this.statistics.sendUnhandledError(error);
67
+        }
64 68
     }.bind(this));
65 69
     this.participants = {};
66 70
     this.lastDominantSpeaker = null;
@@ -1310,7 +1314,7 @@ function setupListeners(conference) {
1310 1314
                 conference.statistics.sendIceConnectionFailedEvent(pc);
1311 1315
                 conference.room.eventEmitter.emit(
1312 1316
                     XMPPEvents.CONFERENCE_SETUP_FAILED,
1313
-                    new Error("ICE fail")); 
1317
+                    new Error("ICE fail"));
1314 1318
             });
1315 1319
 
1316 1320
         conference.rtc.addListener(RTCEvents.TRACK_ATTACHED,

+ 5
- 1
JitsiMeetJS.js Vedi File

@@ -197,7 +197,11 @@ var LibJitsiMeet = {
197 197
               handler(error);
198 198
           });
199 199
         } else {
200
-            Statistics.sendUnhandledError(error);
200
+            if (error instanceof JitsiTrackError && error.gum) {
201
+                Statistics.sendGetUserMediaFailed(error);
202
+            } else {
203
+                Statistics.sendUnhandledError(error);
204
+            }
201 205
         }
202 206
     },
203 207
 

+ 2
- 2
JitsiTrackError.js Vedi File

@@ -33,8 +33,8 @@ TRACK_ERROR_TO_MESSAGE_MAP[JitsiTrackErrors.TRACK_MUTE_UNMUTE_IN_PROGRESS]
33 33
  * @param {Object|string} error - error object or error name
34 34
  * @param {Object|string} (options) - getUserMedia constraints object or error
35 35
  *      message
36
- * @param {('audio'|'video'|'desktop'|'screen')[]} (devices) - list of
37
- *      getUserMedia requested devices
36
+ * @param {('audio'|'video'|'desktop'|'screen'|'audiooutput')[]} (devices) -
37
+ *      list of getUserMedia requested devices
38 38
  */
39 39
 function JitsiTrackError(error, options, devices) {
40 40
     if (typeof error === "object" && typeof error.name !== "undefined") {

+ 1
- 1
doc/API.md Vedi File

@@ -381,7 +381,7 @@ so ```"name"```, ```"message"``` and ```"stack"``` properties are available. For
381 381
 exposes additional ```"gum"``` property, which is an object with following properties:
382 382
  - error - original GUM error
383 383
  - constraints - GUM constraints object used for the call
384
- - devices - array of devices requested in GUM call (possible values - "audio", "video", "screen", "desktop")
384
+ - devices - array of devices requested in GUM call (possible values - "audio", "video", "screen", "desktop", "audiooutput")
385 385
 
386 386
 Getting Started
387 387
 ==============

+ 6
- 3
modules/RTC/RTCUtils.js Vedi File

@@ -578,12 +578,15 @@ function wrapAttachMediaStream(origAttachMediaStream) {
578 578
             stream.getAudioTracks && stream.getAudioTracks().length) {
579 579
             element.setSinkId(RTCUtils.getAudioOutputDevice())
580 580
                 .catch(function (ex) {
581
+                    var err = new JitsiTrackError(ex, null, ['audiooutput']);
582
+
581 583
                     GlobalOnErrorHandler.callUnhandledRejectionHandler(
582
-                        {promise: this, reason: ex});
584
+                        {promise: this, reason: err});
585
+
583 586
                     logger.warn('Failed to set audio output device for the ' +
584 587
                         'element. Default audio output device will be used ' +
585 588
                         'instead',
586
-                        element, ex);
589
+                        element, err);
587 590
                 });
588 591
         }
589 592
 
@@ -603,7 +606,7 @@ var RTCUtils = {
603 606
             disableNS = options.disableNS;
604 607
             logger.info("Disable NS: " + disableNS);
605 608
         }
606
-        
609
+
607 610
         return new Promise(function(resolve, reject) {
608 611
             if (RTCBrowserType.isFirefox()) {
609 612
                 var FFversion = RTCBrowserType.getFirefoxVersion();

Loading…
Annulla
Salva