Search Unity

how to play video from adressable assetbundle on android

Discussion in 'Addressables' started by norbertdump, May 27, 2019.

  1. norbertdump

    norbertdump

    Joined:
    Sep 27, 2018
    Posts:
    4
    so there seem to be a lot of probems with playing videos from assetbundles on android, i tried to create a uncompressed adressables assetbundlegroup for the videos only but they would not load anyway.
    now i am wondering what would be the default way of loading videos via adressables on android?
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
  3. unity_SNfu4UkqyFqO7g

    unity_SNfu4UkqyFqO7g

    Joined:
    Aug 26, 2019
    Posts:
    1
  4. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    looks like someone decided this bug was "as designed". which means we need to now design a workaround. We've got it in the backlog. Not yet sure what our plan is, but we'll put something out there.
     
  5. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    Any update on this? I've hit a roadblock with this issue. Documentation points to use CacheInitializationSettings but it just prevents Addressables from properly initializing at all. More details here.
     
    flex_interativa likes this.
  6. Breathing

    Breathing

    Joined:
    Apr 16, 2016
    Posts:
    7
    Hey! Are there any updates?
     
  7. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
    I keep the Android version of my video in StreamingAssets and load it with that API.
     
  8. Breathing

    Breathing

    Joined:
    Apr 16, 2016
    Posts:
    7
    I have too many videos (about 300mb), streaming assets don't look cool here.
     
  9. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    The issue with CacheInitializationSettings has since been resolved. Just follow the docs, disable compression for the AssetGroup with videos and you should be ok.
     
    Breathing likes this.
  10. Patrick_PS

    Patrick_PS

    Joined:
    Sep 9, 2019
    Posts:
    154
    But if you disable compression you might as well use StreamingAssets...
    And you loose compression on other platform as well (iOS for example).
     
  11. phobos2077

    phobos2077

    Joined:
    Feb 10, 2018
    Posts:
    350
    There is no point compressing the bundle with videos which are themselves already compressed by the codec. (compression ratio is almost 100%)

    The benefits of using Addressable videos vs StreamingAssets:
    - Reference video clips natively vs loading by some hard-coded file names
    - Easily move your video bundles to content server w/o changing any code
    - Use consistent way to manage assets, less extra complexity etc. (assuming you're already using Addressables in the project)
     
  12. HH-Edmund

    HH-Edmund

    Joined:
    Jul 27, 2020
    Posts:
    2
    Hi, I'm facing issues with addressable videos on Android being downloaded from a CDN server.

    I have the CacheInitializationSettings compression unchecked as well as the addressable itself to be uncompressed. However I'm still facing the following error:
    AndroidVideoMedia::OpenExtractor could not translate archive:/CAB-5338c39097d925b8c3995b6501e678de/CAB-5338c39097d925b8c3995b6501e678de.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed.


    Versions used are:
    Unity 2019.4.3f1
    Addressables 1.8.5

    Any other idea or solutions for this? Here are my settings for my addressables



     
    Last edited: Oct 15, 2020
  13. HH-Edmund

    HH-Edmund

    Joined:
    Jul 27, 2020
    Posts:
    2
    Hi all just to update on the situation. I've managed to get the addressable videos working from a remote server by upgrading Addressables to version 1.16.6.

    I've also included this code in the Awake() function of my video downloader
    Code (CSharp):
    1.  private void Awake()
    2.     {
    3.         Caching.ClearCache();
    4.         Caching.compressionEnabled = false;
    5.     }
     
    DeveloperVix and Breathing like this.
  14. AritaDev

    AritaDev

    Joined:
    Aug 13, 2019
    Posts:
    13
    you can try to use
    Caching.compressionEnabled = false;
    before you load these videos.
     
    IvanIvanovP3 likes this.