mirror of
https://github.com/yattee/yattee.git
synced 2026-05-14 03:15:03 +00:00
Add tvOS setting for video click behavior
This commit is contained in:
@@ -58,7 +58,18 @@ struct TappableVideoModifier: ViewModifier {
|
||||
func body(content: Content) -> some View {
|
||||
Button {
|
||||
dismissKeyboard()
|
||||
#if os(tvOS)
|
||||
let tapAction = appEnvironment?.settingsManager.tvOSVideoTapAction ?? .openInfo
|
||||
if tapAction == .openInfo {
|
||||
appEnvironment?.navigationCoordinator.navigate(
|
||||
to: .video(.loaded(video), queueContext: queueContext)
|
||||
)
|
||||
} else {
|
||||
checkPasswordAndPlay()
|
||||
}
|
||||
#else
|
||||
checkPasswordAndPlay()
|
||||
#endif
|
||||
} label: {
|
||||
content
|
||||
.contentShape(Rectangle())
|
||||
|
||||
@@ -17,7 +17,9 @@ struct LayoutNavigationSettingsView: View {
|
||||
#if os(iOS)
|
||||
HapticsSection(settings: settings)
|
||||
#endif
|
||||
#if !os(tvOS)
|
||||
#if os(tvOS)
|
||||
TVVideoActionsSection(settings: settings)
|
||||
#else
|
||||
VideoActionsSection(settings: settings)
|
||||
LinkActionSection(settings: settings)
|
||||
ClipboardSection(settings: settings)
|
||||
@@ -190,6 +192,32 @@ private struct VideoActionsSection: View {
|
||||
}
|
||||
#endif
|
||||
|
||||
// MARK: - TV Video Actions Section
|
||||
|
||||
#if os(tvOS)
|
||||
private struct TVVideoActionsSection: View {
|
||||
@Bindable var settings: SettingsManager
|
||||
|
||||
var body: some View {
|
||||
Section {
|
||||
LabeledContent(String(localized: "settings.behavior.tvOSVideoTapAction")) {
|
||||
Picker(
|
||||
String(localized: "settings.behavior.tvOSVideoTapAction"),
|
||||
selection: $settings.tvOSVideoTapAction
|
||||
) {
|
||||
Text(VideoTapAction.openInfo.displayName).tag(VideoTapAction.openInfo)
|
||||
Text(VideoTapAction.playVideo.displayName).tag(VideoTapAction.playVideo)
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
.labelsHidden()
|
||||
}
|
||||
} header: {
|
||||
Text(String(localized: "settings.videoActions.header"))
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// MARK: - Mini Player Minimize Behavior Section (iOS 26+)
|
||||
|
||||
#if os(iOS)
|
||||
|
||||
Reference in New Issue
Block a user