added controls to desktop-stream videos
authorAndrew Engelbrecht <andrew@fsf.org>
Wed, 21 Mar 2018 21:55:44 +0000 (17:55 -0400)
committerAndrew Engelbrecht <andrew@fsf.org>
Wed, 21 Mar 2018 21:55:44 +0000 (17:55 -0400)
this is so viewers can see the controls for their desktop stream, which
should give them a hint if that video is stopped and no-longer
streaming. we also have to pause and play the main stream when the
destkop stream is paused / resumed.

2018/assets/js/stream.js

index 35f86f35f43faf3e7b7dcb4f35095081245b1303..18d37516762ae8a3898f584fafcb53692652ad9c 100644 (file)
@@ -201,7 +201,15 @@ app.view = function(ctrl) {
   function renderDesktopStream() {
     return m("video.lp-video", {
       id: "desktop-video",
+      controls: true,
       autoplay: true
+      // Sync speaker stream state as best we can.
+      onpause: app.withVideo("speaker-video", function(video) {
+        video.pause();
+      }),
+      onplay: app.withVideo("speaker-video", function(video) {
+        video.play();
+      })
     }, [
       m("source", { src: app.mountToStreamUrl(stream.desktopMount) + "?t=" + (new Date() * 1) }),
       m("p",