diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index d6d4c2f4fc..bf77481522 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -239,6 +239,23 @@ return; } + var allTracks = video.textTracks; // get list of tracks + + for (var i = 0; i < allTracks.length; i++) { + + var track = allTracks[i]; + + // This throws an error in IE, but is fine in chrome + // In IE it's not necessary anyway because changing the src seems to be enough + try { + while (track.cues.length) { + track.removeCue(track.cues[0]); + } + } catch (e) { + console.log('Error removing cue from textTrack'); + } + } + $('track', video).each(function () { var currentSrc = this.src; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index e810c66338..06ea89557a 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -232,14 +232,7 @@ self.supportsTextTracks = function () { - // When seeking with transcoding, there repointing the track element - // to a new url (via src) doesn't seem to work. - if ($.browser.chrome) { - return false; - } - if (supportsTextTracks == null) { - supportsTextTracks = document.createElement('video').textTracks != null; }