Fix macOS opening player window instead of switching video in PiP

The PiP-active guard that skips expanding the player when opening a new
video was compiled iOS-only, so on macOS a browser deep link always
re-showed the hidden player window instead of playing the new video in
the existing PiP window. Extend the guard in both openVideo overloads
and the Handoff path to macOS.
This commit is contained in:
Arkadiusz Fal
2026-06-16 20:42:39 +02:00
parent 4effe5d7a5
commit b21a4920be
2 changed files with 3 additions and 3 deletions

View File

@@ -940,7 +940,7 @@ final class PlayerService {
func openVideo(_ video: Video, startTime: TimeInterval? = nil) {
// Check if MPV PiP is active - if so, don't expand the player
#if os(iOS)
#if os(iOS) || os(macOS)
let mpvPiPActive = (currentBackend as? MPVBackend)?.isPiPActive ?? false
#else
let mpvPiPActive = false
@@ -993,7 +993,7 @@ final class PlayerService {
/// - captions: Optional array of external captions (e.g., from WebDAV subtitle files)
func openVideo(_ video: Video, stream: Stream, audioStream: Stream? = nil, download: Download? = nil, captions: [Caption] = []) {
// Check if MPV PiP is active - if so, don't expand the player
#if os(iOS)
#if os(iOS) || os(macOS)
let mpvPiPActive = (currentBackend as? MPVBackend)?.isPiPActive ?? false
#else
let mpvPiPActive = false

View File

@@ -761,7 +761,7 @@ struct YatteeApp: App {
// Always expand player after handoff (unless PiP is active)
// We add a small delay to ensure ContentView has set up its .onChange observers
// (during app launch via Handoff, the trigger can fire before the view is ready)
#if os(iOS)
#if os(iOS) || os(macOS)
let isPiPActive = appEnvironment.playerService.state.pipState == .active
#else
let isPiPActive = false