Repository navigation
feat: show audio on the Lock Screen and support AirPlay - #4504
Open
SimonStMichel wants to merge 1 commit into
Open
SimonStMichel wants to merge 1 commit into
SimonStMichel wants to merge 1 commit into
Conversation
Audio from the media viewer keeps playing in the background, but it never appeared on the Lock Screen or in Control Center, so it could not be paused or skipped without unlocking the phone and reopening the app. Without a Now Playing session the app was also missing from Control Center's AirPlay picker, and the audio screen had no AirPlay button, so music could not be sent to AirPlay speakers such as Sonos. Only the audio page that started playing owns the Now Playing session, because the viewer keeps the players of neighboring pages alive and they must not clear it. The long-form audio route policy is what Apple recommends for music and lets AirPlay 2 receivers buffer the stream. Assisted-by: Claude Code:claude-opus-5-5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Simon St-Michel <simonstmichel@outlook.com>
SimonStMichel
requested review from
marinofaggiana and
mpivchev
as code owners
November 27, 2026 20:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Audio opened in the media viewer keeps playing when the phone is locked, but it never shows up on the Lock Screen or in Control Center. To pause or skip, you have to unlock the phone and go back to the app. Because the app has no Now Playing session, it is also missing from Control Center's AirPlay picker, and the audio screen has no AirPlay button, so music stored on Nextcloud can't be sent to AirPlay speakers such as Sonos.
What changed
The new
NCAudioNowPlayingControllerconnects the existingNCAudioViewerModeltoMPNowPlayingInfoCenterandMPRemoteCommandCenter. Only the model that started playing owns the session, so the neighboring pages the viewer keeps alive can't clear it. The media viewer README documents the components and adds a manual check.Not included, possible follow-ups: Previous/Next track from the Lock Screen, an AirPlay button in the adaptive (folded) layout, and audio interruptions such as phone calls (#3671).
How to verify
Unit tests:
NCAudioNowPlayingTests(Swift Testing, no server needed).Tested on: iPhone 12, iOS 26.7.3, Nextcloud 35.0.3, AirPlay to a Sonos Ray.
🤖 AI (if applicable)