ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

HlsMediaPlaylist.hasProgramDateTime is false when program date time is at epoch 0

Open matamegger opened this issue 3 years ago • 5 comments
trafficstars

I noticed that HlsMediaPlaylist.hasProgramDateTime is set to false for some streams that actually have a #EXT-X-PROGRAM-DATE-TIME tag. To be more specific, the property is set false if the date time is set to epoch 0 (i.e. #EXT-X-PROGRAM-DATE-TIME:1970-01-01T00:00:00.000Z). As an effect the Window.windowStartTimeMs will be set to "unset".

Before filing a bug report I want to check with you if this is intentional for some reason or indeed a bug. Also maybe I am missing some detail of the HLS spec, but to my understanding the program date time could be basically any timestamp.

matamegger avatar May 30 '22 15:05 matamegger

The only part I found in the spec was in Section 6.2.1 (General Server Responsibilities)

When applied to live content, a reasonable default for the EXT-X-PROGRAM-DATE-TIME tag is the date and time that the content was captured (recorded).

I don't have exact context how this piece of code was implemented, but I suspect the code makes the assumption that EXT-X-PROGRAM-DATE-TIME would not be the epoch based on the above guide from the spec.

May I ask how come you need to set EXT-X-PROGRAM-DATE-TIME to 1970-01-01T00:00:00.000Z?

christosts avatar Jun 23 '22 13:06 christosts

Hey @matamegger. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Jul 13 '22 01:07 google-oss-bot

Hey, sorry I missed that notification.

I have seen such HLS streams several times already. This seems like a common practice, or at least not uncommon practice. On DASH a similar practice can be observers, where live streams have an availabilityStartTime at epoch 0. I can only speculate on why to set the EXT-X-PROGRAM-DATE-TIME to 1970-01-01T00:00:00.000Z.

The tag is mandatory if EXT-X-DATERANGE tags are used. So if the recording time of an asset is not known, but one needs/wants to use that feature, I think epoch 0 is a not too far choice. But that's only my guess.

matamegger avatar Jul 13 '22 06:07 matamegger

We'll try to fix this, it looks like it won't take too much effort.

PS I'm adding the enhancement label rather than bug because I'm not sure if the player existing behavior was intended on not

christosts avatar Jul 13 '22 09:07 christosts

it looks like it won't take too much effort.

Yes, agree.

Thank you! Makes sense 🙂

matamegger avatar Jul 13 '22 09:07 matamegger