kill stream when using gUM for permission to device labels to kill camera

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2018-05-26 15:41:25 +01:00
parent bbdc27019a
commit 5147246c17
No known key found for this signature in database
GPG Key ID: 3F879DA5AD802A5E
1 changed files with 6 additions and 1 deletions

View File

@ -284,7 +284,12 @@ 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
stream.getTracks().forEach((track) => track.stop());
}
Promise.resolve().then(() => {
return CallMediaHandler.getDevices();
}).then((mediaDevices) => {