From 14499f79d4fea5dc1d0b146cf2288b8c5f907bff Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Wed, 21 Mar 2018 17:55:44 -0400 Subject: [PATCH] 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. --- 2018/assets/js/stream.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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", -- 2.25.1