[BUG]: AVPlayer Notifications Crash App When Switching Tracks After Background #4188
Labels
bug
Missing info
Some information from template are missing
Newer Version Available
Platform: iOS
Repro Provided
stale
Closed due to inactivity or lack or resources
Version
6.4.5
What platforms are you having the problem on?
iOS
System Version
iOS 17
On what device are you experiencing the issue?
Real device
Architecture
Old architecture
What happened?
After playing a file, locking the screen, unlocking, then changing the track, the following crash occurs:
The app crashes with:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot remove an observer <NSKeyValueObservance 0x30005b600> for the key path "currentItem.videoComposition" from <AVPlayer 0x300dcac00>, most likely because the value for the key "currentItem" has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the AVPlayer class.'
It's unclear why this is only happening after a screen lock. Possibly some other observers are added for background playback that aren't cleaned up correctly?
Reproduction Link
repository link
Reproduction
Steps to reproduce:
The text was updated successfully, but these errors were encountered: