apache / apache/cordova-plugin-media
ios only: sound not playing when app is in background and some other app has sound on
- Dominant language
- JavaScript
- Stars
- 391
- Forks
- 762
- PR merge metrics
- No merged PRs in 30d
Description
# 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
- [x ] I searched for existing GitHub issues
- [x ] I updated all Cordova tooling to most recent version
- [x ] I included all the necessary information above
Contributor guide
Research direction
Start by tracing the iOS background playback path when the notification plugin wakes the app, then reproduce it while another app plays audio. Compare this with the existing background case where no other app is playing, and verify that the alarm sound starts while the other audio is interrupted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript, objective-c
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100