Class DefaultTrackSelector

  • All Implemented Interfaces:
    RendererCapabilities.Listener
    Direct Known Subclasses:
    FakeTrackSelector

    @Deprecated
    public class DefaultTrackSelector
    extends MappingTrackSelector
    implements RendererCapabilities.Listener
    Deprecated.
    com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    A default TrackSelector suitable for most use cases.

    Modifying parameters

    Track selection parameters should be modified by obtaining a TrackSelectionParameters.Builder initialized with the current TrackSelectionParameters from the player. The desired modifications can be made on the builder, and the resulting TrackSelectionParameters can then be built and set on the player:
    
     player.setTrackSelectionParameters(
         player.getTrackSelectionParameters()
             .buildUpon()
             .setMaxVideoSizeSd()
             .setPreferredAudioLanguage("de")
             .build());
     
    Some specialized parameters are only available in the extended DefaultTrackSelector.Parameters class, which can be retrieved and modified in a similar way by calling methods directly on this class:
    
     defaultTrackSelector.setParameters(
         defaultTrackSelector.getParameters()
             .buildUpon()
             .setTunnelingEnabled(true)
             .build());