Skip to content

fix(ios): sync player state on audio session interruptions - #84

Open
tobyt42 wants to merge 1 commit into
radio-garden:mainfrom
tobyt42:fix/ios-audio-session-interruption-handling
Open

fix(ios): sync player state on audio session interruptions#84
tobyt42 wants to merge 1 commit into
radio-garden:mainfrom
tobyt42:fix/ios-audio-session-interruption-handling

Conversation

@tobyt42

@tobyt42 tobyt42 commented Jul 18, 2026

Copy link
Copy Markdown

iOS pauses AVPlayer automatically on interruption (phone calls, Siri, other apps taking audio focus) without updating playWhenReady, leaving the state machine stuck on .playing and the UI showing a stale pause button. Observe AVAudioSession.interruptionNotification to sync state to paused on interruption begin, and reactivate the session and resume playback on interruption end when the system reports shouldResume.

iOS pauses AVPlayer automatically on interruption (phone calls, Siri,
other apps taking audio focus) without updating playWhenReady, leaving
the state machine stuck on .playing and the UI showing a stale pause
button. Observe AVAudioSession.interruptionNotification to sync state
to paused on interruption begin, and reactivate the session and resume
playback on interruption end when the system reports shouldResume.
@puckey

puckey commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Thanks, this is indeed a gap on main and your diagnosis is right.

However, the native player overhaul in #51, landing in the coming weeks, already includes interruption handling, with a couple of extra edge cases: it captures play intent at .began (so we don't resume after a call if the user had already paused. This PR's unconditional play() on shouldResume would), and it ignores iOS 17 .routeDisconnected interruptions since the route-change observer handles those.

So I'll hold this PR and close it once #51 merges. Thanks again for the report and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants