【发布时间】:2012-06-24 17:45:21
【问题描述】:
我需要在我的AVQueuePlayer 中创建类似无限循环的东西。特别是,一旦最后一个组件播放完毕,我想重播AVPlayerItems 的整个NSArray。
我必须承认我实际上不知道如何实现这一点,希望你能给我一些线索。
【问题讨论】:
-
您是卡在这一点上还是只需要从起点创建它?
-
我现在实际上如何创建它并播放所有 AVQueuePlayers,我现在正在寻找在最后一个 QVPlayerItem 完成后重新启动播放器。
-
-(void) playVideoAtIndex:(NSInteger)index{ [self performSelector:@selector(setObservationInfo)]; currentIndex = index; AVPlayerItem *videoItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:[arrVideoList objectAtIndex:index]]]; }需要检查的地方,if (currentIndex < [arrVideoList count]-1) { currentIndex++; } else { currentIndex = 0; } [self playVideoAtIndex:currentIndex]; -
所以您使用的是包含视频的数组?这个数组包含视频的路径对吗?
-
没错,你只需要传递路径,当你得到最后一个时,你可以重置回第一个索引。
标签: iphone ios avfoundation avplayer avqueueplayer