Skip to content

Replace NativePlayer with AVMediaPlayerProxy#2046

Draft
JPKribs wants to merge 86 commits into
jellyfin:mainfrom
JPKribs:avplayer
Draft

Replace NativePlayer with AVMediaPlayerProxy#2046
JPKribs wants to merge 86 commits into
jellyfin:mainfrom
JPKribs:avplayer

Conversation

@JPKribs

@JPKribs JPKribs commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Main

Resolves: #1853

Children:

Resolves: #1848

This PR migrates the NativePlayer from a view to another proxy which lets us use a single UI for playback and controls. This also breaks out some protocols like subtitle selection and audio selection into their own protocols since, one day, when we have a music player, we will want audio selection only. In testing, everything is working as expected. Track selection works for compatible tracks (see Dependencies).

Still up in the air, I am trying to determine what our default player should be. Leaning towards VLC for codec support but AVPlayer has more HDR support + PiP so I don't know still which makes sense for us to set as the default. Working version is AVPlayer for now but that's a one line change when I land on it.

Dependencies

This PR is functional for track selection on DirectPlay items but cannot utilize other tracks during transcodes. Merging #1882 allows tracks to be selectable as AVPlayer will require us to rebuild the stream everything we want to change tracks.

Leaving this in draft until #1882 is live.

Video

iOS PiP

This is AVPlayer playing, PiP, and subtitle track selection. There is an outstanding iOS issue where subtitles are ~10s out of sync coming from server:

ScreenRecording_06-11-2026.12-59-23_1.mp4

Doing burn-in would resolve this or some kind of offset. Still early days.

tvOS PiP

NoAudioToGetUnder100MB.mov

Yes, I know something was on the camera lens. No, I will not re-record it.

AirPlay (with subtitles)

NoAudio.mov

AI Usage

Utilized Claude Code to merge in #1882 to test this with HLS reconstruction. This has been removed in a later commit to keep that on it's own PR.

JPKribs and others added 30 commits December 31, 2025 01:44
Removed track selection section and updated feature support table.
Updated subtitle format support notes for Swiftfin and Native players.
Updated the XSub entry to clarify subtitle format playback requirements.
@JPKribs JPKribs added enhancement New feature or request playback This item is related to content playback iOS Impacts iOS or iPadOS tvOS Impacts tvOS labels Jun 11, 2026
@JPKribs

JPKribs commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

@LePips I got everything added back in here. Please let me know if you had something else in mind for 1853. This should current cover all the same functionality of VLCKit + AirPlay and PiP.

PiP works natively for tvOS as well. I added the entitlement for it but like.... Who is that for?? Like, I want to watch things in a tiny box in the corner of my tv?

Subtitles work if native. This has the same transcode problem that's resolved in 1882. Merging that on top back in March allowed for full track selection in this. I'm sure it's no different but I will re-test that once it's merged into Main.

@JPKribs

JPKribs commented Jun 12, 2026

Copy link
Copy Markdown
Member Author

Videos are up to date on most recent commit.

@LePips

LePips commented Jun 13, 2026

Copy link
Copy Markdown
Member

Beat me to it, this is great and exciting work!

Initial notes:

  • need UI when AirPlay is occurring/the AV route changed. This should be able to be generalized to any kind of "remote playback" to work alongside ChromeCast.
  • should be able to use AVRoutePickerViewDelegate when presenting routes for "pressed" state for overlay

@JPKribs

JPKribs commented Jun 13, 2026

Copy link
Copy Markdown
Member Author

Beat me to it, this is great and exciting work!

Initial notes:

* need UI when AirPlay is occurring/the AV route changed. This should be able to be generalized to any kind of "remote playback" to work alongside ChromeCast.

* should be able to use `AVRoutePickerViewDelegate` when presenting routes for "pressed" state for overlay

Good calls!

How do you feel about defaulting to AVPlayer? IMO, it sucks how restrictive it is for formats but I think AirPlay + PiP are high value features to the point it might make sense to make that the default.

@JPKribs

JPKribs commented Jun 13, 2026

Copy link
Copy Markdown
Member Author
  • need UI when AirPlay is occurring/the AV route changed. This should be able to be generalized to any kind of "remote playback" to work alongside ChromeCast.

I have a generic version of this that works with the Jellyfin cast as well to compatible clients. The only issue is this will rely on #2042 so I think I have two dependencies now lol

@JPKribs

JPKribs commented Jun 14, 2026

Copy link
Copy Markdown
Member Author

Working version:

Simulator.Screen.Recording.-.iPhone.-.2026-06-14.at.01.24.44.mov

I think for this PR, the devices section will be left out. The goal is that section would be Chromecast + Jellyfin casting to other eligible clients. That will need the socket and some of the other sessionViewModel stuff I have on the other PR so for now this is just for POC

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

Labels

enhancement New feature or request iOS Impacts iOS or iPadOS playback This item is related to content playback tvOS Impacts tvOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Native Player with AVMediaPlayerProxy Native AVKit player stops playing E-AC3 multi-channel audio after couple seconds

2 participants