So I did some poking around to try to figure out how to test for the missing/failed features. The two big clues thrown in the console when the project loads are:
WEBGL11003: INVALID_VALUE: pixelStorei
and
WEBGL11072: INVALID_VALUE: texImage2D: This texture source is not supported
So the question for a newbie like me was, “How do I call these functions given that I’m not directly calling them in my scripts and since they occure when the project loads?”
So I went to the code where we load the video texture and noticed the following code for creating the video texture. Keep in mind that I only sorta understand the code given that I’ve mostly just copied it from the sample projects.
// Create a texture to hold the video frame data
var videoTexture = new pc.Texture(app.graphicsDevice, {
format: pc.PIXELFORMAT_R5_G6_B5,
autoMipmap: false
});
videoTexture.minFilter = pc.FILTER_LINEAR;
videoTexture.magFilter = pc.FILTER_LINEAR;
videoTexture.addressU = pc.ADDRESS_CLAMP_TO_EDGE;
videoTexture.addressV = pc.ADDRESS_CLAMP_TO_EDGE;
So the most interesting thing there to me was app.graphicsDevice. So I decided to find out what that thing was made of by calling it in a console.log() like this.
console.log (this.app.graphicsDevice);
It was much easier to navigate through all the stuff that this object contains using the IE 11 console. So I did that and found a category “gl” and a subcategory “[functions]”. Under that, I found both pixelStorei and texImage2D. Each of these had a length of “0”. So I made some console logs and checked the value in Firefox (and later Edge and Chrome) and saw that they had values of “2” and “6” respectively. Aha!! A clear difference in the two functions that were throwing the errors and presumably, these values must be non-zero for video to play. Also a zero suggests no value was set - presumably due to the initial error? BTW, while I was poking around I noticed a boolean “webgl2” that was showing “false” for IE 11 but true for the others.
So where I’m at now is this simple code that displays an alert if both pixelStorei and texImage2D = 0.
if(this.app.graphicsDevice.gl.texImage2D.length === 0 && this.app.graphicsDevice.gl.pixelStorei.length === 0){
alert("Your browser does not appear to support playing video for this app in WebGL and may render a blank screen. Please try a different browser in order to view this video.");
}
This tosses up an alert on IE 11 That you can dismiss with a click. It does not toss up an alert anywhere else so far. Of course, I only have IE 11 that won’t play video, so I’m not sure that this will catch all situations where video won’t play. But this check doesn’t fire anywhere else and I’ve used two browsers on iPad, Android Chrome (an old tablet and an old phone) or the other browsers I have on Win10. The video plays on all of these devices and no alert is displayed.
A final note:
unmaskedRenderer
reports back the video card in my machine
unmaskedVendor
reports back the “vendor” for the browser but seems unreliable since it reports “Google Inc.” under Firefox.
I’ve only included all this extra detail in the hopes that it will be useful for someone else tracking down this kind of problem/info.