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 addition of tracks mid-stream #6124
Comments
Can you please fill out the required sections for the content not playing template? Especially reproduction steps, example media, devices, etc. are helpful to understand and reproduce the problem. |
[REQUIRED] Content description [REQUIRED] Link to test content [REQUIRED] Version of ExoPlayer being used [REQUIRED] Device(s) and version(s) of Android being used [REQUIRED] A full bug report captured from the device |
@AquilesCanta Can you look at the example and check if that's a valid use case? If so, we should probably mark as an enhancement. |
@AquilesCanta Do you have any update on this? |
@tonihei Can you assign anyone to resolve this issue? Seems like @AquilesCanta has been absent. |
I'll look into this when I have some time. Thanks for your patience. It's worth noting that ExoPlayer does not support the addition of tracks mid-stream, and it's unlikely that's changing any time soon. I'll check the content to make sure this is the case soon, though, but it's possible we won't be able to fix this in the short term. |
@AquilesCanta |
I can confirm a track is being added mid-stream. As mentioned above, this is not something ExoPlayer currently supports. I'll use this issue to track support for addition of tracks mid-stream. Solving this issue is not simple. One way I can think of solving this issue without changing the core representations in ExoPlayer is creating a new MediaSource that, when a track change is detected, signals the end of the current period and the start of a new period that includes the additional tracks. Notes:
|
@AquilesCanta Thanks for your response. If I could detect a track changes from the extractor, how the new MediaSource can signal the end of the current period and the start of a new period? Did you mean releasePeriod & createPeriod method? Please tell more specifically. |
Not sure, not necessarily. You'd have to experiment.
You can start by reading about Timeline, MediaSource and MediaPeriod (ideally, have a look at the code from the dev-branch). When MediaSource.prepare is called, the MediaSource will notify back (through onSourceInfoRefreshed) the shape of the media represented by a timeline, which is conformed of periods. The MediaPeriods are the objects in charge of loading the media of each of the periods in the media.
No. These are called by the player in accordance to what the player is currently playing and loading. You should have a look at the ProgressiveMediaSource and DashMediaSource implementations. |
Note that we will eventually address this issue, and it's possible that a multi-period approach is not the best way to go, so keep in mind this approach may have flaws (like non-continuous playback). If you come up with other ideas, it's worth exploring. |
@AquilesCanta create MediaSource and called player.prepare()
updateSource() when dectected additional track
|
I'm sorry but I can't really follow what's supposed to happen from the provided code but I don't have the resources to guide you to a full implementation either. Just a comment: I don't think you should be using a ConcatenatingMediaSource at any point, but rather creating your own ProgressiveMediaSource fork that will handle the creation of new periods when a track change is detected.
No, and unfortunately, I don't expect any work to happen in this quarter. |
[REQUIRED] Searched documentation and issues
I already have searched on this pages but not found any similar question.
[REQUIRED] Question
I am developing multicast player based on ExoPlayer version 2.10.1.
There are programs that are including DVS (Descriptive Video Service).
That means during playback an audio track could be added into the stream.
I thought onTrackChanged is called when the track is added but didn't.
The text was updated successfully, but these errors were encountered: