-
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
Extend EventTime with current window index and update EventLogger to show consistent output #7332
Comments
onDecoderInputFormatChanged
called before onPositionDiscontinuity
when transitioning in ConcatenatingMediaSource
This is actually working as intended. The decoder input format is changed before the transition because the decoder starts reading the new file before the first finished playing. This is all needed to ensure a smooth gapless transition. As you can see in the EventLogger output, the events are still correctly associated with the right item in the playlist ("window=1" for the decoder input format change), allowing you to understand them correctly by just listening to the events. As an aside, we added an |
Thanks for the quick reply! Ok, I understand, that makes sense. But, it seems we're getting a mix of information as to when this happened and where(in the timeline) this happened. Because if item nr 2 is only 10 seconds long, there really doesn't exist any mediaPos=24.46 and window=1. I'll look into the Thanks again. |
But I see there is room for improvement here:
Marking as an enhancement to change these two things. |
Thank you, that worked perfectly! I agree to the two improvements, makes sense, and looking forward to it :) Regarding my other issue where I was not getting an updated windowIndex, this seems to be caused by my custom MediaSource. I'm using a custom MediaSource to resolve the urls, because I only have an id to begin with. So I need to do an api call in order to decide what media source it should use(progressive, dash, hls etc). |
That's impossible to say without knowing what went wrong. We generally advise to use |
We currently use the playback position in the current window, not the position in the window the event belongs to. This creates confusing outputs, e.g, window=1, mediaPos=100, even if the position refers to window 0. issue:#7332 PiperOrigin-RevId: 310896908
We currently use the playback position in the current window, not the position in the window the event belongs to. This creates confusing outputs, e.g, window=1, mediaPos=100, even if the position refers to window 0. issue:#7332 PiperOrigin-RevId: 310896908
EventTime contains information about when an event happened and where it belongs to. Both places can be fully described using timeline, window index, media period id and position. Right now, only the information for where the event belongs to is fully contained in EventTime, whereas the time when the event happened only has the position, and none of the other information (timeline, window, period). This change adds the missing information, so that the EventTime can easily be used without having access to the Player. This also ensures Event metadata is self-contained and can be stored and reused later. issue:#7332 PiperOrigin-RevId: 311727004
@tonihei - Can this be closed? |
Yes, the enhancement is implemented and the EventLogger updated with the commits above. |
[REQUIRED] Issue description
When transitioning from one
MediaSource
to another in aConcatenatingMediaSource
,onDecoderInputFormatChanged
for the secondMediaSource
is called beforeonPositionDiscontinuity
. This results in that theeventTime.currentPlaybackPositionMs
for the secondMediaSource
is set to the duration of the firstMediaSource
, so we get two calls toonDecoderInputFormatChanged
for the firstMediaSource
and none for the second, making it hard for us to do proper analytics.[REQUIRED] Reproduction steps
Using the ExoPlayer demo app, play the playlist
Cats -> Dogs
and let the firstMediaSource
play to the end so the second starts. Then, you can see by theEventLogger
that themediaPos
for the secondMediaSource
has the duration of the firstMediaSource
set. You can also see that theonPositionDiscontinuity
is called after all of this has happened.[REQUIRED] Link to test content
Included in the demo app
[REQUIRED] A full bug report captured from the device
N/A
[REQUIRED] Version of ExoPlayer being used
2.11.3
[REQUIRED] Device(s) and version(s) of Android being used
The text was updated successfully, but these errors were encountered: