Native Player Integration
The BB Channel Compose SDK uses the BB Native Player SDK for native video playback. This provides smooth, hardware-accelerated playback with full Chromecast support.
BBChannelWithPlayerView
BBChannelWithPlayerView is the recommended way to integrate channels with native video. It provides:
- Native inline player on detail pages
- Back arrow navigation header
- Player reuse across page transitions (no re-creation overhead)
- Playlist auto-advance
- Modal player for main page video playback
- Chromecast support
import com.bluebillywig.channelexample.BBChannelWithPlayerView
import com.bluebillywig.channelexample.BBChannelWithPlayerViewModel
@Composable
fun ChannelScreen() {
val viewModel = remember { BBChannelWithPlayerViewModel() }
BBChannelWithPlayerView(
channelUrl = "https://yourdomain.bbvms.com/ch/123.json",
viewModel = viewModel,
callbacks = BBChannelCallbacks(
onReady = { println("Channel loaded") }
)
)
}
Installation
Add both dependencies to your build.gradle.kts:
implementation("com.bluebillywig:bbchannel-compose:<version>")
implementation("com.bluebillywig:nativeplayer:<version>")
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
showBackArrow | Boolean | true | Show back arrow header above player on detail pages |
playerAspectRatio | Float | 16f/9f | Aspect ratio for the inline player |
Custom Player Handling (Advanced)
For full control over the player lifecycle, use BBChannelView directly and handle onMediaPlay events yourself:
BBChannelView(
channelUrl = "https://yourdomain.bbvms.com/ch/123.json",
viewModel = viewModel,
callbacks = BBChannelCallbacks(
onMediaPlay = { media ->
// Create and manage native player manually
}
)
)
Example App
A full working example is available at github.com/bluebillywig/channel-examples/compose.