diff --git a/Shared/Defaults.swift b/Shared/Defaults.swift index 0cf47ee6..da88c33e 100644 --- a/Shared/Defaults.swift +++ b/Shared/Defaults.swift @@ -34,7 +34,7 @@ extension Defaults.Keys { static let favorites = Key<[FavoriteItem]>("favorites", default: []) static let playerButtonSingleTapGesture = Key("playerButtonSingleTapGesture", default: .togglePlayer) - static let playerButtonDoubleTapGesture = Key("playerButtonDoubleTapGesture", default: .togglePlayerVisibility) + static let playerButtonDoubleTapGesture = Key("playerButtonDoubleTapGesture", default: .nothing) static let playerButtonShowsControlButtonsWhenMinimized = Key("playerButtonShowsControlButtonsWhenMinimized", default: false) static let playerButtonIsExpanded = Key("playerButtonIsExpanded", default: false) static let playerBarMaxWidth = Key("playerBarMaxWidth", default: "600") diff --git a/Shared/Player/ControlsGradientView.swift b/Shared/Player/ControlsGradientView.swift index 34b83763..fabeedfa 100644 --- a/Shared/Player/ControlsGradientView.swift +++ b/Shared/Player/ControlsGradientView.swift @@ -23,7 +23,6 @@ struct ControlsGradientView: View { } } - struct ControlsGradientView_Previews: PreviewProvider { static var previews: some View { ControlsGradientView() diff --git a/Shared/Player/Video Details/VideoActions.swift b/Shared/Player/Video Details/VideoActions.swift index 09390233..accac590 100644 --- a/Shared/Player/Video Details/VideoActions.swift +++ b/Shared/Player/Video Details/VideoActions.swift @@ -133,7 +133,7 @@ struct VideoActions: View { case .close: actionButton("Close", systemImage: "xmark") { - if openWatchNextOnClose { + if player.presentingPlayer, openWatchNextOnClose { player.pause() WatchNextViewModel.shared.closed(player.currentItem) } else { diff --git a/Shared/Player/VideoPlayerView.swift b/Shared/Player/VideoPlayerView.swift index 722d2d5b..19a5b5aa 100644 --- a/Shared/Player/VideoPlayerView.swift +++ b/Shared/Player/VideoPlayerView.swift @@ -479,6 +479,5 @@ struct VideoPlayerView_Previews: PreviewProvider { Color.red VideoPlayerView() } - } } diff --git a/Shared/Settings/PlayerControlsSettings.swift b/Shared/Settings/PlayerControlsSettings.swift index 96a720a5..cd48af74 100644 --- a/Shared/Settings/PlayerControlsSettings.swift +++ b/Shared/Settings/PlayerControlsSettings.swift @@ -52,7 +52,7 @@ struct PlayerControlsSettings: View { #elseif os(iOS) .listStyle(.insetGrouped) #endif - .navigationTitle("Player Controls") + .navigationTitle("Controls") } @ViewBuilder var sections: some View { diff --git a/Shared/Videos/VideoBanner.swift b/Shared/Videos/VideoBanner.swift index a054eead..6c356dd2 100644 --- a/Shared/Videos/VideoBanner.swift +++ b/Shared/Videos/VideoBanner.swift @@ -123,17 +123,14 @@ struct VideoBanner: View { #endif } .fixedSize(horizontal: false, vertical: true) - .contentShape(Rectangle()) + #if os(tvOS) .buttonStyle(.card) - #else + .padding(.trailing, 10) + #elseif os(macOS) .buttonStyle(.plain) #endif - #if os(tvOS) - .padding(.trailing, 10) - #endif - .opacity(contentOpacity) - .id(id ?? video?.videoID ?? video?.id) + .opacity(contentOpacity) } private var extraAttributes: some View { diff --git a/Shared/Videos/VideoCell.swift b/Shared/Videos/VideoCell.swift index 8e051e98..3ed566c7 100644 --- a/Shared/Videos/VideoCell.swift +++ b/Shared/Videos/VideoCell.swift @@ -15,8 +15,6 @@ struct VideoCell: View { @Environment(\.verticalSizeClass) private var verticalSizeClass #endif - @ObservedObject private var thumbnails = ThumbnailsModel.shared - @Default(.channelOnThumbnail) private var channelOnThumbnail @Default(.timeOnThumbnail) private var timeOnThumbnail @Default(.roundedThumbnails) private var roundedThumbnails @@ -445,7 +443,7 @@ struct VideoCell: View { private var thumbnailImage: some View { Group { - ThumbnailView(url: thumbnails.best(video)) + VideoCellThumbnail(video: video) #if os(tvOS) .frame(minHeight: 320) @@ -503,6 +501,15 @@ struct VideoCell: View { } } +struct VideoCellThumbnail: View { + let video: Video + @ObservedObject private var thumbnails = ThumbnailsModel.shared + + var body: some View { + ThumbnailView(url: thumbnails.best(video)) + } +} + struct VideoCell_Preview: PreviewProvider { static var previews: some View { Group { diff --git a/Shared/Views/PlayingIndicatorView.swift b/Shared/Views/PlayingIndicatorView.swift index b4f947be..0edaaa35 100644 --- a/Shared/Views/PlayingIndicatorView.swift +++ b/Shared/Views/PlayingIndicatorView.swift @@ -9,17 +9,19 @@ struct PlayingIndicatorView: View { @ObservedObject private var player = PlayerModel.shared var body: some View { - HStack(spacing: 2) { - bar(low: 0.4) - .animation(animation.speed(1.5), value: drawingHeight) - bar(low: 0.3) - .animation(animation.speed(1.2), value: drawingHeight) - bar(low: 0.5) - .animation(animation.speed(1.0), value: drawingHeight) - } - .opacity(player.currentVideo == video && player.isPlaying ? 1 : 0) - .onAppear { - drawingHeight.toggle() + if player.isPlaying && player.currentVideo == video { + HStack(spacing: 2) { + bar(low: 0.4) + .animation(animation.speed(1.5), value: drawingHeight) + bar(low: 0.3) + .animation(animation.speed(1.2), value: drawingHeight) + bar(low: 0.5) + .animation(animation.speed(1.0), value: drawingHeight) + } + .opacity(player.currentVideo == video && player.isPlaying ? 1 : 0) + .onAppear { + drawingHeight.toggle() + } } }