From 604f7a6a83f0028468e198a286555bef3fd56247 Mon Sep 17 00:00:00 2001 From: Yair Ansbacher Date: Thu, 19 Oct 2017 14:44:35 +0300 Subject: [PATCH] fix(FEC-7317): check if VTTCue and TextTrackCue are not undefined (#137) --- src/engines/html5/html5.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engines/html5/html5.js b/src/engines/html5/html5.js index f01584e8b..677220d79 100644 --- a/src/engines/html5/html5.js +++ b/src/engines/html5/html5.js @@ -770,9 +770,9 @@ export default class Html5 extends FakeEventTarget implements IEngine { textTrack.mode = 'hidden'; for (let cue of textTrack.activeCues) { //Normalize cues to be of type of VTT model - if (cue instanceof window.VTTCue) { + if (window.VTTCue && cue instanceof window.VTTCue) { activeCues.push(cue); - } else if (cue instanceof window.TextTrackCue) { + } else if (window.TextTrackCue && cue instanceof window.TextTrackCue) { activeCues.push(new Cue(cue.startTime, cue.endTime, cue.text)); } }