I tried create loop by AVQueuePlayer, this method has delays between end and start play.
for looping AVQueuePlayer i use this code:
1
2 3 4 5 6 |
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.mPlayerItem]; [self player].actionAtItemEnd = AVPlayerActionAtItemEndNone; |
and playerItemDidReachEnd
1
2 3 4 5 |
- (void)playerItemDidReachEnd:(NSNotification *)notification
{ AVPlayerItem *p = [notification object]; [p seekToTime:kCMTimeZero]; } |
Another solution without hiccups/delays based on AVMutableComposition!
Continue reading