简体   繁体   中英

Customize AVPlayerViewController

I'm using AVPlayerViewController to play video in my application, I don't want to make the player from scratch. is there a way to add some other extra UI components and functionality to the AVPlayerViewController?

class AVKitViewController: AVPlayerViewController {

    private let url =
        URL(string:
            "https://www.digikala.com/mag/wp-content/uploads/2019/09/Call-of-Duty-Modern-Warfare-Story-Trailer.mp4")

    override func viewDidLoad() {
        super.viewDidLoad()

        let video = AVPlayer(url: url!)
        player = video

        player?.play()
    }
}

It looks like there is no way to do such thing. the only way possible, is to use AVFoundation to create our own AVPlayer from scratch.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM