Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
OrenMe committed Mar 13, 2018
1 parent 335b8b1 commit 5f93a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/controller/subtitle-stream-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class SubtitleStreamController extends TaskLoop {

// Check if track was already loaded and if so make sure we finish
// downloading its frags, if not all have been downloaded yet
// For live the tracks are reloaded anyhow every couple of sec so tick will be called than
const currentTrack = this.tracks[this.currentTrackId];
let details = currentTrack.details;
if (details !== undefined && details.live !== true)
Expand Down
5 changes: 3 additions & 2 deletions src/controller/timeline-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,9 @@ class TimelineController extends EventHandler {
// Parse the WebVTT file contents.
WebVTTParser.parse(payload, this.initPTS, vttCCs, frag.cc, function (cues) {
const currentTrack = textTracks[frag.trackId];
// If text track is disabled in middle of process bailout as
// currentTrack.cues will be nullified when track is disabled
// WebVTTParser.parse is an async method and if the currently selected text track mode is set to "disabled"
// before parsing is done then don't try to access currentTrack.cues.getCueById as cues will be null
// and trying to access getCueById method of cues will throw an exception
if (currentTrack.mode === 'disabled') {
hls.trigger(Event.SUBTITLE_FRAG_PROCESSED, { success: false, frag: frag });
return;
Expand Down

0 comments on commit 5f93a70

Please sign in to comment.