AssetsBundle + Video ! Help please

Hello,

I’m facing a major problem, and I believe in its current state it might be unsolvable…

I’m creating an application that mixes films and 3D. I have some very large videos to play (8K or 12K), and I can’t use Unity’s native video player because VisionOS only supports video playback via RenderTexture, which causes huge lags. I already detailed this problem in a previous post:

Therefore, I’m forced to play my videos with the VisionOSVideoComponent. This requires having my videos in the “StreamingAssets/VisionOSVideoClips” folder:
https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@2.1/manual/VideoComponent.html

However, my videos are well over 4GB, which is the limit imposed by the Apple Store.

So, I created a functional system for downloading my VideoClips using AssetBundles and Addressables, in order to reduce the build size. My plan was to download the VideoClips, assign them to my VisionOSVideoComponent at runtime, and copy them into the StreamingAssets folder. But that folder is read-only in a build.

I see no way to play high-quality videos (>4GB) on Unity and publish to the Apple Store. I hope I’m mistaken…

StreamingAssets are part of the original app bundle, which cannot be modified. But there are designated locations for you to download data to, like Application.persistentDataPath or Application.temporaryCachePath.

If you’re using Addressables, it should already take care of downloading and caching the bundles at the right location, though?

Hello mate thanks :slight_smile:

Yes indeed, you are right.
But in order to use the VisionOsVideoComponent. I absolutly need to have my files in StreamingAssets, as it’s written in the documentation …

This is a HUGE limitation for everybody are making an application with a lot of videos …

Oh, yeah, looks like VisionOsVideoComponent is not actually using the video asset and just guessing the StreamingAssets path based on it. But this means it needs direct access to a video file, putting the video into Addressables/Asset Bundles packs it into a bundle file and makes it incompatible with this approach.

You could try to request Unity to add a method to play a video using a file path on VisionOsVideoComponent. Then you could download the video file directly to a writeable location and play it from there.

Otherwise, you’d need to replicate what Unity did and implement your own native video player interface for Unity. HISPlayer seems to be an option but maybe overkill for your needs and they don’t have public prices.

Yes you exactly get my issue eheh,

Thats why I’m asking here, and hoping that someone at Unity’s add something to refer a path in the VisionOsVideoComponent instead of a VideoClip that is linked to a file in StreamingAssets …

I didnt know HISPlayer, I will look at that, maybe it can helps me.

Thanks a lot !

I’ve just tested the HISPlayer Asset, it’s pretty clean but it also use RenderTexture to display videos. And in the case where the videos are too heavy (more than 2K), it lags a lot …

Anyway, thanks for the help Adrian !

Yes, I believe we could add a workaround in a future version that would allow you to load from an arbitrary path/URL. I’d suggest submitting that to our road map, and @vcheung-unity may want to know about the request in order to add it to the list.

That would be absolutly awesome !

I’ve just create a ticket in your roadmap, the title is “VisionOSVideoComponent Improvement”

Have you got any idea when the next version will be available ?

Thanks again :slight_smile: