* Save the mapping from playlist's ProgramDateTime to display. This should only happen * before segments start to load. * * @param {Playlist} playlist - The currently active playlist
(playlist)
| 493 | * @param {Playlist} playlist - The currently active playlist |
| 494 | */ |
| 495 | setDateTimeMappingForStart(playlist) { |
| 496 | // It's possible for the playlist to be updated before playback starts, meaning time |
| 497 | // zero is not yet set. If, during these playlist refreshes, a discontinuity is |
| 498 | // crossed, then the old time zero mapping (for the prior timeline) would be retained |
| 499 | // unless the mappings are cleared. |
| 500 | this.timelineToDatetimeMappings = {}; |
| 501 | |
| 502 | if (playlist.segments && |
| 503 | playlist.segments.length && |
| 504 | playlist.segments[0].dateTimeObject) { |
| 505 | const firstSegment = playlist.segments[0]; |
| 506 | const playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1000; |
| 507 | |
| 508 | this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp; |
| 509 | } |
| 510 | } |
| 511 | |
| 512 | /** |
| 513 | * Calculates and saves timeline mappings, playlist sync info, and segment timing values |
no outgoing calls
no test coverage detected