1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix vtt with chrome

This commit is contained in:
Luke Pulverenti 2014-06-18 12:08:54 -04:00
parent f9c56cae69
commit d39aecd4a5
2 changed files with 17 additions and 7 deletions

View file

@ -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;

View file

@ -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;
}