-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Provide ways to avoid projection for live streams in a playlist #9037
Comments
Not sure if I understand, if your playlist contains two media items, ExoPlayer will handle the transition for you, you don't have to manually do transition. |
I deleted unnecessary lines |
I'm adding new item when current item is ended (this is just a logic of an app). Maybe I should do it in some other place/callback? |
As you can see |
There are a couple of logs from 'EventLogger': as you can see |
I've also notice next log on transition:
|
I've created sample application to reproduce this issue: https://github.com/apptrash/ExoBugSandbox |
I do think that it's a bug rather than question |
@claincly can you help me with this issue? |
I'll involve @christosts since it's related to HLS here. But one thing I wanted to make sure, are you able to reproduce the issue in our demo app? You can verify by adding an entry to The entry could look like
|
How can I add an entry to this repository? By using pull request? |
Of course, I will try to reproduce issue on demo app, but I don't think that it is possible to reproduce on it because there are some specific steps (like changing |
@christosts, Hello! Any updates here? |
I can reproduce on the demo app on 2.14.1. I picked the two playlist URLs from https://github.com/apptrash/ExoBugSandbox and added them as playlist to the ExoPlayer demo app. When the player transitions to the 2nd item, it starts playing from around 10". But if we play the second playlist as a standalone item then it plays from 0. I need to investigate further. |
Hello! Any progress on this task? Maybe you can suggest a workaround? |
The start position for playback is projected, because your playlist has no end tag which indicates that further segments may be added and the stream is treated as a live stream. Because of this, when ExoPlayer starts loading data for buffering like for instance 20 seconds before the actual transition happens, it assumes that it should start 20 seconds later to have the correct latency from the live edge. So if this is not a live stream the best fix would be to add an Is this a viable solution on your end? |
Unfortunately no, and there are situations (in my case) where transitions occurs between two playlists with type=event and the second one without endlist tag. |
There is EXT-X-START tag with 0 value in playlists. Shouldn't that solve the problem? |
I think you can try to wrap your media source with a
|
Unfortunately, it doesn't help, I tried to do the following:
Player still does not start playing from the beginning |
Yes, that's a limitation of the To try that out in a hacky way you can start at the first millisecond. With this it clips the first millisecond of the stream. I would do that only to see that it works as expected:
A proper way to do this is using the
As an alternative you could do your custom
|
Hi, @marcbaechinger. Our use case: |
@marcbaechinger Thanks for explaining how the workaround works! I tried it - works fine. |
A playlist without an X-ENDLIST tag is handled as a live stream. When such a stream is added to a playlist on a position different to 0, ExoPlayer starts buffering data of that live stream before it actually transitions to that stream for playback. Lets assume the player starts buffering from the defaultPosition of the live stream 20 seconds before actually playing it. If the defaultPosition of the live stream tells us to start playback at 1:00:00am wall clock time and we prebuffer 20 seconds but we keep playing the last 20 seconds of the previous VOD stream, we actually start playback of the live stream 20 secs later at 1:00:20am. So the player projects 20 seconds ahead (meaning skipping the 20 seconds of overlapping media). Without doing that we would start playback at 1:00:00am media time at 1:00:20am wall clock time which would increase the target latency to the live edge by the duration of the overlapping buffered media data. I don't think this is a bug, but rather a feature that tries to not to increase the live latency of a live stream in a playlist which looks like a sensible thing for some use cases. I certainly also see how this is problematic for your use case. It appears to me that both are valid use case, so I think we should mark this issue as an enhancement to provide ways that users could configure whether projection should be omitted. We already have ways to configure behaviour for live streams by providing a MediaItem.LiveConfiguration object. Without thinking about whether this is the best solution, we could for example add a flag like |
Hm. If I would suggest reclassifying this issue as a bug again. |
I think the most reasonable solution is to not apply start time projection for |
Agreed this is a valid point to distinguish these cases for HLS EVENT streams. |
Issue: #9037 #minor-release PiperOrigin-RevId: 385630065
@marcbaechinger is it intended you still project start position when |
Technically streams with an EXT-X-START that is positive or zero have the projection suppressed. I think this is intended in the sense that an EVENT stream is handled as a live stream when the end tag is missing and the start offset is undefined. So in this case projection is still applied to answer your question. The change above does not change how the start position is calculated for streams with a start offset that is unset. I would expect that in absence of any other configuration by the playlist and the media source/item, the actual start position is calculated like (duration - (3 * targetDuration)). When you say this isn't the case when you see it starting from at the second segment? Can you provide me with a test stream so I can look into the behavior for your stream? It depends on various properties of the media playlist how this the start position is calculated. If you're unable to share publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #9037". |
@marcbaechinger Hello! I found a case where neither the proposed workaround nor today's fix solve the problem: if segments are added to the second media playlist. I can provide you with an example if required, as well as any clarifying information to reproduce. |
In my previous example, segments were not added to the second media playlist (it was static actually) and your workaround worked correctly. |
Issue: #9037 #minor-release PiperOrigin-RevId: 385630065
Should I create another issue about it? |
@apptrash Please provide me with an example. If the start offset is set to 0 or a positive value by the playlist it does not projection anymore. I'm interested to see why it's not working. Please send me a stream url for your case. |
@marcbaechinger Everything works on version 2.14.2, thanks a lot! |
I'm using HLS event-playlists. There are always two MediaItem's in a playlist. I wish to have seamless transition, but sometimes ExoPlayer doesn't play next item from beginning (it skips around 6-30 seconds and start from this position).
What I do is:
Can you help me? Am i doing something wrong?
All of HLS playlists looks the same:
ExoPlayer version r2.14.0
The text was updated successfully, but these errors were encountered: