Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Addressable videos not working on Android

Discussion in 'Addressables' started by rmuk, Nov 26, 2018.

  1. rmuk

    rmuk

    Joined:
    Feb 18, 2015
    Posts:
    34
    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:
    public void loadVideo(string imagePath)
    {
    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
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    965
    Thanks for the info, I've filed a bug in our system about this.
     
  3. rmuk

    rmuk

    Joined:
    Feb 18, 2015
    Posts:
    34
    Thanks! Is this on a public bug tracker so that I can just watch that page for updates, or is it internal only?
     
  4. MrCool92

    MrCool92

    Joined:
    Jul 13, 2015
    Posts:
    15
    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.
     
    Last edited: Apr 26, 2019
  5. Piflik

    Piflik

    Joined:
    Sep 11, 2011
    Posts:
    230
    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).
     
  6. nilsdr

    nilsdr

    Joined:
    Oct 24, 2017
    Posts:
    230
    MrCool92 likes this.