【发布时间】:2016-06-22 04:09:54
【问题描述】:
我想重用 AVPlayerItem,但不断收到此错误:
An AVPlayerItem cannot be associated with more than one instance of AVPlayer
在尝试重用它之前,我像这样销毁以前的 AVPlayer:
[self.player pause];
[self.player replaceCurrentItemWithPlayerItem:nil];
self.player = nil;
为什么 AVPlayerItem 仍然关联,我该如何断开它?
这是一个完整再现问题的要点(顺便说一句,只有 50 行):https://gist.github.com/sbiermanlytle/14a6faab515f7691b810789086ae9e50
您可以通过创建一个新的单视图应用程序并用该代码替换 ViewController 实现来运行它。
【问题讨论】:
标签: ios avfoundation avplayer