Hello, With Unity 5.6+ version we don't have www.Movie anymore as it has been deprecated. It also looks like the UnityWebRequest doesn't support video streaming neither. In brief, as far as I understood, the only way to stream video now is with the VideoPlayer component. And after digging the docs I couldn't find any API method or example showing how to add an HTTP header when using an url as video source. The server where the media I'm serving to my users lives needs an Authorization header so right now there's no way for me to stream videos into my application. Did someone face this situation? Any ideas? Thanks, Ernesto.
Edit: I made this little script to check is basic in-url auth could wor and well, it looks like it's not supported. To make i clear I tried to load the video by formatting the url like: https://user:mail@url.domain. Code (csharp): string protocol = "http://"; string auth = Email + ":" + Password + "@"; if (url.StartsWith("http://")) url = url.Substring("http://".Length); else if (url.StartsWith("https://")) { url.Substring("https://".Length); protocol = "https://"; } else Debug.LogError("Unexpected : " + url); url = protocol + WWW.EscapeURL(auth) + url; Debug.Log("Final url: " + url); return url;
I have the same issue. As mentioned above, Basic authentication with http does not seem to be supported in the Videoplayer component. You can use a auth Header from script to query your Server and for example get audiofiles back with the www.GetAudioClip() or www.GetMovieTexture() however they currently have no method like www.GetVideoClip() and as Long as that is the case authentication by URL is not going to be available. There was another Forum post where someone asked when www.getVideoClip() will be available but I think None of the unity representatives gave an answer.
I think you can only play pure video files with the video player. So your url must point to a videofile ending with for example .mp4, .mov, or .wmv. Have you tried http: (not https), and without auth? https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html