Vote up: https://issuetracker.unity3d.com/is…webgl-builds-when-the-video-is-loaded-via-url
Hi, I’ve upgraded my project to unity 2019.3 (from 2019.2) as hdpi screens got fixed but unfortunately videos stopped working.
WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty
I’ve tried both RenderTexture and Camera plane as VideoPlayer target. Loading video with url and starting to play it with prepareCompleted event.
I’ve checked Windows and Android platforms.
Happens on GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, v);
in:
function _JS_Video_UpdateToTexture(video, tex) {
var v = videoInstances[video];
if (!(v.videoWidth > 0 && v.videoHeight > 0))
return false;
if (v.lastUpdateTextureTime === v.currentTime)
return false;
v.lastUpdateTextureTime = v.currentTime;
GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, true);
if (v.previousUploadedWidth != v.videoWidth || v.previousUploadedHeight != v.videoHeight) {
GLctx.deleteTexture(GL.textures[tex]);
var t = GLctx.createTexture();
t.name = tex;
GL.textures[tex] = t;
GLctx.bindTexture(GLctx.TEXTURE_2D, t);
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_S, GLctx.CLAMP_TO_EDGE);
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_T, GLctx.CLAMP_TO_EDGE);
GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_MIN_FILTER, GLctx.LINEAR);
GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, v);
v.previousUploadedWidth = v.videoWidth;
v.previousUploadedHeight = v.videoHeight
} else {
GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tex]);
GLctx.texSubImage2D(GLctx.TEXTURE_2D, 0, 0, 0, GLctx.RGBA, GLctx.UNSIGNED_BYTE, v)
}
GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, false);
return true
}