From 0c0db4ecc70f935dad7ed4cf180881e7f7fdf4ab Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 31 Jan 2019 21:48:44 -0700 Subject: [PATCH] Copy over disablement of media streams after permissions requested Fixes https://github.com/vector-im/riot-web/issues/8340 --- src/components/views/settings/tabs/VoiceSettingsTab.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/views/settings/tabs/VoiceSettingsTab.js b/src/components/views/settings/tabs/VoiceSettingsTab.js index 6e48d7f083..65f38c7841 100644 --- a/src/components/views/settings/tabs/VoiceSettingsTab.js +++ b/src/components/views/settings/tabs/VoiceSettingsTab.js @@ -40,7 +40,13 @@ export default class VoiceSettingsTab extends React.Component { this._refreshMediaDevices(); } - _refreshMediaDevices = async () => { + _refreshMediaDevices = async (stream) => { + if (stream) { + // kill stream so that we don't leave it lingering around with webcam enabled etc + // as here we called gUM to ask user for permission to their device names only + stream.getTracks().forEach((track) => track.stop()); + } + this.setState({ mediaDevices: await CallMediaHandler.getDevices(), activeAudioOutput: CallMediaHandler.getAudioOutput(),