AVPlayerItem错误:操作已停止

时间:2016-12-12 10:10:44

标签: ios swift avplayer

我想用AVPlayer播放YouTube视频。

这是我的代码:

let playerItem = AVPlayerItem(asset: AVAsset(url:URL(string: "https://www.youtube.com/watch?v=xxxxxxxxx")!))
player = AVPlayer(playerItem : playerItem)
playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = self.view.bounds
player.play()

AVPlayerItemStatus传递失败并显示以下错误:

Error Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo={NSUnderlyingError=0x1702443e0 {Error Domain=NSOSStatusErrorDomain Code=-12939 "(null)"}, NSLocalizedFailureReason=The server is not correctly configured., NSLocalizedDescription=Operation Stopped}

有人可以帮我解决这个问题吗?

PS:当我将AVPlayer更改为AVQueuePlayer时,它会有效!

0 个答案:

没有答案