Commit 9c556676 authored by limingzhe's avatar limingzhe

fix: debug

parent 0c9ea653
...@@ -183,6 +183,9 @@ cc.Class({ ...@@ -183,6 +183,9 @@ cc.Class({
clearTimeout(this.time1); clearTimeout(this.time1);
} }
this.time1 = setTimeout(() => { this.time1 = setTimeout(() => {
if (this.isDestroy) {
return;
}
this.videoPlayer.stayOnBottom = false; this.videoPlayer.stayOnBottom = false;
cc.find(`Canvas/Controls`).active = false; cc.find(`Canvas/Controls`).active = false;
}, 6000); }, 6000);
...@@ -292,6 +295,9 @@ cc.Class({ ...@@ -292,6 +295,9 @@ cc.Class({
texJsonData: this.data.imgAni.tex, texJsonData: this.data.imgAni.tex,
texPngData: this.data.imgAni.png texPngData: this.data.imgAni.png
}); });
if (this.isDestroy) {
return;
}
const animaNode = animNode['animaNode']; const animaNode = animNode['animaNode'];
animaNode.x = 500; animaNode.x = 500;
...@@ -326,6 +332,9 @@ cc.Class({ ...@@ -326,6 +332,9 @@ cc.Class({
this.videoPlayer.remoteURL = this.data.video_url; this.videoPlayer.remoteURL = this.data.video_url;
// }); // });
await this.initView(); await this.initView();
if (this.isDestroy) {
return;
}
}); });
if(window.CustomEvent){ if(window.CustomEvent){
...@@ -467,11 +476,17 @@ cc.Class({ ...@@ -467,11 +476,17 @@ cc.Class({
this.videoPlayer.node.height = this.node.height; this.videoPlayer.node.height = this.node.height;
this.videoPlayer.node.width = this.node.width; this.videoPlayer.node.width = this.node.width;
setTimeout(() => { setTimeout(() => {
if (this.isDestroy) {
return;
}
// IOS下视频的全屏适配比例有问题,所以做一个计算 // IOS下视频的全屏适配比例有问题,所以做一个计算
this.videoPlayer.node.width = Math.min(this.node.width, this.node.height*16/9); this.videoPlayer.node.width = Math.min(this.node.width, this.node.height*16/9);
}, 100); }, 100);
this.time1 = setTimeout(() => { this.time1 = setTimeout(() => {
if (this.isDestroy) {
return;
}
this.videoPlayer.stayOnBottom = false; this.videoPlayer.stayOnBottom = false;
cc.find(`Canvas/Controls`).active = false; cc.find(`Canvas/Controls`).active = false;
}, 3000); }, 3000);
...@@ -522,6 +537,7 @@ cc.Class({ ...@@ -522,6 +537,7 @@ cc.Class({
onDestroy() { onDestroy() {
if(this.time1) { clearTimeout(this.time1); } if(this.time1) { clearTimeout(this.time1); }
this.isDestroy = true;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment