How to play video with AVPlayerViewController (AVKit) in Swift
Swift 3.x – 5.x Necessary: import AVKit, import AVFoundation AVFoundation framework is needed even if you use AVPlayer If you want to use AVPlayerViewController: 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() } or just AVPlayer: let videoURL = URL(string: “https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4”) … Read more