AVPlayer 重複播放

2015-11-30  本文已影响571人  ShinrenPan
_player = [AVPlayer playerWithPlayerItem:item];
_player.actionAtItemEnd = AVPlayerActionAtItemEndNone; // set this

[[NSNotificationCenter defaultCenter]addObserver:self
                                        selector:@selector(__playerItemDidPlayToEndTimeNotification:)
                                            name:AVPlayerItemDidPlayToEndTimeNotification
                                          object:nil];

- (void)__playerItemDidPlayToEndTimeNotification:(NSNotification *)sender
{
    [_player seekToTime:kCMTimeZero]; // seek to zero
}
上一篇下一篇

猜你喜欢

热点阅读