From 3a699ae3e1f81df1ea8fd3235bd819363b3e7fd9 Mon Sep 17 00:00:00 2001 From: Cat Date: Wed, 4 Jul 2018 11:37:44 +0200 Subject: [PATCH] Embed: added workaround for IE-only issue when seeking after trackswitch --- embed/core.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/embed/core.js b/embed/core.js index 722cc2ef..4aae50e0 100644 --- a/embed/core.js +++ b/embed/core.js @@ -161,7 +161,19 @@ MistPlayer.prototype.setTracks = function(usetracks){ this.element.load(); } - this.element.currentTime = time; + + if (this.element.currentTime != time) { + try { + this.element.currentTime = time; + } + catch (e) { + var f = function(){ + this.currentTime = time; + this.removeEventListener("loadeddata",f); + }; + this.element.addEventListener("loadeddata",f); + } + } if ('trackselects' in this) { for (var i in usetracks) { @@ -1429,7 +1441,7 @@ function mistPlay(streamName,options) { } catch (e) { //show the next player/reload buttons if there is an error in the player build code - player.askNextCombo('Error while building player: '+e.stack); + player.askNextCombo('Error while building player'+("stack" in e ? ": "+e.stack : "")); throw e; player.report({ type: 'init',