-
Notifications
You must be signed in to change notification settings - Fork 428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use a separate ProgramDateTime mapping to player time per timeline #1063
fix: use a separate ProgramDateTime mapping to player time per timeline #1063
Conversation
…nd of a timeline Previously, when the end of a timeline was reached (i.e., the last segment in a given timeline was appended), `endTimeline` would be called, but the loader would not wait for the event to finish. This lead to issues where segment information came back after a segment is considered done with processing, and segment information could be dropped. This fix waits for the `endedtimeline` message from the transmuxer before it considers the transmux complete.
… existsi n program date time
Previously, the ProgramDateTime would map to time 0 at the start of playback, and that mapping would be used for the rest of playback. In case of a discontinuity though, ProgramDateTime can jump (as in, can be a larger difference in time than a single segment). This led to errors while seeking. This change uses a mapping per timeline, allowing those "jumps" in time on discontinuities.
@@ -161,7 +167,7 @@ export default class SyncController extends videojs.EventTarget { | |||
// ...for synching across variants | |||
this.timelines = []; | |||
this.discontinuities = []; | |||
this.datetimeToDisplayTime = null; | |||
this.timelineToDatetimeMappings = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if segment.timeline
is a number, should this just be an array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the timelines contiguous or would there be a danger of a sparse array? Just thinking that maybe it'll be easier to have it be an array since you could just .length it, but if a segment.timeline
could have values like, 0, 1, 100, then it won't work since the length would then be 101.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly: originally had it as an array, but it can be sparse so changed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mainly an issue when either updating a playlist before starting, updating while paused, or if on some refreshes you miss a timeline (a short one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well with the test content we have.
Description
Previously, the ProgramDateTime would map to time 0 at the start of playback, and that mapping would be used for the rest of playback.
However, in the case of a discontinuity, ProgramDateTime can jump (as in, can be a larger difference in time than a single segment duration, e.g., if the encoder went down for a period of time). Because the ProgramDateTime to player time mapping never changed, this led to seeking errors.
This fix uses a mapping of ProgramDateTime to player time per timeline, allowing those "jumps" in time on discontinuities.
Requirements Checklist