WebGL VideoPlayer URL cookies and authorization

I am hosting my WebGL application in Azure with authentication enabled. The auth stuff is all stored in a cookie and it works great for most of the application, except for video. Looking at the request/response headers, I noticed that the request to the videos is not setting the cookie in the request header, while everything else does. Surely enough, turning off authentication makes it work fine.

Am I correct in my assumption that there is no way to get the VideoPlayer to play URLs that require authentication? Is there a way around this?

@DominiqueLrx

I have figured out that Unity is setting the crossorigin attribute on the HTML video to “anonymous” which per spec, sends the HTTP request header without cookies or authorization.

I was able to comment out that code in PlaybackEngines\WebGLSupport\BuildTools\lib\Video.js and now it seems to work correctly.

It would be nice if crossorigin were part of the API :wink:

1 Like