Embed: added workaround for IE-only issue when seeking after trackswitch

This commit is contained in:
Cat 2018-07-04 11:37:44 +02:00 committed by Thulinma
parent e5c1c6f8c4
commit 3a699ae3e1

View file

@ -161,7 +161,19 @@ MistPlayer.prototype.setTracks = function(usetracks){
this.element.load(); 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) { if ('trackselects' in this) {
for (var i in usetracks) { for (var i in usetracks) {
@ -1429,7 +1441,7 @@ function mistPlay(streamName,options) {
} }
catch (e) { catch (e) {
//show the next player/reload buttons if there is an error in the player build code //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; throw e;
player.report({ player.report({
type: 'init', type: 'init',