0

我试图在 AVPlayerViewController 中通过 url 播放视频。我的故事板中设置了 AVPlayerViewController 并且 segue 连接工作正常,但播放按钮被划掉,视频不会播放。那我能做什么?我已经测试了以编程方式创建 AVPlayerViewController 并添加了“允许任意加载”。还是行不通。

performSegueWithIdentifier("videoImpression", sender: self)    

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    if (segue.identifier == "videoImpression") {
        let destination = segue.destinationViewController as! AVPlayerViewController
        let url = NSURL(string: "http://download.wavetlan.com/SVV/Media/HTTP/H264/Other_Media/H264_test8_voiceclip_mov_480x320.mov")
        destination.player = AVPlayer(URL: url!)
    }
}

视频播放器截图

4

1 回答 1

0

可能你忘记录play视频了?

destination.player?.play()
于 2016-02-27T16:04:03.227 回答