Audio Control
This page describes how to control the audio within the Bambuser player, including muting and unmuting the audio.
Mute and Unmute Audio
Use the mute and unmute invoke functions to control the audio output of the player.
func muteAudio() {
Task { @MainActor in
try await playerView?.invoke(function: "mute", arguments: "")
}
}
func unmuteAudio() {
Task { @MainActor in
try await playerView?.invoke(function: "unmute", arguments: "")
}
}
Configuration
You can control the visibility of the volume button using the ui.hideVolumeButton configuration flag. By default, the volume button is visible.
| Config Key | Type | Default | Description |
|---|---|---|---|
ui.hideVolumeButton | boolean | false | Hides the volume control button. |
let config = BambuserVideoConfiguration(
type: .live(id: "your-show-id"),
events: ["*"],
configuration: [
"ui": [
"hideVolumeButton": true
]
]
)
For the full configuration reference, see Configuration and Functions.
Was this page helpful?