Fix 'TypeError: Cannot read property 'kind' of null' in captions feature detection if video lacks captions

This commit is contained in:
Albin Larsson 2017-09-27 00:24:54 +02:00
parent 2bba1f30e2
commit c84f666b55

View File

@ -2448,7 +2448,7 @@
});
// 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) {
utils.on(player.captions.currentTrack, 'cuechange', setActiveCue);