BiddingStack Audio Player React Native Integration Guide
Play BiddingStack audio in your React Native (Expo) app with transport controls, player events, and media session integration. Also includes BSPlayerWebView for placing players inline inside WebView-rendered articles.
| Component | Minimum Version |
|---|---|
| Expo SDK | 50+ (New Architecture enabled) |
| iOS Deployment Target | 14.0+ |
| Android minSdkVersion | 24+ |
| react-native-reanimated | 3.6.0+ |
| react-native-webview | 13.0.0+ (only for BSPlayerWebView) |
The biddingstack-react-native-audio-player package is distributed privately while in early access. Contact the BiddingStack team to get the SDK package.
expo-build-properties in app.json:{
"expo": {
"plugins": [
["expo-build-properties", { "ios": { "deploymentTarget": "14.0" } }]
]
}
}
If you use pnpm, add node-linker=hoisted to your app's .npmrc.
Rebuild the native projects:
npx expo prebuild --clean
Memoize the settings object and give the view an explicit height; use onResize to track the player's content height:
import { BSPlayerView, BSPlayerViewRef, BSPlayerEvent } from 'biddingstack-react-native-audio-player'
function AudioScreen() {
const ref = React.useRef<BSPlayerViewRef>(null)
const settings = React.useMemo(() => ({
playerConfig: {
mode: 'embed',
themeid: 1,
autoPlay: false,
},
audio: [
{
audioUrl: 'https://example.com/audio.mp3',
audioTitle: 'Episode 1',
poster: 'https://example.com/poster.png',
},
],
}), [])
const handleEvent = (event: BSPlayerEvent) => console.log(event.type)
return (
<BSPlayerView
ref={ref}
settings={settings}
onEvent={handleEvent}
style={{ height: 280 }}
/>
)
}
The settings shape (playerConfig + audio) mirrors the web player configuration.
| Prop | Type | Description |
|---|---|---|
settings | object | Player settings: { playerConfig, audio } (required) |
onEvent | (event) => void | Player events: { type, ...payload } |
onResize | ({ height }) => void | Player content height changed |
| Method | Description |
|---|---|
play() / pause() | Start / pause playback |
seek(seconds: number) | Seek to a position in seconds |
destroy() | Tear down the player |
Important:
- Always wrap
settingsinuseMemo; a new object identity recreates the native player.- Do not mount the player inside
FlatList/VirtualizedList.- Give the host view an explicit height.
BSPlayerWebView places native audio players inline inside a react-native-webview article. The player tracks WebView scroll and sits at a marker you place in the article HTML.
In your article HTML, place a marker <div> wherever you want a player:
<div data-bs-player="main"></div>
In your React Native screen:
import { BSPlayerWebView } from 'biddingstack-react-native-audio-player'
const html = `... <div data-bs-player="main"></div> ...`
<BSPlayerWebView
source={{ html }}
audio={{
main: {
settings: {
playerConfig: { mode: 'embed', themeid: 11, autoPlay: false },
audio: [{ audioUrl: 'https://example.com/audio.mp3', audioTitle: 'Episode 1' }],
},
},
}}
style={{ flex: 1 }}
/>
| Prop | Type | Description |
|---|---|---|
source | WebViewSource | { html } is fully supported; { uri } renders but cannot host players |
audio | Record<string, { settings, height? }> | Map of slot id → audio config. Slot id must match a data-bs-player="id" attribute in your HTML |
slotPaddingHorizontal | number | Horizontal padding around each player. Default 12 |
onPlayerEvent | (slotId, event) => void | Aggregated player events, tagged by slot id |
| ...rest | WebViewProps | All other WebView props are forwarded; onMessage and onScroll are chained (SDK first, yours second) |