Skip to content

Commit

Permalink
Merge pull request #689 from Kimentanm/kimen
Browse files Browse the repository at this point in the history
fix: 修复iOS16以上调节屏幕亮度不丝滑的问题
  • Loading branch information
kingslay authored Dec 12, 2023
2 parents c2a88e1 + c0e64b6 commit 1502c63
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit 1502c63

Please sign in to comment.