0
我想在TVOS上用swift播放playerViewController的視頻。我有視頻播放正常,但我想循環播放視頻。這裏是我的代碼到目前爲止:如何使用playerViewController快速製作視頻循環?
override func viewDidAppear(_ animated: Bool) {
let videoURL = URL(string: "https://url-to-video.com/video.mp4")
let player = AVPlayer(url: videoURL!)
let playerViewController = AVPlayerViewController()
playerViewController.player = player self.present(playerViewController, animated: true) {
playerViewController.player!.play()
}
}
任何幫助表示讚賞。謝謝
非常感謝。這工作完美,順利循環視頻:) –