Merge pull request #780 from friday/captions-ie11-indexsizeerror

Fix harmless but annoying IE error 'IndexSizeError'
This commit is contained in:
Sam Potts 2018-02-06 12:51:45 +11:00 committed by GitHub
commit 7221e26eca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,8 @@ const captions = {
setCue(input) {
// Get the track from the event if needed
const track = utils.is.event(input) ? input.target : input;
const active = track.activeCues[0];
const {activeCues} = track;
const active = activeCues.length && activeCues[0];
const currentTrack = captions.getCurrentTrack.call(this);
// Only display current track