Simple question I can\'t seem to find an answer to for some reason.
How do you loop AVPlayer in Swift?
numberOfLoops = -1 only works for AVAudioPlayer
<
Alternatively, you can use the block-based NSNotificationCenter API:
func loopVideo(videoPlayer: AVPlayer) {
NSNotificationCenter.defaultCenter().addObserverForName(AVPlayerItemDidPlayToEndTimeNotification, object: nil, queue: nil) { notification in
videoPlayer.seekToTime(kCMTimeZero)
videoPlayer.play()
}
}