m3u8 icon indicating copy to clipboard operation
m3u8 copied to clipboard

#EXT-X-PROGRAM-DATE-TIME missing?

Open jkeen opened this issue 3 years ago • 1 comments

https://github.com/sethdeckard/m3u8/blob/6e2a54b7f64cf2c1c93b958e31e0aa79e343db09/lib/m3u8/segment_item.rb#L14

It looks like when this gets rendered it's missing the #EXT-X-PROGRAM-DATE-TIME, only rendering the time. I'm not sure if this was an intentional design decision or a bug? It looks like it's been in there for 5 years if it is a bug, so wanted to make sure before working on a PR.

Details:

...
playlist.items << M3u8::SegmentItem.new(program_date_time: Time.now, duration: 10, segment: 'http://example.com/segment-1.aac')
....

Expected:

#EXTINF:9.770667,
#EXT-X-PROGRAM-DATE-TIME: 2020-11-25 14:27:00 -0600
http://example.com/segment-1.aac

Actual:

#EXTINF:9.770667,
2020-11-25 14:27:00 -0600
http://example.com/segment-1.aac

the latter seems to cause players to try and request "2020-11-25 14:27:00 -0600" as a fragment url.

I worked around the issue for the timebeing by passing the "#EXT-X-PROGRAM-DATE-TIME: #{Time.now}", as the program_date_time attribute, which feels a little clunky unless I'm missing the reasoning for it being this way. Thoughts?

jkeen avatar Nov 25 '20 20:11 jkeen

Thanks for reporting this @jkeen and apologies for the really late response. It's definitely a bug.

sethdeckard avatar Mar 07 '21 16:03 sethdeckard