try reloading video 3 seconds after the video ends
authorAndrew Engelbrecht <andrew@fsf.org>
Wed, 20 Mar 2019 21:22:16 +0000 (17:22 -0400)
committerAndrew Engelbrecht <andrew@fsf.org>
Wed, 20 Mar 2019 21:22:16 +0000 (17:22 -0400)
this allows streams on the live page to continue even if they are
interrupted

2019/assets/js/stream.js

index 6fd6804bacdda44c6adf3d96bcb65f9f9f03ce49..866719bc2414e9ba50b95a4d55c6299814c06066 100644 (file)
@@ -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",