Google is committed to advancing racial equity for Black communities. See how.

MediaTracksModifier

public class MediaTracksModifier extends Object

Modifier class for managing media tracks.

The class provides access to the tracks of the top-level MediaInfo, as specified in the getMediaTracks() of getMediaInfoModifier().

The class also provides APIs to get and set the active tracks (including APIs that are scoped to track types). The active track IDs will be populated to MediaStatus.

Public Method Summary

void
clear()
Clears the active track IDs.
Set<Long>
getActiveTrackIds()
Returns the set of IDs of all tracks.
List<MediaTrack>
getActiveTracksByType(int type)
Returns the list of active media tracks of type.
List<MediaTrack>
getMediaTracks()
Returns the list of media tracks of the top-level MediaInfoModifier.
List<MediaTrack>
getMediaTracksByType(int type)
Returns the list of media tracks of type of the top-level MediaInfoModifier.
MediaTracksModifier
setActiveTrackIds(long[] activeTrackIds)
Sets the list of active track IDs.
void
setActiveTracksByType(int type, Set<Long> newTrackIds)
Sets the active track IDs of type.
void
setActiveTracksByType(int type, List<MediaTrack> newActiveTracks)
Sets the active tracks for of type.

Inherited Method Summary

Public Methods

public void clear ()

Clears the active track IDs.

public Set<Long> getActiveTrackIds ()

Returns the set of IDs of all tracks.

public List<MediaTrack> getActiveTracksByType (int type)

Returns the list of active media tracks of type.

Parameters
type the track type, which is one of the types in com.google.android.gms.cast.MediaTrack.TYPE_*

public List<MediaTrack> getMediaTracks ()

Returns the list of media tracks of the top-level MediaInfoModifier.

public List<MediaTrack> getMediaTracksByType (int type)

Returns the list of media tracks of type of the top-level MediaInfoModifier.

Parameters
type the track type, which is one of the types in com.google.android.gms.cast.MediaTrack.TYPE_*

public MediaTracksModifier setActiveTrackIds (long[] activeTrackIds)

Sets the list of active track IDs.

public void setActiveTracksByType (int type, Set<Long> newTrackIds)

Sets the active track IDs of type.

This method is scoped to the given type. Any track IDs that are of the same type and are not in newTrackIds will be unset.

Parameters
type the track type, which is one of the types in com.google.android.gms.cast.MediaTrack.TYPE_*
newTrackIds

public void setActiveTracksByType (int type, List<MediaTrack> newActiveTracks)

Sets the active tracks for of type.

This method is scoped to the given type. Any track IDs that are of the same type and are not in newTrackIds will be unset.

Parameters
type the track type, which is one of the types in com.google.android.gms.cast.MediaTrack.TYPE_*
newActiveTracks