From: Andrew Engelbrecht Date: Wed, 20 Mar 2019 21:22:16 +0000 (-0400) Subject: try reloading video 3 seconds after the video ends X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ba08e1b2c3d3612feb6796d3d2f668ce95bc7ed0;p=libreplanet-static.git try reloading video 3 seconds after the video ends this allows streams on the live page to continue even if they are interrupted --- diff --git a/2019/assets/js/stream.js b/2019/assets/js/stream.js index 6fd6804b..866719bc 100644 --- a/2019/assets/js/stream.js +++ b/2019/assets/js/stream.js @@ -178,6 +178,12 @@ app.view = function(ctrl) { }), onplay: app.withVideo("desktop-video", function(video) { video.play(); + }), + onended: app.withVideo("desktop-video", function(video) { + setTimeout(function() { + video.load(); + video.play(); + }, 3000); }) }, [ m("source", { @@ -196,7 +202,13 @@ app.view = function(ctrl) { return m("video.lp-video", { id: "desktop-video", controls: true, - autoplay: true + autoplay: true, + onended: app.withVideo("desktop-video", function(video) { + setTimeout(function() { + video.load(); + video.play(); + }, 3000); + }) }, [ m("source", { src: app.mountToStreamUrl(stream.desktopMount) + "?t=" + (new Date() * 1) }), m("p",