mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Minor tvOS layout fixes
This commit is contained in:
parent
993e602ca3
commit
d330771fef
@ -85,12 +85,6 @@ final class PlayerControlsModel: ObservableObject {
|
||||
}
|
||||
|
||||
func resetTimer() {
|
||||
#if os(tvOS)
|
||||
if !presentingControls {
|
||||
show()
|
||||
}
|
||||
#endif
|
||||
|
||||
removeTimer()
|
||||
|
||||
guard let player = player, !player.musicMode else {
|
||||
|
@ -69,6 +69,9 @@ struct PlayerControls: View {
|
||||
.offset(y: -25)
|
||||
.zIndex(1)
|
||||
}
|
||||
#if os(tvOS)
|
||||
.offset(y: -100)
|
||||
#endif
|
||||
.frame(maxWidth: 500)
|
||||
.padding(.bottom, 2)
|
||||
}
|
||||
@ -260,7 +263,9 @@ struct PlayerControls: View {
|
||||
HStack(spacing: 20) {
|
||||
restartVideoButton
|
||||
advanceToNextItemButton
|
||||
musicModeButton
|
||||
#if !os(tvOS)
|
||||
musicModeButton
|
||||
#endif
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||
}
|
||||
|
@ -109,6 +109,9 @@ struct TimelineView: View {
|
||||
HStack(spacing: 4) {
|
||||
Text((dragging ? projectedValue : nil)?.formattedAsPlaybackTime(allowZero: true) ?? playerTime.currentPlaybackTime)
|
||||
.frame(minWidth: 35)
|
||||
#if os(tvOS)
|
||||
.font(.system(size: 20))
|
||||
#endif
|
||||
|
||||
ZStack(alignment: .center) {
|
||||
ZStack(alignment: .leading) {
|
||||
@ -209,6 +212,9 @@ struct TimelineView: View {
|
||||
Text(dragging ? playerTime.durationPlaybackTime : playerTime.withoutSegmentsPlaybackTime)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 3))
|
||||
.frame(minWidth: 35)
|
||||
#if os(tvOS)
|
||||
.font(.system(size: 20))
|
||||
#endif
|
||||
}
|
||||
.clipShape(RoundedRectangle(cornerRadius: 3))
|
||||
.font(.system(size: 9).monospacedDigit())
|
||||
|
@ -141,22 +141,22 @@ struct VideoPlayerView: View {
|
||||
playerView
|
||||
.ignoresSafeArea(.all, edges: .all)
|
||||
.onMoveCommand { direction in
|
||||
if direction == .up || direction == .down {
|
||||
playerControls.show()
|
||||
}
|
||||
|
||||
playerControls.resetTimer()
|
||||
|
||||
guard !playerControls.presentingControls else {
|
||||
return
|
||||
}
|
||||
|
||||
if direction == .left {
|
||||
playerControls.resetTimer()
|
||||
player.backend.seek(relative: .secondsInDefaultTimescale(-10))
|
||||
}
|
||||
if direction == .right {
|
||||
playerControls.resetTimer()
|
||||
player.backend.seek(relative: .secondsInDefaultTimescale(10))
|
||||
}
|
||||
if direction == .up {
|
||||
playerControls.show()
|
||||
playerControls.resetTimer()
|
||||
}
|
||||
if direction == .down {
|
||||
playerControls.show()
|
||||
playerControls.resetTimer()
|
||||
}
|
||||
}
|
||||
#else
|
||||
GeometryReader { geometry in
|
||||
|
@ -78,9 +78,11 @@ struct VideoContextMenuView: View {
|
||||
}
|
||||
}
|
||||
|
||||
Section {
|
||||
ShareButton(contentItem: .init(video: video))
|
||||
}
|
||||
#if !os(tvOS)
|
||||
Section {
|
||||
ShareButton(contentItem: .init(video: video))
|
||||
}
|
||||
#endif
|
||||
|
||||
if !inChannelView, !inChannelPlaylistView {
|
||||
Section {
|
||||
|
Loading…
Reference in New Issue
Block a user