Skip to content

In-place AVPlayerItem handover across native loads while PiP is active - #159

Merged
superuser404notfound merged 1 commit into
mainfrom
feature/pip-item-handover
Jul 20, 2026
Merged

superuser404notfound merged 1 commit into
mainfrom
feature/pip-item-handover

Conversation

@superuser404notfound

Copy link
Copy Markdown
Owner

Fixes #158. A system PiP window closes the moment its source layer's player drops its item; the load teardown nulled it for the whole load gap (probe, demuxer, fresh loopback session). The #93 in-PiP recovery reload already established the failure mode and the inPlaceSwap mechanism. This wires it into the regular load path: load() arms shouldHandOverItemInPlace(pipActive:priorBackendWasNative:), stopInternal defers the item detach behind the new keepCurrentItem parameter, and the loopback host.load callsite consumes the armed handover as inPlaceSwap (consume-and-reset, so audio-switch and recovery reloads keep their contracts). The old item keeps playing until replaceCurrentItem swaps in the ready master with transport intent latched. Covered by PiPItemHandoverTests; full suite 782 green, tvOS sim build clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw

…le PiP is active

A system PiP window closes when its source layer's player drops its
item; the load teardown nulled it for the whole load gap. load() now
arms shouldHandOverItemInPlace, stopInternal defers the item detach
(keepCurrentItem), and the loopback host.load callsite swaps in place
(inPlaceSwap), keeping the old item playing until replaceCurrentItem
hands over the ready master. Fixes next-episode transitions closing the
tvOS PiP window.

Closes #158

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NAPCg4tCDdSqkK6tPkNptw
@superuser404notfound
superuser404notfound merged commit fdf8699 into main Jul 20, 2026
3 checks passed
@superuser404notfound
superuser404notfound deleted the feature/pip-item-handover branch July 20, 2026 09:12
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.

VOD load option to reuse the native AVPlayer across loads so system PiP survives next-episode transitions

1 participant