In ionic capacitor IOS, play audio in background without stopping other apps from playing
P粉555696738
P粉555696738 2024-03-21 20:12:02
0
1
414

In my Angular Ion Capacitor app, On IOS, when I have Spotify music playing in the background and then my quiz app makes a sound, the Spotify music stops playing.

Both of these situations will happen:

HTMLAudioElement https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement

and Capacitor Community/Native Audio (source: https://github.com/Capacitor Community/Native Audio/issues/40)

Can anyone solve this problem?

Note: It works on Android

P粉555696738
P粉555696738

reply all(1)
P粉203648742

I just solved this problem myself using this package: https://github.com/Cap-go/native-audio

This fork is ahead of the packages you mentioned and is capable of mixing audio. Check out the fade and focus options mentioned in the readme.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template