In mobile web client sometimes volume up down to m...
# ask-ai
b
In mobile web client sometimes volume up down to media volume but sometimes to call volume. Why?
t
Thanks for reaching out, 최윤지. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You're seeing that because mobile OSes and browsers decide how a WebRTC audio stream is classified (call/communication vs media). When the browser treats the WebRTC track as a "call" stream, the device volume buttons adjust the call/communication volume; when it treats the audio as regular media playback, the buttons adjust media volume. This behavior varies by platform and browser (iOS vs Android and different browsers) and is controlled by the OS/browser implementation — LiveKit cannot force which volume stream the device uses. If you want, tell me: • which OS (iOS/Android) and browser you're testing, and • whether audio starts after a user gesture or automatically. With that I can suggest targeted workarounds to try. Sources: client-sdk-unity-web | livekit/livekit_composite | DeepWiki | Realtime media | LiveKit Docs
b
When that happens, there were cases where pressing the volume up or down buttons on a mobile browser didn’t actually change the volume. I wish the connected track could adjust the volume automatically… Is there any way to achieve that?
t
You're right to want the volume buttons to work reliably. I’ll address your two points: why physical button presses sometimes do nothing, and whether the connected track can auto-adjust. Why volume buttons sometimes do nothing • Mobile browsers and OSes decide whether a WebRTC audio stream is treated as a "call/communication" stream or as regular media. That routing is handled by the browser/OS and can vary by platform and browser. • Browsers do not expose physical volume-button events to JavaScript, so the page can't detect those presses to react programmatically. What you can do instead • You cannot make the browser auto-adjust a LiveKit track in response to physical volume buttons. However, you can control playback volume in-app: ◦ Use
track.setVolume(value)
to set per-track volume (0.0–1.0). ◦ Provide an on-screen volume slider or buttons and persist the user’s preference, applying it to incoming tracks. ◦ Ensure audio playback is started by a user gesture before adjusting volume, since some mobile browsers block or delay audio until user interaction. If you want, tell me: • which OS (iOS/Android) and browser you’re testing, and • whether audio is started by a user gesture or auto-played. With that I can suggest targeted workarounds (e.g., ensuring playback is unlocked, UI placement for sliders, or applying saved volume to newly subscribed tracks). Sources: Agent session | LiveKit docs | client-sdk-unity-web | livekit/livekit_composite | DeepWiki | Subscribing to tracks | LiveKit docs | Stream music over WebRTC using React and WebAudio