[LayaAir 2.0]Cannot read property 'offCanplay' of null
游戏公测的时候,后台很多这样的报错。
估计是因为网络比较满的情况,在文件下载完毕之后,sound对象已经被销毁了,所以自己加了一个判断。
Cannot read property 'offCanplay' of null
TypeError: Cannot read property 'offCanplay' of null
at n.onCanPlay (https://usr/game.js:39:9226)
at Function.t (https://lib/WAGameSubContext.js:2:153278)
Cannot read property 'offCanplay' of null;at audioContext.oncanplay callback function我查了一下,也就一个地方,用到,在laya.wxmini.js
TypeError: Cannot read property 'offCanplay' of null
at n.onCanPlay (https://usr/game.js:39:9226)
at Function.t (https://lib/WAGameSubContext.js:2:148325)
onCanPlay() {
this.loaded = true;
this.event(Laya.Event.COMPLETE);
this._sound.offCanplay(null);
}
估计是因为网络比较满的情况,在文件下载完毕之后,sound对象已经被销毁了,所以自己加了一个判断。
onCanPlay() {有遇到一样问题的哥们吗?
this.loaded = true;
this.event(Laya.Event.COMPLETE);
if(this._sound){
this._sound.offCanplay(null);
}
}
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复