BBNativeShorts

fun BBNativeShorts(jsonUrl: String, modifier: Modifier = Modifier, options: BBShortsOptions = BBShortsOptions(), state: BBShortsState = rememberBBShortsState(), onReady: () -> Unit? = null, onError: (String?) -> Unit? = null)

A Jetpack Compose wrapper for BBNativeShortsView.

Embeds the Blue Billywig Shorts experience in a Compose layout using AndroidView.

Example

@Composable
fun ShortsScreen(shortsUrl: String) {
val shortsState = rememberBBShortsState()

BBNativeShorts(
jsonUrl = shortsUrl,
modifier = Modifier.fillMaxSize(),
state = shortsState,
options = BBShortsOptions(displayFormat = "full"),
)
}

Parameters

jsonUrl

The JSON embed URL for the shorts configuration.

modifier

Modifier for sizing and layout.

options

Type-safe shorts options. Defaults to empty (uses defaults).

state

Reactive state holder. Create with rememberBBShortsState.

onReady

Called when the shorts view has finished setup.

onError

Called when the shorts view encounters an error.