From: Andrew Engelbrecht Date: Wed, 21 Mar 2018 21:55:44 +0000 (-0400) Subject: added controls to desktop-stream videos X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=14499f79d4fea5dc1d0b146cf2288b8c5f907bff;p=libreplanet-static.git added controls to desktop-stream videos 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. --- diff --git a/2018/assets/js/stream.js b/2018/assets/js/stream.js index 35f86f35..18d37516 100644 --- a/2018/assets/js/stream.js +++ b/2018/assets/js/stream.js @@ -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",