Skip to content

Commit

Permalink
fix: add a default sync point when currentTimeline is -1
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed May 6, 2019
1 parent ad6f292 commit d0e9c92
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sync-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ export default class SyncController extends videojs.EventTarget {
currentTime);

if (!syncPoints.length) {
// if currentTimeline is -1, assume we're refetching a playlist from the beginning
// and thus create a new syncpoint of 0, 0
if (currentTimeline === -1) {
return {
segmentIndex: 0,
time: 0
};
}

// Signal that we need to attempt to get a sync-point manually
// by fetching a segment in the playlist and constructing
// a sync-point from that information
Expand Down

0 comments on commit d0e9c92

Please sign in to comment.