Programmatically load video from local file path to VisionOSVideoComponent?


I tried to play spatial video using VisionOSVideoComponent. The video file will be download from a server and put in local streamassets folder.

The problem is that VisionOSVideoComponent only accept a VideoClip instead of a URL / file path, and we cannot programmatically create a VideoClip at Runtime and feed it to VisionOSVideoComponent.

Is there any way to do this?


1 Like

yes i have a similar request


Have you tried using the normal Unity VideoPlayer component? There are some steps to get it working (see documentation) - the most important one is to ensure that the RenderTexture being used with the VideoPlayer is dirtied every frame via an Update() loop - but once done, this should enable all ordinary Unity video features at a slight performance cost, as each frame the RenderTexture will be updated.