Commit e5ad276e authored by 李维's avatar 李维

使用widget进行全屏

parent 6505c14a
......@@ -602,8 +602,8 @@ export default class VideoPlayerComponent extends cc.Component {
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.width = this.node.width;
// videoContainer.height = this.node.height;
videoContainer.x = 0;
videoContainer.y = 0;
......@@ -624,13 +624,13 @@ export default class VideoPlayerComponent extends cc.Component {
controlBg.opacity = 240;
controlBg.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;
const videoNode = cc.find("Canvas/VideoNode");
const widget = videoNode.getComponent(cc.Widget)
widget.enabled = true;
this.time1 = setTimeout(() => {
this.videoPlayer.stayOnBottom = false;
cc.find(`Canvas/Controls`).active = false;
......@@ -649,6 +649,12 @@ export default class VideoPlayerComponent extends cc.Component {
cc.find(`Canvas/title`).active = !this.isVideoFull;
cc.find('Canvas/pageButton').active = true;
const videoNode = cc.find("Canvas/VideoNode");
const widget = videoNode.getComponent(cc.Widget)
widget.enabled = false;
videoNode.width = 967;
videoNode.height = 544;
const videoContainer = cc.find('Canvas/video_node');
videoContainer.width = this.tempPos.videoPos.width;
videoContainer.height = this.tempPos.videoPos.height;
......
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