0

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

tinkz
  • 100
  • 2
  • 17
  • Are you using a server to test your WebGL build? If not you probably need to use one as WebGL with textures/videos/images can't be run without a server. There's a simple one [here](https://greggman.github.io/servez) and a list of others [here](https://stackoverflow.com/questions/12905426/what-is-a-faster-alternative-to-pythons-http-server-or-simplehttpserver). – gman Nov 30 '18 at 14:15
  • I had no idea, it's my first WebGl build ! I'm trying that asap and will get back to you, thanks man – tinkz Nov 30 '18 at 14:18
  • I can't read French or whatever language that error message is in but it looks like you're trying to play a .wmv file. That might also be a problem. wmv is a Windows only format. Browsers generally only support .mp4. Chrome and Windows also support .webm Try converting your movie to .mp4. You can use [handbrake](https://handbrake.fr/) to do that – gman Nov 30 '18 at 14:21
  • Nope, same issue with the server, thank you though – tinkz Nov 30 '18 at 14:22
  • I know, that's what the last line is saying. But those videos are mp4 to begin with – tinkz Nov 30 '18 at 14:23

1 Answers1

0

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();
tinkz
  • 100
  • 2
  • 17