Skip to content
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

Support EXT-X-DATERANGE #2218

Closed
ramoncaldeira opened this issue Apr 9, 2019 · 5 comments · Fixed by #4720
Closed

Support EXT-X-DATERANGE #2218

ramoncaldeira opened this issue Apr 9, 2019 · 5 comments · Fixed by #4720

Comments

@ramoncaldeira
Copy link

In WWDC2016[1] Apple announced In-Playlist Timed Metadata as an alternative to ID3 Timed Metadata. As far as I understood, the main idea is to use the m3u8 tag EXT-X-DATERANGE to describe the timed metadata in plain text on the playlist file, outside the video stream.

I think it would be great to have this feature implemented in the hls.js library, because that way it will no longer be necessary to use the Apple-only mediafilesegmenter tool to inject timed ID3 into video streams.

[1] https://developer.apple.com/videos/play/wwdc2016/504/

@johnBartos
Copy link
Collaborator

Will do

@robwalch robwalch added this to Top priorities in Release Planning and Backlog via automation Mar 3, 2020
@robwalch robwalch added this to the 1.0.0 milestone Mar 3, 2020
@robwalch robwalch moved this from Top priorities to Other Topics (incomplete) in Release Planning and Backlog Mar 3, 2020
@robwalch robwalch moved this from Other Topics (incomplete) to Top priorities in Release Planning and Backlog Mar 17, 2020
@robwalch robwalch self-assigned this Jul 25, 2020
@robwalch robwalch removed this from the 1.0.0 milestone Aug 12, 2020
@robwalch
Copy link
Collaborator

robwalch commented Aug 12, 2020

I removed the milestone for this as I think we can get it into a minor release or v1.0.0. There isn't much of a difference.

Sample streams are welcome!

It would be helpful to know if anyone has seen this metadata surface as DataCues in metadata TextTracks in Safari (as ID3 does). I heard that was introduced in a recent release but still haven't seen it myself. The goal for this work would be to surface EXT-X-DATERANGE the same way Safari does.

You can get at this information now in hls.js via hls.levels[].details.fragments[].tagList[]['EXT-X-DATERANGE', AttributesString] which you can get with accurate timing as early as the first FRAG_BUFFERED event . You just have to parse the attributes yourself.

@robwalch robwalch added this to To do in Metadata via automation May 20, 2021
@jpatallah
Copy link

Based on your last comment are you recommending: getting the tag from the fragment, checking the start-time, and then triggering the event based on EXT-X-PROGRAM-DATE-TIME + video duration?

It would be super helpful to have this as a timed metadata event.

@robwalch
Copy link
Collaborator

robwalch commented May 21, 2021

Based on your last comment are you recommending: getting the tag from the fragment, checking the start-time, and then triggering the event based on EXT-X-PROGRAM-DATE-TIME + video duration?

Yes (almost). Video duration is not part of the calculation. In v1.0, each fragment has a programDateTime and a start when it's part of a playlist containing EXT-X-PROGRAM-DATE-TIME. The "PROGRAM-DATE-TIME" (in seconds) at video.currentTime is:

frag.programDateTime / 1000 + (video.currentTime - frag.start)

This is what is required currently to generate your own metadata cues or events. The comment above, and these details shared here are tips for implementing your own events or working with PDT. You could also use this information to develop this feature in hls.js, use it in your own fork, and upstream it for a future release. This change would go well in the next minor which includes other timed metadata features like emsg extraction.

It would be super helpful to have this as a timed metadata event.

The goal of this issue is to expose EXT-X-DATERANGE in a "metadata" TextTrack in the same way that Safari does. You would use the same video.textTrack[].mode = 'hidden', cues, activeCues and video.textTrack[].oncuechange listener to capture timed metadata as with HTML5 video in Safari with HLS streams.

@robwalch robwalch added this to the 1.1.0 milestone May 21, 2021
@jercul79
Copy link

jercul79 commented Aug 29, 2021

use the same video.textTrack[].mode = 'hidden', cues, activeCues and video.textTrack[].oncuechange listener

Hi, I am dealing with a similar problem. Are there any sample streams and sample code to test video.textTrack[] with both hls.js and native Safari video element? I am trying to get cue events firing on native Safari video elements, but failing miserably.

Thanks,
Jeremy

@robwalch robwalch modified the milestones: 1.1.0, 1.2.0 Nov 10, 2021
robwalch added a commit that referenced this issue Jun 2, 2022
Resolves #2218
Other changes:
- Remove cues on buffer flush based on track type associated with metadata schema (video: emsg, audio: org.id3)
- Handle Delta Playlist Update Date Range updates
- Parse and validate DateRange tags
- Add hls.playingDate to API: gets program date time at media playhead (video.currentTime)
- Fix code formatting with prettier
robwalch added a commit that referenced this issue Jul 11, 2022
Resolves #2218
Other changes:
- Remove cues on buffer flush based on track type associated with metadata schema (video: emsg, audio: org.id3)
- Handle Delta Playlist Update Date Range updates
- Parse and validate DateRange tags
- Add hls.playingDate to API: gets program date time at media playhead (video.currentTime)
- Fix code formatting with prettier
Metadata automation moved this from To do to Done Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

5 participants