Skip to main content

Components

BBChannel

The main channel component. Use BBChannelWithPlayer (below) for the recommended integration with native video playback.

import { BBChannel, BBChannelRef } from '@bluebillywig/react-native-channel';

const ref = useRef<BBChannelRef>(null);

<BBChannel
ref={ref}
channelUrl="https://demo.bbvms.com/ch/1152.json"
options={{ autoPlay: true }}
onReady={() => console.log('Channel loaded')}
onMediaPlay={(media) => console.log('Playing:', media.title)}
onNavigate={(event) => console.log('Page:', event.pageType)}
/>

Props

PropTypeRequiredDefaultDescription
channelUrlstringYes-URL to the channel JSON configuration
optionsBBChannelOptionsNo-Configuration options
styleViewStyleNo-Container view styles
initialNavigationStateBBNavigationStateNo-Initial navigation state for deep linking
handleBackButtonbooleanNofalseHandle Android hardware back button
bundleUrlstringNo-Custom JS bundle URL (overrides CDN)
safeAreaEdgesSafeAreaEdge[]No['top']Safe area edges to respect
safeAreaInsetsSafeAreaInsetsNo-Custom safe area inset values

Lifecycle callbacks

PropTypeDescription
onReady() => voidChannel finished loading
onError(error: BBErrorEvent) => voidAn error occurred
PropTypeDescription
onNavigate(event: BBNavigationEvent) => voidUser navigated to a page
onNavigationStateChange(state: BBNavigationState) => voidNavigation state changed
onCanGoBackChange(canGoBack: boolean) => voidBack navigation availability changed

Media callbacks

PropTypeDescription
onMediaPlay(media: BBMediaInfo) => voidA video started playing
onMediaPause(media: BBMediaInfo) => voidA video was paused
onMediaEnd(media: BBMediaInfo) => voidA video finished playing
onFirstPlayerMedia(media: BBMediaInfo) => voidFirst auto-playing video loaded

Player callbacks

PropTypeDescription
onPlayerStateChange(state: BBPlayerState) => voidPlayer state changed
onPlayerEvent(event: any) => voidRaw player event
onTimeUpdate(event: any) => voidPlayback time updated
onClipLoaded(event: any) => voidA clip was loaded in the player
onAdStart(event: any) => voidAn ad started playing
onAdEnd(event: any) => voidAn ad finished playing

Multi-player callbacks

PropTypeDescription
onPlayersChange(players: any) => voidRegistered players changed
onActivePlayerChange(player: any) => voidActive player changed

Other callbacks

PropTypeDescription
onSearch(event: BBSearchEvent) => voidUser performed a search
onExternalLink(url: string) => voidExternal link clicked. If not provided, external links are silently blocked
onAnalyticsEvent(event: any) => voidAnalytics event fired

BBChannelOptions

interface BBChannelOptions {
autoPlay?: boolean;
playout?: string;
searchBar?: boolean;
noStats?: boolean;
jwt?: string;
rpcToken?: string;
contentId?: string;
contentType?: string;
}
OptionTypeDescription
autoPlaybooleanAuto-play the first video
playoutstringOverride the playout ID
searchBarbooleanShow the search bar
noStatsbooleanDisable analytics/statistics
jwtstringJWT for authenticated content
rpcTokenstringRPC token for API access
contentIdstringInitial content ID to display
contentTypestringInitial content type

BBFullscreenPlayer

A fullscreen video player overlay. Use this to play a video in a modal fullscreen player triggered from your own UI.

import { BBFullscreenPlayer } from '@bluebillywig/react-native-channel';

<BBFullscreenPlayer
media={selectedMedia}
visible={isPlayerVisible}
onClose={() => setIsPlayerVisible(false)}
/>

Props

PropTypeRequiredDefaultDescription
mediaBBMediaInfo | nullYes-Media to play
visiblebooleanYes-Whether the player is visible
onClose() => voidYes-Called when the player should close
onError(error: BBErrorEvent) => voidNo-Error callback
fullscreenMode'fullscreen' | 'landscape'No'fullscreen'Fullscreen presentation mode

BBInlinePlayer

An inline video player component for embedding a player within your layout.

import { BBInlinePlayer } from '@bluebillywig/react-native-channel';

<BBInlinePlayer
media={media}
style={{ height: 220 }}
autoPlay={true}
/>

Props

PropTypeRequiredDefaultDescription
mediaBBMediaInfoYes-Media to play
styleViewStyleNo-Container view styles
autoPlaybooleanNofalseAuto-play on mount
onError(error: BBErrorEvent) => voidNo-Error callback

BBChannelWithPlayer

The recommended way to integrate channels with native video playback using the Blue Billywig native player. Requires @bluebillywig/react-native-bb-player as a peer dependency.

Provides:

  • Native inline player on detail pages
  • Fullscreen modal player for main page video playback
  • Player reuse across page transitions (no re-creation overhead)
  • Playlist auto-advance
  • Chromecast support (automatic cast routing when a session is active)
import { BBChannelWithPlayer } from '@bluebillywig/react-native-channel';

<BBChannelWithPlayer
channelUrl="https://demo.bbvms.com/ch/1152.json"
playerMode="inline"
playerAspectRatio={16 / 9}
showBackArrow={true}
onMediaPlay={(media) => console.log('Playing:', media.title)}
/>

Props

Inherits all BBChannel props plus:

PropTypeRequiredDefaultDescription
playerMode'inline' | 'fullscreen'No'inline'inline: native player fixed at top, channel scrolls below. fullscreen: tapping a video opens a native modal player.
playerHeightnumberNo-Fixed height for the inline player in pixels. Overrides playerAspectRatio.
playerAspectRationumberNo16/9Aspect ratio for the inline player (e.g. 16/9, 4/3). Ignored when playerHeight is set.
showBackArrowbooleanNofalseShow a back arrow above the player on detail pages
jwtstringNo-JWT for authenticated/protected content
onNativePlayerError(error: string) => voidNo-Called when the native player encounters an error
getNativePlayerRef(ref) => voidNo-Access the native player ref for direct control

See Native Player Integration for a full guide including Chromecast setup.