Skip to content

Commit

Permalink
Merge pull request #191 from jwplayer/bugfix/vttCCs-0
Browse files Browse the repository at this point in the history
Initialize vttCCs map with cc 0
  • Loading branch information
robwalch committed Dec 21, 2018
2 parents f680bd7 + 6008752 commit e45f8a6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/controller/timeline-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,16 @@ class TimelineController extends EventHandler {
onManifestLoading () {
this.lastSn = -1; // Detect discontiguity in fragment parsing
this.prevCC = -1;
this.vttCCs = { ccOffset: 0, presentationOffset: 0 }; // Detect discontinuity in subtitle manifests
// Detect discontinuity in subtitle manifests
// The start time for cc 0 is always 0; initialize it here first so that we don't accidentally set to the currentTime
// when captions are enabled.
this.vttCCs = {
ccOffset: 0,
presentationOffset: 0,
0: {
start: 0, prevCC: -1, new: false
}
};
this._cleanTracks();
}

Expand Down

0 comments on commit e45f8a6

Please sign in to comment.