浏览代码

Updates statistics when device is not found.

We log an application log to callstats and analytics event.
master
damencho 9 年前
父节点
当前提交
bc2c8f06c7
共有 1 个文件被更改,包括 14 次插入6 次删除
  1. 14
    6
      JitsiMeetJS.js

+ 14
- 6
JitsiMeetJS.js 查看文件

250
                     Statistics.sendLog(JSON.stringify(logObject));
250
                     Statistics.sendLog(JSON.stringify(logObject));
251
                     Statistics.analytics.sendEvent(
251
                     Statistics.analytics.sendEvent(
252
                         "getUserMedia.userCancel.extensionInstall");
252
                         "getUserMedia.userCancel.extensionInstall");
253
+                } else if (JitsiTrackErrors.NOT_FOUND === error.name) {
254
+                    // logs not found devices with just application log to cs
255
+                    var logObject = {
256
+                        id: "usermedia_missing_device",
257
+                        status: error.gum.devices
258
+                    };
259
+                    Statistics.sendLog(JSON.stringify(logObject));
260
+                    Statistics.analytics.sendEvent(
261
+                        "getUserMedia.deviceNotFound."
262
+                            + error.gum.devices.join('.'));
253
                 } else {
263
                 } else {
254
                     // Report gUM failed to the stats
264
                     // Report gUM failed to the stats
255
                     Statistics.sendGetUserMediaFailed(error);
265
                     Statistics.sendGetUserMediaFailed(error);
266
+                    Statistics.analytics.sendEvent(
267
+                        addDeviceTypeToAnalyticsEvent(
268
+                            "getUserMedia.failed", options) + '.' + error.name,
269
+                        options);
256
                 }
270
                 }
257
 
271
 
258
                 window.connectionTimes["obtainPermissions.end"] =
272
                 window.connectionTimes["obtainPermissions.end"] =
259
                     window.performance.now();
273
                     window.performance.now();
260
 
274
 
261
-
262
-                Statistics.analytics.sendEvent(
263
-                    addDeviceTypeToAnalyticsEvent(
264
-                        "getUserMedia.failed", options) + '.' + error.name,
265
-                    options);
266
-
267
                 return Promise.reject(error);
275
                 return Promise.reject(error);
268
             }.bind(this));
276
             }.bind(this));
269
     },
277
     },

正在加载...
取消
保存