ソースを参照

ref(RTC): Distinguish data by using different names.

master
Guus der Kinderen 6年前
コミット
cd1a89c49e
1個のファイルの変更12行の追加12行の削除
  1. 12
    12
      modules/RTC/RTCUtils.js

+ 12
- 12
modules/RTC/RTCUtils.js ファイルの表示

1552
 
1552
 
1553
 /**
1553
 /**
1554
  *
1554
  *
1555
- * @param options
1555
+ * @param context Execution context, containing options and callbacks
1556
  */
1556
  */
1557
-function obtainDevices(options) {
1558
-    if (!options.devices || options.devices.length === 0) {
1559
-        return options.successCallback(options.streams || {});
1557
+function obtainDevices(context) {
1558
+    if (!context.devices || context.devices.length === 0) {
1559
+        return context.successCallback(context.streams || {});
1560
     }
1560
     }
1561
 
1561
 
1562
-    const device = options.devices.splice(0, 1);
1562
+    const device = context.devices.splice(0, 1);
1563
 
1563
 
1564
-    options.deviceGUM[device](options.options)
1564
+    context.deviceGUM[device](context.options)
1565
         .then(stream => {
1565
         .then(stream => {
1566
-            options.streams = options.streams || {};
1567
-            options.streams[device] = stream;
1568
-            obtainDevices(options);
1566
+            context.streams = context.streams || {};
1567
+            context.streams[device] = stream;
1568
+            obtainDevices(context);
1569
         }, error => {
1569
         }, error => {
1570
-            Object.keys(options.streams).forEach(
1571
-                d => rtcUtils.stopMediaStream(options.streams[d]));
1570
+            Object.keys(context.streams).forEach(
1571
+                d => rtcUtils.stopMediaStream(context.streams[d]));
1572
             logger.error(
1572
             logger.error(
1573
                 `failed to obtain ${device} stream - stop`, error);
1573
                 `failed to obtain ${device} stream - stop`, error);
1574
 
1574
 
1575
-            options.errorCallback(error);
1575
+            context.errorCallback(error);
1576
         });
1576
         });
1577
 }
1577
 }
1578
 
1578
 

読み込み中…
キャンセル
保存