ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Support seamlessly changing tracks during adaptive playbacks (DASH/SS/HLS)

Open AntonAFA opened this issue 9 years ago • 9 comments

Hello, have a question. Is it possible in Exoplayer2 to switch between tracks seamlessly without rebufferring?

For example start buffering the switched track only from point where the last dowloaded chunk of the previous track is ended? Or in case of text track changes it takes a couple of seconds until the track is changed and rebuffered.

Any ideas?

AntonAFA avatar Dec 22 '16 14:12 AntonAFA

This is not currently supported. Marking as an enhancement.

ojw28 avatar May 24 '17 14:05 ojw28

So a possible way of switching stream quality without forcing a rebuffer (note that it might be unavoidable) would be injecting a custom AdaptiveTrackSelection through the DefaultTrackSelector's constructor DefaultTrackSelector(TrackSelection.Factory adaptiveTrackSelectionFactory). A good place to start looking is AdaptiveTrackSelection.

This custom adjustable track selection could then be configured to select specific qualities, if the default adaptive behavior is not adequate. Threading here might be a concern, as most likely the quality is selected in the main thread, but the TrackSelection methods are invoked on the playback thread, so this is something that must be kept in mind. The changes in qualities will take effect from the moment they are applied to the custom track selection onwards.

This is just an idea of how it can be done in application code, it is not yet on our map to implement this enhancement as part of the library, unfortunately. Feel free to post any issues you encounter here.

AquilesCanta avatar Nov 30 '17 10:11 AquilesCanta

Is there any plan about this?

hsahnv avatar Dec 21 '18 07:12 hsahnv

@hsahnv No current plans to support that. As described above, you can implement such a feature yourself by customizing AdaptiveTrackSelection.

tonihei avatar Dec 21 '18 09:12 tonihei

Is there any plan to support this feature?

Romantic-LiXuefeng avatar Sep 10 '19 06:09 Romantic-LiXuefeng

@Romantic-LiXuefeng Still no immediate plan to support this. You can easily implement it yourself as noted above, maybe also using the canSelectTrack method of AdaptiveTrackSelection. To support that in a better way, we'd need to restructure some code which is non-trivial.

tonihei avatar Sep 10 '19 08:09 tonihei

@AntonAFA @ojw28 @AquilesCanta Hey Any update on this? ExoPlayer still does not support this out of the box?

vabhishek avatar Jan 20 '20 08:01 vabhishek

When there is an update, it will be posted here.

ojw28 avatar Jan 27 '20 12:01 ojw28

This is an old issue, but the general request still makes sense. I'll de-duplicate it a newer version of in the Media3 repository: https://github.com/androidx/media/issues/1631. Also note there is still a manual workaround to inject custom track filters dynamically as explained in https://github.com/google/ExoPlayer/issues/6630#issuecomment-1023007702.

tonihei avatar Aug 19 '24 12:08 tonihei