4 ms·
That was the problem, thanks :) So I learned something today: apps like Spotify will play regardless of the hardware mute. But a browser clearly mutes.
by Gys 3y ago
That was the problem, thanks :) So I learned something today: apps like Spotify will play regardless of the hardware mute. But a browser clearly mutes.
- basil-rash 3y agoYes, the AVAudioSession.Category parameter defaults to “soloAmbient”, signifying the sound playback is non primary and nonmixable. This pauses all other audio, respects the mute switch, and pauses on lock. For cases when the sound playback is central to the successful use of the application, the “playback” Category should be used. This allows audi to be generated even when the hardware mute is enabled and the screen is locked, and has options for mixing. This is set by apps like Spotify, Apple Music, and Safari when playing video content. I do not know of a way in HTML to configure this, I think it’s up to Safari to interpret the context based on user intention. It is possible that if the app defaulted to mute and had a user feature that started the audio session, Safari might assign it the “playback” Category. https://developer.apple.com/documentation/avfaudio/avaudiosession/category/1616509-playback https://developer.apple.com/documentation/avfaudio/avaudiose...