Skip to content

feat(player): play under iOS's Playback audio session and in the background - #42

Merged
oneo-me merged 1 commit into
mainfrom
agiox/ios-playback-audio-session
Nov 24, 2026
Merged

oneo-me merged 1 commit into
mainfrom
agiox/ios-playback-audio-session

Conversation

@oneo-me

@oneo-me oneo-me commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #18

  • A player holds iOS's audio session at Playback through NSGo's audio.HoldSession (audio: let a library's own audio output hold the iOS audio session nsgo#1931) while the app wants it playing, from Play to a pause, the end, a failure or Close, so the Ring/Silent switch does not silence it. Interruptions and unplugged headphones still pause it as before.
  • With the app's audio background mode (read from Info.plist), a source with sound plays on in the background: a 100 ms timer runs the presenter, as no display frames come, and the pipeline's new audio-only mode decodes no picture. Coming back seeks exactly to the position to show the picture again. Without the mode, going to the background pauses, as before.
  • The demo declares UIBackgroundModes: [audio].
  • Tests: the pipeline's audio-only mode, when the session is held, background behavior, and an iOS test that checks the session's category is Playback while playing and restored after.
  • Docs: ARCHITECTURE.md, requirements, the website's playback page (en/zh) and the changelog.

Verified on the iOS simulator and on an iPhone (2026-11-24): playing in silent mode, in the background and locked, the picture coming back, and pausing for unplugged headphones and a call, resuming after it.

TestHLSLiveWindow fails on macOS with local libraries, and TestPlayerPlaysAndShowsFrames sometimes fails on the simulator. Both happen on main too.

🤖 Generated with Claude Code

@oneo-me oneo-me self-assigned this Nov 24, 2026
@oneo-me oneo-me changed the title feat(player): play under iOS's Playback audio session feat(player): play under iOS's Playback audio session and in the background Nov 24, 2026
@oneo-me
oneo-me marked this pull request as ready for review November 24, 2026 10:53
…ground

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oneo-me
oneo-me force-pushed the agiox/ios-playback-audio-session branch from aad2cfc to b7c719d Compare November 24, 2026 10:54
@oneo-me
oneo-me merged commit 49c6c5b into main Nov 24, 2026
@oneo-me
oneo-me deleted the agiox/ios-playback-audio-session branch November 24, 2026 10:54
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.

iOS: the Playback audio session and background playback

1 participant