BunnyLiveStreamPlayer

fun BunnyLiveStreamPlayer(libraryId: Long, streamId: String, token: String? = null, expires: Long? = null, modifier: Modifier = Modifier, onVideoSizeChanged: (width: Int, height: Int) -> Unit? = null, bunny: StreamApi? = null, viewModel: BunnyLiveStreamPlayerViewModel = viewModel( factory = BunnyLiveStreamPlayerViewModel.factory(bunny), ))(source)

Public Compose entry point for live-stream playback. Mirrors Bunny's web player behaviour for every non-running state (offline overlays, countdown, pre-stream trailer) and auto-connects to the live source when polling reports the stream is running — the viewer never needs to refresh.

UI customization is server-driven, mirroring the iOS SDK: the accent colour, font family, UI language, control set and compact mode all come from the live /play endpoint (the Bunny dashboard's player settings). There is no client-side configuration object; SDK defaults apply until play-data arrives or for any field the endpoint doesn't provide.

The behaviour mirrors Bunny's web player; the state resolver in resolveLiveStreamPlayerState codifies it. This composable is intentionally thin: it observes BunnyLiveStreamPlayerViewModel.state and renders one of a handful of branches with no decision logic of its own.

Parameters

libraryId

the Bunny library id the stream lives in.

streamId

GUID of the live stream to play.

token

optional embed-view token for token-authenticated libraries.

expires

embed-view token expiration timestamp (epoch seconds).

modifier

Compose modifier for the root container.

bunny

the SDK instance to play from. Leave it null to use the default instance registered by net.bunny.api.BunnyStreamApi.initialize; pass one from BunnyStreamApi.create when the app addresses more than one library.

viewModel

injected for testability; defaults to a lifecycle-scoped instance bound to bunny.