Skip to content

Commit

Permalink
Support every browser which won't throw error when structure is invalid
Browse files Browse the repository at this point in the history
fix video-dev#2400 throw error when the added cue isn't exist anymore
  • Loading branch information
Yuvalke committed Oct 30, 2019
1 parent 09797f5 commit 71867a9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/controller/timeline-controller.ts
Expand Up @@ -294,6 +294,7 @@ class TimelineController extends EventHandler {
if (!currentTrack.cues.getCueById(cue.id)) {
try {
currentTrack.addCue(cue);
if (!currentTrack.cues.getCueById(cue.id)) throw new Error('browser which doesnt throw error when cues structure is invalid');
} catch (err) {
const textTrackCue = new (window as any).TextTrackCue(cue.startTime, cue.endTime, cue.text);
textTrackCue.id = cue.id;
Expand Down

0 comments on commit 71867a9

Please sign in to comment.