Hi,
Thanks for reaching out and sorry to hear you’re having trouble!
As you’ve noticed, VisionOSVideoComponent
currently heavily relies on RealityKit’s native AVPlayer
for video playback, and as far as I’m aware, AVPlayer
does not support playing MV-HEVC
with alpha channels. I know AVPlayer
does support non-spatial videos (HEVC
) with transparency, but I’m not sure when that feature will be brought over to MV-HEVC
, and I would encourage filing feedback to Xcode to push for it.
I can certainly take a look at what it would take to allow control over ImmersiveViewingMode
through Unity - at a short glance, I think we’d have to change some underlying architecture to support it. ImmersiveViewingMode
is provided through VideoPlayerComponent
and we’re using just plain old AVPlayer
so users can apply the VideoMaterial
to arbitrary meshes.
For both this feature and for better support around video seeking, I would encourage you to submit both ideas to the road map to signal support for these features.
Alternatively, if you’re interested in just displaying a video without actually applying it to a specific mesh, you may be able to write some Swift code to create a VideoPlayerComponent
and attach it to a Unity-created entity. After an Xcode build, you should be able to access the video file at ../Data/Raw/VisionOSVideoClips
. You should be able to access the entity corresponding to a specific Unity instance id through PolySpatialWindowManagerAccess.entitiesForUnityInstanceId()
- please see the HelloWorldContentView.swift
file contained in the SwiftUI sample scene to see specific examples of how it functions.
You will need to delete the ModelComponent
on the entity corresponding with the Unity-side GameObject MeshRenderer
that VisionOSVideoComponent
is being applied to, and then add a VideoPlayerComponent
to it:
entity.components.remove(ModelComponent.self)
let videoPlayerComponent = VideoPlayerComponent(avPlayer: player)
entity.components.set(videoPlayerComponent)
Alternatively, you can disable VisionOSVideoComponent
entirely by using PolySpatialSettings - Disabled Features
. You’ll need to manually import the video file into your Xcode project, but you won’t need to delete the ModelComponent
.
I’m very sorry this couldn’t have been a more affirmative answer, but hopefully this’ll help defray the feature gap somewhat!