Commit c4902839 authored by liujiangnan's avatar liujiangnan

feat: 控制条的显隐

parent 1cb849ab
......@@ -75,37 +75,37 @@
"__id__": 5
},
{
"__id__": 12
"__id__": 13
},
{
"__id__": 15
"__id__": 16
},
{
"__id__": 18
"__id__": 19
},
{
"__id__": 21
"__id__": 22
},
{
"__id__": 72
"__id__": 73
},
{
"__id__": 76
"__id__": 77
},
{
"__id__": 78
"__id__": 79
}
],
"_active": true,
"_components": [
{
"__id__": 84
},
{
"__id__": 85
},
{
"__id__": 86
},
{
"__id__": 87
}
],
"_prefab": null,
......@@ -272,7 +272,7 @@
"_active": true,
"_components": [
{
"__id__": 11
"__id__": 12
}
],
"_prefab": null,
......@@ -459,6 +459,9 @@
"_components": [
{
"__id__": 10
},
{
"__id__": 11
}
],
"_prefab": null,
......@@ -524,11 +527,79 @@
"_mute": false,
"_isFullscreen": false,
"_N$isFullscreen": false,
"_stayOnBottom": true,
"_stayOnBottom": false,
"videoPlayerEvent": [],
"_N$keepAspectRatio": true,
"_id": "fce7ZaGl9IwYI1a7QJjapU"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "d0QH9i8cBFT7dTSr564GES"
},
{
"__type__": "cc.Mask",
"_name": "",
......@@ -560,10 +631,10 @@
"_active": true,
"_components": [
{
"__id__": 13
"__id__": 14
},
{
"__id__": 14
"__id__": 15
}
],
"_prefab": null,
......@@ -619,7 +690,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 13
},
"_enabled": false,
"_materials": [
......@@ -651,7 +722,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
......@@ -684,10 +755,10 @@
"_active": true,
"_components": [
{
"__id__": 16
"__id__": 17
},
{
"__id__": 17
"__id__": 18
}
],
"_prefab": null,
......@@ -743,7 +814,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 16
},
"_enabled": true,
"_materials": [
......@@ -775,7 +846,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 16
},
"_enabled": true,
"alignMode": 1,
......@@ -808,10 +879,10 @@
"_active": true,
"_components": [
{
"__id__": 19
"__id__": 20
},
{
"__id__": 20
"__id__": 21
}
],
"_prefab": null,
......@@ -867,7 +938,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 19
},
"_enabled": true,
"_materials": [
......@@ -899,7 +970,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
"__id__": 19
},
"_enabled": true,
"alignMode": 1,
......@@ -930,19 +1001,19 @@
},
"_children": [
{
"__id__": 22
"__id__": 23
},
{
"__id__": 61
"__id__": 62
},
{
"__id__": 66
"__id__": 67
}
],
"_active": true,
"_components": [
{
"__id__": 71
"__id__": 72
}
],
"_prefab": null,
......@@ -998,38 +1069,38 @@
"_name": "ProgressBar",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 22
},
"_children": [
{
"__id__": 23
"__id__": 24
},
{
"__id__": 28
"__id__": 29
},
{
"__id__": 35
"__id__": 36
},
{
"__id__": 42
"__id__": 43
},
{
"__id__": 49
"__id__": 50
},
{
"__id__": 53
"__id__": 54
},
{
"__id__": 56
"__id__": 57
}
],
"_active": true,
"_components": [
{
"__id__": 59
"__id__": 60
},
{
"__id__": 60
"__id__": 61
}
],
"_prefab": null,
......@@ -1085,20 +1156,20 @@
"_name": "bar",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [
{
"__id__": 24
"__id__": 25
}
],
"_active": true,
"_components": [
{
"__id__": 26
"__id__": 27
},
{
"__id__": 27
"__id__": 28
}
],
"_prefab": null,
......@@ -1154,13 +1225,13 @@
"_name": "bar_tag",
"_objFlags": 0,
"_parent": {
"__id__": 23
"__id__": 24
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 25
"__id__": 26
}
],
"_prefab": null,
......@@ -1216,7 +1287,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 24
"__id__": 25
},
"_enabled": true,
"_materials": [
......@@ -1248,7 +1319,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 24
},
"_enabled": true,
"_materials": [
......@@ -1280,7 +1351,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
"__id__": 24
},
"_enabled": true,
"alignMode": 1,
......@@ -1307,20 +1378,20 @@
"_name": "Play",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [
{
"__id__": 29
"__id__": 30
}
],
"_active": true,
"_components": [
{
"__id__": 32
"__id__": 33
},
{
"__id__": 34
"__id__": 35
}
],
"_prefab": null,
......@@ -1376,16 +1447,16 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 28
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 31
},
{
"__id__": 31
"__id__": 32
}
],
"_prefab": null,
......@@ -1441,7 +1512,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 30
},
"_enabled": true,
"_materials": [
......@@ -1473,7 +1544,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 30
},
"_enabled": true,
"alignMode": 0,
......@@ -1500,7 +1571,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 29
},
"_enabled": true,
"_normalMaterial": null,
......@@ -1509,7 +1580,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 33
"__id__": 34
}
],
"_N$interactable": true,
......@@ -1575,7 +1646,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 29
"__id__": 30
},
"_id": "a8bWaLdnFKA5ITxJunB2R2"
},
......@@ -1594,7 +1665,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 29
},
"_enabled": true,
"alignMode": 1,
......@@ -1621,20 +1692,20 @@
"_name": "Pause",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [
{
"__id__": 36
"__id__": 37
}
],
"_active": false,
"_components": [
{
"__id__": 39
"__id__": 40
},
{
"__id__": 41
"__id__": 42
}
],
"_prefab": null,
......@@ -1690,16 +1761,16 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 35
"__id__": 36
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 37
"__id__": 38
},
{
"__id__": 38
"__id__": 39
}
],
"_prefab": null,
......@@ -1755,7 +1826,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
"__id__": 37
},
"_enabled": true,
"_materials": [
......@@ -1787,7 +1858,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 36
"__id__": 37
},
"_enabled": true,
"alignMode": 0,
......@@ -1814,7 +1885,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
"__id__": 36
},
"_enabled": true,
"_normalMaterial": null,
......@@ -1823,7 +1894,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 40
"__id__": 41
}
],
"_N$interactable": true,
......@@ -1879,7 +1950,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 36
"__id__": 37
},
"_id": "94dhG7VhpIZZJp5e+IJuYc"
},
......@@ -1898,7 +1969,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 35
"__id__": 36
},
"_enabled": true,
"alignMode": 1,
......@@ -1925,20 +1996,20 @@
"_name": "Restart",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [
{
"__id__": 43
"__id__": 44
}
],
"_active": false,
"_components": [
{
"__id__": 46
"__id__": 47
},
{
"__id__": 48
"__id__": 49
}
],
"_prefab": null,
......@@ -1994,16 +2065,16 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 42
"__id__": 43
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 44
"__id__": 45
},
{
"__id__": 45
"__id__": 46
}
],
"_prefab": null,
......@@ -2059,7 +2130,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
"__id__": 44
},
"_enabled": true,
"_materials": [
......@@ -2091,7 +2162,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 43
"__id__": 44
},
"_enabled": true,
"alignMode": 0,
......@@ -2118,7 +2189,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 42
"__id__": 43
},
"_enabled": true,
"_normalMaterial": null,
......@@ -2127,7 +2198,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 47
"__id__": 48
}
],
"_N$interactable": true,
......@@ -2183,7 +2254,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 43
"__id__": 44
},
"_id": "23rFQGz+tCTpq6+bq4cJzR"
},
......@@ -2202,7 +2273,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 42
"__id__": 43
},
"_enabled": true,
"alignMode": 1,
......@@ -2229,19 +2300,19 @@
"_name": "CurrentLabel",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 50
},
{
"__id__": 51
},
{
"__id__": 52
},
{
"__id__": 53
}
],
"_prefab": null,
......@@ -2297,7 +2368,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 50
},
"_enabled": true,
"_materials": [
......@@ -2332,7 +2403,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 50
},
"_enabled": false,
"_color": {
......@@ -2350,7 +2421,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 50
},
"_enabled": true,
"alignMode": 1,
......@@ -2377,16 +2448,16 @@
"_name": "TimeLabel",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 54
"__id__": 55
},
{
"__id__": 55
"__id__": 56
}
],
"_prefab": null,
......@@ -2442,7 +2513,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 54
},
"_enabled": true,
"_materials": [
......@@ -2477,7 +2548,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 54
},
"_enabled": true,
"alignMode": 1,
......@@ -2504,16 +2575,16 @@
"_name": "text_tips_left",
"_objFlags": 0,
"_parent": {
"__id__": 22
"__id__": 23
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 57
"__id__": 58
},
{
"__id__": 58
"__id__": 59
}
],
"_prefab": null,
......@@ -2569,7 +2640,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
"__id__": 57
},
"_enabled": true,
"_materials": [
......@@ -2601,7 +2672,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
"__id__": 57
},
"_enabled": true,
"alignMode": 1,
......@@ -2628,7 +2699,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 23
},
"_enabled": true,
"_materials": [
......@@ -2660,7 +2731,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
"__id__": 23
},
"_enabled": true,
"alignMode": 1,
......@@ -2687,19 +2758,19 @@
"_name": "fullscreen",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 22
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 62
},
{
"__id__": 63
},
{
"__id__": 64
},
{
"__id__": 65
}
],
"_prefab": null,
......@@ -2755,7 +2826,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
"__id__": 62
},
"_enabled": true,
"_materials": [
......@@ -2787,7 +2858,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
"__id__": 62
},
"_enabled": true,
"alignMode": 1,
......@@ -2814,7 +2885,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
"__id__": 62
},
"_enabled": true,
"_normalMaterial": null,
......@@ -2823,7 +2894,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 65
"__id__": 66
}
],
"_N$interactable": true,
......@@ -2896,19 +2967,19 @@
"_name": "exitfull",
"_objFlags": 0,
"_parent": {
"__id__": 21
"__id__": 22
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 67
},
{
"__id__": 68
},
{
"__id__": 69
},
{
"__id__": 70
}
],
"_prefab": null,
......@@ -2964,7 +3035,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
"__id__": 67
},
"_enabled": true,
"_materials": [
......@@ -2996,7 +3067,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
"__id__": 67
},
"_enabled": true,
"alignMode": 1,
......@@ -3023,7 +3094,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
"__id__": 67
},
"_enabled": true,
"_normalMaterial": null,
......@@ -3032,7 +3103,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 70
"__id__": 71
}
],
"_N$interactable": true,
......@@ -3105,7 +3176,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 21
"__id__": 22
},
"_enabled": true,
"alignMode": 1,
......@@ -3137,14 +3208,14 @@
"_children": [],
"_active": false,
"_components": [
{
"__id__": 73
},
{
"__id__": 74
},
{
"__id__": 75
},
{
"__id__": 76
}
],
"_prefab": null,
......@@ -3200,7 +3271,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 73
},
"_enabled": true,
"_materials": [
......@@ -3232,7 +3303,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 73
},
"_enabled": true,
"alignMode": 1,
......@@ -3259,7 +3330,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
"__id__": 73
},
"_enabled": true,
"_id": "beaGv1g0JBZ59RUOJpzt0W"
......@@ -3275,7 +3346,7 @@
"_active": false,
"_components": [
{
"__id__": 77
"__id__": 78
}
],
"_prefab": null,
......@@ -3331,7 +3402,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 76
"__id__": 77
},
"_enabled": true,
"alignMode": 1,
......@@ -3362,16 +3433,16 @@
},
"_children": [
{
"__id__": 79
"__id__": 80
}
],
"_active": true,
"_components": [
{
"__id__": 82
"__id__": 83
},
{
"__id__": 83
"__id__": 84
}
],
"_prefab": null,
......@@ -3427,16 +3498,16 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 78
"__id__": 79
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 80
"__id__": 81
},
{
"__id__": 81
"__id__": 82
}
],
"_prefab": null,
......@@ -3492,7 +3563,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 79
"__id__": 80
},
"_enabled": true,
"_materials": [
......@@ -3527,7 +3598,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 79
"__id__": 80
},
"_enabled": true,
"alignMode": 1,
......@@ -3554,7 +3625,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 79
},
"_enabled": true,
"_materials": [
......@@ -3586,7 +3657,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 79
},
"_enabled": true,
"alignMode": 1,
......@@ -3664,30 +3735,30 @@
"__id__": 10
},
"ProgressBar": {
"__id__": 22
"__id__": 23
},
"playButton": {
"__id__": 32
"__id__": 33
},
"pauseButton": {
"__id__": 39
"__id__": 40
},
"restartButton": {
"__id__": 46
"__id__": 47
},
"backButton": null,
"forwardButton": null,
"durationLabel": {
"__id__": 54
"__id__": 55
},
"currentTimeLabel": {
"__id__": 50
"__id__": 51
},
"barTag": {
"__id__": 24
"__id__": 25
},
"bar": {
"__id__": 23
"__id__": 24
},
"_id": "ec0d87qy5Eoavi5EqUiZj3"
}
......
......@@ -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