Giter Club home page Giter Club logo

Comments (9)

kingslay avatar kingslay commented on August 18, 2024

这个应该是用了UIMenu 才会有这个问题。你可以换成不用UIMenu,

from ksplayer.

sunzongzheng avatar sunzongzheng commented on August 18, 2024

这个应该是用了UIMenu 才会有这个问题。你可以换成不用UIMenu,

试了下用UIAlertController也会,能提供一个示例吗

1-2.mp4

我是直接改的Demo仓库里的RootViewController

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")
    }
}

from ksplayer.

charsdavy avatar charsdavy commented on August 18, 2024

可以关闭自动旋转的支持吗?

from ksplayer.

kingslay avatar kingslay commented on August 18, 2024

你手机的锁定屏幕应该是打开的吧。所以这个走的应该是强制旋转,而不是自动旋转。

from ksplayer.

charsdavy avatar charsdavy commented on August 18, 2024

你手机的锁定屏幕应该是打开的吧。所以这个走的应该是强制旋转,而不是自动旋转。

可以在我手机屏幕锁定开关未开启的状态下,关闭KSPlayer的自动旋转吗?即我手动旋转手机,KSPlayer不自动响应旋转。

from ksplayer.

kingslay avatar kingslay commented on August 18, 2024

这个应该是可以的。

from ksplayer.

charsdavy avatar charsdavy commented on August 18, 2024

看你的文档说了支持自动旋转,但是代码中没看到哪个配置可以控制这个能力。

from ksplayer.

Kimentanm avatar Kimentanm commented on August 18, 2024

看你的文档说了支持自动旋转,但是代码中没看到哪个配置可以控制这个能力。

KSOptions.supportedInterfaceOrientations
用这个可以控制

from ksplayer.

charsdavy avatar charsdavy commented on August 18, 2024

那需要实时动态调整吗?不然如果只给了portrait,那不是不能手动旋转了?

from ksplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.