i am having an issue with playing back a video in my intro scene. i have added my video to the scene and it plays fine. i just want it to repeat again and again. is there an
Initialize your SKVideoNode with:
- (instancetype)initWithAVPlayer:(AVPlayer *)player
When setting up the AVPlayer use:
avPlayer.actionAtItemEnd = AVPlayerActionAtItemEndNone;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[avPlayer currentItem]];
this will prevent the player to pause at the end.
In the notification:
-(void)playerItemDidReachEnd:(NSNotification *)notification {
AVPlayerItem *p = [notification object];
[p seekToTime:kCMTimeZero];
}
this will rewind the movie.
(Credit to Bastian for his answer to this question)