BBPlayerState

Reactive state holder that bridges BBNativePlayerViewDelegate callbacks to Compose state.

Observe any property directly in a composable to trigger recomposition when it changes. Use the imperative control methods (play, pause, seek, etc.) to control the player.

Create with rememberBBPlayerState.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard

Estimated current playback position in seconds.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var mode: String?
Link copied to clipboard
var phase: Phase?
Link copied to clipboard
Link copied to clipboard
var state: State?
Link copied to clipboard

Functions

Link copied to clipboard
fun destroy()

Destroy the player and release resources.

Link copied to clipboard

Enter fullscreen mode. Requires the hosting Activity to extend AppCompatActivity.

Link copied to clipboard

Exit fullscreen mode.

Link copied to clipboard

Get the muted state.

Link copied to clipboard
fun loadClip(clipId: String, autoPlay: Boolean = true, seekTo: Number? = null)

Load a clip by ID.

Link copied to clipboard
fun loadClipList(clipListId: String, autoPlay: Boolean = true)

Load a clip list by ID.

Link copied to clipboard
fun loadProject(projectId: String, autoPlay: Boolean = true)

Load a project by ID.

Link copied to clipboard
fun pause()

Pause playback.

Link copied to clipboard
fun play()

Start or resume playback.

Link copied to clipboard
fun seek(seconds: Double)

Seek to the given absolute position in seconds.

Link copied to clipboard
fun seekRelative(offsetInSeconds: Double)

Seek relative to the current position (e.g. +10.0 or -10.0 seconds).

Link copied to clipboard
fun setMuted(muted: Boolean)

Set the muted state.

Link copied to clipboard
fun setVolume(volume: Double)

Set the playback volume (0.0 to 1.0).

Link copied to clipboard

Show the Chromecast device picker by programmatically clicking the cast button in the player UI.