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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Q getActiveQuality() The active Quality of the media track, i.e.
      abstract QualityList<Q> getQualities() The qualities of the media track.
      abstract Q getTargetQuality() The desired quality of the media track.
      abstract QualityList<Q> getTargetQualities() The desired qualities of the media track.
      abstract void setTargetQuality(@Nullable() Q quality) Sets the target quality.
      abstract void setTargetQualities(@Nullable() List<Q> targetQualities) Set the target qualities.
      abstract boolean isEnabled()
      abstract void setEnabled(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
    • Constructor Detail

    • 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)

      • 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)

      • setTargetQualities

         abstract void setTargetQualities(@Nullable() List<Q> targetQualities)

        Set the target 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.