Skip to content

Commit

Permalink
Merge pull request #2431 from Yuvalke/fix_issue_2400
Browse files Browse the repository at this point in the history
fix #2400 issue - cues doesn't show up on browsers which addCue doesn't throw error with invalid structure
  • Loading branch information
robwalch committed Dec 12, 2019
2 parents ceed27e + 23aeab1 commit 263e94b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/controller/timeline-controller.ts
Expand Up @@ -289,7 +289,11 @@ class TimelineController extends EventHandler {
if (!currentTrack.cues.getCueById(cue.id)) {
try {
currentTrack.addCue(cue);
if (!currentTrack.cues.getCueById(cue.id)) {
throw new Error(`addCue is failed for: ${cue}`);
}
} catch (err) {
logger.debug(`Failed occurred on adding cues: ${err}`);
const textTrackCue = new (window as any).TextTrackCue(cue.startTime, cue.endTime, cue.text);
textTrackCue.id = cue.id;
currentTrack.addCue(textTrackCue);
Expand Down

0 comments on commit 263e94b

Please sign in to comment.