We cannot play video which is attached to VisionOSVideoComponent directly

There is video clip serializefield on VisionOSVideoComponent.
However, only attaching video clip to serialize-field, it doesn’t work well.

Could not find url ~/PolySpatial1.1.4Sample/Assets/StreamingAssets/PolySpatialVideoClips/Download.mp4 for id 56338:0, if this is a networked app, there is no current support for video players over network./build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Platforms/Unity/UnitySceneGraph.cs:1293)

If we copy video file to Assets/StreamingAssets/PolySpatialVideoClips/ , we can play video.
I think this behaviour is kind of bug. (Only put the video file under StreamingAssets/, we cannot set the file to serialize-field)

Do we have to put the video file both Assets/Resources and Assets/StreamingAssets/PolySpatialVideoClips/ ?

I believe that that is indeed necessary, based on the documentation, although @vcheung-unity would be able to confirm.

1 Like

Unfortunately, yes, that is still a requirement. The real requirement is the clip being in Assets/StreamingAssets/PolySpatialVideoClips/ so that we can pass it on to RealityKit’s video player, the clip being added to Assets/Resources is mostly for getting the name of the clip and the URL.

Would it help if, instead, you just had to drop the clip into Assets/StreamingAssets/PolySpatialVideoClips/ and type in the name of the clip into some URL input field in VisionOSVideoComponent to reduce the amount of clip resource management you had to do?

1 Like

I’m not OP, but that would probably be helpful. As far as I can tell it’s currently necessary to have two copies of the clip in the project?

As an aside, it’d also be nice if we could access the underlying AVPlayer to enable things like seeking (though maybe it’s possible to obtain it by getting the RealityKit VideoPlayerComponent from the RK entity corresponding with the object in native code?)

1 Like

Surfacing the underlying AVPlayer to Unity (or otherwise exposing access to it) might be tricky, though in theory, yes, if you got the entity corresponding with the video player game object, you could access the AVPlayer directly. That being said, I can see about adding seek functionality to VisionOSVideoComponent directly.