PillarboxExoPlayer

Pillarbox player

Parameters

context

The context.

coroutineContext
exoPlayer

The underlying player.

monitoringMessageHandler

The class to handle each Monitoring message.

Properties

Link copied to clipboard
open override var smoothSeekingEnabled: Boolean

Smooth seeking enabled

Link copied to clipboard
open override var trackingEnabled: Boolean

Enable or disable analytics tracking for the current MediaItem.

Functions

Link copied to clipboard
Link copied to clipboard
open override fun addListener(listener: Player.Listener)
Link copied to clipboard
open override fun addMediaItem(p0: MediaItem)
open override fun addMediaItem(p0: Int, p1: MediaItem)
Link copied to clipboard
open override fun addMediaItems(p0: MutableList<MediaItem>)
open override fun addMediaItems(p0: Int, p1: MutableList<MediaItem>)
Link copied to clipboard
open override fun addMediaSource(p0: MediaSource)
open override fun addMediaSource(p0: Int, p1: MediaSource)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun canAdvertiseSession(): Boolean
Link copied to clipboard
open override fun clearAuxEffectInfo()
Link copied to clipboard
open override fun clearMediaItems()
Link copied to clipboard
open override fun clearVideoSurface()
open override fun clearVideoSurface(@Nullable p0: Surface?)
Link copied to clipboard
Link copied to clipboard
open override fun clearVideoSurfaceView(@Nullable p0: SurfaceView?)
Link copied to clipboard
open override fun clearVideoTextureView(@Nullable p0: TextureView?)
Link copied to clipboard
Link copied to clipboard
fun Player.currentBufferedPercentageAsFlow(updateInterval: Duration = DefaultUpdateInterval): Flow<Float>

Current buffered percentage as flow Player.getBufferedPercentage

Link copied to clipboard

Current media metadata as flow Player.getCurrentMediaItem

Link copied to clipboard
fun Player.currentMediaMetadataAsFlow(withPlaylistMediaMetadata: Boolean = false): Flow<MediaMetadata>

Current media metadata as flow Player.getMediaMetadata

Link copied to clipboard
fun Player.currentPositionAsFlow(updateInterval: Duration = DefaultUpdateInterval): Flow<Long>

Current position of the player updates every updateInterval when it is playing. Send current position once if not playing.

Link copied to clipboard

Current position percent

Link copied to clipboard
open override fun decreaseDeviceVolume()
open override fun decreaseDeviceVolume(p0: Int)
Link copied to clipboard

Disable the audio track.

Link copied to clipboard

Disable the text track.

Link copied to clipboard

Disable the video track.

Link copied to clipboard

Duration Player.getDuration as Flow.

Link copied to clipboard

Enable the audio track.

Link copied to clipboard

Enable the text track.

Link copied to clipboard

Enable the video track.

Link copied to clipboard
Link copied to clipboard
open override fun getApplicationLooper(): Looper
Link copied to clipboard
fun Player.getAspectRatioAsFlow(defaultAspectRatio: Float): Flow<Float>

Get aspect ratio of the current video as Flow.

Link copied to clipboard
open override fun getAudioAttributes(): AudioAttributes
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getAudioSessionId(): Int
Link copied to clipboard
Link copied to clipboard
@IntRange(from = 0, to = 100)
open override fun getBufferedPercentage(): Int
Link copied to clipboard
open override fun getBufferedPosition(): Long
Link copied to clipboard
fun Player.getChapterAtPosition(positionMs: Long = currentPosition): Chapter?

Get the chapter at position.

Link copied to clipboard
open override fun getClock(): Clock
Link copied to clipboard
open override fun getContentBufferedPosition(): Long
Link copied to clipboard
open override fun getContentDuration(): Long
Link copied to clipboard
open override fun getContentPosition(): Long
Link copied to clipboard
fun Player.getCreditAtPosition(positionMs: Long = currentPosition): Credit?

Get the credit at position.

Link copied to clipboard
open override fun getCurrentAdGroupIndex(): Int
Link copied to clipboard
open override fun getCurrentAdIndexInAdGroup(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getCurrentCues(): CueGroup
Link copied to clipboard
open override fun getCurrentLiveOffset(): Long
Link copied to clipboard
Link copied to clipboard
open override fun getCurrentMediaItem(): MediaItem?
Link copied to clipboard
open override fun getCurrentMediaItemIndex(): Int
Link copied to clipboard

Get current media item index as flow Player.getCurrentMediaItemIndex

Link copied to clipboard

Get a snapshot of the current media items

Link copied to clipboard

Get current media items as flow Player.getCurrentMediaItems

Link copied to clipboard

Get current metrics

Link copied to clipboard
open override fun getCurrentPeriodIndex(): Int
Link copied to clipboard
open override fun getCurrentPosition(): Long
Link copied to clipboard
open override fun getCurrentTimeline(): Timeline
Link copied to clipboard
Link copied to clipboard
open override fun getCurrentTracks(): Tracks
Link copied to clipboard

Get current tracks as flow Player.getCurrentTracks

Link copied to clipboard
Link copied to clipboard
open override fun getDeviceInfo(): DeviceInfo
Link copied to clipboard
@IntRange(from = 0)
open override fun getDeviceVolume(): Int
Link copied to clipboard
open override fun getDuration(): Long
Link copied to clipboard
open override fun getMaxSeekToPreviousPosition(): Long
Link copied to clipboard
open override fun getMediaItemAt(p0: Int): MediaItem
Link copied to clipboard
open override fun getMediaItemCount(): Int
Link copied to clipboard
open override fun getMediaMetadata(): MediaMetadata
Link copied to clipboard

Get metrics for item index

Link copied to clipboard
open override fun getNextMediaItemIndex(): Int
Link copied to clipboard
open override fun getNextWindowIndex(): Int
Link copied to clipboard
Link copied to clipboard
open override fun getPlaybackLooper(): Looper
Link copied to clipboard
Link copied to clipboard

Get playback speed

Link copied to clipboard

Playback speed Player.getPlaybackSpeed as Flow.

Link copied to clipboard
open override fun getPlaybackState(): Int
Link copied to clipboard
open override fun getPlaybackSuppressionReason(): Int
Link copied to clipboard
Link copied to clipboard
open override fun getPlaylistMetadata(): MediaMetadata
Link copied to clipboard
open override fun getPlayWhenReady(): Boolean
Link copied to clipboard
open override fun getPreviousMediaItemIndex(): Int
Link copied to clipboard
Link copied to clipboard
open override fun getRenderer(p0: Int): Renderer
Link copied to clipboard
open override fun getRendererCount(): Int
Link copied to clipboard
open override fun getRendererType(p0: Int): Int
Link copied to clipboard
open override fun getRepeatMode(): Int
Link copied to clipboard
open override fun getSeekBackIncrement(): Long
Link copied to clipboard
open override fun getSeekForwardIncrement(): Long
Link copied to clipboard
Link copied to clipboard
open override fun getShuffleModeEnabled(): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun getSurfaceSize(): Size
Link copied to clipboard
Link copied to clipboard
open override fun getTotalBufferedDuration(): Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getVideoScalingMode(): Int
Link copied to clipboard
open override fun getVideoSize(): VideoSize
Link copied to clipboard
@FloatRange(from = 0.0, to = 1.0)
open override fun getVolume(): Float
Link copied to clipboard
open operator override fun hasNext(): Boolean
Link copied to clipboard
open override fun hasNextMediaItem(): Boolean
Link copied to clipboard
open override fun hasNextWindow(): Boolean
Link copied to clipboard
open override fun hasPrevious(): Boolean
Link copied to clipboard
open override fun hasPreviousMediaItem(): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun increaseDeviceVolume()
open override fun increaseDeviceVolume(p0: Int)
Link copied to clipboard
fun Player.isAtLiveEdge(positionMs: Long = currentPosition, window: Timeline.Window = Window()): Boolean

Is at live edge

Link copied to clipboard
open override fun isCommandAvailable(p0: Int): Boolean
Link copied to clipboard
open override fun isCurrentMediaItemDynamic(): Boolean
Link copied to clipboard
open override fun isCurrentMediaItemLive(): Boolean
Link copied to clipboard
open override fun isCurrentMediaItemSeekable(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun isDeviceMuted(): Boolean
Link copied to clipboard
open override fun isLoading(): Boolean
Link copied to clipboard
fun Player.isPlaybackSpeedPossibleAtPosition(position: Long, speed: Float, window: Timeline.Window = Window()): Boolean

Return if the playback speed is possible at position. Always return true for none live content or if Player.getCurrentTimeline is empty.

Link copied to clipboard
open override fun isPlaying(): Boolean
Link copied to clipboard
open override fun isPlayingAd(): Boolean
Link copied to clipboard

Is playing Player.isPlaying as Flow.

Link copied to clipboard
open override fun isReleased(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Media item count Player.getMediaItemCount as Flow.

Link copied to clipboard
open override fun moveMediaItem(p0: Int, p1: Int)
Link copied to clipboard
open override fun moveMediaItems(p0: Int, p1: Int, p2: Int)
Link copied to clipboard
open operator override fun next()
Link copied to clipboard
open override fun pause()
Link copied to clipboard
open override fun play()
Link copied to clipboard

Playback state Player.getPlaybackState as flow.

Link copied to clipboard
Link copied to clipboard

Play when ready as flow Player.getPlayWhenReady

Link copied to clipboard
open override fun prepare()
open override fun prepare(p0: MediaSource)
open override fun prepare(p0: MediaSource, p1: Boolean, p2: Boolean)
Link copied to clipboard
open override fun previous()
Link copied to clipboard
open override fun release()

Releases the player. This method must be called when the player is no longer required. The player must not be used after calling this method.

Link copied to clipboard
Link copied to clipboard
open override fun removeListener(listener: Player.Listener)
Link copied to clipboard
open override fun removeMediaItem(p0: Int)
Link copied to clipboard
open override fun removeMediaItems(p0: Int, p1: Int)
Link copied to clipboard
open override fun replaceMediaItem(p0: Int, p1: MediaItem)
Link copied to clipboard
open override fun replaceMediaItems(p0: Int, p1: Int, p2: MutableList<MediaItem>)
Link copied to clipboard

Run the task in the same thread as Player.getApplicationLooper if it is necessary.

Link copied to clipboard
open override fun seekBack()
Link copied to clipboard
open override fun seekForward()
Link copied to clipboard
open override fun seekTo(positionMs: Long)
open override fun seekTo(mediaItemIndex: Int, positionMs: Long)
Link copied to clipboard
open override fun seekToDefaultPosition()
open override fun seekToDefaultPosition(mediaItemIndex: Int)
Link copied to clipboard
open override fun seekToNext()
Link copied to clipboard
open override fun seekToNextMediaItem()
Link copied to clipboard
open override fun seekToNextWindow()
Link copied to clipboard
open override fun seekToPrevious()
Link copied to clipboard
open override fun seekToPreviousMediaItem()
Link copied to clipboard
open override fun seekToPreviousWindow()
Link copied to clipboard

Select the provided track.

Link copied to clipboard
open override fun setAudioAttributes(p0: AudioAttributes, p1: Boolean)
Link copied to clipboard
open override fun setAudioSessionId(p0: Int)
Link copied to clipboard

Restore the default audio track.

Link copied to clipboard

Restore the default text track.

Link copied to clipboard

Restore the default video track.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun setDeviceMuted(p0: Boolean)
open override fun setDeviceMuted(p0: Boolean, p1: Int)
Link copied to clipboard
open override fun setDeviceVolume(@IntRange(from = 0) p0: Int)
open override fun setDeviceVolume(@IntRange(from = 0) p0: Int, p1: Int)
Link copied to clipboard
open override fun setForegroundMode(p0: Boolean)
Link copied to clipboard
open override fun setHandleAudioBecomingNoisy(p0: Boolean)
Link copied to clipboard
fun Player.setHandleAudioFocus(handleAudioFocus: Boolean)

Handle audio focus with the currently set AudioAttributes.

Link copied to clipboard
Link copied to clipboard
open override fun setMediaItem(p0: MediaItem)
open override fun setMediaItem(p0: MediaItem, p1: Boolean)
open override fun setMediaItem(p0: MediaItem, p1: Long)
Link copied to clipboard
open override fun setMediaItems(p0: MutableList<MediaItem>)
open override fun setMediaItems(p0: MutableList<MediaItem>, p1: Boolean)
open override fun setMediaItems(p0: MutableList<MediaItem>, p1: Int, p2: Long)
Link copied to clipboard
open override fun setMediaSource(p0: MediaSource)
open override fun setMediaSource(p0: MediaSource, p1: Boolean)
open override fun setMediaSource(p0: MediaSource, p1: Long)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun setPlaybackParameters(playbackParameters: PlaybackParameters)
Link copied to clipboard
open override fun setPlaybackSpeed(speed: Float)
Link copied to clipboard
open override fun setPlaylistMetadata(p0: MediaMetadata)
Link copied to clipboard
open override fun setPlayWhenReady(p0: Boolean)
Link copied to clipboard
Link copied to clipboard
open override fun setPriority(p0: Int)
Link copied to clipboard
Link copied to clipboard
open override fun setRepeatMode(p0: Int)
Link copied to clipboard
Link copied to clipboard
open override fun setShuffleModeEnabled(p0: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Set track override.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun setVideoScalingMode(p0: Int)
Link copied to clipboard
open override fun setVideoSurface(@Nullable p0: Surface?)
Link copied to clipboard
open override fun setVideoSurfaceHolder(@Nullable p0: SurfaceHolder?)
Link copied to clipboard
open override fun setVideoSurfaceView(@Nullable p0: SurfaceView?)
Link copied to clipboard
open override fun setVideoTextureView(@Nullable p0: TextureView?)
Link copied to clipboard
open override fun setVolume(@FloatRange(from = 0.0, to = 1.0) p0: Float)
Link copied to clipboard
open override fun setWakeMode(p0: Int)
Link copied to clipboard

Shuffle mode enabled Player.getShuffleModeEnabled as Flow.

Link copied to clipboard
open override fun stop()
Link copied to clipboard
fun Player.tickerWhilePlayingAsFlow(interval: Duration = DefaultUpdateInterval): Flow<Unit>

Ticker emits event every interval when Player.isPlaying is true. Emit a value once at least once.

Link copied to clipboard

Get video size as flow Player.getVideoSize