Skip to main content

Components

BBChannel

The main component that renders a BB Channel inside a WebView.

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

Extended channel component that integrates a native player for video playback instead of the WebView-based player. Supports all BBChannel props plus player-specific configuration.

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

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

Props

Inherits all BBChannel props plus:

PropTypeRequiredDefaultDescription
playerMode'inline' | 'fullscreen'No'inline'How videos are played — inline above the channel or in a fullscreen overlay
playerHeightnumberNo-Height of the inline player (only applies when playerMode is 'inline')
showBackArrowbooleanNofalseShow a back arrow in the player area