PlayerModel

interface PlayerModel

Properties

Link copied to clipboard
abstract var audioTrack: String?

The preferred audio language

Link copied to clipboard
abstract var autoRepeatEnabled: Boolean

The current repeat mode enabled

Link copied to clipboard
abstract var currentVolume: Float

The current volume

Link copied to clipboard
abstract var playbackSpeed: Float

The factor by which playback will be sped up. Must be greater than zero. The default value is 1.0.

Link copied to clipboard
abstract val playWhenReady: Boolean

Get player will play video or not when the resource is ready. Player will play the content if result is true, otherwise, render the first frame

Link copied to clipboard

The preferred subtitle language

Functions

Link copied to clipboard
abstract fun addMetadataOutput(metadataOutput: MetadataOutput)
Link copied to clipboard
abstract fun cancelPreCache()

Cancel pre-cache

Link copied to clipboard
abstract fun cancelPreCacheAndPlay()

Cancel pre-cache and play media source

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

loop the current video infinitely

Link copied to clipboard
abstract fun getAudioTrackList(): MutableList<String>

Get audio track list

Link copied to clipboard
abstract fun getBufferedPosition(): Long
Link copied to clipboard
abstract fun getCurrentDashManifest(): DashManifest?
Link copied to clipboard
abstract fun getCurrentLiveOffset(): Long

Get currentLiveOffset

Link copied to clipboard
abstract fun getCurrentTrackGroups(): TrackGroupArray?

Get the audioTrack list

Link copied to clipboard
abstract fun getCurrentWindow(): Timeline.Window?
Link copied to clipboard
abstract fun getDuration(): Long
Link copied to clipboard
abstract fun getIsCurrentWindowDynamic(): Boolean

Get isCurrentWindowDynamic

Link copied to clipboard
abstract fun getIsCurrentWindowLive(): Boolean

Get isCurrentWindowLive

Link copied to clipboard
abstract fun getMaxVideoHeight(): Int

Get the current maximal video height.

Link copied to clipboard
abstract fun getPlayer(): BVPlayer
Link copied to clipboard
abstract fun getPlayerState(): PlayerState
Link copied to clipboard
abstract fun getPosition(): Long
Link copied to clipboard
Link copied to clipboard
abstract fun getQualityTrackList(): List<Quality>
Link copied to clipboard
abstract fun getSubtitleTrackList(): MutableList<TrackInfo.Subtitle>

Get subtitle track list

Link copied to clipboard
abstract fun getTotalBufferedDuration(): Long
Link copied to clipboard
abstract fun initializePlayer(context: Context, lastPlayed: Long?, playWhenReady: Boolean?, bvPlayerParameters: BVPlayerParameters)

New a ExoPlayer instance and load video. Please call releasePlayer() when player is never used.

Link copied to clipboard
abstract fun isPaused(): Boolean

Whether the player is paused.

Link copied to clipboard
abstract fun isPlaybackEndedWhenReady(): Boolean
Link copied to clipboard
abstract fun isPlaying(): Boolean
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 pause()

Pause the video.

Link copied to clipboard
abstract fun play()

Play the video.

Link copied to clipboard
abstract fun preCache(context: Context, url: String)

pre-cache media source

Link copied to clipboard
abstract fun prepareSource(context: Context, bvPlayerSource: BVPlayerSource)

prepare media source

Link copied to clipboard
abstract fun releasePlayer()

Release the resource of player.

Link copied to clipboard
abstract fun resetState()

Reset the state, ex: reset playWhenReady to initial value

Link copied to clipboard
abstract fun seekTo(position: Long)

Seek the video to a specified position.

Link copied to clipboard
abstract fun seekToDefaultPosition()

Seek the video to the default position.

Link copied to clipboard
abstract fun setBVPlayerEventListener(eventListener: BVPlayerEventListener)

Setup a BVPlayerEventListener.

Link copied to clipboard
abstract fun setMaxVideoHeight(maxVideoHeight: Int)

Sets the maximum allowed video height in pixels. The default value is Int.MAX_VALUE (i.e. no constraint).

Link copied to clipboard
abstract fun setMute(isMute: Boolean)

Set audio mute or unmute

Link copied to clipboard
abstract fun setVideoSurfaceView(surfaceView: SurfaceView?)
Link copied to clipboard
abstract fun stop(reset: Boolean)

Stop the player