BiddingStack Audio Player Android Integration Guide
Play BiddingStack audio in your Android app with full playback control, runtime configuration, player events, media session integration, and an optional fullscreen player. Written in Kotlin, callable from Java.
| Component | Minimum Version |
|---|---|
| Android API Level | 24 (Android 7.0)+ |
The SDK is distributed privately while in early access. Contact the BiddingStack team to get the SDK package.
Add the required permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
POST_NOTIFICATIONS is used for media session notifications and must also be requested at runtime on API 33+.
<com.biddingstack.audioplayer.PlayerView
android:id="@+id/player"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
| Property | Default | Description |
|---|---|---|
listener | null | Receives player events, resize, and link callbacks |
mediaSessionEnabled | true | Lock screen / notification media controls |
verbose | false | Verbose logging |
readyTimeoutMs | 20000 | Milliseconds to wait for the player to become ready |
val player = findViewById<PlayerView>(R.id.player)
player.listener = object : PlayerListener {
override fun onEvent(playerView: PlayerView, event: PlayerEvent) {
Log.d("BSAP", "${event.type} t=${event.currentTime}")
}
}
val settings = PlayerSettings(
playerConfig = PlayerSettings.PlayerConfig().apply {
themeid = 1
autoPlay = false
},
audio = listOf(
PlayerSettings.AudioItem(
audioUrl = "https://example.com/audio.mp3",
audioTitle = "Episode 1",
)
),
)
player.load(settings)
PlayerConfig mirrors the web player configuration. mode is managed by the SDK and set to embed automatically.
All PlayerListener methods have default implementations:
| Callback | Description |
|---|---|
onEvent(playerView, event) | Player events |
onResize(playerView, height) | Player content height changed |
onShouldOpenExternalLink(playerView, url) | Return false to suppress opening external links (default true) |
override fun onDestroy() {
player.destroy()
super.onDestroy()
}
Important: All
PlayerViewmethods must be called on the main thread; calls from other threads throwIllegalStateException.
| 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: Boolean) | 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
readyTimeoutMs, aPLAYBACK_ERROREDevent witherrorCode "ready_timeout"is emitted.
Present a fullscreen audio player as a dialog fragment. Settings are passed to present(); there is no load():
val fullscreenSettings = PlayerSettings(
playerConfig = PlayerSettings.PlayerConfig().apply {
mode = "fullscreen"
themeid = 5
},
audio = items,
)
val fragment = FullscreenPlayerFragment.present(
host = this,
settings = fullscreenSettings,
onEvent = { event -> Log.d("BSAP", event.type.toString()) },
)
reveal() to bring it back and release() to tear it down.onEvent and shouldOpenExternalLink) instead of PlayerListener.