我用这个视频播放没有混蛋。但是如何在循环中播放secondVideoItem ..在视频播放后我想将此视频添加到 10-15time。只有secondVideoItem不是firstVideoItem。
NSString *secondVideoPath = [[NSBundle mainBundle] pathForResource:@"video1" ofType:@"mp4"];
NSString *firstVideoPath = [[NSBundle mainBundle] pathForResource:@"video2" ofType:@"mp4"];
AVPlayerItem *firstVideoItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:firstVideoPath]];
AVPlayerItem *secondVideoItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:secondVideoPath]];
AVQueuePlayer* queuePlayer = [AVQueuePlayer queuePlayerWithItems:[NSArray arrayWithObjects:firstVideoItem, secondVideoItem,nil]];
AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:queuePlayer];
avPlayer.actionAtItemEnd = AVPlayerItemStatusReadyToPlay;
layer.frame = CGRectMake(0, 0, 1024, 768);
[self.view.layer addSublayer:layer];
[queuePlayer play];
提前感谢