From e34d86b485315f8d36df6b13943948b56942c637 Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 9 Nov 2016 12:42:47 -0600 Subject: [PATCH] Stops player update before sending stopping of shared video. We used to stop player updates on self presence received, so between stop and self presence we can send a playing update which will provoke adding the video again to other participants. --- modules/UI/shared_video/SharedVideo.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js index 8991de840..501b40ba4 100644 --- a/modules/UI/shared_video/SharedVideo.js +++ b/modules/UI/shared_video/SharedVideo.js @@ -84,6 +84,14 @@ export default class SharedVideoManager { if(APP.conference.isLocalId(this.from)) { showStopVideoPropmpt().then(() => { + // make sure we stop updates for playing before we send stop + // if we stop it after receiving self presence, we can end + // up sending stop playing, and on the other end it will not + // stop + if(this.intervalId) { + clearInterval(this.intervalId); + this.intervalId = null; + } this.emitter.emit( UIEvents.UPDATE_SHARED_VIDEO, this.url, 'stop'); JitsiMeetJS.analytics.sendEvent('sharedvideo.stoped'); @@ -423,11 +431,6 @@ export default class SharedVideoManager { } } - if(this.intervalId) { - clearInterval(this.intervalId); - this.intervalId = null; - } - this.emitter.removeListener(UIEvents.AUDIO_MUTED, this.localAudioMutedListener); this.localAudioMutedListener = null;