From 4be0444bf4aeb64d47fc6cc2fdd5c43445fc3483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5var=20Aamb=C3=B8=20Fosstveit?= Date: Fri, 26 Oct 2018 08:41:51 +0200 Subject: [PATCH] Remove support for device cookie at the moment --- app/lib/RoomClient.js | 53 +++++++------------------------------------ 1 file changed, 8 insertions(+), 45 deletions(-) diff --git a/app/lib/RoomClient.js b/app/lib/RoomClient.js index c8b857b..11f8555 100644 --- a/app/lib/RoomClient.js +++ b/app/lib/RoomClient.js @@ -1273,27 +1273,9 @@ export default class RoomClient await this._updateAudioDevices(); - const devicesCookie = cookiesManager.getDevices(); - - let audioDeviceId; - - if (devicesCookie) - audioDeviceId = devicesCookie.audioDeviceId; - logger.debug('_setMicProducer() | calling getUserMedia()'); - let stream; - - if (this._audioDevices.has(audioDeviceId)) - stream = await navigator.mediaDevices.getUserMedia( - { - audio : - { - deviceId : { exact: audioDeviceId } - } - }); - else - stream = await navigator.mediaDevices.getUserMedia({ audio: true }); + const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); const track = stream.getAudioTracks()[0]; @@ -1512,35 +1494,16 @@ export default class RoomClient if (!device) throw new Error('no webcam devices'); - const devicesCookie = cookiesManager.getDevices(); - - let videoDeviceId; - - if (devicesCookie) - videoDeviceId = devicesCookie.videoDeviceId; - logger.debug('_setWebcamProducer() | calling getUserMedia()'); - let stream; - - if (this._webcams.has(videoDeviceId)) - stream = await navigator.mediaDevices.getUserMedia( + const stream = await navigator.mediaDevices.getUserMedia( + { + video : { - video : - { - deviceId : { exact: videoDeviceId }, - ...VIDEO_CONSTRAINS - } - }); - else - stream = await navigator.mediaDevices.getUserMedia( - { - video : - { - deviceId : { exact: device.deviceId }, - ...VIDEO_CONSTRAINS - } - }); + deviceId : { exact: device.deviceId }, + ...VIDEO_CONSTRAINS + } + }); const track = stream.getVideoTracks()[0];