Disable live camera feed in ARSCNView?

Viewed 177

Is there any way to disable the live camera feed and pass the custom video as input in ARSession? I want to achieve Record & Replay ARSession by code.

1 Answers

There you go :)

    var originalSource: if originalSource == nil || scene.background.contents as? UIColor != UIColor.black
    
    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
    if originalSource == nil {
    originalSource = sceneView.scene.background.contents
    
    sceneView.scene.background.contents = UIColor.black
    
    } else {
    sceneView.scene.background.contents = originalSource
    
    }
    
    }
Related