diff options
author | Amo Wu <amo260@gmail.com> | 2016-12-15 16:38:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-15 16:38:46 +0800 |
commit | d02e57bdb387a1f03024533cf015951dfc50ff68 (patch) | |
tree | a6e91b757b82171c4ff3f030ea6bbf46df434899 /src/js | |
parent | 663c1fb62747d8b3ae2c6c2073b52ff7e9c420a4 (diff) | |
download | plyr-d02e57bdb387a1f03024533cf015951dfc50ff68.tar.lz plyr-d02e57bdb387a1f03024533cf015951dfc50ff68.tar.xz plyr-d02e57bdb387a1f03024533cf015951dfc50ff68.zip |
fix: Firefox can not display captions
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/plyr.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index ddc20630..83c54976 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1252,25 +1252,22 @@ captions = req.split(lineSeparator + lineSeparator); + var numOfAvailableCaptions = 0; + for (var r = 0; r < captions.length; r++) { caption = captions[r]; - plyr.captions[r] = []; // Get the parts of the captions var parts = caption.split(lineSeparator), index = 0; // Incase caption numbers are added - if (parts[index].indexOf(":") === -1) { - index = 1; + if (parts[index].indexOf(":") !== -1) { + plyr.captions[numOfAvailableCaptions] = [parts[index], parts[index + 1]]; + numOfAvailableCaptions ++; } - - plyr.captions[r] = [parts[index], parts[index + 1]]; } - // Remove first element ('VTT') - plyr.captions.shift(); - _log('Successfully loaded the caption file via AJAX'); } else { _warn(config.logPrefix + 'There was a problem loading the caption file via AJAX'); |