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

[iOs] plugin configures AVAudioSession after AVAudioPlayer makes it active inside prepareToPlay

Open RSATom opened this issue 4 years ago • 2 comments

According to AVAudioPlayer docs prepareToPlay activates audio session (in plugin it happens here). But plugin calls setCategory for AVAudioSession a little bit later, i.e. at wrong time.

RSATom avatar Oct 14 '21 06:10 RSATom

I found this issue while was trying to solve https://github.com/apache/cordova-plugin-media/issues/306. I was trying to add withOptions:AVAudioSessionCategoryOptionMixWithOthers to https://github.com/apache/cordova-plugin-media/blob/master/src/ios/CDVSound.m#L374 but it was working only on second play...

RSATom avatar Oct 14 '21 06:10 RSATom

It blows my mind that this isn't configurable inside this highly used plugin.

johannds avatar Feb 04 '22 13:02 johannds