mirror of
https://github.com/yattee/yattee.git
synced 2024-12-23 14:03:41 +00:00
Fix animation of overlays
This commit is contained in:
parent
9197309115
commit
9def7fc8ac
@ -60,42 +60,46 @@ struct VideoPlayerView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
ZStack(alignment: overlayAlignment) {
|
ZStack(alignment: overlayAlignment) {
|
||||||
videoPlayer
|
videoPlayer
|
||||||
|
.zIndex(-1)
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
.gesture(playerControls.presentingControlsOverlay ? videoPlayerCloseControlsOverlayGesture : nil)
|
.gesture(playerControls.presentingControlsOverlay ? videoPlayerCloseControlsOverlayGesture : nil)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if playerControls.presentingControlsOverlay {
|
VStack {
|
||||||
HStack {
|
if playerControls.presentingControlsOverlay {
|
||||||
HStack {
|
HStack {
|
||||||
ControlsOverlay()
|
HStack {
|
||||||
#if os(tvOS)
|
ControlsOverlay()
|
||||||
.onExitCommand {
|
#if os(tvOS)
|
||||||
withAnimation(PlayerControls.animation) {
|
.onExitCommand {
|
||||||
playerControls.hideOverlays()
|
withAnimation(PlayerControls.animation) {
|
||||||
|
playerControls.hideOverlays()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
.onPlayPauseCommand {
|
||||||
.onPlayPauseCommand {
|
player.togglePlay()
|
||||||
player.togglePlay()
|
}
|
||||||
|
#endif
|
||||||
|
.padding()
|
||||||
|
.modifier(ControlBackgroundModifier())
|
||||||
|
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||||
|
}
|
||||||
|
#if !os(tvOS)
|
||||||
|
.frame(maxWidth: fullScreenLayout ? .infinity : player.playerSize.width)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !os(tvOS)
|
||||||
|
if !fullScreenLayout && sidebarQueue {
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
.padding()
|
|
||||||
.modifier(ControlBackgroundModifier())
|
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
|
||||||
.transition(.opacity)
|
|
||||||
}
|
}
|
||||||
#if !os(tvOS)
|
#if os(tvOS)
|
||||||
.frame(maxWidth: fullScreenLayout ? .infinity : player.playerSize.width)
|
.clipShape(RoundedRectangle(cornerRadius: 10))
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !os(tvOS)
|
|
||||||
if !fullScreenLayout && sidebarQueue {
|
|
||||||
Spacer()
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
.zIndex(1)
|
||||||
|
.transition(.opacity)
|
||||||
}
|
}
|
||||||
#if os(tvOS)
|
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 10))
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
Loading…
Reference in New Issue
Block a user