Skip to content

Commit

Permalink
do not use distance
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey committed Apr 22, 2019
1 parent f10c5ef commit e612e21
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/sync-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const syncPointStrategies = [

let segments = playlist.segments || [];
let syncPoint = null;
let lastDistance = null;

currentTime = currentTime || 0;

Expand All @@ -47,15 +46,7 @@ export const syncPointStrategies = [
if (segment.dateTimeObject) {
let segmentTime = segment.dateTimeObject.getTime() / 1000;
let segmentStart = segmentTime + syncController.datetimeToDisplayTime;
let distance = Math.abs(currentTime - segmentStart);

// Once the distance begins to increase, we have passed
// currentTime and can stop looking for better candidates
if (lastDistance !== null && lastDistance < distance) {
break;
}

lastDistance = distance;
syncPoint = {
time: segmentStart,
segmentIndex: i
Expand Down

0 comments on commit e612e21

Please sign in to comment.