Add preferred mime type(s) to DefaultTrackSelector parameters
See original GitHub issueI’d like to implement a customized TrackSelector. My situations are
- I don’t want to change any code of ExoPlayer core library so that I’ll not modify DefaultTrackSelector directly;
- I know I can do some kinds of customization via setParameter API.
trackSelector.setParameters( trackSelector .buildUponParameters() .setMaxVideoSizeSd() .setPreferredAudioLanguage("deu"));
But Current APIs can’t satisfy my requirement. For example, I’d like to always set higher priority for Dolby Digital plus track than AAC audio track. It seems that current interface can’t support it.
According to ExoPlayer official documentation (https://exoplayer.dev/customization.html),
TrackSelector – Implementing a custom TrackSelector allows an app developer to change the way in which tracks exposed by a MediaSource are selected for consumption by each of the available Renderers.
My first feeling is I need to copy all files under “library\core\src\main\java\com\google\android\exoplayer2\trackselection” folder into my application layer and then do some modification. Do you have any suggestion for this? Is there a better solution?
Thank you very much in advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
I hope your team can help to implement it since it will be more quickly to be merged. Thanks a lot in advance.
In a similar case for languages we have two methods
setPreferredAudioLanguage(String)
andsetPreferredAudioLanguages(String...)
, which both end up in anImmutableList<String>
in theParameters
object (with one or many elements). I think we can just do the same here. I’ll mark as an enhancement for now. Are you thinking about providing a PR yourself or shall we implement this?