diff --git a/Swiftfin tvOS/Components/HomeCinematicView/CinematicNextUpCardView.swift b/Swiftfin tvOS/Components/HomeCinematicView/CinematicNextUpCardView.swift index fa95e274..3cab0897 100644 --- a/Swiftfin tvOS/Components/HomeCinematicView/CinematicNextUpCardView.swift +++ b/Swiftfin tvOS/Components/HomeCinematicView/CinematicNextUpCardView.swift @@ -28,13 +28,13 @@ struct CinematicNextUpCardView: View { item.getSeriesThumbImage(maxWidth: 350), item.getSeriesBackdropImage(maxWidth: 350), ]) - .frame(width: 350, height: 210) + .frame(width: 350, height: 210) } else { ImageView([ .init(url: item.getThumbImage(maxWidth: 350)), .init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()), ]) - .frame(width: 350, height: 210) + .frame(width: 350, height: 210) } LinearGradient(colors: [.clear, .black], diff --git a/Swiftfin tvOS/Components/HomeCinematicView/CinematicResumeCardView.swift b/Swiftfin tvOS/Components/HomeCinematicView/CinematicResumeCardView.swift index 8aa188c5..52b3cf88 100644 --- a/Swiftfin tvOS/Components/HomeCinematicView/CinematicResumeCardView.swift +++ b/Swiftfin tvOS/Components/HomeCinematicView/CinematicResumeCardView.swift @@ -29,13 +29,13 @@ struct CinematicResumeCardView: View { item.getSeriesThumbImage(maxWidth: 350), item.getSeriesBackdropImage(maxWidth: 350), ]) - .frame(width: 350, height: 210) + .frame(width: 350, height: 210) } else { ImageView([ .init(url: item.getThumbImage(maxWidth: 350)), .init(url: item.getBackdropImage(maxWidth: 350), blurHash: item.getBackdropImageBlurHash()), ]) - .frame(width: 350, height: 210) + .frame(width: 350, height: 210) } LinearGradient(colors: [.clear, .black], diff --git a/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSLiveTVOverlay.swift b/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSLiveTVOverlay.swift index 1a0f3814..dace960b 100644 --- a/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSLiveTVOverlay.swift +++ b/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSLiveTVOverlay.swift @@ -62,18 +62,18 @@ struct tvOSLiveTVOverlay: View { SFSymbolButton(systemName: "chevron.left.circle", action: { viewModel.playerOverlayDelegate?.didSelectPlayPreviousItem() }) - .frame(maxWidth: 30, maxHeight: 30) - .disabled(viewModel.previousItemVideoPlayerViewModel == nil) - .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) + .frame(maxWidth: 30, maxHeight: 30) + .disabled(viewModel.previousItemVideoPlayerViewModel == nil) + .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) } if viewModel.shouldShowPlayNextItem { SFSymbolButton(systemName: "chevron.right.circle", action: { viewModel.playerOverlayDelegate?.didSelectPlayNextItem() }) - .frame(maxWidth: 30, maxHeight: 30) - .disabled(viewModel.nextItemVideoPlayerViewModel == nil) - .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) + .frame(maxWidth: 30, maxHeight: 30) + .disabled(viewModel.nextItemVideoPlayerViewModel == nil) + .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) } if viewModel.shouldShowAutoPlay { diff --git a/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSVLCOverlay.swift b/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSVLCOverlay.swift index 20db21e6..aa480d1a 100644 --- a/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSVLCOverlay.swift +++ b/Swiftfin tvOS/Views/VideoPlayer/Overlays/tvOSVLCOverlay.swift @@ -62,18 +62,18 @@ struct tvOSVLCOverlay: View { SFSymbolButton(systemName: "chevron.left.circle", action: { viewModel.playerOverlayDelegate?.didSelectPlayPreviousItem() }) - .frame(maxWidth: 30, maxHeight: 30) - .disabled(viewModel.previousItemVideoPlayerViewModel == nil) - .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) + .frame(maxWidth: 30, maxHeight: 30) + .disabled(viewModel.previousItemVideoPlayerViewModel == nil) + .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) } if viewModel.shouldShowPlayNextItem { SFSymbolButton(systemName: "chevron.right.circle", action: { viewModel.playerOverlayDelegate?.didSelectPlayNextItem() }) - .frame(maxWidth: 30, maxHeight: 30) - .disabled(viewModel.nextItemVideoPlayerViewModel == nil) - .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) + .frame(maxWidth: 30, maxHeight: 30) + .disabled(viewModel.nextItemVideoPlayerViewModel == nil) + .foregroundColor(viewModel.nextItemVideoPlayerViewModel == nil ? .gray : .white) } if viewModel.shouldShowAutoPlay { diff --git a/Swiftfin.xcodeproj/project.pbxproj b/Swiftfin.xcodeproj/project.pbxproj index b945bfaa..e37de740 100644 --- a/Swiftfin.xcodeproj/project.pbxproj +++ b/Swiftfin.xcodeproj/project.pbxproj @@ -2951,7 +2951,7 @@ ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 70; - DEVELOPMENT_TEAM = 4BHXT8RHFR; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = WidgetExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -2977,7 +2977,7 @@ ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 70; - DEVELOPMENT_TEAM = 4BHXT8RHFR; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = WidgetExtension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/Swiftfin/Components/PortraitHStackView.swift b/Swiftfin/Components/PortraitHStackView.swift index a9aa57c0..79261be4 100644 --- a/Swiftfin/Components/PortraitHStackView.swift +++ b/Swiftfin/Components/PortraitHStackView.swift @@ -48,9 +48,9 @@ struct PortraitImageHStackView: View { failureView: { InitialFailureView(item.failureInitials) }) - .portraitPoster(width: maxWidth) - .shadow(radius: 4, y: 2) - .accessibilityIgnoresInvertColors() + .portraitPoster(width: maxWidth) + .shadow(radius: 4, y: 2) + .accessibilityIgnoresInvertColors() if item.showTitle { Text(item.title) diff --git a/Swiftfin/Views/ContinueWatchingView.swift b/Swiftfin/Views/ContinueWatchingView.swift index e4f55910..505e187f 100644 --- a/Swiftfin/Views/ContinueWatchingView.swift +++ b/Swiftfin/Views/ContinueWatchingView.swift @@ -33,13 +33,13 @@ struct ContinueWatchingView: View { item.getSeriesThumbImage(maxWidth: 320), item.getSeriesBackdropImage(maxWidth: 320), ]) - .frame(width: 320, height: 180) + .frame(width: 320, height: 180) } else { ImageView(sources: [ item.getThumbImage(maxWidth: 320), item.getBackdropImage(maxWidth: 320), ]) - .frame(width: 320, height: 180) + .frame(width: 320, height: 180) } } .accessibilityIgnoresInvertColors() diff --git a/Swiftfin/Views/ItemView/ItemViewBody.swift b/Swiftfin/Views/ItemView/ItemViewBody.swift index 55dfc8a5..5e9b959d 100644 --- a/Swiftfin/Views/ItemView/ItemViewBody.swift +++ b/Swiftfin/Views/ItemView/ItemViewBody.swift @@ -69,7 +69,7 @@ struct ItemViewBody: View { selectedAction: { genre in itemRouter.route(to: \.library, (viewModel: .init(genre: genre), title: genre.title)) }) - .padding(.bottom) + .padding(.bottom) } // MARK: Studios diff --git a/Swiftfin/Views/VideoPlayer/Overlays/VLCPlayerOverlayView.swift b/Swiftfin/Views/VideoPlayer/Overlays/VLCPlayerOverlayView.swift index 9bb57530..5530e798 100644 --- a/Swiftfin/Views/VideoPlayer/Overlays/VLCPlayerOverlayView.swift +++ b/Swiftfin/Views/VideoPlayer/Overlays/VLCPlayerOverlayView.swift @@ -375,16 +375,16 @@ struct VLCPlayerOverlayView: View { ValueSlider(value: $viewModel.sliderPercentage, onEditingChanged: { editing in viewModel.sliderIsScrubbing = editing }) - .valueSliderStyle(HorizontalValueSliderStyle(track: - HorizontalValueTrack(view: - Capsule().foregroundColor(.purple)) - .background(Capsule().foregroundColor(Color.gray.opacity(0.25))) - .frame(height: 4), - thumb: Circle().foregroundColor(.purple), - thumbSize: CGSize.Circle(radius: viewModel.sliderIsScrubbing ? 20 : 15), - thumbInteractiveSize: CGSize.Circle(radius: 40), - options: .defaultOptions)) - .frame(maxHeight: 50) + .valueSliderStyle(HorizontalValueSliderStyle(track: + HorizontalValueTrack(view: + Capsule().foregroundColor(.purple)) + .background(Capsule().foregroundColor(Color.gray.opacity(0.25))) + .frame(height: 4), + thumb: Circle().foregroundColor(.purple), + thumbSize: CGSize.Circle(radius: viewModel.sliderIsScrubbing ? 20 : 15), + thumbInteractiveSize: CGSize.Circle(radius: 40), + options: .defaultOptions)) + .frame(maxHeight: 50) Text(viewModel.rightLabelText) .font(.system(size: 18, weight: .semibold, design: .default)) diff --git a/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift b/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift index 6f7e2173..f2eda1ce 100644 --- a/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift +++ b/Swiftfin/Views/VideoPlayer/VLCPlayerViewController.swift @@ -60,23 +60,33 @@ class VLCPlayerViewController: UIViewController { UIKeyCommand(title: L10n.playAndPause, action: #selector(didSelectMain), input: " "), UIKeyCommand(title: L10n.jumpForward, action: #selector(didSelectForward), input: UIKeyCommand.inputRightArrow), UIKeyCommand(title: L10n.jumpBackward, action: #selector(didSelectBackward), input: UIKeyCommand.inputLeftArrow), - UIKeyCommand(title: L10n.nextItem, action: #selector(didSelectPlayNextItem), input: UIKeyCommand.inputRightArrow, + UIKeyCommand(title: L10n.nextItem, + action: #selector(didSelectPlayNextItem), + input: UIKeyCommand.inputRightArrow, modifierFlags: .command), - UIKeyCommand(title: L10n.previousItem, action: #selector(didSelectPlayPreviousItem), input: UIKeyCommand.inputLeftArrow, + UIKeyCommand(title: L10n.previousItem, + action: #selector(didSelectPlayPreviousItem), + input: UIKeyCommand.inputLeftArrow, modifierFlags: .command), UIKeyCommand(title: L10n.close, action: #selector(didSelectClose), input: UIKeyCommand.inputEscape), ] if let previous = viewModel.playbackSpeed.previous { commands.append(.init(title: "\(L10n.playbackSpeed) \(previous.displayTitle)", - action: #selector(didSelectPreviousPlaybackSpeed), input: "[", modifierFlags: .command)) + action: #selector(didSelectPreviousPlaybackSpeed), + input: "[", + modifierFlags: .command)) } if let next = viewModel.playbackSpeed.next { - commands.append(.init(title: "\(L10n.playbackSpeed) \(next.displayTitle)", action: #selector(didSelectNextPlaybackSpeed), - input: "]", modifierFlags: .command)) + commands.append(.init(title: "\(L10n.playbackSpeed) \(next.displayTitle)", + action: #selector(didSelectNextPlaybackSpeed), + input: "]", + modifierFlags: .command)) } if viewModel.playbackSpeed != .one { commands.append(.init(title: "\(L10n.playbackSpeed) \(PlaybackSpeed.one.displayTitle)", - action: #selector(didSelectNormalPlaybackSpeed), input: "\\", modifierFlags: .command)) + action: #selector(didSelectNormalPlaybackSpeed), + input: "\\", + modifierFlags: .command)) } commands.forEach { $0.wantsPriorityOverSystemBehavior = true } return commands @@ -148,12 +158,18 @@ class VLCPlayerViewController: UIViewController { refreshJumpForwardOverlayView(with: viewModel.jumpForwardLength) let defaultNotificationCenter = NotificationCenter.default - defaultNotificationCenter.addObserver(self, selector: #selector(appWillTerminate), name: UIApplication.willTerminateNotification, + defaultNotificationCenter.addObserver(self, + selector: #selector(appWillTerminate), + name: UIApplication.willTerminateNotification, + object: nil) + defaultNotificationCenter.addObserver(self, + selector: #selector(appWillResignActive), + name: UIApplication.willResignActiveNotification, + object: nil) + defaultNotificationCenter.addObserver(self, + selector: #selector(appWillResignActive), + name: UIApplication.didEnterBackgroundNotification, object: nil) - defaultNotificationCenter.addObserver(self, selector: #selector(appWillResignActive), - name: UIApplication.willResignActiveNotification, object: nil) - defaultNotificationCenter.addObserver(self, selector: #selector(appWillResignActive), - name: UIApplication.didEnterBackgroundNotification, object: nil) } @objc @@ -205,11 +221,8 @@ class VLCPlayerViewController: UIViewController { let singleTapGesture = UITapGestureRecognizer(target: self, action: #selector(didTap)) - let rightSwipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(didRightSwipe)) - rightSwipeGesture.direction = .right - - let leftSwipeGesture = UISwipeGestureRecognizer(target: self, action: #selector(didLeftSwipe)) - leftSwipeGesture.direction = .left + let doubleTapGesture = UITapGestureRecognizer(target: self, action: #selector(didDoubleTap)) + doubleTapGesture.numberOfTapsRequired = 2 let pinchGesture = UIPinchGestureRecognizer(target: self, action: #selector(didPinch(_:))) @@ -219,8 +232,10 @@ class VLCPlayerViewController: UIViewController { view.addGestureRecognizer(pinchGesture) if viewModel.jumpGesturesEnabled { - view.addGestureRecognizer(rightSwipeGesture) - view.addGestureRecognizer(leftSwipeGesture) + view.addGestureRecognizer(doubleTapGesture) + singleTapGesture.require(toFail: doubleTapGesture) + singleTapGesture.delaysTouchesBegan = true + doubleTapGesture.delaysTouchesBegan = true } if viewModel.systemControlGesturesEnabled { @@ -246,13 +261,12 @@ class VLCPlayerViewController: UIViewController { } @objc - private func didRightSwipe() { - didSelectForward() - } - - @objc - private func didLeftSwipe() { - didSelectBackward() + private func didDoubleTap(_ gestureRecognizer: UITapGestureRecognizer) { + if gestureRecognizer.location(in: mainGestureView).x > (mainGestureView.frame.width / 2) { + didSelectForward() + } else { + didSelectBackward() + } } @objc @@ -736,8 +750,11 @@ extension VLCPlayerViewController { extension VLCPlayerViewController { private func restartOverlayDismissTimer(interval: Double = 3) { overlayDismissTimer?.invalidate() - overlayDismissTimer = Timer.scheduledTimer(timeInterval: interval, target: self, selector: #selector(dismissTimerFired), - userInfo: nil, repeats: false) + overlayDismissTimer = Timer.scheduledTimer(timeInterval: interval, + target: self, + selector: #selector(dismissTimerFired), + userInfo: nil, + repeats: false) } @objc