Initialize your SKVideoNode with
- (instancetype)initWithAVPlayer:(AVPlayer *)player
When setting up AVPlayer, use:
avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerItemDidReachEnd:) name:AVPlayerItemDidPlayToEndTimeNotification object:[avPlayer currentItem]];
this will prevent the player from pausing at the end.
In the notice:
-(void)playerItemDidReachEnd:(NSNotification *)notification { AVPlayerItem *p = [notification object]; [p seekToTime:kCMTimeZero]; }
it rewinds the film.
(Confirm Bastian for your answer to this question )
source share