Repository navigation
feat(ios): add AVPlayer as a switchable phone player engine - #563
Merged
Merged
Conversation
mpv stays the default for "play on this phone". Player settings gain a "Player engine" choice, and the failure screen offers "Try with AVPlayer" (or "Try with mpv"). Switching reopens the stream at the same position for that player session only; nothing is saved as a default. Streams with headers or plain HTTP go through the loopback proxy, preferred languages use AVFoundation's media selection, and ticked and website subtitles use the existing caption overlay. MKV and other formats AVPlayer can't play fail with a message suggesting mpv. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds AVPlayer as a second, switchable engine for the iPhone's own player ("play on this phone"). mpv stays the default. This reverses the earlier mpv-only rule for the phone, for streams mpv handles badly (for example an HLS video that mpv opens as live and can't seek).
What changes
PlaybackSession.switchEngine(to:)re-prepares the route like Retry and reopens at the current position, keeping play/pause.http://play through the phone's loopback proxy (StreamRouteService.localPlayback); the registration lives as long as the video. Without the proxy it fails with a message suggesting mpv.avTextStyleRules(). Ticked subtitle files (SRT/WebVTT) and website subtitles use the existing caption overlay, including the timing offset.docs/ios-phone-playback.mdgets a "Player engine" section;AGENTS.mdand theplaybridge-appleskill now describe mpv as the default with AVPlayer as a per-session choice (still no automatic selection, silent fallback or saved default).What AVPlayer can't do compared with mpv
MKV, ASS/SSA subtitle files, picture-based subtitles, DASH and codecs Apple doesn't decode. Custom subtitle fonts and the timing offset don't apply to subtitles inside the stream.
Privacy
Debug logs show only the host and file extension, header names, and error domain and code, never URLs, header values or AVPlayer's error-log text.
Testing
run-phone-engine-checks.shadds tests for switching, retry and episode changes keeping the engine, pause kept, MKV refusal, diagnostics, loopback rules, error mapping, messages and overlay captions with delay.Not verified
run-mpv-phone-probe.sh(needs a booted simulator and ffmpeg) wasn't run; its file list was updated.🤖 Generated with Claude Code