Skip to main content

Android Player SDK API Reference

interface UniPlayer

Types

NameSummary
Builder[androidJvm]class Builder(context: Context, playerConfig: PlayerConfig)

Functions

NameSummary
enableRepeatMode[androidJvm]abstract fun enableRepeatMode(repeatModeEnabled: Boolean) Enable repeat mode
forward[androidJvm]abstract fun forward(milliseconds: Long) Forward the playback with the specific timestamp.
getAudioTracks[androidJvm]abstract fun getAudioTracks(): List<AudioTrack>Get all audio track(s) of the playback.
getBufferedPosition[androidJvm]abstract fun getBufferedPosition(): Long Get current buffered time during playback
getCurrentAudioTrack[androidJvm]abstract fun getCurrentAudioTrack(): AudioTrack?Get the current audio track of the playback.
getCurrentLiveOffset[androidJvm]abstract fun getCurrentLiveOffset(): Long Returns the current live offset
getCurrentPlaybackSpeed[androidJvm]abstract fun getCurrentPlaybackSpeed(): Float Get the current playback speed value.
getCurrentQuality[androidJvm]abstract fun getCurrentQuality(): Quality? Get the current playback quality.
getCurrentSubtitle[androidJvm]abstract fun getCurrentSubtitle(): Subtitle? Get the current subtitle of the playback.
getCurrentWindow[androidJvm]abstract fun getCurrentWindow(): Timeline.Window? Get current window in timeline
getDuration[androidJvm]abstract fun getDuration(): Long Get the total duration of the playback.
getIsCurrentWindowDynamic[androidJvm]abstract fun getIsCurrentWindowDynamic(): Boolean Returns whether if the current window is dynamic
getMaxLiveOffsetMs[androidJvm]abstract fun getMaxLiveOffsetMs(): Long Returns max live offset for configuration
getMinLiveOffsetMs[androidJvm]abstract fun getMinLiveOffsetMs(): Long Returns min live offset for configuration
getPosition[androidJvm]abstract fun getPosition(): Long Get the current playback position.
getQualities[androidJvm]abstract fun getQualities(): List<Quality> Get all quality(ies) during playback.
getSubtitles[androidJvm]abstract fun getSubtitles(): List<Subtitle> Get all subtitle(s) of the playback.
getTargetLiveOffsetMs[androidJvm]abstract fun getTargetLiveOffsetMs(): Long Returns target live offset for configuration
getThumbnail[androidJvm]abstract suspend fun getThumbnail(positionMs: Long): Bitmap Return the cropped bitmap according to positionMs
getVolume[androidJvm]abstract fun getVolume(): Float Get the current playback volume value.
isOnLiveEdge[androidJvm]abstract fun isOnLiveEdge(): Boolean Check if the current progress is the latest
isPlaying[androidJvm]abstract fun isPlaying(): Boolean Get the playing status of the playback.
isSupportThumbNailSeeking[androidJvm]abstract fun isSupportThumbNailSeeking(): Boolean Check if the current media config supports thumbnail seeking
load[androidJvm]abstract fun load(mediaConfig: MediaConfig) Set the media source config into the player.
mute[androidJvm]abstract fun mute() Mute the playback volume.
pause[androidJvm]abstract fun pause() Pause the playback.
play[androidJvm]abstract fun play() Resume the playback.
playNext[androidJvm]abstract fun playNext() Play the next episode
playPrevious[androidJvm]abstract fun playPrevious() Play the previous episode
release[androidJvm]abstract fun release() Uninitialize/destroy the initialized/created player
replay[androidJvm]abstract fun replay() Replay the content.
rewind[androidJvm]abstract fun rewind(milliseconds: Long) Rewind the playback with the specific timestamp.
seek[androidJvm]abstract fun seek(milliseconds: Long Set the playback position with the specific timestamp.
setAudioTrack[androidJvm]abstract fun setAudioTrack(audioTrack: AudioTrack) Set the specific audio track of the playback.
setPlaybackSpeed[androidJvm] abstract fun setPlaybackSpeed(speed: Float): Boolean Set the current playback speed value.
setQuality[androidJvm]abstract fun setQuality(height: Int?): BooleanSet the playback quality of the playback video.
setSubtitle[androidJvm]abstract fun setSubtitle(subtitle: Subtitle)Set or disable the playback subtitle of the playback video.
setVolume[androidJvm]abstract fun setVolume(@FloatRange(from = 0.0, to = 1.0)volume: Float)Set the current playback volume value.
start[androidJvm]abstract fun start()Start the playback.
stop[androidJvm]abstract fun stop()Stop the content
unmute[androidJvm]abstract fun unmute()Unmute the playback volume.