Hello,
Does anybody know if it’s possible to add an HTTP header to a VideoPlayer url? I need to pass a username/password to my server when downloading an mp4 file…
Thanks!
Hello,
Does anybody know if it’s possible to add an HTTP header to a VideoPlayer url? I need to pass a username/password to my server when downloading an mp4 file…
Thanks!
Bump
Unfortunately, you can’t do it directly in the VideoPlayer. What you need to do is use an UnityWebRequest and SetRequestHeader. You can then set the VideoPlayer.url to the downloaded file path when the file has finished downloading. It is a pain to manage, and we want to improve this. I sent your feedback for this feature to the team.
Thanks for the update about that – still helpful to know that you can do this by downloading the file directly!
Can this be done in WebGL without the user saving the video file to disk? I have clients who need to play videos hosted on 3rd party servers where the video can’t be accessed without including an auth token in the header. The inability to add the token to the VideoPlayer’s request header is turning into a big obstacle for us.
Unfortunately, no, and we know it is a big issue. I recommend anyone with this issue add your feedback to our roadmap so we can work on this. https://unity.com/roadmap/unity-platform/audio-video