Merge pull request #1931 from matrix-org/t3chguy/webcam_light

kill stream when using gUM for permission to device labels to turn off camera
pull/21833/head
Luke Barnard 2018-05-29 12:12:52 +01:00 committed by GitHub
commit 3a222e02f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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
// 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) => {