Commit c4902839 authored by liujiangnan's avatar liujiangnan

feat: 控制条的显隐

parent 1cb849ab
This diff is collapsed.
......@@ -176,6 +176,17 @@ cc.Class({
});
this.videoPlayer.node.on('clicked', () => {
console.log('clicked');
if (this.isVideoFull) {
this.videoPlayer.stayOnBottom = true;
cc.find(`Canvas/Controls`).active = true;
if (this.time1) {
clearTimeout(this.time1);
}
this.time1 = setTimeout(() => {
this.videoPlayer.stayOnBottom = false;
cc.find(`Canvas/Controls`).active = false;
}, 6000);
}
});
this.videoPlayer.node.on('playing', () => {
console.log('playing');
......@@ -268,7 +279,7 @@ cc.Class({
});
this.videoPlayer.node.off(cc.Node.EventType.TOUCH_START);
this.videoPlayer.node.on(cc.Node.EventType.TOUCH_START, (e) => {
console.log("screen TOUCH_START");
console.log("screen TOUCH_START");
this.triggerInteractive()
});
const pgBar = this.ProgressBar;
......@@ -465,6 +476,7 @@ cc.Class({
cc.audioEngine.playEffect(audio.clip, false);
},
time1: null,
isVideoFull: false,
fullScreen() {
if (this.isVideoFull) {
......@@ -472,6 +484,7 @@ cc.Class({
}
console.log("====进入全屏===");
this.isVideoFull = true;
this.videoPlayer.stayOnBottom = true;
cc.find(`Canvas/Controls/fullscreen`).active = !this.isVideoFull;
cc.find(`Canvas/Controls/exitfull`).active = this.isVideoFull;
......@@ -482,6 +495,11 @@ cc.Class({
this.videoPlayer.node.width = this.node.width;
this.videoPlayer.node.height = this.node.height;
this.time1 = setTimeout(() => {
this.videoPlayer.stayOnBottom = false;
cc.find(`Canvas/Controls`).active = false;
}, 3000);
},
exitFullScreen() {
......@@ -500,8 +518,16 @@ cc.Class({
this.videoPlayer.node.width = 1377;
this.videoPlayer.node.height = 775;
if(this.time1) {
clearTimeout(this.time1);
}
},
onDestroy() {
if(this.time1) { clearTimeout(this.time1); }
},
// called every frame
update: function (dt) {
......
export const defaultData = {
"title": "Hello Apples",
"tipSwitch": 0,
"audio": "https://staging-teach.cdn.ireadabc.com/c03129693e6cabf061661fba349fa031.mp3",
"title": "Look,count and say and.",
"tipSwitch": "1",
"audio": "http://staging-teach.cdn.ireadabc.com/af5208a0e0d869f6be410c46e50bb501_l.mp3",
"imgAni": {
"ske": {
"url": "https://teach.cdn.ireadabc.com/e13afca23d37ba33489c0aaa61a515f5.json",
"name": "川阅阅_ske.json"
"url": "http://staging-teach.cdn.ireadabc.com/a7dc36aa85121807bb7e049642192cec.json",
"name": "niao_ske.json"
},
"tex": {
"url": "https://teach.cdn.ireadabc.com/7afcddbb7f0127613059e574638a9f3e.json",
"name": "川阅阅_tex.json"
"url": "http://staging-teach.cdn.ireadabc.com/c635daaa86b4c5c39f4af88e826d3433.json",
"name": "niao_tex.json"
},
"png": {
"url": "https://teach.cdn.ireadabc.com/63699fcef6053eef4f58b89dad35af0b.png",
"name": "川阅阅_tex.png"
"url": "http://staging-teach.cdn.ireadabc.com/75c87beb2b7d79033ace8978edc91a12.png",
"name": "niao_tex.png"
}
},
"video_url": "http://staging-teach.cdn.ireadabc.com/1dde63cee33e4445fbab13297479e733.mp4"
}
\ No newline at end of file
"video_url": "http://staging-teach.cdn.ireadabc.com/c8b49f6f032bd91a637df072c01ccaf7.mp4",
"audioName": ""
};
\ 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