Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Problems loading Video Files into Player Using Addressables

Discussion in 'Addressables' started by mandivision, Mar 22, 2020.

  1. mandivision

    mandivision

    Joined:
    Mar 17, 2019
    Posts:
    8
    Hi There,
    Currently trying to use addressable assets to load videos into my project but keep getting errors.
    First calling this in the OnEnable function:

    Then calling this to load the clip into the video player:
    Code (CSharp):
    1.  
    2. void Awake(){
    3.         Caching.ClearCache();
    4.         Caching.compressionEnabled = false;
    5.         videoPlayer=GetComponent<VideoPlayer>();
    6.         introVid.LoadAssetAsync<VideoClip>().Completed += OnVideoLoaded;
    7.        
    8.  
    9.     }
    Code (CSharp):
    1.    
    2. void OnVideoLoaded(AsyncOperationHandle<VideoClip> clip){
    3.         var videoclip=clip.Result;
    4.         videoPlayer.clip=videoclip;
    5.         Debug.Log("succesfully downloaded " + videoclip);
    6.         videoPlayer.Play();
    7.    
    8.     }
    The debug is saying that the clip was successfully downloaded with the proper asset:
    "succesfully downloaded introwAMA.m4v"

    Put I'm getting these two errors:
    Player failed to load "unityvideo://library/metadata/50/501e965e158e54b39b498e9c4e3a6e0b.resource"​

    "VideoPlayer cannot play clip : Assets/introwAMA.m4v Cannot read file."​
     
  2. mandivision

    mandivision

    Joined:
    Mar 17, 2019
    Posts:
    8
    Update, the problems seems to be with having Unity transcode the video files.

    Transcoding seems to be incompatible with Addressables