mirror of
https://github.com/yattee/yattee.git
synced 2026-07-19 22:02:10 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user