AVplayer


//定义一个视频文件路径        let filePath = Bundle.main.path(forResource: "HanDou", ofType: "mp4")        let videoURL = URL(fileURLWithPath: filePath!)        //定义一个视频播放器,通过本地文件路径初始化        let player = AVPlayer(url: videoURL)        let playerViewController = AVPlayerViewController()        playerViewController.player = player        self.present(playerViewController, animated: true) {            playerViewController.player!.play()        }

[如果您在阅读我的文章时有疑问 , 请点击这里](https://www.jianshu.com/p/1e68be1e6646)

你可能感兴趣的:(AVplayer)