我正在尝试使AVPlayer在屏幕的边缘到边缘工作,但是它不能像横向模式中从左到右的两侧都是黑色,并且内容仅在中间播放一样。我是Swift的新手,所以没有经验可以帮助我,这就是我的代码。
import UIKit
import MediaPlayer
import AVKit
import AVFoundation
class PlayerVC: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let videoURL = URL(string: "http://somevideo.m3u8")!
let player = AVPlayer(url: videoURL)
let playerViewController = AVPlayerViewController()
playerViewController.player = player
self.present(playerViewController, animated: true) {
playerViewController.player?.play()
}
}
}