发布微信小游戏报了一个错误,跟下面链接的问题一模一样:
https://forum.cocos.com/t/cc-rendertexture-create-gl-teximage2d/58801
后来按照引导,修改引擎源码后,重新编译gulp build
重新发布后,提示错误:
Failed to load scene: Error: [AssetLibrary] loading JSON or dependencies failed: Uuid Loader: Deserialize asset [res/import/af/afd741b1-54fd-4e34-9510-55a168d3f154.json] failed : ReferenceError: HTMLVideoElement is not defined
at CCClass.216.game.once._p._setImage (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:38169:163)
at CCClass.216.game.once._p.update (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:38152:22)
at CCClass.216.game.once._p.handleLoadedTexture (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:38213:18)
at 128._ccsg.Label.WebGLRenderCmd.127.proto._updateTexture (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:25198:23)
at 128._ccsg.Label.WebGLRenderCmd.127.proto._bakeLabel (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:25145:14)
at TheClass._updateLabel (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:24421:127)
at TheClass.getContentSize (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:24433:16)
at TheClass._setDimensions (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:24565:28)
at TheClass.setContentSize (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:24386:14)
at 105._ccsg.EditBox.WebGLRenderCmd.105.proto._updateLabelPosition (http://127.0.0.1:33015/game/cocos2d-js.f098b.js:20439:25)
补充下图片:
1.这张是修改引擎源码的
2.微信开发工具报错
在加载首个场景的时候就报错,请教如何解决?
再补充下图片:
源码改成:
_p._setImage = function(img, width, height, glFmt, premultiplyAlpha) {
var gl = this._gl;
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha);
var ret2 = img instanceof HTMLCanvasElement && !(img instanceof Uint8Array);
var ret4 = img instanceof HTMLVideoElement;
sys.platform === sys.QQ_PLAY || ret2 || img instanceof HTMLImageElement || ret4 ? gl.texImage2D(gl.TEXTURE_2D, 0, glFmt.internalFormat, glFmt.format, glFmt.pixelType, img) : gl.texImage2D(gl.TEXTURE_2D, 0, glFmt.internalFormat, width, height, 0, glFmt.format, glFmt.pixelType, img);
};
提示HTMLVideoElement is not defined?求救SOS!!!


