Commit c4902839 authored by liujiangnan's avatar liujiangnan

feat: 控制条的显隐

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