AV PRO - How to play video from asset bundle?

Hello!

I have large videos in an asset bundle that I need to play using AV Pro in an Oculus GO.

Right now I have the bundle created (with uncompressed videos), and can load it using AssetBundle.LoadFromFileAsync().

In order to fetch a video from the bundle, I’m using bundle.LoadAsset, which returns a VideoClip.

The issue is that AV pro needs an absolute path in order to play the video, and I’m struggling to find the path of the loaded asset.

The other option is to convert the VideoClip into a byte, as AV Pro can open videos from byte as well.

Does anyone know where the path of the loaded asset is, or how to convert a VideoClip into a byte?

Thanks!

For anyone having this issue, this is how to solve it:

  1. When creating the bundle, save your videos as .bytes files (not .mp4)

  2. You then want to use bundle.LoadAsset or bundle.LoadAssetAsync<> to load the .bytes file.

  3. Use File.WriteAllBytes to write the file into local storage and save it to StreamingAssets or DataPath.

  4. From there, you can feed the path to AVPro and play the video