-
public class TrackSelectorHelper
Helper class to do several operations with the MappingTrackSelector selector.
-
-
Constructor Summary
Constructors Constructor Description TrackSelectorHelper(ExoPlayer player, DefaultTrackSelector trackSelector)
Instantiates a new Track selector helper. TrackSelectorHelper(ExoPlayer player, DefaultTrackSelector trackSelector, MediaStore mediaStore)
Instantiates a new Track selector helper.
-
Method Summary
Modifier and Type Method Description List<Format>
getAvailableFormatList(int trackType)
Gets the available Format list by type. void
selectCaption(@NonNull() BrightcoveCaptionFormat captions)
Selects the Brightcove caption in the @MappingTrackSelector if available. void
selectAudio(@NonNull() String language)
Selects the audio language in the MappingTrackSelector if available. void
applySelectionOverride(int renderType, @NonNull() SelectionOverrideCreator selectionOverrideCreator)
void
applyTrackSelectionOverrides(int renderType, @NonNull() TrackSelectionOverrideCreator trackSelectionOverrideCreator)
Creates a {#TrackSelectionOverrides} with the TrackSelectionOverrideCreator and the render type.Such Track Selection Override will be set to the {#TrackSelector}. String
getSelectedAudioLanguage()
Gets the selected audio language if any. void
updateTracksSelectionArray(@Nullable() TrackSelectionArray trackSelections)
Updates the Track Selection array. void
updateTracksGroupInfos(@Nullable() ImmutableList<Tracks.Group> trackGroupInfos)
Updates the Track Group array. void
enableTrack(int trackType)
Enables the Renderer track. void
disableTrack(int trackType)
Disables the Renderer track. Map<Integer, String>
getAudioTracksIndexMap(Context context, DeliveryType deliveryType, boolean offline)
Creates a map from the Renderer of type TYPE_AUDIO with the track index and the language code. int
getRendererIndex(int renderType)
Gets the renderer index. List<Format>
findOfflineFormatList(@NonNull() Context context, @NonNull() List<Format> formatList)
Filter the Format list parameter returning only those stored in the device. -
-
Constructor Detail
-
TrackSelectorHelper
TrackSelectorHelper(ExoPlayer player, DefaultTrackSelector trackSelector)
Instantiates a new Track selector helper.- Parameters:
player
- the playertrackSelector
- the track selector
-
TrackSelectorHelper
TrackSelectorHelper(ExoPlayer player, DefaultTrackSelector trackSelector, MediaStore mediaStore)
Instantiates a new Track selector helper.- Parameters:
player
- the playertrackSelector
- the track selectormediaStore
- the store to check for downloaded content
-
-
Method Detail
-
getAvailableFormatList
@NonNull() List<Format> getAvailableFormatList(int trackType)
Gets the available Format list by type.
- Parameters:
trackType
- the track type
-
selectCaption
void selectCaption(@NonNull() BrightcoveCaptionFormat captions)
Selects the Brightcove caption in the @MappingTrackSelector if available.
- Parameters:
captions
- the captions
-
selectAudio
void selectAudio(@NonNull() String language)
Selects the audio language in the MappingTrackSelector if available.
- Parameters:
language
- the language
-
applySelectionOverride
@Deprecated() void applySelectionOverride(int renderType, @NonNull() SelectionOverrideCreator selectionOverrideCreator)
-
applyTrackSelectionOverrides
void applyTrackSelectionOverrides(int renderType, @NonNull() TrackSelectionOverrideCreator trackSelectionOverrideCreator)
Creates a {#TrackSelectionOverrides} with the TrackSelectionOverrideCreator and the render type.Such Track Selection Override will be set to the {#TrackSelector}.
If TrackSelectionOverrideCreator returns EMPTY_TRACK_SELECTION_OVERRIDES, the Track Selection Overridewill be ignored.
- Parameters:
renderType
- the com.brightcove.player.display.ExoPlayerVideoDisplayComponent.TrackTypetrackSelectionOverrideCreator
- the selection override creator
-
getSelectedAudioLanguage
String getSelectedAudioLanguage()
Gets the selected audio language if any.
-
updateTracksSelectionArray
@Deprecated() void updateTracksSelectionArray(@Nullable() TrackSelectionArray trackSelections)
Updates the Track Selection array.
- Parameters:
trackSelections
- the track selection array
-
updateTracksGroupInfos
void updateTracksGroupInfos(@Nullable() ImmutableList<Tracks.Group> trackGroupInfos)
Updates the Track Group array.
- Parameters:
trackGroupInfos
- the track selection array
-
enableTrack
void enableTrack(int trackType)
Enables the Renderer track.
- Parameters:
trackType
- the track type
-
disableTrack
void disableTrack(int trackType)
Disables the Renderer track.
- Parameters:
trackType
- the track type
-
getAudioTracksIndexMap
@NonNull() Map<Integer, String> getAudioTracksIndexMap(Context context, DeliveryType deliveryType, boolean offline)
Creates a map from the Renderer of type TYPE_AUDIO with the track index and the language code.
- Parameters:
deliveryType
- the delivery type
-
getRendererIndex
int getRendererIndex(int renderType)
Gets the renderer index.
- Parameters:
renderType
- the render type
-
findOfflineFormatList
@NonNull() List<Format> findOfflineFormatList(@NonNull() Context context, @NonNull() List<Format> formatList)
Filter the Format list parameter returning only those stored in the device.
- Parameters:
context
- reference to the host application context.formatList
- the format list
-
-
-
-