Skip to main content

Setup

Quick Start

import { useRef } from 'react';
import {
BambuserVideoView,
type BambuserVideoViewRef,
} from '@bambuser/react-native-commerce-sdk';

export function LiveVideoScreen() {
const playerRef = useRef<BambuserVideoViewRef>(null);

return (
<BambuserVideoView
ref={playerRef}
style={{ flex: 1 }}
id="your-video-id"
server="US"
configuration={{
autoplay: true,
currency: 'USD',
locale: 'en-US',
}}
onStatus={(e) => console.log('state:', e.nativeEvent.state)}
onError={(e) => console.error(e.nativeEvent.message)}
/>
);
}

<BambuserVideoView /> Props

PropTypeDefaultPlatformDescription
idstringrequiredBothVideo identifier.
server'US' | 'EU''US'BothOrganization server region.
mode'live''live'BothVideo mode.
eventsstring[]['*']BothCustom events to subscribe to. Changing this prop creates a new player.
configurationRecord<string, any>{}BothPlayer configuration. Changing this prop creates a new player; memoize it.
ignoredSafeAreaEdgesSafeAreaEdge[][]BothEdges to ignore when the player computes safe-area padding.
onEvent(e) => voidn/aBothPlayer emitted a custom event. See Events.
onStatus(e) => voidn/aBothPlayback state changed.
onProgress(e) => voidn/aBothPeriodic progress updates.
onError(e) => voidn/aBothAn error occurred.
onPiPStateChanged(e) => voidn/aBothPicture-in-Picture state changed.
onThumbnailTapped(e) => voidn/aiOS onlyUser tapped the video thumbnail (pre-play).

⚠️ Memoize configuration. Passing a new object literal on every render rebuilds the player. Use useMemo, a module-level constant, or a state-stable object. The same applies to events.

Configuration

configuration is forwarded to the underlying SDK. Common options:

configuration={{
autoplay: true,
currency: 'USD',
locale: 'en-US',
buttons: { dismiss: 'none' },
ui: { hideShareButton: true, hideEmojiOverlay: true },
}}

For the complete list of supported keys (per-event, per-feature) consult the Bambuser Player API Reference.

Safe-area handling

By default, the player applies its own safe-area padding. To opt out for specific edges, pass ignoredSafeAreaEdges:

<BambuserVideoView
ignoredSafeAreaEdges={['top']}
...
/>
type SafeAreaEdge = 'all' | 'top' | 'bottom' | 'leading' | 'trailing';

Types

import type {
BambuserVideoViewRef,
BambuserPlayerState,
BambuserPiPState,
SafeAreaEdge,
NotifyInfo,
} from '@bambuser/react-native-commerce-sdk';

type BambuserPlayerState =
| 'ready' | 'loading' | 'playing' | 'paused' | 'stopped'
| 'completed' | 'error' | 'idle' | 'buffering';

type BambuserPiPState =
| 'willStart' | 'willStop' | 'started' | 'stopped' | 'restored';

type SafeAreaEdge = 'all' | 'top' | 'bottom' | 'leading' | 'trailing';

type NotifyInfo =
| boolean | number | string | null | undefined
| Record<string, any> | Array<any>;

Continue to Player API for imperative ref methods, lifecycle, and Picture-in-Picture, or to Events for callback payloads.