Skip to content

Commit

Permalink
Fix issue with duplicated devices
Browse files Browse the repository at this point in the history
Fix an issue with duplicated devices being listed on DetectRTC.MediaDevices, DetectRTC.audioInputDevices, DetectRTC.audioOutputDevices, DetectRTC.videoInputDevices when calling DetectRTC.load() multiple times in a row.
  • Loading branch information
rodrigoscna committed Mar 17, 2020
1 parent d2b7d96 commit 48e798e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev/CheckDeviceSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ function checkDeviceSupport(callback) {
var alreadyUsedDevices = {};

navigator.enumerateDevices(function(devices) {
MediaDevices = [];

audioInputDevices = [];
audioOutputDevices = [];
videoInputDevices = [];

devices.forEach(function(_device) {
var device = {};
for (var d in _device) {
Expand Down

0 comments on commit 48e798e

Please sign in to comment.