Essentially I have the following function that plays through the footage once and stops - how can I continue to loop the playback non-stop. What can be done in this use case?
Below is what I currently have for playback:
func playVideo() {
guard let path = Bundle.main.path(forResource: "intro", ofType: "mp4") else {
return
}
let player = AVPlayer(url: URL(fileURLWithPath: path))
let playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = self.view.bounds
playerLayer.videoGravity = .resizeAspectFill
self.videoLayer.layer.addSublayer(playerLayer)
player.play()
}