For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • Player SDKs
    • Introduction
  • Web player
    • Install the FastPix web player
    • Play uploaded videos
    • Handle playback errors
  • Android player
    • Install FastPix Android player
    • Set up the player
    • Play uploaded videos
    • Handle playback errors
      • Control video playback
      • Adjust volume and mute
      • Control playback speed
      • Set playback resolution
      • Control rendition order
      • Listen to playback events
  • iOS player
    • Install FastPix iOS player
    • Play uploaded videos
    • Handle playback errors
  • Flutter player
    • Install FastPix Flutter player
    • Play uploaded videos
    • Handle playback errors
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Set volume
  • Mute and unmute
  • Listen for volume changes
Android playerPlayback

Adjust volume and mute

Was this page helpful?
Previous

Control playback speed

Next
Built with

Learn how to control volume and mute state in the FastPix Android Player.

Set volume

Set the player volume on a scale from 0.0 (silent) to 1.0 (maximum). Values are clamped to this range.

1player.setVolume(0.75f) // Set volume to 75%
2val vol = player.getVolume() // Get current volume level

Mute and unmute

1player.mute() // Mute — stores the current volume for later restore
2player.unmute() // Unmute — restores the previous volume (defaults to 1.0)

mute() stores the current non-zero volume level. unmute() restores it, or defaults to 1.0 if no previous volume was saved.

Listen for volume changes

The SDK monitors system volume while at least one playback listener is attached. It fires callbacks for both programmatic and hardware button volume changes:

1override fun onVolumeChanged(volumeLevel: Float) {
2 // Device volume changed (0.0..1.0)
3}
4
5override fun onMuteStateChanged(isMuted: Boolean) {
6 // Mute state changed
7}

Use these callbacks to keep custom volume sliders and mute icons synchronized with the player’s audio state.