From 774785c648058706dc65d7750d22cded6629fa6c Mon Sep 17 00:00:00 2001 From: George Politis Date: Mon, 20 Oct 2014 11:50:15 +0200 Subject: [PATCH] Attempts to prevent blackness when switching simulcast streams. --- index.html | 3 ++- videolayout.js | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 8171f3f3e..e961fa68c 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@ - + @@ -249,6 +249,7 @@
powered by jitsi.org +
diff --git a/videolayout.js b/videolayout.js index 63013d5b2..9d50b80d5 100644 --- a/videolayout.js +++ b/videolayout.js @@ -227,7 +227,13 @@ var VideoLayout = (function (my) { if (fade) { $('#largeVideo').fadeOut(300, doUpdate); } else { - doUpdate(); + $("#preload").attr("src", largeVideoState.newSrc); + // The 'canplay' event occurs when the browser can start + // playing the specified audio/video. See: + // http://www.w3schools.com/tags/av_event_canplay.asp + $("#preload").one("canplay",function(){ + doUpdate(); + }); } } }