Skip to main content

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:

ParameterRequiredDescription
modifierNoCompose modifier (default Modifier.fillMaxSize())
playerIdNoUnique player identifier (auto-generated if omitted)
videoConfigurationYesConfiguration including video type, events, and config
videoPlayerDelegateYesDelegate to receive events and errors
piPStateNoPiP state object for picture-in-picture support

BambuserVideoConfiguration

BambuserVideoConfiguration takes three parameters:

ParameterRequiredDescription
videoTypeYesBambuserVideoAsset.Live(id) for live shows
eventsYesList of event types to receive — use listOf("*") for all
configurationYesMap 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 NameValueDescription
dismissnoneHides the button, no events emits
dismisseventEmits an event that can be handled by your custom event handler.
dismissminimizeNot applicable in the Mobile SDK.

Product Button Configs

Property NameValueDescription
productnoneEmits an event – implement your own product view logic.
producteventEmits an event that can be handled by your custom handler.
productautoDefault behavior – opens the product detail modal.

Checkout Button Configs

Property NameValueDescription
checkoutnoneEmits an event – implement your own checkout flow.
checkoutautoDefault behavior – opens the product detail modal.

ActionCard Button Configs

Property NameValueDescription
actionCardnoneEmits an event – handle navigation in your app.
actionCardautoDefault 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 of configuration.

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 NameTypeDescription
hideActionBarbooleanHides the full action bar. No button will be displayed.
hideCartViewbooleanHides the cart view in the modal, showing only product listing.
hideChatOverlaybooleanHides the chat overlay.
hideEmojiOverlaybooleanHides the emoji overlay on the player.
hideProductListbooleanHides the product list.
hideShareButtonbooleanHides the share button.
hideShareViewbooleanHides the share view.
hideVolumeButtonbooleanHides the volume control button.
hideClosedCaptionsButtonbooleanHides the closed captions / subtitles button.
hidePlaybackRateButtonbooleanHides the playback speed button.
hidePromotedShowsbooleanHides the promoted shows carousel inside the player.

Tracking Configurations

Property NameTypeDescription
enableTrackingPointbooleanSends all tracking information. You will receive notifications in the onNewEventReceived delegate method.

Player Behavior Configurations

Property NameTypeDefaultDescription
autoplaybooleantrueAutomatically 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:

  1. Add to your AndroidManifest.xml<application> block:

    android:resizeableActivity="true"
  2. Add to your AndroidManifest.xml<activity> block:

    android:supportsPictureInPicture="true"
    android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
  3. Use the PiPDelegateActivity helper 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(), or switchScreenMode() 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,
)