From 55b74bcb48b893918f8210adc22e699b6b550d42 Mon Sep 17 00:00:00 2001 From: Darlingnotin Date: Sat, 17 Oct 2020 15:23:23 -0400 Subject: [PATCH] Update videoSyncServerScript.js --- videoSyncServerScript.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/videoSyncServerScript.js b/videoSyncServerScript.js index ebc9a5b..de24e97 100644 --- a/videoSyncServerScript.js +++ b/videoSyncServerScript.js @@ -168,6 +168,17 @@ timeStampInterval = Script.setInterval(function () { timeStamp = timeStamp + 1; pingTimer = pingTimer + 1; + if (timeStamp > videoLength) { + Script.clearInterval(timeStampInterval); + videoUrl = ""; + videoPlaying = false; + intervalIsRunning = false; + var readyEvent = { + action: "videoEnd" + }; + var message = JSON.stringify(readyEvent); + Messages.sendMessage(videoPlayerChannel, message); + } if (pingTimer == 60) { pingTimer = 0; messageData.timeStamp = timeStamp;