Commit 6e114f90 authored by liujiangnan's avatar liujiangnan

feat: 添加重开

parent 229d6e20
{"ver":"1.1.2","uuid":"4f557179-a05f-4891-bac0-6a3d0275c8ce","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "4f557179-a05f-4891-bac0-6a3d0275c8ce",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
......@@ -90,13 +90,13 @@
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 65
},
{
"__id__": 59
"__id__": 66
},
{
"__id__": 60
"__id__": 67
}
],
"_prefab": null,
......@@ -1054,7 +1054,7 @@
"_active": true,
"_components": [
{
"__id__": 57
"__id__": 64
}
],
"_prefab": null,
......@@ -1126,19 +1126,22 @@
"__id__": 45
},
{
"__id__": 49
"__id__": 52
},
{
"__id__": 52
"__id__": 56
},
{
"__id__": 59
}
],
"_active": true,
"_components": [
{
"__id__": 55
"__id__": 62
},
{
"__id__": 56
"__id__": 63
}
],
"_prefab": null,
......@@ -2031,22 +2034,326 @@
},
{
"__type__": "cc.Node",
"_name": "CurrentLabel",
"_name": "Restart",
"_objFlags": 0,
"_parent": {
"__id__": 25
},
"_children": [
{
"__id__": 46
}
],
"_active": false,
"_components": [
{
"__id__": 49
},
{
"__id__": 51
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 209,
"height": 218
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1180,
16,
0,
0,
0,
0,
1,
1,
1,
0.5
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8drp6fHuFLyphSJlVtbhhf"
},
{
"__type__": "cc.Node",
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 47
},
{
"__id__": 48
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 238,
"height": 256
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
0
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "4fztIuEW5Eqqs6ZXr0imzF"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"_materials": [
{
"__id__": 47
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "16ea0a4c-9fd6-4334-8f5a-56b9ec1673f8"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "eequwmnWdCoIc1Uk/eXoss"
},
{
"__id__": 48
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 45,
"_left": -14.5,
"_right": -14.5,
"_top": -19,
"_bottom": -19,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": "c9E0ZHd6ZEfomfQxBaI53I"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 50
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_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": {
"__id__": 46
},
"_id": "23rFQGz+tCTpq6+bq4cJzR"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "280c3rsZJJKnZ9RqbALVwtK",
"handler": "replay",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": -256,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "84W8oDETlDNKQpFEh8y23S"
},
{
"__type__": "cc.Node",
"_name": "CurrentLabel",
"_objFlags": 0,
"_parent": {
"__id__": 25
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 53
},
{
"__id__": 54
},
{
"__id__": 55
}
],
"_prefab": null,
......@@ -2102,7 +2409,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 52
},
"_enabled": true,
"_materials": [
......@@ -2135,7 +2442,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 52
},
"_enabled": false,
"_color": {
......@@ -2153,7 +2460,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
"__id__": 52
},
"_enabled": true,
"alignMode": 1,
......@@ -2186,10 +2493,10 @@
"_active": true,
"_components": [
{
"__id__": 50
"__id__": 57
},
{
"__id__": 51
"__id__": 58
}
],
"_prefab": null,
......@@ -2245,7 +2552,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 56
},
"_enabled": true,
"_materials": [
......@@ -2278,7 +2585,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 49
"__id__": 56
},
"_enabled": true,
"alignMode": 1,
......@@ -2311,10 +2618,10 @@
"_active": true,
"_components": [
{
"__id__": 53
"__id__": 60
},
{
"__id__": 54
"__id__": 61
}
],
"_prefab": null,
......@@ -2370,7 +2677,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 52
"__id__": 59
},
"_enabled": true,
"_materials": [
......@@ -2402,7 +2709,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 52
"__id__": 59
},
"_enabled": true,
"alignMode": 1,
......@@ -2574,14 +2881,16 @@
"pauseButton": {
"__id__": 42
},
"restartButton": null,
"restartButton": {
"__id__": 49
},
"backButton": null,
"forwardButton": null,
"durationLabel": {
"__id__": 50
"__id__": 57
},
"currentTimeLabel": {
"__id__": 46
"__id__": 53
},
"barTag": {
"__id__": 27
......
......@@ -179,6 +179,7 @@ cc.Class({
console.log('playing');
this.durationLabel.string = this.formatTime(this.videoPlayer.getDuration());
this.playButton.node.active = false;
this.restartButton.node.active = false;
this.pauseButton.node.active = true;
});
this.videoPlayer.node.on('paused', () => {
......@@ -193,9 +194,10 @@ cc.Class({
});
this.videoPlayer.node.on('completed', async () => {
console.log('completed');
this.videoPlayer.currentTime = 0;
// this.playButton.node.active = true;
// this.pauseButton.node.active = false;
// this.videoPlayer.currentTime = 0;
this.playButton.node.active = false;
this.pauseButton.node.active = false;
this.restartButton.node.active = true;
});
cc.view.setResizeCallback((params) => {
console.log('Resize', params);
......@@ -448,6 +450,7 @@ cc.Class({
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;
......
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