Commit e53860d5 authored by 李维's avatar 李维

修复全屏尺寸错误问题

parent c2d73f53
......@@ -579,14 +579,14 @@ export default class VideoPlayerComponent extends cc.Component {
cc.find(`Canvas/title`).active = !this.isVideoFull;
const videoContainer = cc.find('Canvas/video_node');
this.tempPos.videoPos = { x: videoContainer.x, y: videoContainer.y, width: videoContainer.width, height: videoContainer.height };
this.tempPos.videoPos.width *= videoContainer.scale;
this.tempPos.videoPos.height *= videoContainer.scale;
this.tempPos.videoPos = { x: videoContainer.x, y: videoContainer.y, width: videoContainer.width, height: videoContainer.height, scale: this.videoPlayer.node.scale };
// this.tempPos.videoPos.width *= videoContainer.scale;
// this.tempPos.videoPos.height *= videoContainer.scale;
videoContainer.width = this.node.width;
videoContainer.height = this.node.height;
videoContainer.x = 0;
videoContainer.y = 0;
console.log(this.tempPos.videoPos)
cc.find(`Canvas/videolist`).active = false;
const controls = cc.find(`Canvas/Controls`);
......@@ -601,15 +601,13 @@ export default class VideoPlayerComponent extends cc.Component {
controlBg.opacity = 240;
controlBg.width = this.node.width;
this.videoPlayer.node.height = this.node.height;
this.videoPlayer.node.width = this.node.width;
const sx = this.node.width / this.videoPlayer.node.width;
const sy = this.node.height / this.videoPlayer.node.height;
const scale = Math.min(sx, sy)
this.videoPlayer.node.scale = scale
this.videoPlayer.node.x = 0;
this.videoPlayer.node.y = 0;
setTimeout(() => {
this.videoPlayer.node.width = Math.min(this.node.width, this.node.height * 16 / 9);
}, 100);
this.time1 = setTimeout(() => {
this.videoPlayer.stayOnBottom = false;
cc.find(`Canvas/Controls`).active = false;
......@@ -634,8 +632,9 @@ export default class VideoPlayerComponent extends cc.Component {
videoContainer.x = this.tempPos.videoPos.x;
videoContainer.y = this.tempPos.videoPos.y;
this.videoPlayer.node.width = this.tempPos.videoPos.width;
this.videoPlayer.node.height = this.tempPos.videoPos.height;
// this.videoPlayer.node.width = this.tempPos.videoPos.width;
// this.videoPlayer.node.height = this.tempPos.videoPos.height;
this.videoPlayer.node.scale = this.tempPos.videoPos.scale;
this.videoPlayer.node.x = videoContainer.x;
this.videoPlayer.node.y = videoContainer.y;
......
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