【发布时间】:2014-07-01 04:03:55
【问题描述】:
假设队列已经初始化,我看到的将项目添加到队列中的唯一方法是:
- (void)insertItem:(AVPlayerItem *)item afterItem:(AVPlayerItem *)afterItem
文档说Pass nil to append the item to the queue.
那么是不是不能在队列的顶部添加一个项目呢?我希望能够重播之前播放的内容,而无需再次删除和重新排队。
【问题讨论】:
-
怎么样:
AVPlayerItem *currentItem = [yourAVPlayer currentItem]; [yourAVPlayer insertItem:currentItem afterItem:currentItem];?请注意,您可能必须执行 `[yourAVPlayer insertItem:[currentItem copy] afterItem:currentItem];`。 -
我不确定它是如何工作的,因为我的新项目还没有被插入到队列中。但你实际上让我思考,我能够弄清楚。请参阅下面的答案。
标签: ios avplayer avqueueplayer