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

kill stream when using gUM for permission to device labels to turn off camera
This commit is contained in:
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

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