1

I use SCNRenderer with Vuforia. On iOS 13, video content not showing, sound is heard. I tried to set the video material in the following ways:

material.diffuse.contents = AVPlayer

or

material.diffuse.contents = SKVideoNode

But none of these methods work on iOS 13. Unfortunately, I don’t have the opportunity to use SCNView to render a SCNScene, since it is impossible to use with Vuforia. Maybe someone has already encountered this? Or does someone know how to otherwise render the AVPlayer in the SCNScene?

  • More information is required to help you solve that issue. Errors found in the console and more detailed information about the specific video file you're using can help. – mnuages Sep 23 '19 at 12:57
  • @mnuages unfortunately, no errors are observed. On iOS 12 and iOS 11 it works correctly. Video file mp4, h264 codec. In UIKit the AVPlayer normally displays all the videos that I'm trying to play. You can understand by the sound that the player plays them correctly, for some reason they cannot be rendered by the SCNRenderer and only on iOS 13. – Daniil Sencov Sep 23 '19 at 15:27
  • It looks like a bug of iOS 13, since before that a couple of years everything worked fine – Daniil Sencov Sep 23 '19 at 15:34

1 Answers1

0

Root Cause:

In my app, we have multiple types of AR modes.

When we switch between these modes with the UISegmentedControls, I have to “reset” the scene by clearing any AR nodes that should not be there. (e.g: previous mode's AR nodes not interfering with the new nodes)

I did this with the following code:

func resetARScene() {

    self.node.geometry?.firstMaterial?.normal.contents = nil

    self.node.geometry?.firstMaterial?.diffuse.contents = nil

    self.node.removeFromParentNode()

    self.node = SCNNode()




    DispatchQueue.main.async {

        self.sceneView.scene.rootNode.addChildNode(self.node)
    }

}

The issue arises when in iOS 12, we could re-add the childNode back to the sceneView. Somehow in iOS 13 it doesn’t add properly.

Solution:

func resetARScene() {

    self.node.enumerateChildNodes { (existingNode, _) in
        existingNode.removeFromParentNode()
    }

}

This function achieves the same purpose without removing the node from the sceneView and the video plays. I hope this helps, although I am not sure if your circumstances are the same as mine.

Bau
  • 36
  • 3