Skip to content

Commit

Permalink
Merge pull request #1911 from sheyll/development
Browse files Browse the repository at this point in the history
Fix TypeError in the segments update code
  • Loading branch information
Dan Sparacio authored Jun 2, 2017
2 parents d793c75 + d8760d2 commit c7c7c65
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/dash/DashHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ function DashHandler(config) {

if (segments && segments.length > 0) {
earliestTime = isNaN(earliestTime) ? segments[0].presentationStartTime : Math.min(segments[0].presentationStartTime, earliestTime);
}

if (isDynamic && isNaN(timelineConverter.getExpectedLiveEdge())) {
const lastSegment = segments[segments.length - 1];
const liveEdge = lastSegment.presentationStartTime;
const metrics = metricsModel.getMetricsFor('stream');
// the last segment is the Expected, not calculated, live edge.
timelineConverter.setExpectedLiveEdge(liveEdge);
metricsModel.updateManifestUpdateInfo(dashMetrics.getCurrentManifestUpdate(metrics), {presentationStartTime: liveEdge});
if (isDynamic && isNaN(timelineConverter.getExpectedLiveEdge())) {
const lastSegment = segments[segments.length - 1];
const liveEdge = lastSegment.presentationStartTime;
const metrics = metricsModel.getMetricsFor('stream');
// the last segment is the Expected, not calculated, live edge.
timelineConverter.setExpectedLiveEdge(liveEdge);
metricsModel.updateManifestUpdateInfo(dashMetrics.getCurrentManifestUpdate(metrics), {presentationStartTime: liveEdge});
}
}
}

Expand Down

0 comments on commit c7c7c65

Please sign in to comment.