Closed djokt closed 10 months ago
633
@Alanko5 So you mean that only using this code would solve the problem?
override func updateVideo(refreshRate: Float, isDovi: Bool, formatDescription: CMFormatDescription?) {
guard let displayManager = UIApplication.shared.windows.first?.avDisplayManager,
displayManager.isDisplayCriteriaMatchingEnabled,
!displayManager.isDisplayModeSwitchInProgress
else {
return
}
if let formatDescription {
if KSOptions.displayCriteriaFormatDescriptionEnabled, #available(tvOS 17.0, *) {
displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, formatDescription: formatDescription)
} else {
let dynamicRange = isDovi ? .dolbyVision : formatDescription.dynamicRange
displayManager.preferredDisplayCriteria = AVDisplayCriteria(refreshRate: refreshRate, videoDynamicRange: dynamicRange.rawValue)
}
}
#endif
}
Yes you need add bridging header for objc file header. https://github.com/kingslay/KSPlayer/blob/119f75a6251ac0807b9a529e8ef335c1033ba4ab/Demo/SwiftUI/Shared/AVDisplayCriteriaKS.h
On Tracy, when we activate "FormatDescription DisplayCriteria", Dolby Vision content is played as HDR10. (Tested on tvOS 17.1)