SpriteKit; How to loop a SKVideoNode?

295 views Asked by At

I am currently trying to play a video in a loop via SpriteKit. I know that I need AVFoundation and the AVPLayer() for this, however I don't know how to initialize and use this... Could someone help me with this?

Here is my current code block:

let mapSeriallyVideo = SKVideoNode(fileNamed: "map_serially.mp4")
                mapSeriallyVideo.position = CGPoint(x: 850, y: 1100)
                addChild(mapSeriallyVideo)
                mapSeriallyVideo.play()
0

There are 0 answers