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

Publish HLS media structure defined by EXT-DISCONTINUITY tags #5665

Open
AfanasievAnton opened this issue Mar 21, 2019 · 6 comments
Open

Publish HLS media structure defined by EXT-DISCONTINUITY tags #5665

AfanasievAnton opened this issue Mar 21, 2019 · 6 comments

Comments

@AfanasievAnton
Copy link

AfanasievAnton commented Mar 21, 2019

[REQUIRED] Searched documentation and issues

#4983
#4176

[REQUIRED] Question

We have an HLS SSAI stream with ads separated by #EXT-X-DISCONTINUITY tag. As part of our flow we should be able to play ads even if user seek behind the ad position. So basically when we detect that, we are doing basic seek adjustment to the beginning of the ad. The problem raises when ad had reached to the end and we want to adjust that seek position to the initially requested one(by the user).
Currently we request playhead position once in ~1s. When ad length is 2.5s player will start playing content that comes immediately after ad for 0.5s. Only next getCurrentPosition() request would notify us that ad has ended and we need to adjust seeking to the originaly requested position.
Basically we can adjust our calls getCurrentPosition() to be more frequent (something that we want to avoid). I was thinking that hence we have a #EXT-X-DISCONTINUITY tag that separate our ads from content - notification of reaching that tag might be really useful for us to detect that transition.
Are you planning to expose that behaviour? Is there anything to be aware of if we decide to implement it by our own?
Any input from you will be really useful.

Thank you in advance.

@google-oss-bot
Copy link
Collaborator

This issue does not seem to follow the issue template. Make sure you provide all the required information.

@tonihei tonihei self-assigned this Mar 25, 2019
@tonihei
Copy link
Collaborator

tonihei commented Mar 25, 2019

Generally, we consider the entire playlist as one piece of media and thus do not publish the discontinuity tags in any way at the moment.

@AquilesCanta Ignoring the effort to implement it - Would it logically make sense to divide the HLS playlist along its discontinuity tags to create multiple periods similar to DASH? This would allow better playback customizations for cases like this.

@AfanasievAnton Do you know the positions of the discontinuity tags in the app? If so, can you send a message similar to how it's described in #4176 to seek to the desired position? In pseudocode something like player.createMessage(() -> player.seekTo(resumePositionAfterAd)).setPosition(endOfAd).send().

@AquilesCanta
Copy link
Contributor

Would it logically make sense to divide the HLS playlist along its discontinuity tags to create multiple periods similar to DASH?

Yep. We've discussed this in the past, but it has not been on our roadmap.

@AfanasievAnton
Copy link
Author

Thank you for you reply. Just wondering how precise setPosition(). I mean, is it possible to have a frame accurate message trigger?

@tonihei
Copy link
Collaborator

tonihei commented Mar 28, 2019

It's not frame precise at the moment because it just sends a Handler message to another thread while playback is continuing. The enhancement to block playback until the message has been handled is tracked by #5660. It seems such an option would be helpful for cases like this where the message pauses, stops or seeks the player and the short blocking of playback is intentional.

I'll use this issue to track the support for better publishing the media parts of HLS playlists. Note that this is probably low priority and we won't get around to do that soon.

@tonihei tonihei removed the question label Mar 28, 2019
@tonihei tonihei assigned AquilesCanta and unassigned tonihei Mar 28, 2019
@tonihei tonihei changed the title Detect any EXT-DISCONTINUITY tag in HLS stream Publish HLS media structure defined by EXT-DISCONTINUITY tags Mar 28, 2019
@androaddict
Copy link

@AfanasievAnton
I am also looking for same thing. I want to detect the ads and get the ad start time & ad end time. How to do that ? did you fix that?

@icbaker icbaker assigned christosts and unassigned AquilesCanta Aug 26, 2021
@christosts christosts assigned tianyif and unassigned christosts Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants