PlayerAdapter
A generic adapter interface that any RAW player must adapt to, for seamless working with Player and it's internal state-machines.
This layer is designed to accept only Primitive parameters so that it works well during cross-platform bridging
Types
Properties
The collection of views that are required to render ad related content.
Represents the MediaSessionCompat associated with the playback.
Represents the com.quickplay.vstb7.player.model.PlaybackProperties associated with this playback.
The Layout which contains Views to render all the visual elements of the media under playback. The PlayerView is available not until load is called. Please check for Listener.onPlayerViewAvailable callback for when the player-view is available.
Enables/disables repeated playback when stream reaches the end. When set to true
, when triggering play()
after the playback reached the end time, will start the playback from the beginning. When set to false
, the playback will not be started once it reached the end time. Default value is false
.
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
Obtain the Active Track variant option for the passed TrackVariantInfo.Type, if available.
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.
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.
When this command is received Player should auto-shutdown and trigger release of all underlying resources held by the Player irrespective of the state it is in. Player should fire PlayerAdapter.EV_PLAYBACK_DISPOSED on successful abort. After dispose is processed, any call upon this Adapter instance will have no-effect.
Returns the Entire list of MediaPlaylistItem.
Returns the Entire list of MediaPlaylistItem.
Retrieves the current audio volume.
Returns the CaptionSettingsSelector for this PlayerAdapter
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.
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.
Retrieves the current playback rate.
Retrieves the current order of preference for various MIME types. Ex: aac, ec3, ac3, etc. Use MimeTypes for all possible values.
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
Retrieves the current ResizeMode
Retrieves the latest Stream Information.
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.
Removes the MediaPlaylistItem at the given index of the playlist.
Removes a range of MediaPlaylistItems from the playlist.
Replaces all the ad tag parameters used for the upcoming ad requests for a live stream. Note that this call is a no-op for VOD streams.
Replaces the MediaPlaylistItem at the given index of the playlist.
When this command is received the Player should trigger the seek of Media Source to the passed position parameter, in milliseconds
When this command is received the Player should trigger the seek back of Media Source by PlaybackProperties.preferredSeekBackIncrementMs increment, in milliseconds
When this command is received the Player should trigger the seek forward of Media Source by PlaybackProperties.preferredSeekForwardIncrementMs increment, in milliseconds
Seeks to a position specified in milliseconds in the specified MediaPlaylistItem.
When this command is received the Player should trigger the seek of Media Source to the current live edge.
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.
For the content with ads, sets AdRequest and AdEventListener. Note: This function needs to be called before load is called.
When this command is received the Player should change the audio volume by given volume value.
Clears the playlist, adds the specified MediaItem and resets the position to the default position.
When this command is received the Player should increase the playback rate by given factor.
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.
When this command is received the Player should change the ResizeMode to the given value.
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.
Set the position of subtitles in the video. Note: This will NOT override the embedded subtitle styles.
When this command is received Player should trigger the stop of rendering playback. Player should fire PlayerAdapter.EV_PLAYBACK_IDLE on successful stop