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;