Skip to main content

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

PropertyTypeDefaultDescription
showBackArrowBooleantrueShow back arrow header above player on detail pages
playerAspectRatioFloat16f/9fAspect 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.