Fix screen unshare on Chrome 47+

Backport f78bc2596c
This commit is contained in:
Daniel Berteaud 2016-07-19 15:36:54 +02:00
parent 5eae36ef1f
commit 572d0b47cd
1 changed files with 3 additions and 1 deletions

View File

@ -430,7 +430,9 @@ SimpleWebRTC.prototype.stopScreenShare = function () {
// a hack to emit the event the removes the video
// element that we want
if (videoEl) this.emit('videoRemoved', videoEl);
if (stream) stream.stop();
if (stream) {
stream.getTracks().forEach(function (track) { track.stop(); });
}
this.webrtc.peers.forEach(function (peer) {
if (peer.broadcaster) {
peer.end();