Addressable videos not working on Android

I have a mobile project (both iOS/Android) and I recently tried moving all of the video assets we have over to addressables. On iOS builds they play just fine, however on Android they do not load. I am seeing the following error:
AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-5ac6a43aade2e32bbe0b94c06f8a0126/CAB-5ac6a43aade2e32bbe0b94c06f8a0126.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.

Right below that is this:
AndroidVideoMedia: Error opening extractor: -10004

Here is the code used to load the video:

{
Addressables.LoadAsset<VideoClip>(imagePath).Completed += onLoadDone;
}

private void onLoadDone(UnityEngine.ResourceManagement.IAsyncOperation<VideoClip> obj)
{
GetComponent<VideoPlayer>().clip = obj.Result;
}```

Some other bits of info:
- The file plays perfectly if i just include it in the project and don't use it with addressables
- The file is HEVC

Thanks for the info, I’ve filed a bug in our system about this.

Thanks! Is this on a public bug tracker so that I can just watch that page for updates, or is it internal only?

This is because videos are inside compressed bundle and should not be… Just put them in streaming assets and stream them via url or uncompressed bundle.

Tip: enable send ready events of video player, subscribe to on frame ready and enable video canvas to avoid “last video frame” bug.

edit: correcting myself… this behavior is not a bug.

I get the same error with videos I try to load from the disk (not part of the apk, nor in an asset bundle or in streaming assets, just a video file in /storage/emulated/0/BUNDLE_IDENTIFIER).

This issue has been around for ages and is by design, read all about it here

[ Load VideoClip in assetbundle on Android ]( Load VideoClip in assetbundle on Android page-2)

1 Like

Hi @unity_bill
I have similar error on Android with loading of the Video from Addressable with Uncompressed remote group. Adressable version 1.6.2.
Unity version 2018.4.17.
Android version 9.0
Do you have plan to fix this issue in upcoming releases? And if not, are there any workarounds for loading video from addressable remote group on Android?
Thanks.

JFYI error message is the same:
AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-0e93fe237ec0f897d04b37ebb9d6d416/CAB-0e93fe237ec0f897d04b37ebb9d6d416.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.
AndroidVideoMedia: Error opening extractor: -10004

1 Like

For anyone who has the same issue caused by addresable system , try to build addressable (window->asset managment → addresable → build → new build → default build script) before exporting.

The following settings worked for me:

  • Turn off Cache Compression in script: Caching.compressionEnabled = false;
  • Set Assetpack Compression to None
2 Likes

i try everything and none work :confused:

Hi there! Running into the same issues all are having with running video from addressables on Android. One question, what’s the impact will setting compressionEnabled to false have? Does that mean ALL addressable assets are now unable be be compressed in the local cache (thus bloating size on disk more)? Am I some how selectively able to set compression enabled for the majority of assets and have it non enabled for videos. I tried putting all my videos in an Addressable group with compression and caching turned off and this does not seem to work.

I also read that this might be fixed in Unity 2020 but we’re trying to stick to 2019 LTS until 2020 LTS is ready. So looking for workaround basically that doesn’t completely turn off compression for all addressables.

Any help would be greatly appreciated!

I have put the video in its own addressable group and only set that group to not use compression (group inspector => Compressions => Uncompressed).

1 Like

Can u show your inspector and what code did u use?

The only relevant thing I changed in the inspector is compression.

By code you mean how I load it? I have an AssetReference in a script in the scene and during runtime I call AsyncOperationHandle<VideoClip> handle = Addressables.LoadAssetAsync<VideoClip>(assetReference.RuntimeKey);

In the callback method I use handle.Result to get the clip.
Don’t forget to release the handle after playing the video.

Thanks for ur reply)

Weird I’ve tried the same thing. Where I have an addressable group that’s dedicated to storing videos and it’s set to uncompressed. I wonder if it’s related to me instantiating a single prefab which then loops through addressable dependencies (one being the video). I am not directly loading the video as you are. I’ll try to do a direct load and report back. Thanks!

I literally just ran into the same thing. Yes, all the asset bundles will be stored as uncompressed in the cache just so you can get the video files to work. I don’t think this is an acceptable solution. The only alternatives to make video files work that I can see is either embedding the video files in the client, or not having caching for video files.

FWIW not really a solve. But we transitioned to using Video Player’s URL video playback instead of Addressables for this and it works pretty well. Again, not really a solve but a nice alternative to explore if you’re able to.

As of Unity 2020.2 this has been fixed, but only for Android 9 and up

1 Like