apache / cordova-plugin-media

Apache Cordova Media Plugin
https://cordova.apache.org/
Apache License 2.0
390 stars 763 forks source link

ios only: sound not playing when app is in background and some other app has sound on #369

Open orhan-swe opened 1 year ago

orhan-swe commented 1 year ago

Bug Report

Problem

I have an alarm app. On ios sound will not start playing when the app is in background and some other app has sound on. When the app is in background and there is no other app playing sound the sound in my alarm app will start fine. Works fine on Andrid.

What is expected to happen?

The other app sound should stop and my alarm app sound should start playing.

What does actually happen?

The other app sound continues playing but my alarm app only shows alarm notification.

Information

This is an alarm app. The alarm sound starts fine and sound is working fine all the other time, even when the app is in background and phone is in sleep. But the sound does not start when the app is in backround and some other app is playing some other sound. For example if ios Music app is playing music.

Command or Code

It is difficult to reproduce this as you need to have notification plugin wake up the app at some point in time and then play some audio file in form of alarm sound at the same time as some other app is playing music for example.

Environment, Platform, Device

The issue is only seen on ios, on android it works fine.

Version information

I have tested this on several ios versions and it is same on all of them. Cordova-plugin-media version i am using is 6.1.0 and cordova-ios is 6.2.0

Checklist