UniPlayer

interface UniPlayer

Types

Link copied to clipboard
class Builder(context: Context, playerConfig: PlayerConfig)

Properties

Link copied to clipboard

Seek data provider

Functions

Link copied to clipboard
abstract fun addEventListener(eventCallback: EventCallback)

Listen to the playback event (error, warning) that happened during playback.

Link copied to clipboard
abstract fun addStateEventListener(stateEventListener: StateEventListener)

Listen to the player state that happened during playback.

Link copied to clipboard
abstract fun enableRepeatMode(repeatModeEnabled: Boolean)

Enable repeat mode

Link copied to clipboard
abstract fun forward(milliseconds: Long)

Forward the playback with the specific timestamp.

Link copied to clipboard
abstract fun getAudioTracks(): List<AudioTrack>

Get all audio track(s) of the playback.

Link copied to clipboard
abstract fun getBufferedPosition(): Long

Get current buffered time during playback

Link copied to clipboard

Get the current audio track of the playback.

Link copied to clipboard
abstract fun getCurrentLiveOffset(): Long

Returns the current live offset

Link copied to clipboard

Get the media config data set to the player.

Link copied to clipboard
abstract fun getCurrentPlaybackSpeed(): Float

Get the current playback speed value.

Link copied to clipboard
abstract fun getCurrentQuality(): Quality?

Get the current playback quality.

Link copied to clipboard
abstract fun getCurrentSubtitle(): Subtitle?

Get the current subtitle of the playback.

Link copied to clipboard
abstract fun getCurrentWindow(): Timeline.Window?

Get current window in timeline

Link copied to clipboard
abstract fun getDuration(): Long

Get the total duration of the playback.

Link copied to clipboard
abstract fun getIsCurrentWindowDynamic(): Boolean

Check current playback is Live or not.

Link copied to clipboard
abstract fun getMaxLiveOffsetMs(): Long

Returns max live offset for configuration

Link copied to clipboard
abstract fun getMinLiveOffsetMs(): Long

Returns min live offset for configuration

Link copied to clipboard
abstract fun getPosition(): Long

Get the current playback position.

Link copied to clipboard
abstract fun getQualities(): List<Quality>

Get all quality(ies) during playback.

Link copied to clipboard
abstract fun getSubtitles(): List<Subtitle>

Get all subtitle(s) of the playback.

Link copied to clipboard
abstract fun getTargetLiveOffsetMs(): Long

Returns target live offset for configuration

Link copied to clipboard
abstract suspend fun getThumbnail(positionMs: Long): Bitmap

Return the cropped bitmap according to positionMs

Link copied to clipboard
abstract fun getVolume(): Float

Get the current playback volume value.

Link copied to clipboard
abstract fun isOnLiveEdge(): Boolean

Check if the current progress is the latest

Link copied to clipboard
abstract fun isPaused(): Boolean

Whether the player is paused.

Link copied to clipboard
abstract fun isPlaying(): Boolean

Whether the player is currently playing (i.e. has started and is not paused).

Link copied to clipboard
abstract fun isStalled(): Boolean

Whether the player is currently stalled due to low buffer conditions.

Link copied to clipboard
abstract fun isSupportThumbNailSeeking(): Boolean

Check if the current media config supports thumbnail seeking

Link copied to clipboard
abstract fun load(mediaConfig: MediaConfig)

Set the media source config into the player.

abstract fun load(offlineMediaConfig: OfflineMediaConfig)

Set the media source config into the player for offline playback.

Link copied to clipboard
abstract fun mute()

Mute the playback volume.

Link copied to clipboard
abstract fun pause()

Pause the playback.

Link copied to clipboard
abstract fun play()

Resume the playback.

Link copied to clipboard
abstract fun playNext()

Play the next episode

Link copied to clipboard
abstract fun playPrevious()

Play the previous episode

Link copied to clipboard
abstract fun release()

Uninitialize/destroy the initialized/created player

Link copied to clipboard
abstract fun replay()

Replay the content.

Link copied to clipboard
abstract fun rewind(milliseconds: Long)

Rewind the playback with the specific timestamp.

Link copied to clipboard
abstract fun seek(milliseconds: Long)

Set the playback position with the specific timestamp.

Link copied to clipboard
abstract fun setAudioTrack(audioTrack: AudioTrack)

Set the specific audio track of the playback.

Link copied to clipboard
abstract fun setCastEventListener(castEventListener: CastEventListener)

Listen to the cast event when the device is connected

Link copied to clipboard
abstract fun setPlaybackSpeed(speed: Float): Boolean

Set the current playback speed value.

Link copied to clipboard
abstract fun setPlayerOptions(playerOptions: PlayerOptions)
Link copied to clipboard
abstract fun setQuality(height: Int?): Boolean

Set the playback quality of the playback video.

Link copied to clipboard
abstract fun setSubtitle(subtitle: Subtitle)

Set or disable the playback subtitle of the playback video.

Link copied to clipboard
abstract fun setUiConfig(uiConfig: UiConfig)

set the colors of UI

Link copied to clipboard
abstract fun setVolume(@FloatRange(from = 0.0, to = 1.0) volume: Float)

Set the current playback volume value.

Link copied to clipboard
abstract fun start()

Start the playback.

Link copied to clipboard
abstract fun stop()

Stop the content

Link copied to clipboard
abstract fun unmute()

Unmute the playback volume.