Search code examples
unity-game-engineunity-webgl360-panorama

Unity - 360 video on Web using panoramic Skybox


My Unity project is really simple :

I'm rendering a 360° video on a texture. It plays via a Video Player applied to a panoramic Skybox. As described here : https://docs.unity3d.com/Manual/VideoPanoramic.html

It works fine on all platforms, except for the Web GL build. It compiles, plays, but the background (skybox) is black.

Since it's pretty new, I found nothing on the subject,

Is there a limitation I'm not aware of ?

Thank you guys,

EDIT :

Firefox Logs :

enter image description here

The last line says : - Unable to read the media. No codec found for the required formats : video/x-ms-wmv


Solution

  • The workaround is to call your videos from an URL inside the StreamingAssets Folder instead of doing it locally.

    So :

    VideoPlayer vp;
    vp.clip = clips [idVid]; //Local array of vids
    vp.Play();
    

    Becomes :

    VideoPlayer vp;
    string url = Application.streamingAssetsPath+"/"+idVideo+".mp4;
    vp.url = url;
    vp.Prepare();
    vp.Play();