ComposablePlayer
Properties
The value of the audio volume. The range varies from MIN_AUDIO_VOLUME to MAX_AUDIO_VOLUME where MIN_AUDIO_VOLUME being the silence (volume muted).
Sets or gets the mute state of the player's audio.
Indicates the Player's current buffering state. Possible values:
The CaptionSettingsSelector instance.
Media content URL
The playback position in the current content window in epoch time or the prospective position in epoch time (in milliseconds).
The duration of the live offset (in milliseconds).
The playback position in the current content window or the prospective position (in milliseconds).
The duration of the current content window (in milliseconds) or com.google.android.exoplayer2.C#TIME_UNSET if the duration is not known.
The DRMDelegate instance.
The PlaybackProperties instance.
The factor by which playback should be sped up. Must be greater than zero. 1.0 indicates normal speed
Indicates the Player's current playback state. Possible values:
The PlayerAdapter instance.
The Player's rendering surface
Represents the order of preference for various audio MIME types. Ex: aac, ec3, ac3, etc. If no preference is provided, the player will automatically pick the best track. Use MimeTypes for all possible values.
Represents the order of preference for various video MIME types. Ex: avc, hevc, etc. If no preference is provided, the player will automatically pick the best track. Use MimeTypes for all possible values.
The ResizeMode of the player
Indicates the Player's current seeking state. Possible values:
Get the stream information
This optional attribute can be set if positioning of the subtitle is required. The value of this attribute will be set as percentage of bottom margin (extra space) on the bottom side of the subtitle view allowing the client to position the subtitle as required.
A subtitleView for displaying the subtitles. Add the subtitleView onto the parent view after Player is loaded. NOTE: This is applicable only when application creates its own surface.
Functions
Aborts Playback with Error which will be propagated via Player.Listener.onError
Obtain the Active Track variant option for the passed TrackVariantInfo.Type, if available.
Register a listener to receive events from the core player. The listener's methods will be called on the UI thread.
Called on Playback progress
Register a listener to receive events from the player. The listener's methods will be called on the UI thread.
Adds a MediaPlaylistItem to the end of the playlist.
Adds a MediaPlaylistItem at the given index of the playlist.
Adds a collection of MediaPlaylistItems to the end of the playlist.
Adds a collection of MediaPlaylistItems at the given index of the playlist.
Called before Player.load is called.
Called on every state-change.
Returns the collection of MIME types of the Player's track variants available in TrackVariantInfo
Obtain the Available Track variants for passed TrackVariantInfo.Type.
Clears the playlist.
Returns the Entire list of MediaPlaylistItem.
Returns the Entire list of MediaPlaylistItem.
Returns the currently playing MediaPlaylistItem. May be null if the timeline is empty.
Returns the currently playing MediaPlaylistItem. May be null if the timeline is empty.
Returns the index of the current MediaPlaylistItem in the timeline, or the prospective index if the current timeline is empty.
Returns the index of the current MediaPlaylistItem in the timeline, or the prospective index if the current timeline is empty.
Provides the maximum number of player's secured hardware decoders that can be instantiated for multi-stream playback. The secured decoder is used for playing DRM content. NOTE: This is a utility function that can be called before the playback starts (before calling play).
Returns the MediaPlaylistItem at the given index.
Returns the MediaPlaylistItem at the given index.
Returns the number of MediaPlaylistItems in the playlist.
Returns the number of MediaPlaylistItems in the playlist.
returns the Parcelable Media session token. Represents an ongoing session. This may be passed to apps by the session owner to allow them to create a MediaControllerCompat to communicate with the session.
Returns the index of the MediaPlaylistItem that will be played if seekToNextMediaPlaylistItem is called, which may depend on the current repeat mode and whether shuffle mode is enabled. Returns INDEX_UNSET if hasNextMediaPlaylistItem returns Boolean.false.
Returns the index of the MediaPlaylistItem that will be played if seekToNextMediaPlaylistItem is called, which may depend on the current repeat mode and whether shuffle mode is enabled.
Returns the index of the MediaPlaylistItem that will be played if seekToPreviousMediaPlaylistItem is called, which may depend on the current repeat mode and whether shuffle mode is enabled. Returns INDEX_UNSET if hasPreviousMediaPlaylistItem returns Boolean.false.
Returns the index of the MediaPlaylistItem that will be played if seekToPreviousMediaPlaylistItem is called, which may depend on the current repeat mode and whether shuffle mode is enabled.
returns the underlying native player instance e.g. ExoPlayer
Provides video stream preview image that can be shown to the user when seeking (VOD content only).
Provides, if available, the URL to video stream preview image file. The client uses this URL to load the video stream preview image that can be shown to the user when seeking (VOD content only).
Returns whether a next MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.
Returns whether a next MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.
Returns whether a previous MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.
Returns whether a previous MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.
Moves the MediaPlaylistItem at the current index to the new index.
Unregister a listener. The listener will no longer receive events from the player.
Unregister a listener. The listener will no longer receive events from the player.
Removes the MediaPlaylistItem at the given index of the playlist.
Removes a range of MediaPlaylistItems from the playlist.
Replaces the MediaPlaylistItem at the given index of the playlist.
Seeks a content to a particular time position.
Seeks back in the current content by PlaybackProperties.preferredSeekBackIncrementMs
Seeks forward in the current content by PlaybackProperties.preferredSeekForwardIncrementMs
Seeks to a position specified in milliseconds in the specified MediaPlaylistItem.
Seeks to the default position associated with the current window. For live streams it will typically be the live edge of the window. For other streams it will typically be the start of the window. Call this api only for DVR enabled LIVE streams.
Seeks to the default position of the next MediaPlaylistItem, which may depend on the current repeat mode and whether shuffle mode is enabled. Does nothing if hasNextMediaPlaylistItem returns Boolean.false.
Seeks to the default position of the previous MediaPlaylistItem, which may depend on the current repeat mode and whether shuffle mode is enabled. Does nothing if hasPreviousMediaPlaylistItem returns Boolean.false.
Sends the event, action, and metadata related to stream timeline changes.
Clears the playlist, adds the specified MediaItem and resets the position to the default position.
Configures the Player's Variant Adaptation Logic with the passed maximum and minimum bitrate constraints.
Activates an Elementary track matching the passed TrackVariantInfo option Sets the order of preference for various MIME types. Ex: aac, ec3, ac3, etc. Use MimeTypes for all possible values.
Configures the Player's Variant Adaptation Logic with the passed maximum bitrate constraint.
Activates an Elementary track matching the passed TrackVariantInfo option
Enables or disables the repeat mode for the playlist at any time.
Enables or disables (default state) the shuffle mode for the playlist at any time. If the shuffle mode is enabled one can specify the shuffle order with the specified random seed. When in shuffle mode, the player will play the playlist in a precomputed, randomized order. All items will be played once and the shuffle mode can also be combined with playlist repeat mode to repeat the same randomized order in an endless loop. When shuffle mode is turned off, playback continues from the current item at its original position in the playlist. NOTE that the indices as returned by methods like getCurrentMediaPlaylistItemIndex always refer to the original, un-shuffled order. Similarly, seekToNextMediaPlaylistItem will not play the item at getCurrentMediaPlaylistItemIndex + 1, but the next item according to the shuffle order. Inserting new items in the playlist or removing items will keep the existing shuffled order unchanged as far as possible.
Stops a Playing Content and releases any held resources if necessary. After successful stop, player moves to PlaybackState.IDLE
Declares all the methods that can be used to listen to changes and events in varied aspects of the playback.