Search code examples
unity-game-enginewebassemblyunity-webgl

Unity WebGL build missing sharedassets1.resource on loading and not playing videos


In my project I have couple of "screens" which have videos playing on them. Usual .mp4 files attached to 3D object.

When I Play it in the editor - all works as expected. No errors. Not problems.

When I build the project for WebGL and play it online - everything works except these videos. Looking at the console I see this error:

sharedassets1.resource:1 Failed to load resource: the server responded with a status of 404 (File not found)

It repeats 6 times = I have 6 videos.

What is this file sharedassets1.resource? I don't see it anywhere? In the error the link to the file expects it here: http://localhost:8000/main/sharedassets1.resource - in the main folder. But that's my folder structure of the Successful build:

enter image description here

What should I check? What kind of settings might be not right?

Any ideas/knowledge appreciated! Thanks!

UPDATE WITH SOLUTION DETAILS:

Below suggestion can solve this. However this means that you need to check the format of your videos (mp4? mov? avi?) and convert them to something that WebGL can stream without any issues. For example .webm will work PERFECTLY but only if the game is played via chrome.


Solution

  • In editor create a folder with the name StreamingAssets and put your video files into it.