📜  在 AVPlayer ViewController 中播放视频示例代码 Swift 代码示例

📅  最后修改于: 2022-03-11 15:00:58.779000             🧑  作者: Mango

代码示例1
let videoURL = URL(string: "https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4")
let player = AVPlayer(url: videoURL!)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
self.present(playerViewController, animated: true) {
    playerViewController.player!.play()
}