[PR #327] [MERGED] Fix playback session starting sometimes on app launch #1403

Closed
opened 2026-04-24 23:58:12 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf-app/pull/327
Author: @ronaldheft
Created: 8/21/2022
Status: Merged
Merged: 8/21/2022
Merged by: @advplyr

Base: masterHead: bug-ios-playback-on-session-resume


📝 Commits (2)

  • f335d87 Fix progress sync not updating playback object
  • 872931f Guard against player actions before player is initialized

📊 Changes

3 files changed (+22 additions, -5 deletions)

View changed files

📝 ios/App/App/plugins/AbsAudioPlayer.swift (+1 -1)
📝 ios/App/Shared/player/AudioPlayer.swift (+4 -0)
📝 ios/App/Shared/player/PlayerProgress.swift (+17 -4)

📄 Description

This turned out to be several problems:

  1. The active session was not syncing with the server on startup, due to an assumption the player was initialized and PlayerHandler.getPlaybackSession() could be used
  2. This lead to a scenario that when the player did sync with the server on the next sync, seek() was called, which was triggering playback to start
  3. Upon investigation, I also found a situation where iOS being "smart" could attempt to restore playback when connecting Bluetooth headphones during app startup
  4. This issue was solved by adding a guard to play and pause until the player is initialized

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/327 **Author:** [@ronaldheft](https://github.com/ronaldheft) **Created:** 8/21/2022 **Status:** ✅ Merged **Merged:** 8/21/2022 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `bug-ios-playback-on-session-resume` --- ### 📝 Commits (2) - [`f335d87`](https://github.com/advplyr/audiobookshelf-app/commit/f335d8735f79a4208687638e83c9d336271f725b) Fix progress sync not updating playback object - [`872931f`](https://github.com/advplyr/audiobookshelf-app/commit/872931f5077d4ae724fb24257bc5c6a422b62a01) Guard against player actions before player is initialized ### 📊 Changes **3 files changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `ios/App/App/plugins/AbsAudioPlayer.swift` (+1 -1) 📝 `ios/App/Shared/player/AudioPlayer.swift` (+4 -0) 📝 `ios/App/Shared/player/PlayerProgress.swift` (+17 -4) </details> ### 📄 Description This turned out to be several problems: 1) The active session was not syncing with the server on startup, due to an assumption the player was initialized and `PlayerHandler.getPlaybackSession()` could be used 2) This lead to a scenario that when the player did sync with the server on the next sync, `seek()` was called, which was triggering playback to start 3) Upon investigation, I also found a situation where iOS being "smart" could attempt to restore playback when connecting Bluetooth headphones during app startup 4) This issue was solved by adding a guard to `play` and `pause` until the player is initialized --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-24 23:58:12 +02:00
adam closed this issue 2026-04-24 23:58:13 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1403