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:
commit
3a222e02f1
1 changed files with 7 additions and 1 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue