mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Code style change
This commit is contained in:
@@ -30,9 +30,7 @@ struct PlayerBackendView: View {
|
||||
}
|
||||
.overlay(GeometryReader { proxy in
|
||||
Color.clear
|
||||
.onAppear {
|
||||
player.playerSize = proxy.size
|
||||
}
|
||||
.onAppear { player.playerSize = proxy.size }
|
||||
.onChange(of: proxy.size) { _ in player.playerSize = proxy.size }
|
||||
.onChange(of: player.controls.presentingOverlays) { _ in player.playerSize = proxy.size }
|
||||
.onChange(of: player.aspectRatio) { _ in player.playerSize = proxy.size }
|
||||
|
@@ -210,33 +210,33 @@ struct VideoPlayerView: View {
|
||||
)
|
||||
.overlay(playerPlaceholder)
|
||||
#endif
|
||||
.frame(maxWidth: fullScreenLayout ? .infinity : nil, maxHeight: fullScreenLayout ? .infinity : nil)
|
||||
.onHover { hovering in
|
||||
hoveringPlayer = hovering
|
||||
hovering ? playerControls.show() : playerControls.hide()
|
||||
}
|
||||
.frame(maxWidth: fullScreenLayout ? .infinity : nil, maxHeight: fullScreenLayout ? .infinity : nil)
|
||||
.onHover { hovering in
|
||||
hoveringPlayer = hovering
|
||||
hovering ? playerControls.show() : playerControls.hide()
|
||||
}
|
||||
#if os(iOS)
|
||||
.gesture(playerControls.presentingOverlays ? nil : playerDragGesture)
|
||||
.onChange(of: dragGestureState) { _ in
|
||||
if !dragGestureState {
|
||||
onPlayerDragGestureEnded()
|
||||
}
|
||||
}
|
||||
#elseif os(macOS)
|
||||
.onAppear(perform: {
|
||||
NSEvent.addLocalMonitorForEvents(matching: [.mouseMoved]) {
|
||||
hoverThrottle.execute {
|
||||
if !player.currentItem.isNil, hoveringPlayer {
|
||||
playerControls.resetTimer()
|
||||
}
|
||||
.gesture(playerControls.presentingOverlays ? nil : playerDragGesture)
|
||||
.onChange(of: dragGestureState) { _ in
|
||||
if !dragGestureState {
|
||||
onPlayerDragGestureEnded()
|
||||
}
|
||||
|
||||
return $0
|
||||
}
|
||||
})
|
||||
#elseif os(macOS)
|
||||
.onAppear(perform: {
|
||||
NSEvent.addLocalMonitorForEvents(matching: [.mouseMoved]) {
|
||||
hoverThrottle.execute {
|
||||
if !player.currentItem.isNil, hoveringPlayer {
|
||||
playerControls.resetTimer()
|
||||
}
|
||||
}
|
||||
|
||||
return $0
|
||||
}
|
||||
})
|
||||
#endif
|
||||
|
||||
.background(Color.black)
|
||||
.background(Color.black)
|
||||
|
||||
#if !os(tvOS)
|
||||
if !fullScreenLayout {
|
||||
|
Reference in New Issue
Block a user