Browse Source

devicesReceived array should not be modified

dev1
Maxence Dalmais (maxired) 4 years ago
parent
commit
0633de599a
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      modules/RTC/RTCUtils.js

+ 3
- 3
modules/RTC/RTCUtils.js View File

@@ -664,9 +664,9 @@ function onMediaDevicesListChanged(devicesReceived) {
664 664
     sendDeviceListToAnalytics(availableDevices);
665 665
 
666 666
     // Used by tracks to update the real device id before the consumer of lib-jitsi-meet receives the new device list.
667
-    eventEmitter.emit(RTCEvents.DEVICE_LIST_WILL_CHANGE, devicesReceived);
667
+    eventEmitter.emit(RTCEvents.DEVICE_LIST_WILL_CHANGE, availableDevices);
668 668
 
669
-    eventEmitter.emit(RTCEvents.DEVICE_LIST_CHANGED, devicesReceived);
669
+    eventEmitter.emit(RTCEvents.DEVICE_LIST_CHANGED, availableDevices);
670 670
 }
671 671
 
672 672
 /**
@@ -846,7 +846,7 @@ class RTCUtils extends Listenable {
846 846
 
847 847
         if (this.isDeviceListAvailable()) {
848 848
             this.enumerateDevices(ds => {
849
-                availableDevices = ds.splice(0);
849
+                availableDevices = ds.slice(0);
850 850
 
851 851
                 logger.debug('Available devices: ', availableDevices);
852 852
                 sendDeviceListToAnalytics(availableDevices);

Loading…
Cancel
Save