Description
During audio playback, the UI becomes noticeably laggy on lower-powered devices like the iPhone SE 2 (A13 chip). This affects both the player screen and the library list view.
Root cause
Several progress-related publishers fire every ~1 second (from AVPlayer's periodic time observer) without any throttling:
PlayerViewModel.bindBookPlayingProgressEvents() — The .bookPlaying and .listeningProgressChanged notification subscribers call recalculateProgress() on every tick, updating ~6 @Published properties and triggering a full player view redraw each second.
ItemProgressView — Both currentProgressPublisher() (KVO on percentCompleted) and immediateProgressUpdatePublisher fire every second for the currently playing item with no throttle, causing every visible library row's progress ring to redraw.
The existing .folderProgressUpdated subscriber in ItemProgressView already has a 1-second throttle, but the other two publishers were missed.
Expected behavior
Smooth UI during playback on all supported devices.
Steps to reproduce
- Open BookPlayer on an iPhone SE 2 (or similar A13 device)
- Start playing an audiobook
- Navigate to the library list while playback continues
- Observe stuttering/lag in scrolling and UI interactions
Environment
- Device: iPhone SE 2nd generation
- iOS version: current
- BookPlayer version: latest develop
Description
During audio playback, the UI becomes noticeably laggy on lower-powered devices like the iPhone SE 2 (A13 chip). This affects both the player screen and the library list view.
Root cause
Several progress-related publishers fire every ~1 second (from
AVPlayer's periodic time observer) without any throttling:PlayerViewModel.bindBookPlayingProgressEvents()— The.bookPlayingand.listeningProgressChangednotification subscribers callrecalculateProgress()on every tick, updating ~6@Publishedproperties and triggering a full player view redraw each second.ItemProgressView— BothcurrentProgressPublisher()(KVO onpercentCompleted) andimmediateProgressUpdatePublisherfire every second for the currently playing item with no throttle, causing every visible library row's progress ring to redraw.The existing
.folderProgressUpdatedsubscriber inItemProgressViewalready has a 1-second throttle, but the other two publishers were missed.Expected behavior
Smooth UI during playback on all supported devices.
Steps to reproduce
Environment