Commit 17d22488 authored by 李维's avatar 李维

修复暂停播放失效的问题

parent 683ddab7
......@@ -831,8 +831,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
3.5660000000000505,
-173.50300000000007,
3.566,
-182.545,
0,
0,
0,
......
......@@ -530,10 +530,16 @@ export default class VideoPlayerComponent extends cc.Component {
this.videoPlayer.node.x = videoContainer.x;
this.videoPlayer.node.y = videoContainer.y;
this.videoPlayer.play();
this.playButton.node.active = false;
this.pauseButton.node.active = true;
}
pause() {
this.videoPlayer.pause();
this.playButton.node.active = true;
this.pauseButton.node.active = false;
}
forward() {
......@@ -582,7 +588,9 @@ export default class VideoPlayerComponent extends cc.Component {
videoContainer.height = this.node.height;
videoContainer.x = 0;
videoContainer.y = 0;
console.log(this.tempPos.videoPos)
const maskCom = videoContainer.getComponent(cc.Mask);
maskCom.enabled = false;
cc.find(`Canvas/videolist`).active = false;
const controls = cc.find(`Canvas/Controls`);
......@@ -635,6 +643,9 @@ export default class VideoPlayerComponent extends cc.Component {
this.videoPlayer.node.x = videoContainer.x;
this.videoPlayer.node.y = videoContainer.y;
const maskCom = videoContainer.getComponent(cc.Mask);
maskCom.enabled = true;
cc.find(`Canvas/videolist`).active = this.data.dataArr.length>1;
const controls = cc.find(`Canvas/Controls`);
......@@ -674,25 +685,25 @@ export default class VideoPlayerComponent extends cc.Component {
if (ct) {
this.updateBarByTime(ct);
}
// if (this.videoPlayer.isPlaying()) {
// if (this.playButton.node.active) {
// this.playButton.node.active = false;
// this.restartButton.node.active = false;
// }
// if (!this.pauseButton.node.active) {
// this.pauseButton.node.active = true;
// }
// } else {
// if (!this.playButton.node.active) {
// this.playButton.node.active = true;
// }
// if (this.pauseButton.node.active) {
// this.pauseButton.node.active = false;
// }
// if (this.restartButton.node.active) {
// this.playButton.node.active = false;
// }
// }
if (this.videoPlayer.isPlaying()) {
if (this.playButton.node.active) {
this.playButton.node.active = false;
this.restartButton.node.active = false;
}
if (!this.pauseButton.node.active) {
this.pauseButton.node.active = true;
}
} else {
if (!this.playButton.node.active) {
this.playButton.node.active = true;
}
if (this.pauseButton.node.active) {
this.pauseButton.node.active = false;
}
if (this.restartButton.node.active) {
this.playButton.node.active = false;
}
}
}
}
}
\ No newline at end of file
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