From f1d57c303d741d7c7e1351d9c737b1bac368e130 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 13 Aug 2022 16:14:38 +0200 Subject: [PATCH] Remove custom PiP placeholder --- Shared/Player/VideoPlayerView.swift | 58 ++++++----------------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 2a87d53f..d0cada1b 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -199,23 +199,17 @@ struct VideoPlayerView: View { } #else GeometryReader { geometry in - Group { - if player.playingInPictureInPicture { - pictureInPicturePlaceholder - } else { - PlayerBackendView() - #if !os(tvOS) - .modifier( - VideoPlayerSizeModifier( - geometry: geometry, - aspectRatio: player.aspectRatio, - fullScreen: fullScreenLayout - ) - ) - .overlay(playerPlaceholder) - #endif - } - } + PlayerBackendView() + #if !os(tvOS) + .modifier( + VideoPlayerSizeModifier( + geometry: geometry, + aspectRatio: player.aspectRatio, + fullScreen: fullScreenLayout + ) + ) + .overlay(playerPlaceholder) + #endif .frame(maxWidth: fullScreenLayout ? .infinity : nil, maxHeight: fullScreenLayout ? .infinity : nil) .onHover { hovering in hoveringPlayer = hovering @@ -261,7 +255,6 @@ struct VideoPlayerView: View { } #endif } - .background(((colorScheme == .dark || fullScreenLayout) ? Color.black : Color.white).edgesIgnoringSafeArea(.all)) #if os(macOS) .frame(minWidth: 650) @@ -333,35 +326,6 @@ struct VideoPlayerView: View { } } - var pictureInPicturePlaceholder: some View { - HStack { - Spacer() - VStack { - Spacer() - VStack(spacing: 10) { - #if !os(tvOS) - Image(systemName: "pip") - .font(.system(size: 120)) - #endif - - Text("Playing in Picture in Picture") - } - Spacer() - } - .foregroundColor(.gray) - Spacer() - } - .contextMenu { - Button { - player.closePiP() - } label: { - Label("Exit Picture in Picture", systemImage: "pip.exit") - } - } - .contentShape(Rectangle()) - .frame(width: player.playerSize.width, height: player.playerSize.height) - } - #if os(iOS) var playerDragGesture: some Gesture { DragGesture(minimumDistance: 0, coordinateSpace: .global)