You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently use ExoPlayer 1.5.7, but are considering a switch to ExoPlayer 2.2. So this question applies equally to both.
We have several different audio tracks in a stream - segregated by language and a couple other factors. What's the best way to switch between tracks? Can this be done on the fly or would the entire content need to be re-prepared?
In ExoPlayer 2, we noticed that DefaultTrackSelector.selectAudioTrack() gets called by ExoPlayerImplInternal.handlePrepared(). So perhaps track selection can only be done right after a prepare? And is the best solution to create our own TrackSelector? Or is there an existing one that could easily fit the bill?
The text was updated successfully, but these errors were encountered:
As long as you are providing the alternative audio tracks demuxed (see #2014), you can either use a track selection override (have a look at the demo app for this) or set the according selection parameters to the default track selector:
So perhaps track selection can only be done right after a prepare?
It can be done at any point. The demo app is a good example of this.
And is the best solution to create our own TrackSelector? Or is there an existing one that could easily fit the bill?
Unless you are doing seriously complicating the DefaultTrackSelector should provide what you need. You can even subclass it to override a specific track type selection.
We currently use ExoPlayer 1.5.7, but are considering a switch to ExoPlayer 2.2. So this question applies equally to both.
We have several different audio tracks in a stream - segregated by language and a couple other factors. What's the best way to switch between tracks? Can this be done on the fly or would the entire content need to be re-prepared?
In ExoPlayer 2, we noticed that
DefaultTrackSelector.selectAudioTrack()
gets called byExoPlayerImplInternal.handlePrepared()
. So perhaps track selection can only be done right after a prepare? And is the best solution to create our own TrackSelector? Or is there an existing one that could easily fit the bill?The text was updated successfully, but these errors were encountered: