Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

kill stream when using gUM for permission to device labels to turn off camera #1931

Merged
merged 2 commits into from
May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/structures/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,13 @@ module.exports = React.createClass({
this.setState({ electron_settings: settings });
},

_refreshMediaDevices: function() {
_refreshMediaDevices: function(stream) {
if (stream) {
// kill stream so that we don't leave it lingering around with webcam enabled etc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps also explain that we don't need streams now, we just need device IDs to populate the audio and video input dropdowns.

// as here we called gUM to ask user for permission to their device names only
stream.getTracks().forEach((track) => track.stop());
}

Promise.resolve().then(() => {
return CallMediaHandler.getDevices();
}).then((mediaDevices) => {
Expand Down