Skip to main content

Components

BBPlayerView​

The main video player component. Renders a native player view (AVPlayer on iOS, ExoPlayer on Android).

import { BBPlayerView } from '@bluebillywig/react-native-bb-player';

<BBPlayerView
ref={playerRef}
jsonUrl="https://demo.bbvms.com/p/default/c/4701337.json"
options={{ autoPlay: true }}
style={{ flex: 1 }}
onDidTriggerPlay={() => console.log('Playing')}
/>

Props​

PropTypeRequiredDescription
jsonUrlstringYesJSON embed URL
playerIdstringNoUnique identifier for multi-player scenarios
jwtstringNoJWT token for authenticated access
optionsRecord<string, unknown>NoPlayer configuration options (see below)
styleViewStyleNoReact Native style object
Event callbacksSee EventsNoPlayer lifecycle event handlers

Player Options​

Options are passed through to the native SDK's createPlayerView. They can override playout settings.

options={{
// Playback
autoPlay: true, // Override playout auto-play setting
autoMute: true, // Override playout auto-mute setting
showStartControlBar: 'Yes', // Override playout start control bar setting
controlBar: 'Autohide', // 'Always' | 'Never' | 'Autohide'
modalPlayer: true, // Force landscape on fullscreen tap
forceFullscreenLandscape: true, // Rotate to landscape on fullscreen

// Commercials
commercials: true, // Allow commercials (overrides playout)
noChromeCast: false, // Disable ChromeCast support (overrides playout)

// Outstream
allowCollapseExpand: true, // Enable collapse/expand (for outstream)

// Analytics
noStats: false, // Disable stats logging

// Consent Management
waitForCmp: true, // Wait for Consent Management before setup
handleConsentManagement: true, // Handle Consent Management (requires waitForCmp)
tagForUnderAgeOfConsent: false, // Tag for under age of consent
consent_string: '', // Default consent string
consent_gdprApplies: 1, // Default GDPR applies (0 or 1)
consent_cmpVersion: 2, // Default CMP version
disableCookies: false, // GDPR cookie compliance

// Ad System parameters
adsystem_buid: 'app-bundle-id', // App bundle ID
adsystem_rdid: 'resettable-device-id', // Resettable device identifier
adsystem_idtype: 'idfa', // 'idfa' (iOS) or 'adid' (Android)
adsystem_is_lat: false, // Limit ad tracking
adsystem_ppid: 'publisher-provided-id', // Publisher-provided ID

// Custom ad tag URL parameters (prefix with adTagUrlParam_)
adTagUrlParam_userId: '12345',
adTagUrlParam_section: 'sports',
}}

BBShortsView​

Vertical video player with swipe navigation (TikTok-style). Uses a separate native view optimized for the Shorts experience.

import { BBShortsView } from '@bluebillywig/react-native-bb-player';

<BBShortsView
jsonUrl="https://demo.bbvms.com/sh/58.json"
options={{ displayFormat: 'full' }}
style={{ flex: 1 }}
/>

Props​

PropTypeRequiredDescription
jsonUrlstringYesShorts JSON URL (/sh/{id}.json)
optionsBBShortsViewOptionsNoShorts configuration
styleViewStyleNoContainer style
onDidSetupWithJsonUrl(url: string) => voidNoLoaded successfully
onDidFailWithError(error: string) => voidNoError occurred
onDidTriggerResize(w: number, h: number) => voidNoView resized

BBShortsViewOptions​

OptionTypeDefaultDescription
displayFormat'full' | 'list' | 'player''full'Display format
skipShortsAdOnSwipebooleanfalseSkip ad when swiping
shelfStartSpacingnumber—Start spacing for list format
shelfEndSpacingnumber—End spacing for list format

Methods (via ref)​

MethodDescription
destroy()Clean up and release resources

See Shorts Guide for usage details.


BBOutstreamPlayerView​

Convenience wrapper for outstream advertising with automatic collapse/expand animations.

Note: Previously named BBOutstreamView. The old name is still exported as a deprecated alias.

import { BBOutstreamPlayerView } from '@bluebillywig/react-native-bb-player';

<BBOutstreamPlayerView
jsonUrl="https://demo.bbvms.com/a/native_sdk_outstream.json"
expandedHeight={250}
animation={{ type: 'spring', damping: 15, stiffness: 100 }}
/>

Props​

Extends all BBPlayerView props, plus:

PropTypeDefaultDescription
expandedHeightnumber200Height when expanded (px)
collapsedHeightnumber0Height when collapsed (px)
animationOutstreamAnimationConfigtiming, 300msAnimation configuration
onCollapsed() => void—After collapse animation
onExpanded() => void—After expand animation
onAnimationStart(isCollapsing: boolean) => void—Animation started

Methods (via ref)​

All BBPlayerViewMethods plus:

MethodReturnDescription
isCollapsed()booleanCurrent collapsed state
animateCollapse()voidCollapse with animation
animateExpand()voidExpand with animation

See Outstream Guide for usage details.


BBModalPlayer​

Imperative API for presenting a native modal player. No component mounting required.

import { BBModalPlayer } from '@bluebillywig/react-native-bb-player';

// Present a clip
BBModalPlayer.present('https://demo.bbvms.com/p/default/c/4701337.json', {
autoPlay: true,
});

// Present a clip within a playlist context (enables auto-advance)
BBModalPlayer.present(
'https://demo.bbvms.com/p/default/c/4701337.json',
{ autoPlay: true },
{
contextEntityId: '4701337',
contextCollectionId: '12345',
contextCollectionType: 'MediaClipList',
}
);

// Dismiss
BBModalPlayer.dismiss();

// Listen for events
BBModalPlayer.addEventListener('dismiss', () => {
console.log('Modal closed');
});

API​

Method / PropertyDescription
BBModalPlayer.isAvailableboolean — check if native module is available
BBModalPlayer.present(jsonUrl, options?, context?)Present modal player. Returns boolean (success)
BBModalPlayer.dismiss()Dismiss modal player
BBModalPlayer.addEventListener(event, callback)Listen for modal events

ModalPlayerOptions​

OptionTypeDescription
autoPlaybooleanAuto-play after loading
jwtstringJWT token for authenticated access
playerBackgroundColorstringBackground color
fitmodestringVideo fit mode

Any additional key-value pairs are passed through to the native SDK as player options.

ModalPlayerContext​

FieldTypeDescription
contextEntityTypestringEntity type (e.g. 'MediaClipList')
contextEntityIdstringEntity ID (clip ID when playing within a collection)
contextCollectionTypestringCollection type (e.g. 'MediaClipList')
contextCollectionIdstringCollection ID (playlist/cliplist ID)

Events​

EventDescription
'dismiss'Modal was dismissed