ExoPlayerAdapter

Concrete implementation of PlayerAdapter interface that is responsible for hiding integration details with com.google.android.exoplayer2.ExoPlayer instance.

Parameters

playbackLooper

– A Looper that will be used for playback.

contentURL

A valid URL to retrieve the content itself or its manifest.

mediaType

one of MediaType types.

licenseURL

A valid URL to retrieve DRM License if the content is DRM protected.

drmScheme

one of DRMScheme types.

downloadID

download identifier for the content.

appContext

Context instance.

userAgent

The User-Agent string that should be used.

playbackProperties

PlaybackProperties to apply for playback customization/optimization.

listener

PlayerAdapter.Listener that listens for playback events.

networkStack

The NetworkStack to be used.

mediaMetadata

The android.media.MediaMetadata object corresponding to the playback.

preferredAudioMimeTypes

The Array of String objects that represent the preference of audio MIME types. If no preference is provided, the player will automatically pick the best track.

preferredVideoMimeTypes

The Array of String objects that represent the preference of video MIME types. If no preference is provided, the player will automatically pick the best track.

seekPreference

Represents the desired tolerances for seeking behaviour of the player.

renderingView

The optional View to render the video into.

renderingSurface

The optional Surface to render the video into.

repeatPlaybackOnStreamEnd

Enables/disables repeated playback when stream reaches the end.

exoPlayerMediaPlaylistAdapter

The ExoPlayerMediaPlaylistAdapter instance.

adapterLogger

The Logger instance to be used for capturing logs.

decoderConfiguration

A DecoderConfiguration to configure decoders of the the Player

Properties

Link copied to clipboard
open override var adPlayerViews: List<FrameLayout>?
Link copied to clipboard
open override var mediaSession: MediaSessionCompat?
Link copied to clipboard
Link copied to clipboard
open override val playerView: FrameLayout?
Link copied to clipboard
Link copied to clipboard
open override var streamId: String?
Link copied to clipboard
open override val subtitleView: FrameLayout?

Functions

Link copied to clipboard
Link copied to clipboard
open override fun addMediaPlaylistItem(mediaPlaylistItem: MediaPlaylistItem)
Link copied to clipboard
open override fun addMediaPlaylistItemAt(index: Int, mediaPlaylistItem: MediaPlaylistItem)
Link copied to clipboard
open override fun addMediaPlaylistItems(mediaPlaylistItems: List<MediaPlaylistItem>)
Link copied to clipboard
open override fun addMediaPlaylistItemsAt(index: Int, mediaPlaylistItems: List<MediaPlaylistItem>)
Link copied to clipboard
fun attachAdViewProvider(adViewProvider: AdViewProvider)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun clearMediaPlaylist()
Link copied to clipboard
open override 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 will have no effect.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getAudioVolume(): Float

Retrieves the current audio volume.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getMediaPlaylistItemAt(index: Int): MediaPlaylistItem?
Link copied to clipboard
open override fun getMediaPlaylistItemAtAsync(index: Int, callback: Callback<MediaPlaylistItem?, Error?>)
Link copied to clipboard
open override fun getMediaPlaylistItemCount(): Int
Link copied to clipboard
open override fun getMediaPlaylistItemCountAsync(callback: Callback<Int, Error?>)
Link copied to clipboard
Link copied to clipboard
open override fun getNextMediaPlaylistItemIndex(): Int
Link copied to clipboard
open override fun getNextMediaPlaylistItemIndexAsync(callback: Callback<Int, Error?>)
Link copied to clipboard
open override fun getPlaybackRate(): Float

Retrieves the current playback rate.

Link copied to clipboard
fun getPlaybackStats(): PlaybackStats?

Returns the PlaybackStats for the currently playback session, or null if no session is active.

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
Link copied to clipboard
Link copied to clipboard
open override fun getRawPlayer(): Any?

Returns the underlying native ExoPlayer player instance.

Link copied to clipboard
open override fun getResizeMode(): ResizeMode

Retrieves the current ResizeMode.

Link copied to clipboard
open override fun getStreamInfo(): StreamInformation?
Link copied to clipboard
open override fun hasNextMediaPlaylistItem(): Boolean
Link copied to clipboard
open override fun hasNextMediaPlaylistItemAsync(callback: Callback<Boolean, Error?>)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun isLive(): Boolean
Link copied to clipboard
open override fun isPlaying(): Boolean
Link copied to clipboard
open override fun isPlayingAd(): Boolean
Link copied to clipboard
open override fun isPlayingAudioStream(): Boolean
Link copied to clipboard
open override fun load()

When this command is received Player should trigger loading of Resources needed to Start the Playback .

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

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

Link copied to clipboard
open override fun play()

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

Link copied to clipboard
open override fun removeMediaPlaylistItem(index: Int)
Link copied to clipboard
open override fun removeMediaPlaylistItems(fromIndex: Int, toIndex: Int)
Link copied to clipboard
open override fun replaceAdTagParameters(adTagParameters: Map<String, String>)
Link copied to clipboard
open override fun replaceMediaPlaylistItem(index: Int, mediaPlaylistItem: MediaPlaylistItem)
Link copied to clipboard
open override fun seek(seekPositionMs: Long, seekPreference: SeekPreference?)

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

Link copied to clipboard
open override 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
open override 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 override fun seekTo(mediaItemIndex: Int, positionMs: Long)
Link copied to clipboard
open override fun seekToLiveEdge()

When this command is received, Player should trigger the seek of Media Source to the edge of Live Window.

Link copied to clipboard
open override fun seekToNextMediaPlaylistItem()
Link copied to clipboard
Link copied to clipboard
open override fun setAdsContext(adRequest: AdRequest, adEventListener: AdEventListener, adUIVisibilityPreference: IMAAdUIVisibilityPreference?)
Link copied to clipboard
open override fun setAudioVolume(volume: Float)

Set the Player audio volume to the given volume value.

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

Attach the corresponding android.media.MediaMetadata object to the MediaSession.

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

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

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

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

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

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

Link copied to clipboard
open override fun setPreferredTrackVariant(type: TrackVariantInfo.Type, variantInfo: TrackVariantInfo)
Link copied to clipboard
open override fun setRepeatMode(enableRepeatMode: Boolean, repeatTimeline: Boolean)
Link copied to clipboard
open override fun setResizeMode(resizeMode: ResizeMode)

When this command is received Player should set the ResizeMode to the given input.

Link copied to clipboard
open override fun setShuffleMode(enableShuffleMode: Boolean, shuffledIndices: IntArray?, randomSeed: Long?)
Link copied to clipboard
open override 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
open override 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 override fun updateMediaMetadata(mediaMetadata: MediaMetadata)
Link copied to clipboard

Update streamStartUpTimeData property to data provided.