How to prevent the Audio `play` method from stopping sounds in backgrounded apps in a Webview?

17 views Asked by At

I'm writing a web chat app and whenever a user receives a message, an associated incoming message sound is played. This all works works fine on desktop, but if I'm listening to, say, Youtube or Spotify on my mobile device, and then access the chat app (which embeds the web app URL via a WebView into a native application), then that incoming message sound cuts off/stops/pauses the music.

Is there any way to get the play method to NOT stop any other backgrounded sounds? Or at least temporarily bring the volume down for the duration of the incoming message sound? I've looked around and found few similar questions and even less satisfactory answers.

0

There are 0 answers