ストリーミングURLがサーバーダウンであり、AVPlayer(Swift 2.2)でエラーが発生しました。Swift 2.2 AVPlayerのエラー処理
私はステータスとレートのオブザーバーを追加しましたが、その応答は期待通りでした。プレーヤーのステータスが再生準備が整っていることを示します。
playerItem = AVPlayerItem(URL: NSURL(string: streaminglink)!)
playerItem.addObserver(self, forKeyPath: "timedMetadata", options: .New, context: nil)
player = AVPlayer(playerItem:playerItem)
player.addObserver(self, forKeyPath: "status", options: NSKeyValueObservingOptions(), context: nil)
player.addObserver(self, forKeyPath: "rate", options: .New, context: nil)
player.rate = 1.0
player.play()
ヒントは参考になります。ありがとう。
あなたの提案と迅速な対応に感謝します。私はそれを試してみましょう。 –