From 00684f72ac0da49654c6c435c0264ed0754e145b Mon Sep 17 00:00:00 2001
From: Lucas Zawacki <lfzawacki@gmail.com>
Date: Wed, 11 Sep 2019 18:43:25 -0300
Subject: [PATCH] Send most updated version of state.playing into the external
 video handlers

---
 .../ui/components/external-video-player/component.jsx        | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bigbluebutton-html5/imports/ui/components/external-video-player/component.jsx b/bigbluebutton-html5/imports/ui/components/external-video-player/component.jsx
index 646bf0cdc5..5c7f21fb5d 100644
--- a/bigbluebutton-html5/imports/ui/components/external-video-player/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/external-video-player/component.jsx
@@ -112,14 +112,13 @@ class VideoPlayer extends Component {
 
   registerVideoListeners() {
     const { isPresenter } = this.props;
-    const { playing } = this.state;
 
     if (isPresenter) {
       this.syncInterval = setInterval(() => {
         const curTime = this.player.getCurrentTime();
         const rate = this.getCurrentPlaybackRate();
 
-        sendMessage('playerUpdate', { rate, time: curTime, state: playing });
+        sendMessage('playerUpdate', { rate, time: curTime, state: this.state.playing });
       }, SYNC_INTERVAL_SECONDS * 1000);
     } else {
       onMessage('play', ({ time }) => {
@@ -168,7 +167,7 @@ class VideoPlayer extends Component {
           }, 'Seek external video to:');
         }
 
-        if (playing !== data.state) {
+        if (this.state.playing !== data.state) {
           this.setState({ playing: data.state });
         }
       });
-- 
GitLab