mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 05:40:32 +05:30
Remove custom PiP placeholder
This commit is contained in:
parent
e8dbf46e14
commit
2c81808125
@ -199,23 +199,17 @@ struct VideoPlayerView: View {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
GeometryReader { geometry in
|
GeometryReader { geometry in
|
||||||
Group {
|
PlayerBackendView()
|
||||||
if player.playingInPictureInPicture {
|
#if !os(tvOS)
|
||||||
pictureInPicturePlaceholder
|
.modifier(
|
||||||
} else {
|
VideoPlayerSizeModifier(
|
||||||
PlayerBackendView()
|
geometry: geometry,
|
||||||
#if !os(tvOS)
|
aspectRatio: player.aspectRatio,
|
||||||
.modifier(
|
fullScreen: fullScreenLayout
|
||||||
VideoPlayerSizeModifier(
|
)
|
||||||
geometry: geometry,
|
)
|
||||||
aspectRatio: player.aspectRatio,
|
.overlay(playerPlaceholder)
|
||||||
fullScreen: fullScreenLayout
|
#endif
|
||||||
)
|
|
||||||
)
|
|
||||||
.overlay(playerPlaceholder)
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.frame(maxWidth: fullScreenLayout ? .infinity : nil, maxHeight: fullScreenLayout ? .infinity : nil)
|
.frame(maxWidth: fullScreenLayout ? .infinity : nil, maxHeight: fullScreenLayout ? .infinity : nil)
|
||||||
.onHover { hovering in
|
.onHover { hovering in
|
||||||
hoveringPlayer = hovering
|
hoveringPlayer = hovering
|
||||||
@ -261,7 +255,6 @@ struct VideoPlayerView: View {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
.background(((colorScheme == .dark || fullScreenLayout) ? Color.black : Color.white).edgesIgnoringSafeArea(.all))
|
.background(((colorScheme == .dark || fullScreenLayout) ? Color.black : Color.white).edgesIgnoringSafeArea(.all))
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
.frame(minWidth: 650)
|
.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)
|
#if os(iOS)
|
||||||
var playerDragGesture: some Gesture {
|
var playerDragGesture: some Gesture {
|
||||||
DragGesture(minimumDistance: 0, coordinateSpace: .global)
|
DragGesture(minimumDistance: 0, coordinateSpace: .global)
|
||||||
|
Loading…
Reference in New Issue
Block a user