apache / apache/cordova-plugin-media
[iOs] plugin configures AVAudioSession after AVAudioPlayer makes it active inside prepareToPlay
- Dominant language
- JavaScript
- Stars
- 391
- Forks
- 762
- PR merge metrics
- No merged PRs in 30d
Description
According to [AVAudioPlayer docs](https://developer.apple.com/documentation/avfaudio/avaudioplayer/1386886-preparetoplay) `prepareToPlay` activates audio session (in plugin it happens [here](https://github.com/apache/cordova-plugin-media/blob/master/src/ios/CDVSound.m#L357)). But plugin calls `setCategory` for `AVAudioSession` [a little bit later](https://github.com/apache/cordova-plugin-media/blob/master/src/ios/CDVSound.m#L374), i.e. at wrong time.
Contributor guide
Research direction
Start in src/ios/CDVSound.m at the AVAudioPlayer prepareToPlay call near line 357 and the AVAudioSession setCategory call near line 374, then compare their order with the AVAudioPlayer prepareToPlay documentation. Done means the audio session category is configured at the correct point relative to activation and media playback still works on iOS.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100