ExoPlayer
ExoPlayer copied to clipboard
Provide a way to access information from all the EXT-X-PROGRAM-DATE-TIME tags in a playlist
Use case description
Currently ExoPlayer ignores all the EXT-X-PROGRAM-DATE-TIME (PDT) tags save for the very first one in a media playlist. When such a playlist has no gaps between the segments no information is lost. However, in some cases playlists do have gaps and for such playlists the PDT information is lost during the playlist parsing.
Let's say an application wants to detect playlists' gaps, for example to show its users a message about some content being lost. To achieve this the app extends ParsingLoadable.Parser<HlsPlaylist> and calculates the PDT for each segment. However, the information about the gaps is lost and using something like
HlsMediaPlaylist.startTimeUs + SegmentBase.relativeStartTimeUs
ignores gaps and does not provide the required data.
Proposed solution
As there is no request here to modify the playback in any way, just a request to propagate the missing information, the preferred solution would be to add to the
HlsMediaPlaylist.Segment
class an additional field which contains either absolute PDT including the gaps or adjusted for gaps relative start time.
Note:
This appears to be similar to https://github.com/google/ExoPlayer/issues/8312. The main difference is that the current issue does not have any requirement to modify the playback behavior, while https://github.com/google/ExoPlayer/issues/8312 has such a requirement.