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

Link copied to clipboard
annotation class AdEvent
Link copied to clipboard
annotation class AuxiliaryEvent
Link copied to clipboard
object Companion
Link copied to clipboard
annotation class Event
Link copied to clipboard
interface Listener : DRMDelegate

Properties

Link copied to clipboard

The collection of views that are required to render ad related content.

Link copied to clipboard

Represents the MediaSessionCompat associated with the playback.

Link copied to clipboard

Represents the com.quickplay.vstb7.player.model.PlaybackProperties associated with this playback.

Link copied to clipboard
abstract val playerView: FrameLayout?

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.

Link copied to clipboard

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.

Link copied to clipboard
abstract var streamId: String?

Represents the identifier used during server side ad insertion to uniquely identify a stream. Returns null if server side ad insertion was not used.

Link copied to clipboard
abstract val subtitleView: FrameLayout?

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

Link copied to clipboard

Obtain the Active Track variant option for the passed TrackVariantInfo.Type, if available.

Link copied to clipboard
open fun addMediaPlaylistItem(mediaPlaylistItem: MediaPlaylistItem)

Adds a MediaPlaylistItem to the end of the playlist.

Link copied to clipboard
open fun addMediaPlaylistItemAt(index: Int, mediaPlaylistItem: MediaPlaylistItem)

Adds a MediaPlaylistItem at the given index of the playlist.

Link copied to clipboard
open fun addMediaPlaylistItems(mediaPlaylistItems: List<MediaPlaylistItem>)

Adds a collection of MediaPlaylistItems to the end of the playlist.

Link copied to clipboard
open fun addMediaPlaylistItemsAt(index: Int, mediaPlaylistItems: List<MediaPlaylistItem>)

Adds a collection of MediaPlaylistItems at the given index of the playlist.

Link copied to clipboard

Returns the collection of MIME types of the Player's track variants available in TrackVariantInfo

Link copied to clipboard

Obtain the Available Track variants for passed TrackVariantInfo.Type.

Link copied to clipboard

Clears the playlist.

Link copied to clipboard
abstract fun dispose()

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.

Link copied to clipboard

Returns the Entire list of MediaPlaylistItem.

Link copied to clipboard

Returns the Entire list of MediaPlaylistItem.

Link copied to clipboard
open fun getAudioVolume(): Float

Retrieves the current audio volume.

Link copied to clipboard

Returns the currently playing MediaPlaylistItem. May be null if the timeline is empty.

Link copied to clipboard

Returns the currently playing MediaPlaylistItem. May be null if the timeline is empty.

Link copied to clipboard

Returns the index of the current MediaPlaylistItem in the timeline, or the prospective index if the current timeline is empty.

Link copied to clipboard

Returns the index of the current MediaPlaylistItem in the timeline, or the prospective index if the current timeline is empty.

Link copied to clipboard

Returns the MediaPlaylistItem at the given index.

Link copied to clipboard

Returns the MediaPlaylistItem at the given index.

Link copied to clipboard

Returns the number of MediaPlaylistItems in the playlist.

Link copied to clipboard

Returns the number of MediaPlaylistItems in the playlist.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
abstract fun getPlaybackRate(): Float

Retrieves the current playback rate.

Link copied to clipboard

Retrieves the current order of preference for various MIME types. Ex: aac, ec3, ac3, etc. Use MimeTypes for all possible values.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
open fun getRawPlayer(): Any?

returns the underlying native player instance e.g. ExoPlayer

Link copied to clipboard
abstract fun getResizeMode(): ResizeMode

Retrieves the current ResizeMode

Link copied to clipboard

Retrieves the latest Stream Information.

Link copied to clipboard

Returns whether a next MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.

Link copied to clipboard

Returns whether a next MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.

Link copied to clipboard

Returns whether a previous MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.

Link copied to clipboard

Returns whether a previous MediaPlaylistItem exists, which may depend on the current repeat mode and whether shuffle mode is enabled.

Link copied to clipboard
abstract fun isLive(): Boolean
Link copied to clipboard
abstract fun isPlaying(): Boolean
Link copied to clipboard
abstract fun isPlayingAd(): Boolean
Link copied to clipboard
Link copied to clipboard
abstract fun load()

When this command is received the Player should trigger loading of resources needed to start the playback.

Link copied to clipboard
open fun moveMediaPlaylistItem(currentIndex: Int, newIndex: Int)

Moves the MediaPlaylistItem at the current index to the new index.

Link copied to clipboard
abstract fun pause()

When this command is received the Player should trigger the pause of rendering playback.

Link copied to clipboard
abstract fun play()

When this command is received the Player should trigger the start of rendering Playback .

Link copied to clipboard
open fun removeMediaPlaylistItem(index: Int)

Removes the MediaPlaylistItem at the given index of the playlist.

Link copied to clipboard
open fun removeMediaPlaylistItems(fromIndex: Int, toIndex: Int)

Removes a range of MediaPlaylistItems from the playlist.

Link copied to clipboard
open fun replaceAdTagParameters(adTagParameters: Map<String, String>)

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.

Link copied to clipboard
open fun replaceMediaPlaylistItem(index: Int, mediaPlaylistItem: MediaPlaylistItem)

Replaces the MediaPlaylistItem at the given index of the playlist.

Link copied to clipboard
abstract fun seek(seekPositionMs: Long, seekPreference: SeekPreference? = null)

When this command is received the Player should trigger the seek of Media Source to the passed position parameter, in milliseconds

Link copied to clipboard
abstract fun seekBack()

When this command is received the Player should trigger the seek back of Media Source by PlaybackProperties.preferredSeekBackIncrementMs increment, in milliseconds

Link copied to clipboard
abstract fun seekForward()

When this command is received the Player should trigger the seek forward of Media Source by PlaybackProperties.preferredSeekForwardIncrementMs increment, in milliseconds

Link copied to clipboard
open fun seekTo(mediaItemIndex: Int, positionMs: Long)

Seeks to a position specified in milliseconds in the specified MediaPlaylistItem.

Link copied to clipboard
abstract fun seekToLiveEdge()

When this command is received the Player should trigger the seek of Media Source to the current live edge.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard
open fun setAdsContext(adRequest: AdRequest, adEventListener: AdEventListener, adUIVisibilityPreference: IMAAdUIVisibilityPreference?)

For the content with ads, sets AdRequest and AdEventListener. Note: This function needs to be called before load is called.

Link copied to clipboard
open fun setAudioVolume(volume: Float)

When this command is received the Player should change the audio volume by given volume value.

Link copied to clipboard
open fun setMediaPlaylistItem(mediaPlaylistItem: MediaPlaylistItem)

Clears the playlist, adds the specified MediaItem and resets the position to the default position.

Link copied to clipboard
open fun setPlaybackRate(rateFactor: Float)

When this command is received the Player should increase the playback rate by given factor.

Link copied to clipboard
open fun setPreferredBitrateThresholds(maxBitrate: Int, minBitrate: Int)

Configures the Player's Variant Adaptation Logic with the passed maximum and minimum bitrate constraints.

Link copied to clipboard
open fun setPreferredMimeTypes(type: TrackVariantInfo.Type, preferredMimeTypes: Array<String>)

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.

Link copied to clipboard

Configures the Player's Variant Adaptation Logic with the passed maximum bitrate constraint.

Link copied to clipboard

Activates an Elementary track matching the passed TrackVariantInfo option

Link copied to clipboard
open fun setRepeatMode(enableRepeatMode: Boolean, repeatTimeline: Boolean = true)

Enables or disables the repeat mode for the playlist at any time.

Link copied to clipboard
open fun setResizeMode(resizeMode: ResizeMode)

When this command is received the Player should change the ResizeMode to the given value.

Link copied to clipboard
open fun setShuffleMode(enableShuffleMode: Boolean, shuffledIndices: IntArray?, randomSeed: Long? = DEFAULT_RANDOM_SEED)

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.

Link copied to clipboard
open fun setSubtitleBottomMarginPosition(subtitleBottomMarginPosition: Int)

Set the position of subtitles in the video. Note: This will NOT override the embedded subtitle styles.

Link copied to clipboard
abstract fun stop()

When this command is received Player should trigger the stop of rendering playback. Player should fire PlayerAdapter.EV_PLAYBACK_IDLE on successful stop

Link copied to clipboard
open fun updateMediaMetadata(mediaMetadata: MediaMetadata)