guard let url = Bundle.main.url(forResource: "demoVideo2", withExtension: "m4v") else { return }
// Create the AVPlayer
let player = AVPlayer(url: url)
playerLayer.videoGravity = .resizeAspectFill
// Create the video material
let videoMaterial = VideoMaterial(avPlayer: player)
// Create a sphere and set its material to the video material
let sphere = MeshResource.generateSphere(radius: 0.5) // You can adjust the radius as needed
let sphereEntity = ModelEntity(mesh: sphere, materials: [videoMaterial])
sphereEntity.transform = Transform(scale: [1, 1, 1], rotation: simd_quatf())
sphereEntity.position = [0,0,-2]
// Add the sphere entity to the scene
let anchor = AnchorEntity()
anchor.addChild(sphereEntity)
content.add(anchor)
// Play the video
player.play()
Here is the code that I have been using to try and change a simulated scene to a 360 degree panorama video. Unfortunately, the closest I got to was a sphere with the video in it.
Is there anything that you can do to help me with the code? I could use some help. I can't use ARKit because it is not available in xrOS.
Also, is there an option in the build settings that can make the screen transform to a fully immersive one as you enter the app meaning without seeing the simulator around you. Thank you.