Commit 7ff94b42 authored by 李维's avatar 李维

fix: 调整视频组件对齐屏幕时间

parent 8abaa35e
...@@ -544,10 +544,15 @@ cc.Class({ ...@@ -544,10 +544,15 @@ cc.Class({
setTimeout(() => { setTimeout(() => {
this.videoCanPlay = true; this.videoCanPlay = true;
if (window && window["air"] && this.pageLoaded) { if (window && window["air"]) {
if(this.pageLoaded) {
cc.find("Canvas/VideoPlayer").x = 0;
this.alignVideoPlayer();
window["air"].hideAirClassLoading();
}
} else {
cc.find("Canvas/VideoPlayer").x = 0; cc.find("Canvas/VideoPlayer").x = 0;
this.alignVideoPlayer(); this.alignVideoPlayer();
window["air"].hideAirClassLoading();
} }
}, 100); }, 100);
...@@ -574,10 +579,15 @@ cc.Class({ ...@@ -574,10 +579,15 @@ cc.Class({
this.videoplayer.remoteURL = this.data.video_url; this.videoplayer.remoteURL = this.data.video_url;
this.addServerListener(); this.addServerListener();
this.pageLoaded = true; this.pageLoaded = true;
if (window && window["air"] && this.videoCanPlay) { if (window && window["air"]) {
if(this.videoCanPlay) {
cc.find("Canvas/VideoPlayer").x = 0;
this.alignVideoPlayer();
window["air"].hideAirClassLoading();
}
} else {
cc.find("Canvas/VideoPlayer").x = 0; cc.find("Canvas/VideoPlayer").x = 0;
this.alignVideoPlayer(); this.alignVideoPlayer();
window["air"].hideAirClassLoading();
} }
}); });
}, },
...@@ -694,6 +704,7 @@ cc.Class({ ...@@ -694,6 +704,7 @@ cc.Class({
playerWidget.enabled = true; playerWidget.enabled = true;
this.videoplayer.width = canvas.width; this.videoplayer.width = canvas.width;
} }
playerWidget.updateAlignment();
}, },
...@@ -708,7 +719,7 @@ cc.Class({ ...@@ -708,7 +719,7 @@ cc.Class({
// this.videoplayer.node.on('stopped', this.onStoped, this); // this.videoplayer.node.on('stopped', this.onStoped, this);
this.videoplayer.node.on('completed', this.onCompleted, this); this.videoplayer.node.on('completed', this.onCompleted, this);
this.alignVideoPlayer(); // this.alignVideoPlayer();
// this.initPic(); // this.initPic();
// this.initBtn(); // this.initBtn();
// this.initIcon(); // this.initIcon();
......
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