Videoplayer WebGL "Can't play movie" Error

I am streaming a .mp4 into a videoplayer using the URL property. This works perfectly in editor, but once I deploy the webgl build onto our server, I get a “Can’t play movie” error. Should this be working at this point in the beta, or am I hitting a known bug?

var path = “http://www.efsdeveloper.com/mission01/kitchen/StreamingAssets/Videos/prologue_p1.mp4”;
Debug.Log("load video at: " + path);
videoPlayer.errorReceived += OnErrorRecieved;
videoPlayer.loopPointReached += OnEndReached;
videoPlayer.url = path;
videoPlayer.audioOutputMode = VideoAudioOutputMode.AudioSource;
AudioManager.GetInstance().RegisterAudio(“video”, null);
_audio = AudioManager.GetInstance().Play(“video”, “video”);
videoPlayer.SetTargetAudioSource(0, _audio.Source);
videoPlayer.controlledAudioTrackCount = 1;
videoPlayer.Play();
Debug.Log(“video player play”);

From the browser console:
Can’t play movie [http://www.efsdeveloper.com/mission01/kitchen/StreamingAssets/Videos/prologue_p1.mp4]

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/WebGL/runtime/DebugBindings.gen.cpp Line: 51)

Hi DGordon,
Other users have reported similar problems too. It was discussed in this thread:

If that doesn’t help, please file a bug report with a minimal reproduction case and reply in here with the case #.

Also check your CORS setup on your server. You can test it with www.test-cors.org

@Schubkraft Thanks, I didn’t know I could test it there. From what I can tell, it passed … posted the final results below.

@LeonhardP I noticed that they discuss a problem with video and WebGL, but the error message being discussed is not the same as I am getting. Furthermore, it seems like it was a CORS issue for their problem, but according to the test I just performed above, my CORS are fine for the video. Of course, I’m just going by the result of the test … there may be other issues I don’t know about?

CORS results:
XHR status: 200
XHR status text: OK
XHR exposed response headers:
Last-Modified: Tue, 14 Feb 2017 19:04:12 GMT
Content-Type: video/mp4
Fired XHR event: loadend

I filed a bug report under my work e-mail. The case # is 881503_59h929r6sg4e957i

Please note that this can be replicated by simply adding a videoplayer to an empty scene and assigning http://www.efsdeveloper.com/mission01/videotest/prologue_p1.mp4 as the URL. It works in the editor, but does not work when posted as WebGL (at least on my end).

You can see an isolated test of the WebGL at http://efsdeveloper.com/mission01/videotest/.

This was using the latest Unity version of 5.6.0b8

1 Like

Any idea what the status on this is? If this won’t be fixed within the next … say … four months-ish, we really need to know so we can look into alternative methods.

Thanks.

Hi DGordon,

We found and fixed an important problem with textures in WebGL that caused the images to not show up when using WebGL 2.0 (but work with WebGL 1.0). This fixed the bug you reported and you will see the fix appear in beta 11.

Sorry for the inconvenience and thanks for logging this bug: this is what made us realize this recent degradation in our WebGL implementation.

Dominique
A/V developer at Unity

1 Like

Thank you for your response. I guess we’ll plan for using the new video player (as well as continue testing out new features coming down the pike) :)!