Merge pull request #667 from friday/fix/caption-feature-detection

Fix 'TypeError: Cannot read property 'kind' of null' in captions feat…
This commit is contained in:
Sam Potts 2017-09-27 10:03:25 +10:00 committed by GitHub
commit ad105877ed

View File

@ -2448,7 +2448,7 @@
}); });
// Check if suported kind // Check if suported kind
var supported = utils.inArray(['captions', 'subtitles'], player.captions.currentTrack.kind); var supported = utils.inArray(['captions', 'subtitles'], player.captions.currentTrack && player.captions.currentTrack.kind);
if (utils.is.track(player.captions.currentTrack) && supported) { if (utils.is.track(player.captions.currentTrack) && supported) {
utils.on(player.captions.currentTrack, 'cuechange', setActiveCue); utils.on(player.captions.currentTrack, 'cuechange', setActiveCue);