BiddingStack Audio Player for Android

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.

Requirements

ComponentMinimum Version
Android API Level24 (Android 7.0)+

Installation

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+.

Integration

1. Add the player view to your layout

<com.biddingstack.audioplayer.PlayerView
    android:id="@+id/player"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
PropertyDefaultDescription
listenernullReceives player events, resize, and link callbacks
mediaSessionEnabledtrueLock screen / notification media controls
verbosefalseVerbose logging
readyTimeoutMs20000Milliseconds to wait for the player to become ready

2. Load audio

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:

CallbackDescription
onEvent(playerView, event)Player events
onResize(playerView, height)Player content height changed
onShouldOpenExternalLink(playerView, url)Return false to suppress opening external links (default true)

3. Release the player

override fun onDestroy() {
    player.destroy()
    super.onDestroy()
}

Important: All PlayerView methods must be called on the main thread; calls from other threads throw IllegalStateException.

Playback Control

MethodDescription
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.01.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, a PLAYBACK_ERRORED event with errorCode "ready_timeout" is emitted.

Fullscreen Player

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()) },
)
  • The close button and back press hide the player (audio keeps playing) instead of dismissing it. Use reveal() to bring it back and release() to tear it down.
  • Callbacks are lambdas (onEvent and shouldOpenExternalLink) instead of PlayerListener.