Skip to main content

Audio Control

This page describes how to control the audio within the Bambuser player, including muting and unmuting playback.

Mute and Unmute Audio

Use the mute() and unMute() methods on the BambuserVideoView ref. See Player API › Ref Methods.

import { useRef } from 'react';
import {
BambuserVideoView,
type BambuserVideoViewRef,
} from '@bambuser/react-native-commerce-sdk';

const playerRef = useRef<BambuserVideoViewRef>(null);

function muteAudio() {
playerRef.current?.mute();
}

function unmuteAudio() {
playerRef.current?.unMute();
}

Configuration

You can control the visibility of the volume button using the ui.hideVolumeButton configuration flag. By default, the volume button is visible.

Config KeyTypeDefaultDescription
ui.hideVolumeButtonbooleanfalseHides the volume control button.
<BambuserVideoView
ref={playerRef}
id="your-show-id"
configuration={{
ui: {
hideVolumeButton: true,
},
}}
/>

For the full configuration reference, see Configuration and Functions.