Interface MediaTrack
-
- All Implemented Interfaces:
-
com.theoplayer.android.api.event.EventDispatcher,com.theoplayer.android.api.player.track.Track
public interface MediaTrack<Q extends Quality> implements EventDispatcher<E>, Track
Represents a media track (audio or video) of a media resource.
-
-
Method Summary
Modifier and Type Method Description abstract QgetActiveQuality()The active Quality of the media track, i.e. abstract QualityList<Q>getQualities()The qualities of the media track. abstract QgetTargetQuality()The desired quality of the media track. abstract QualityList<Q>getTargetQualities()The desired qualities of the media track. abstract voidsetTargetQuality(@Nullable() Q quality)Sets the target quality. abstract voidsetTargetQualities(@Nullable() List<Q> targetQualities)Set the target qualities. abstract booleanisEnabled()abstract voidsetEnabled(boolean enabled)Sets whether the track is enabled. -
Methods inherited from class com.theoplayer.android.api.event.EventDispatcher
addEventListener, removeEventListener -
Methods inherited from class com.theoplayer.android.api.player.track.Track
getId, getKind, getLabel, getLanguage, getUid -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getActiveQuality
@Nullable() abstract Q getActiveQuality()
The active Quality of the media track, i.e. the quality that is currently being played.
- Returns:
The active quality of the media track. (Nullable)
-
getQualities
@NonNull() abstract QualityList<Q> getQualities()
The qualities of the media track.
- Returns:
The QualityList of the media track. (NonNull)
-
getTargetQuality
@Nullable() abstract Q getTargetQuality()
The desired quality of the media track.
- The provided quality is a member of the QualityList of the track.
- When multiple target qualities are present, this method will return the first one from the list.
- Returns:
The desired quality of the media track. (Nullable)
-
getTargetQualities
@Nullable() abstract QualityList<Q> getTargetQualities()
The desired qualities of the media track.
- The provided qualities are members of the QualityList of the track.
- Returns:
The desired qualities of the media track. (Nullable)
-
setTargetQuality
abstract void setTargetQuality(@Nullable() Q quality)
Sets the target quality.
- The quality should be a member of the getQualities.
- Parameters:
quality- The new Quality to be set.
-
setTargetQualities
abstract void setTargetQualities(@Nullable() List<Q> targetQualities)
Set the target qualities.
- The qualities should be a member of the getQualities.
- Setting `null` is similar to not having target qualities, so ABR will pick from all available qualities.
- Parameters:
targetQualities- The new list of qualities to be set
-
isEnabled
abstract boolean isEnabled()
- Returns:
Returns whether the track is enabled.
-
setEnabled
abstract void setEnabled(boolean enabled)
Sets whether the track is enabled.
- Only one track of the same type (e.g. video) can be enabled at the same time.
- Enabling a track will disable all other tracks of the same type.
- Disabling a track will not enable a different track of the same type.
- Parameters:
enabled- Whether the track should be enabled.
-
-
-
-