Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复iOS16以上调节屏幕亮度不丝滑的问题 #689

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Sources/KSPlayer/Video/IOSVideoPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ open class IOSVideoPlayerView: VideoPlayerView {
fullScreenDelegate?.player(isMaskShow: isMaskShow, isFullScreen: landscapeButton.isSelected)
}
}

#if !os(xrOS)
private var brightness: CGFloat = UIScreen.main.brightness {
didSet {
UIScreen.main.brightness = brightness
}
}
#endif

override open func customizeUIComponents() {
super.customizeUIComponents()
Expand Down Expand Up @@ -254,7 +262,7 @@ open class IOSVideoPlayerView: VideoPlayerView {
}
} else if KSOptions.enableBrightnessGestures {
#if !os(xrOS)
UIScreen.main.brightness += CGFloat(panValue(velocity: point, direction: direction, currentTime: Float(toolBar.currentTime), totalTime: Float(totalTime)))
brightness += CGFloat(panValue(velocity: point, direction: direction, currentTime: Float(toolBar.currentTime), totalTime: Float(totalTime)))
#endif
}
} else {
Expand Down