Types
All types are exported from @bluebillywig/react-native-channel.
import type {
BBMediaInfo,
BBNavigationState,
BBNavigationEvent,
BBPlayerState,
BBSearchEvent,
BBErrorEvent,
BBChannelOptions,
NavigateToEntityOptions,
BBPageType,
FullscreenMode,
SafeAreaEdge,
SafeAreaInsets,
BBRegisteredPlayer,
} from '@bluebillywig/react-native-channel';
BBMediaInfo
Information about a media item.
interface BBMediaInfo {
jsonUrl: string;
playoutId: string;
autoplay: boolean;
thumbnailUrl?: string;
title?: string;
}
BBNavigationState
Represents the full navigation state of the channel. Can be serialized for deep linking or state restoration.
interface BBNavigationState {
pageType: BBPageType;
contentId?: string;
contentType?: string;
searchQuery?: string;
clickedSearchResult?: string;
blockId?: string;
contextId?: string;
playout?: string;
collectionId?: string;
subChannelId?: string;
}
BBNavigationEvent
Emitted on navigation changes.
interface BBNavigationEvent {
pageType: BBPageType;
entity?: any;
state: BBNavigationState;
canGoBack: boolean;
stackDepth: number;
}
BBPlayerState
Current state of a player instance.
interface BBPlayerState {
isPlaying: boolean;
currentTime?: number;
duration?: number;
volume?: number;
isMuted?: boolean;
isFullscreen?: boolean;
}
BBSearchEvent
Emitted when a search is performed.
interface BBSearchEvent {
query: string;
resultCount: number;
}
BBErrorEvent
Emitted when an error occurs.
interface BBErrorEvent {
code: string;
message: string;
details?: any;
}
Common error codes
| Code | Description |
|---|---|
LOAD_ERROR | Failed to load the channel configuration |
NETWORK_ERROR | Network request failed |
PLAYER_ERROR | Player encountered an error during playback |
CONFIG_ERROR | Invalid channel configuration |
BRIDGE_ERROR | Communication error between native and WebView |
BBChannelOptions
Configuration options passed to the channel.
interface BBChannelOptions {
autoPlay?: boolean;
playout?: string;
searchBar?: boolean;
noStats?: boolean;
jwt?: string;
rpcToken?: string;
contentId?: string;
contentType?: string;
}
NavigateToEntityOptions
Options for navigateToEntity.
interface NavigateToEntityOptions {
playout?: string;
blockId?: string;
autoPlay?: boolean;
}
BBRegisteredPlayer
Information about a registered player instance.
interface BBRegisteredPlayer {
id: string;
[key: string]: any;
}
BBPageType
type BBPageType = 'main' | 'detailPage' | 'overviewPage' | 'searchPage';
FullscreenMode
type FullscreenMode = 'fullscreen' | 'landscape';
SafeAreaEdge
type SafeAreaEdge = 'top' | 'bottom' | 'left' | 'right';
SafeAreaInsets
Custom safe area inset values in pixels.
interface SafeAreaInsets {
top?: number;
bottom?: number;
left?: number;
right?: number;
}