Baseflow / Baseflow/XamarinMediaManager
ios: NSInternalInconsistencyException for "currentItem.hasEnabledAudio" observer
- Dominant language
- C#
- Stars
- 763
- Forks
- 299
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug Report
Sometimes when playback stops, the app crashes throwing this exception:
`NSInternalInconsistencyException Reason: Cannot update for observer NSKeyValueObservance for the key path "currentItem.hasEnabledAudio" from AVQueuePlayer, most likely because the value for the key "currentItem" has changed without an appropriate KVO notification being sent.`
It seems to be not limited to `currentItem.hasEnabledAudio`. We saw similar exceptions for these members:
* currentItem.hasEnabledVideo
* currentItem.presentationSize
* currentItem.seekableTimeRanges
* currentItem.status
* currentItem.playbackBufferEmpty
### Expected behavior
No crash :)
### Reproduction steps
Play and stop playback, repeat approx 15 times.
### Configuration
**Version:** 1.0.8
**Platform:**
- [x] :iphone: iOS
- [ ] :robot: Android
- [ ] :checkered_flag: WPF
- [ ] :earth_americas: UWP
- [ ] :apple: MacOS
- [ ] :tv: tvOS
- [x] :monkey: Xamarin.Forms
Contributor guide
Research direction
Start by reproducing the crash on iOS with Xamarin.Forms by playing and stopping playback about 15 times, then inspect the AVQueuePlayer observer handling for currentItem properties. Done means the repeated playback sequence no longer raises the reported NSInternalInconsistencyException for the listed observers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, ios
- Domain
- audio-video-rtc, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100