Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : devicesReceived array should not be modified #1411

Merged
merged 1 commit into from Dec 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/RTC/RTCUtils.js
Expand Up @@ -664,9 +664,9 @@ function onMediaDevicesListChanged(devicesReceived) {
sendDeviceListToAnalytics(availableDevices);

// Used by tracks to update the real device id before the consumer of lib-jitsi-meet receives the new device list.
eventEmitter.emit(RTCEvents.DEVICE_LIST_WILL_CHANGE, devicesReceived);
eventEmitter.emit(RTCEvents.DEVICE_LIST_WILL_CHANGE, availableDevices);

eventEmitter.emit(RTCEvents.DEVICE_LIST_CHANGED, devicesReceived);
eventEmitter.emit(RTCEvents.DEVICE_LIST_CHANGED, availableDevices);
}

/**
Expand Down Expand Up @@ -846,7 +846,7 @@ class RTCUtils extends Listenable {

if (this.isDeviceListAvailable()) {
this.enumerateDevices(ds => {
availableDevices = ds.splice(0);
availableDevices = ds.slice(0);

logger.debug('Available devices: ', availableDevices);
sendDeviceListToAnalytics(availableDevices);
Expand Down