cordova-plugin-media icon indicating copy to clipboard operation
cordova-plugin-media copied to clipboard

fix (ios): update audio session configuration so audio can start to play when app in background

Open orhan-swe opened this issue 1 year ago • 0 comments

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

Platforms affected

ios

Motivation and Context

The audio would not start if app is in background and some other app audio is running. Reported issue: https://github.com/apache/cordova-plugin-media/issues/369

Description

update audio session with withOptions:AVAudioSessionCategoryOptionMixWithOthers so that we can play audio on top of other audio when our app is in background

Testing

I have tested the changes on my ios app.

Checklist

  • [x] I've run the tests to see all new and existing tests pass
  • [ ] I added automated test coverage as appropriate for this change
  • [x] Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • [x] I've updated the documentation if necessary

orhan-swe avatar Apr 28 '23 16:04 orhan-swe