Search Unity

VideoPlayer triggered in Timeline doesn't work from Asset Bundle

Discussion in 'Editor & General Support' started by WaveVRStefan, Feb 13, 2020.

  1. WaveVRStefan

    WaveVRStefan

    Joined:
    Aug 9, 2018
    Posts:
    2
    Hello,

    We've been working on an interactive experience that has a large part of its visuals driven from a Unity Timeline. On the timeline are a number of VideoPlayer components with video clips that are setto Play on Awake and get turned on / off over the course of the timeline.

    When tested in the Editor, it works just fine. However, when we assemble it all into an asset bundle and load it up for playback from the bundle. the video clips fail to load. The errors we see look like so:

    Code (CSharp):
    1. WindowsMediaFoundation received empty file D:/Perforce/ssinclair_STEFANWARE_PERF-TW-Release/Clients/Unity/Project/archive:/BuildPlayer-Show_Main/BuildPlayer-Show_Main.resource
    2.  
    3. VideoPlayer cannot play clip : C:/Perforce/TeamDesktop_DESKTOP-HIH1F7S_2070/Clients/Unity/Project/Assets/Show/Videos/video_loop_01.mp4
    When I inspect the bundle contents. the video clips are there. Similarly when I inspect the Timeline component from the asset bundle at run time, the references to the video clips are all good. I've tried compressed and uncompressed bundles, no difference.

    This is on Windows 10, standalone build. Is there an issue with VideoClips loading from asset bundles through a VideoPlayer component?
     
  2. WaveVRStefan

    WaveVRStefan

    Joined:
    Aug 9, 2018
    Posts:
    2
    In case anyone comes across this thread - we were able to work around the issue in our case by changing our VideoPlayer assets to use URL references to the raw video files, re-encoded to a lower bit-rate, in order to get them to work for us. Not an ideal workflow by any means, and unfortunately very unhelpful error messages from the Unity Player. Video Player support still feels half-baked.
     
  3. timetosmile

    timetosmile

    Joined:
    Oct 4, 2017
    Posts:
    4
    yeah I'm here with the same problem.

    Would be nice if there is a conviened solution.
     
  4. timetosmile

    timetosmile

    Joined:
    Oct 4, 2017
    Posts:
    4
    Ok, I followed this video


    there I realized that I have to call
    Code (CSharp):
    1. myAssetBundle.LoadAsset<VideoClip>("assetname");
    instead of .. idk

    sry, while I tried to fix my problem I forgot what the problem causes. But I know that this code solved my problem. Maybe it helps you too.
     
    xrchapter3 likes this.