无法使用AvPlayerViewController播放视频

时间:2017-02-06 10:31:38

标签: ios swift swift3 xcode8

我想通过以下代码在tableview单元格中使用swift 3播放来自Server的视频。当我从bundle播放视频然后成功播放。但是从服务器无法播放。我怎么玩?

let url = URL(string: "http://68d07921.ngrok.io/modules/users/client/videos/video.mp4")
    avpController = AVPlayerViewController()
    avpController.player = AVPlayer.init(url: url!)
    avpController.view.frame = self.videoPlayerView.bounds
    avpController.showsPlaybackControls = false
    self.videoPlayerView.addSubview(avpController.view)
    self.videoPlayerView.autoresizesSubviews = true

enter image description here

0 个答案:

没有答案