How to configure Spatial Audio on a Video Material?, Compile error.

I've tried following apple's documentation to apply a video material on a Model Entity, but I have encountered a compile error while attempting to specify the Spatial Audio type.

It is a 360 video on a Sphere which plays just fine, but the audio is too quiet compared to the volume I get when I preview the video on Xcode. So I tried tried to configure audio playback mode on the material but it gives me a compile error: "audioInputMode' is unavailable in visionOS audioInputMode' has been explicitly marked unavailable here RealityFoundation.VideoPlaybackController.audioInputMode)"

https://developer.apple.com/documentation/realitykit/videomaterial/

Code:

let player = AVPlayer(url: url)

// Instantiate and configure the video material.

let material = VideoMaterial(avPlayer: player)

// Configure audio playback mode.

material.controller.audioInputMode = .spatial // this line won’t compile.

VisionOS 2.4, Xcode 16.4, also tried Xcode 26 beta 2. The videos are HEVC MPEG-4 codecs.

Is there any other way to do this, or is there a workaround available?

Thank you.

Hi bvsdev!

You can specify the audio rendering behavior of a view material by placing a spatial, ambient, or channel audio component on the same entity.

Thank you for calling attention to the inconsistency in documentation; we will get this updated.

Hello,

We have SpatialAudioComponent set on the sphere to play audio when certain Entities within the sphere are tapped. That part works great. However, when we switch out the image material on the sphere with a VideoMaterial, the spatial sound doesn't appear to be enabled. The volume actually decreases. Is there some meta data we are missing somewhere to spatially play the audio in the video?

Thank you! bvsdev

How to configure Spatial Audio on a Video Material?, Compile error.
 
 
Q