BiddingStack Audio Player iOS Integration Guide
Play BiddingStack audio in your iOS app with full playback control, runtime configuration, player events, lock screen / Control Center integration, and an optional fullscreen player.
| Component | Minimum Version |
|---|---|
| iOS Deployment Target | 14.0+ |
| Swift | 5.7+ |
The SDK is distributed privately while in early access. Contact the BiddingStack team to get the BSAudioPlayer package (Swift Package, CocoaPods, or XCFramework).
Add the audio background mode to your Info.plist:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
You can omit this if you set mediaSessionEnabled = false on the player view.
import BSAudioPlayer
let player = PlayerView(frame: .zero)
player.delegate = self
view.addSubview(player)
| Property | Default | Description |
|---|---|---|
delegate | nil | Receives player events, resize, and link callbacks |
mediaSessionEnabled | true | Lock screen / Control Center integration |
verbose | false | Verbose logging |
readyTimeoutSeconds | 20 | Seconds to wait for the player to become ready |
var config = PlayerSettings.PlayerConfig()
config.themeid = 1
config.autoPlay = false
let item = PlayerSettings.AudioItem(
audioUrl: "https://example.com/audio.mp3",
audioTitle: "Episode 1",
poster: "https://example.com/cover.png"
)
player.load(PlayerSettings(playerConfig: config, audio: [item]))
PlayerConfig mirrors the web player configuration. mode is managed by the SDK and set to embed automatically.
Only onEvent is required; didResize and shouldOpenExternalLink have default implementations:
extension ViewController: PlayerDelegate {
func player(_ playerView: PlayerView, onEvent event: PlayerEvent) {
print(event.type, event.currentTime ?? 0)
}
func player(_ playerView: PlayerView, didResize height: CGFloat) {
// Adjust the view's height constraint
}
func player(_ playerView: PlayerView, shouldOpenExternalLink url: URL) -> Bool {
return true
}
}
PlayerView is not released automatically. Call destroy() when you are done:
deinit {
player.destroy()
}
Important: Do not place
PlayerViewin reusable cells (e.g.UITableViewCell).
| Method | Description |
|---|---|
play() / pause() | Start / pause playback |
seek(_ seconds: Float) | Seek to a position in seconds |
next() / prev() | Switch tracks in a playlist |
setPlaybackRate(_ rate: Float) | Set playback speed |
setVolume(_ volume: Float) | Set volume, 0.0–1.0 |
setMuted(_ muted: Bool) | Mute / unmute |
destroy() | Tear down the player |
Note: Commands issued before the player is ready are queued and flushed once it becomes ready. If the player does not become ready within
readyTimeoutSeconds, aPlaybackErroredevent witherrorCode: "ready_timeout"is emitted.
Present a fullscreen audio player as a modal view controller. Settings are passed at init; there is no load():
var config = PlayerSettings.PlayerConfig()
config.mode = "fullscreen"
config.themeid = 5
let controller = FullscreenPlayerViewController(
settings: PlayerSettings(playerConfig: config, audio: items)
)
controller.onEvent = { event in
print(event.type)
}
present(controller, animated: true)
onEvent and shouldOpenExternalLink) instead of the delegate protocol.play(), pause(), seek(_:), next(), prev(), setPlaybackRate(_:), setVolume(_:), setMuted(_:)).