Configuration and Functions
To find the detailed configuration and functions please refer to Bambuser Player API Reference
BambuserSDK Initialization
Initialize the SDK in your Application class. You can create separate instances for different regions:
class HostApplication : Application() {
lateinit var globalBambuserSDK: BambuserSDK
lateinit var euBambuserSDK: BambuserSDK
override fun onCreate() {
super.onCreate()
globalBambuserSDK = BambuserSDK(
applicationContext = this,
organizationServer = OrganizationServer.US,
)
euBambuserSDK = BambuserSDK(
applicationContext = this,
organizationServer = OrganizationServer.EU,
)
}
}
Choose OrganizationServer.US or OrganizationServer.EU to match your organization's region.
Video Player Creation
Use the SDK instance to create a live player view:
application.globalBambuserSDK.GetLiveView(
modifier = Modifier.fillMaxSize(),
videoConfiguration = BambuserVideoConfiguration(
events = listOf("*"),
configuration = mapOf(
"buttons" to mapOf("dismiss" to "none"),
"currency" to "USD",
"locale" to "en-US",
"autoplay" to true,
),
videoType = BambuserVideoAsset.Live(showId)
),
videoPlayerDelegate = videoPlayerDelegate
)
GetLiveView accepts the following parameters:
| Parameter | Required | Description |
|---|---|---|
modifier | No | Compose modifier (default Modifier.fillMaxSize()) |
playerId | No | Unique player identifier (auto-generated if omitted) |
videoConfiguration | Yes | Configuration including video type, events, and config |
videoPlayerDelegate | Yes | Delegate to receive events and errors |
piPState | No | PiP state object for picture-in-picture support |
BambuserVideoConfiguration
BambuserVideoConfiguration takes three parameters:
| Parameter | Required | Description |
|---|---|---|
videoType | Yes | BambuserVideoAsset.Live(id) for live shows |
events | Yes | List of event types to receive — use listOf("*") for all |
configuration | Yes | Map of player configuration key/value pairs |
Button Configurations
Each button type has different modes of operation:
none→ will hide the button.event→ emits an event to be captured by your event handler.auto→ uses the SDK's default behavior.
Dismiss Button
| Property Name | Value | Description |
|---|---|---|
dismiss | none | Hides the button, no events emits |
dismiss | event | Emits an event that can be handled by your custom event handler. |
dismiss | minimize | Not applicable in the Mobile SDK. |
Product Button Configs
| Property Name | Value | Description |
|---|---|---|
product | none | Emits an event – implement your own product view logic. |
product | event | Emits an event that can be handled by your custom handler. |
product | auto | Default behavior – opens the product detail modal. |
Checkout Button Configs
| Property Name | Value | Description |
|---|---|---|
checkout | none | Emits an event – implement your own checkout flow. |
checkout | auto | Default behavior – opens the product detail modal. |
ActionCard Button Configs
| Property Name | Value | Description |
|---|---|---|
actionCard | none | Emits an event – handle navigation in your app. |
actionCard | auto | Default behavior – opens configured link in a webview. ⚠️ Recommended: Use none and handle redirection from your app. |
UI Configurations
⚠️ All UI flags must be nested under a
"ui"key — not at the top level ofconfiguration.
configuration = mapOf(
"ui" to mapOf(
"hideEmojiOverlay" to true,
"hideActionBar" to false,
"hideShareButton" to false,
"hideVolumeButton" to false,
"hideClosedCaptionsButton" to false,
"hidePlaybackRateButton" to false,
"hidePromotedShows" to false,
)
)
| Property Name | Type | Description |
|---|---|---|
hideActionBar | boolean | Hides the full action bar. No button will be displayed. |
hideCartView | boolean | Hides the cart view in the modal, showing only product listing. |
hideChatOverlay | boolean | Hides the chat overlay. |
hideEmojiOverlay | boolean | Hides the emoji overlay on the player. |
hideProductList | boolean | Hides the product list. |
hideShareButton | boolean | Hides the share button. |
hideShareView | boolean | Hides the share view. |
hideVolumeButton | boolean | Hides the volume control button. |
hideClosedCaptionsButton | boolean | Hides the closed captions / subtitles button. |
hidePlaybackRateButton | boolean | Hides the playback speed button. |
hidePromotedShows | boolean | Hides the promoted shows carousel inside the player. |
Tracking Configurations
| Property Name | Type | Description |
|---|---|---|
enableTrackingPoint | boolean | Sends all tracking information. You will receive notifications in the onNewEventReceived delegate method. |
Player Behavior Configurations
| Property Name | Type | Default | Description |
|---|---|---|---|
autoplay | boolean | true | Automatically starts playback when the player is ready. When false, use PlayerActions.play() from the onVideoStatusChanged callback to start playback manually. |
configuration = mapOf(
"autoplay" to false // Use playerActions.play() in onVideoStatusChanged to start manually
)
Picture-in-Picture
To enable PiP for your activity:
-
Add to your
AndroidManifest.xml—<application>block:android:resizeableActivity="true" -
Add to your
AndroidManifest.xml—<activity>block:android:supportsPictureInPicture="true"
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation" -
Use the
PiPDelegateActivityhelper to manage PiP state:
class LiveActivity : ComponentActivity(), PiPDelegate by PiPDelegateActivity() {
override fun enterPiP() {
val aspectRatio = Rational(
playbackDimensions.value.width,
playbackDimensions.value.height
)
enterPictureInPictureMode(
PictureInPictureParams.Builder().setAspectRatio(aspectRatio).build()
)
}
override fun onPictureInPictureModeChanged(
isInPictureInPictureMode: Boolean,
newConfig: Configuration
) {
pipState.value = pipState.value.copy(isPipMode = isInPictureInPictureMode)
}
override fun onStop() {
super.onStop()
pipState.value = pipState.value.copy(shouldClosePip = true)
}
}
Pass piPState = pipState.value to GetLiveView to enable PiP.
⚠️ Do not use
viewAction.invoke(),notifyView(), orswitchScreenMode()while in PiP mode.
Full Configuration Example
application.globalBambuserSDK.GetLiveView(
modifier = Modifier.fillMaxSize(),
videoConfiguration = BambuserVideoConfiguration(
events = listOf("*"),
configuration = mapOf(
"buttons" to mapOf(
"dismiss" to "none", // Hides dismiss button, emits event
"product" to "none", // Emits event on product tap
),
"ui" to mapOf(
"hideEmojiOverlay" to false,
"hidePlaybackRateButton" to false,
"hidePromotedShows" to false,
),
"autoplay" to true,
"currency" to "USD", // Required for product hydration
"locale" to "en-US", // Required for product hydration
),
videoType = BambuserVideoAsset.Live(showId)
),
videoPlayerDelegate = videoPlayerDelegate,
piPState = pipState.value,
)