Skip to content

Commit

Permalink
Update clock sync on manifest update.
Browse files Browse the repository at this point in the history
Issue #345

Change-Id: I9faef800444e3b818c8da64cf71848a99713c3ff
  • Loading branch information
TheModMaker committed Apr 22, 2016
1 parent 60d2944 commit f9552a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/dash/dash_parser.js
Expand Up @@ -450,6 +450,7 @@ shaka.dash.DashParser.prototype.parseManifest_ =
if (this.manifest_) {
this.manifest_.presentationTimeline.setSegmentAvailabilityDuration(
segmentAvailabilityDuration);
this.manifest_.presentationTimeline.setClockOffset(offset);
} else {
if (presentationStartTime != null) {
// Offset the start time by @suggestedPresentationDelay. This has the
Expand Down
10 changes: 10 additions & 0 deletions lib/media/presentation_timeline.js
Expand Up @@ -96,6 +96,16 @@ shaka.media.PresentationTimeline.prototype.setDuration = function(duration) {
};


/**
* Sets the clock offset. The offset may be updated at any time.
*
* @param {number} offset The clock offset, in ms.
*/
shaka.media.PresentationTimeline.prototype.setClockOffset = function(offset) {
this.clockOffset_ = offset;
};


/**
* @return {?number} The presentation's segment availability duration.
* Always returns null for video-on-demand, and never returns null for live.
Expand Down

0 comments on commit f9552a5

Please sign in to comment.