video.play();
};
+app.withVideo = function(id, callback) {
+ return function() {
+ var video = document.getElementById(id);
+
+ if(video) {
+ callback(video);
+ }
+ };
+};
+
app.streams = [
{
name: "Room 123",
return m("video.lp-video", {
id: "speaker-video",
controls: true,
- autoplay: true
+ autoplay: true,
+ // Sync desktop stream state as best we can.
+ onpause: app.withVideo("desktop-video", function(video) {
+ video.pause();
+ }),
+ onplay: app.withVideo("desktop-video", function(video) {
+ video.play();
+ })
}, [
m("source", {
src: app.mountToStreamUrl(stream.speakerMount)