Class DefaultTrackSelector

  • Direct Known Subclasses:
    FakeTrackSelector

    public class DefaultTrackSelector
    extends MappingTrackSelector
    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 in this track selector:
    
     defaultTrackSelector.setParameters(
         defaultTrackSelector.getParameters()
             .buildUpon()
             .setTunnelingEnabled(true)
             .build());