Video player doesn't work in webgl

Hi ,

Im trying to set up a virtual expo with some video players on planes showing animations made by students.

The webgl build is hosted on a cors enabled server, and the video players are set to URL with the adress of the files on the server. The files do play when the server adres url is used directly in the browser.
I’ve been reading up on such issues and made sure also a .htaccess file is available in all directories.

Here’s currently the best working build https://piazza.me/vr

My problems :

  • There are multiple video players in the game, but most don’t play. Results vary on computers & browsers…
    This is the main problem atm.
    The only video that seems to work directly is warped as texture around a 3D object. The other 4 videos , being played on a plane object stay blank.
    This goes for the hosted version shared above ,as on a firefox webgl build running of my localhost.

This is the error i see in firefox browser console, and it builds up quickly :
Error: WebGL warning: texSubImage2D: Source must not be null.

In chrome i see :
f5c2d259-8b68-45bf-a94e-f819b35a9e67:8 WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty

[.WebGL-00000200E4BC6230] GL_INVALID_OPERATION: Level of detail outside of range.

Can anyone please have a look at this project ? Thank you so much

this worked for me
https://stackoverflow.com/questions/54856356/webgl-unity-build-wont-play-video

Following…

I have the same problem… video’s hosted on same domain.
You can see the video downloading in (F12) network monitor.

But they are not playing.

Platform: webgl /unity 2019.3

Errors:
GL_INVALID_OPERATION: Level of detail outside of range.
&
WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty

no one a clue ?

The issue is already raised - Unity Issue Tracker - [WebGL] VideoPlayer is not rendered in WebGL builds when the video is loaded via URL

For the time begin, you can downgrade your project 2019.2 in order to make Video Player work in WebGL.

Any Luck?? I’ve having the same issue except my video wont play on a webGL build at all no matter the browser. Also downgrading to 2019.2 didnt work for me. I’m a noob, can someone tell me what im doing wrong?

,Only managed to get my videos to work in webgl with the proAV video asset from the store , tried so much other things it drove me nuts

Unity 2019.3.8f1: For the most common problem I was able to get ride of it by forcing the user to click something in order to launch the video. It seams an interaction is needed to let the browser think that the video url request is the result of a user decision. Now for Chrome compatibility I did solve my problem by using Unity 2019.3.15f1 Video.js file instead of 2019.3.8f1 one. A diff reveals a single open GL line modification that is the source of all evils (see attachment).

This worked for me:
Put your video in SteamingAssets. and in script use this

public VideoPlayer videoPlayer;
void Start()
{
videoPlayer.url = System.IO.Path.Combine(Application.streamingAssetsPath, “Sample.mp4”);
}

For me I put my videos on a blob (to make it a direct link) and assign the url to the VideoPlayer during runtime. And then use VideoPlayer.Play() to play it. It works both in editor and WebGL.

VideoPlayer is setup like this:
176912-vp.png

I also get warnings “WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty” but the videos play just fine in browser.