apache / cordova-plugin-media

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

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

Open orhan-swe opened 1 year ago

orhan-swe commented 1 year ago

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