From 572d0b47cd344b3cfb39962d2a8ebc965632818d Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 19 Jul 2016 15:36:54 +0200 Subject: [PATCH] Fix screen unshare on Chrome 47+ Backport https://github.com/andyet/SimpleWebRTC/commit/f78bc2596c3b69a42f91dde229ff960055ae373a --- public/js/simplewebrtc.bundle.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/js/simplewebrtc.bundle.js b/public/js/simplewebrtc.bundle.js index 9e707b9..6ed0453 100644 --- a/public/js/simplewebrtc.bundle.js +++ b/public/js/simplewebrtc.bundle.js @@ -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();