mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 10:55:03 +00:00
Add tvOS display frame rate and dynamic range matching
Lets the Apple TV switch its HDMI output to match the playing video's frame rate and dynamic range via AVDisplayManager.preferredDisplayCriteria, driven from MPV's container-fps and video-params/gamma. Two opt-in toggles (default off) live under Playback → Display on tvOS; both are no-ops on other platforms. Anchor an AVKit class symbol so the linker keeps AVKit linked — Swift only autolinks AVFoundation here, and without AVKit the UIWindow.avDisplayManager category isn't loaded at runtime.
This commit is contained in:
@@ -17,6 +17,9 @@ struct PlaybackSettingsView: View {
|
||||
AudioSection(settings: settings)
|
||||
SubtitlesSection(settings: settings)
|
||||
BehaviorSection(settings: settings)
|
||||
#if os(tvOS)
|
||||
TVDisplayMatchingSection(settings: settings)
|
||||
#endif
|
||||
QueueSection(settings: settings)
|
||||
#if os(iOS)
|
||||
OrientationSection(settings: settings)
|
||||
@@ -286,6 +289,31 @@ private struct BehaviorSection: View {
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - TV Display Matching Section
|
||||
|
||||
#if os(tvOS)
|
||||
private struct TVDisplayMatchingSection: View {
|
||||
@Bindable var settings: SettingsManager
|
||||
|
||||
var body: some View {
|
||||
SettingsFormSection(
|
||||
"settings.playback.tvDisplayMatching.header",
|
||||
footer: "settings.playback.tvDisplayMatching.footer"
|
||||
) {
|
||||
Toggle(
|
||||
String(localized: "settings.playback.tvDisplayMatching.frameRate"),
|
||||
isOn: $settings.tvMatchDisplayFrameRate
|
||||
)
|
||||
|
||||
Toggle(
|
||||
String(localized: "settings.playback.tvDisplayMatching.dynamicRange"),
|
||||
isOn: $settings.tvMatchDisplayDynamicRange
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// MARK: - Queue Section
|
||||
|
||||
private struct QueueSection: View {
|
||||
|
||||
Reference in New Issue
Block a user