Hello, I just upgraded to the 5.6 VideoPlayer from using the old WebGLMovieTexture from the asset store. I have a bunch of video clips on my server that are too big to fit in the build. When i want to play one i would give WebGLMovieTexture a link like this http://www.mysite.com?video=1 http://www.mysite.com?video=2 This worked fine in the browser using WebGLMovieTexture. When I do the same thing with the new 5.6 VideoPlayer, it works in the editor, but when i compile for WebGL and run it in the browser it doesnt work However if i give VideoPlayer the URL to the actual mp4 file on my server like this http://www.mysite.com/path/intro.mp4 it works. This means that the new VideoPlayer wont play a video unless the link contains .mp4 or some kind of indication as to the type of the video. If the type isnt there, the VideoPlayer doesnt even try to download the video from the URL (I checked the browser network access). For security reasons, im unable to use the link that contains the actual path, so if i fake the url like this http://www.mysite.com?t=.mp4&video=2 by faking .mp4 in the URL it start playing a little then it gives another error Media Foundation : The current media has type changed for one or more streams in file then stops playing. I think this is a bug because none of these problems exist with the VideoPlayer while its running in the editor, and im giving it the same links as the WebGLMovieTexture which works fine in the browser. Anybody have any idea how to fix this? Thanks
Just discovered that WebGLMovieTexture dont work in 5.6 either...... So since VideoPlayer cant play videos at a URL that doesnt have the video type in it, I decided to downgrade again for the 4th time from 5.6 back to 5.4
You could probably do something with a UnityWebRequest where you first retrieve the redirected url and then feed that to the video player class. https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-url.html I agree though it should work without having to do that, but for now...
kognito1, Right now when i do videoPlayer.prepare() or videoPlayer.Play(), if the URL string doesnt contain "mp4" somewhere in it the videoPlayer doesnt even try to download the video, it does nothing at all. So if i use UnityWebRequest, how do i force feed the videoPlayer with the data stream from the video? Is there API for that? I would happily try it because i WANT to use 5.6, it just doesnt want to play nice!
Hey everyone! The VideoPlayer initially needed to finish with the proper filename extension in order for the file to be recognized as a movie file. This was fixed however and it now supports a) having a query string after the filename and b) having no filename extension at all. The playback initialization logic looks like it would handle this case correctly, but there seems to be something else at play that breaks the assumptions. @nsmith1024 : can you please file a bug report (hopefully with the troublesome URLs) with this so we can have a look? Also, can you give us a bit more info about the "Media Foundation : The current media has type changed for one or more streams in file" error? This is happening in the Windows editor or in your WebGL build? Thanks for reporting this, hopefully we'll be able to address quickly! Dominique A/V developer at Unity.
Hello DominiqueLrx, Sorry but i cant seem to remember if the "media foundation...." error happened in the editor or in the browser. Unfortunately i cant recreate the issue because it happened in Unity 5.6 which i discarded because i couldnt get the VideoPlayer to work, i went back to 5.4 using the old WebGLMovieTexture. I will file a bug report thanks!
Hello Dominique, I really would like to upgrade to 5.6 to get the cool new features, but i got stuck with the VideoPlayer not working as described above, so i had to stay with 5.4 (which is good too!) You said it was fixed in a version of 5.6, is there a way i could get that version with the fix in it? Thanks so much
What I meant was, does your http://www.mysite.com?video=1 link redirect to http://www.mysite.com/path/intro.mp4? If so you can use unitywebrequest to get the redirected link and then feed that into the video class. In Unity 5.7 (2017.1) you can use unitywebrequest to directly download the video file (https://docs.unity3d.com/2017.1/Doc...nce/Networking.UnityWebRequestMultimedia.html).
kognito, Yes the actual file represented by the first link "http://www.mysite.com?video=1" is the "intro.mp4" file. But the actual path to the mp4 file cant be sent back because the real path is not accessible from the internet for security reasons. The server fetches the actual file and streams it back, the real path cant be access from the internet because then anybody would be able to access the file without following the proper channels (hacking).
Then unfortunately it seems like you'll have to file a bug report with @DominiqueLrx . Perhaps even just private messaging him the link to the video on your site will suffice if you can't file a bug report.
I send message to DominiquelRx but no response in over a week. I want to use 5.6 but the video doesnt work for me because it wont work for a URL that doesnt contain the file type. Does anybody know if this was fixed yet?
I submitted a bug report using the unity editor long ago, then it sent me an email containing a link to the bug, but then when i went to the link, it said bug not found or some such thing. is there a website where i can submit the bug? Thanks