-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
开启屏幕锁定后观看横屏视频,点击倍速画面会转回竖屏 #580
Comments
这个应该是用了UIMenu 才会有这个问题。你可以换成不用UIMenu, |
试了下用 1-2.mp4我是直接改的Demo仓库里的 private class TableViewCell: UITableViewCell {
public let vodListButton = UIButton()
#if os(iOS)
fileprivate let playerView = IOSVideoPlayerView()
#else
fileprivate let playerView = CustomVideoPlayerView()
#endif
override public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(playerView)
playerView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
contentView.heightAnchor.constraint(equalTo: contentView.widthAnchor, multiplier: 0.65),
playerView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 5),
playerView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
playerView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
playerView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),
])
vodListButton.tintColor = .white
if let vodListButton = vodListButton as? UIButton {
vodListButton.setImage(UIImage(systemName: "list.and.film"), for: .normal)
vodListButton.setImage(UIImage(systemName: "list.and.film"), for: .selected)
}
vodListButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
vodListButton.widthAnchor.constraint(equalToConstant: 30),
])
playerView.toolBar.addArrangedSubview(vodListButton)
vodListButton.addTarget(self, action: #selector(presentAlert), for: .touchUpInside)
}
@objc func presentAlert() {
let alertController = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .default))
var topController = UIApplication.shared.keyWindow?.rootViewController
while let presentedViewController = topController?.presentedViewController {
topController = presentedViewController
}
topController?.present(alertController, animated: true, completion: nil)
}
@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
} |
可以关闭自动旋转的支持吗? |
你手机的锁定屏幕应该是打开的吧。所以这个走的应该是强制旋转,而不是自动旋转。 |
可以在我手机屏幕锁定开关未开启的状态下,关闭KSPlayer的自动旋转吗?即我手动旋转手机,KSPlayer不自动响应旋转。 |
这个应该是可以的。 |
看你的文档说了支持自动旋转,但是代码中没看到哪个配置可以控制这个能力。 |
KSOptions.supportedInterfaceOrientations |
那需要实时动态调整吗?不然如果只给了portrait,那不是不能手动旋转了? |
Demo项目中可以复现,如果不锁定屏幕&横屏观看就没有问题
auto-rotate.mp4
The text was updated successfully, but these errors were encountered: