Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn03_playVideo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
sn03_playVideo
Commits
61c13b34
Commit
61c13b34
authored
Nov 13, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化全屏进度条
parent
121122e9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
483 additions
and
167 deletions
+483
-167
sn03_playVideo.fire
assets/sn03_playVideo/Scene/sn03_playVideo.fire
+408
-118
sn03_playVideo.ts
assets/sn03_playVideo/Scene/sn03_playVideo.ts
+17
-41
videoControl_sn03_playVideo.ts
assets/sn03_playVideo/Script/videoControl_sn03_playVideo.ts
+58
-8
No files found.
assets/sn03_playVideo/Scene/sn03_playVideo.fire
View file @
61c13b34
...
...
@@ -93,31 +93,31 @@
"__id__": 81
},
{
"__id__": 13
3
"__id__": 13
9
},
{
"__id__": 17
1
"__id__": 17
7
},
{
"__id__": 18
2
"__id__": 18
8
},
{
"__id__": 1
85
"__id__": 1
91
},
{
"__id__": 1
87
"__id__": 1
93
}
],
"_active": true,
"_components": [
{
"__id__": 1
89
"__id__": 1
95
},
{
"__id__": 19
0
"__id__": 19
6
},
{
"__id__": 19
1
"__id__": 19
7
}
],
"_prefab": null,
...
...
@@ -3627,15 +3627,18 @@
},
{
"__id__": 96
},
{
"__id__": 131
}
],
"_active": true,
"_components": [
{
"__id__": 13
1
"__id__": 13
7
},
{
"__id__": 13
2
"__id__": 13
8
}
],
"_prefab": null,
...
...
@@ -3661,7 +3664,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-9
000
,
-9
999
,
0,
0,
0,
...
...
@@ -5941,6 +5944,290 @@
"_originalHeight": 0,
"_id": "fbKtfLRTVLcZPBiawa64xA"
},
{
"__type__": "cc.Node",
"_name": "center",
"_objFlags": 0,
"_parent": {
"__id__": 81
},
"_children": [
{
"__id__": 132
},
{
"__id__": 135
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 150
},
"_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,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "b4dRB85ThAj5axmwu5wQBs"
},
{
"__type__": "cc.Node",
"_name": "color_bg",
"_objFlags": 0,
"_parent": {
"__id__": 131
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 133
},
{
"__id__": 134
}
],
"_prefab": null,
"_opacity": 180,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 150
},
"_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,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a07Jr5DddAo7l9/dFd+M9N"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "d3ugRes+JBhLAkWBpVaecF"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_id": "d3HzceU+tASrRCWsgGBAhP"
},
{
"__type__": "cc.Node",
"_name": "text",
"_objFlags": 0,
"_parent": {
"__id__": 131
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 136
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 126
},
"_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,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "eeKuopoGtJtrITlOeltFNj"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 135
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "",
"_N$string": "",
"_fontSize": 40,
"_lineHeight": 100,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "88A+87hx1OyJp/xJJLZIaY"
},
{
"__type__": "cc.Widget",
"_name": "",
...
...
@@ -5952,8 +6239,8 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": -9
000
,
"_right": 9
000
,
"_left": -9
999
,
"_right": 9
999
,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
...
...
@@ -6004,6 +6291,9 @@
"endTime": {
"__id__": 121
},
"centerInfo": {
"__id__": 131
},
"_id": "31vAPhl1xCbb7SgXfkJ5yi"
},
{
...
...
@@ -6015,16 +6305,16 @@
},
"_children": [
{
"__id__": 1
34
"__id__": 1
40
}
],
"_active": true,
"_components": [
{
"__id__": 1
69
"__id__": 1
75
},
{
"__id__": 17
0
"__id__": 17
6
}
],
"_prefab": null,
...
...
@@ -6080,17 +6370,17 @@
"_name": "view",
"_objFlags": 0,
"_parent": {
"__id__": 13
3
"__id__": 13
9
},
"_children": [
{
"__id__": 1
35
"__id__": 1
41
}
],
"_active": true,
"_components": [
{
"__id__": 1
68
"__id__": 1
74
}
],
"_prefab": null,
...
...
@@ -6146,17 +6436,17 @@
"_name": "content",
"_objFlags": 0,
"_parent": {
"__id__": 1
34
"__id__": 1
40
},
"_children": [
{
"__id__": 1
36
"__id__": 1
42
}
],
"_active": true,
"_components": [
{
"__id__": 1
67
"__id__": 1
73
}
],
"_prefab": null,
...
...
@@ -6212,20 +6502,20 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 1
35
"__id__": 1
41
},
"_children": [
{
"__id__": 1
37
"__id__": 1
43
},
{
"__id__": 15
1
"__id__": 15
7
}
],
"_active": false,
"_components": [
{
"__id__": 1
65
"__id__": 1
71
}
],
"_prefab": null,
...
...
@@ -6281,29 +6571,29 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 1
36
"__id__": 1
42
},
"_children": [
{
"__id__": 1
38
"__id__": 1
44
},
{
"__id__": 14
0
"__id__": 14
6
},
{
"__id__": 1
44
"__id__": 1
50
},
{
"__id__": 1
46
"__id__": 1
52
},
{
"__id__": 1
48
"__id__": 1
54
}
],
"_active": true,
"_components": [
{
"__id__": 15
0
"__id__": 15
6
}
],
"_prefab": null,
...
...
@@ -6359,13 +6649,13 @@
"_name": "cover_bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
37
"__id__": 1
43
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
39
"__id__": 1
45
}
],
"_prefab": null,
...
...
@@ -6421,7 +6711,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
38
"__id__": 1
44
},
"_enabled": true,
"_materials": [
...
...
@@ -6453,17 +6743,17 @@
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 1
37
"__id__": 1
43
},
"_children": [
{
"__id__": 14
1
"__id__": 14
7
}
],
"_active": true,
"_components": [
{
"__id__": 14
3
"__id__": 14
9
}
],
"_prefab": null,
...
...
@@ -6519,13 +6809,13 @@
"_name": "cover",
"_objFlags": 0,
"_parent": {
"__id__": 14
0
"__id__": 14
6
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
2
"__id__": 14
8
}
],
"_prefab": null,
...
...
@@ -6581,7 +6871,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
1
"__id__": 14
7
},
"_enabled": true,
"_materials": [
...
...
@@ -6613,7 +6903,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
0
"__id__": 14
6
},
"_enabled": true,
"_materials": [
...
...
@@ -6635,13 +6925,13 @@
"_name": "num",
"_objFlags": 0,
"_parent": {
"__id__": 1
37
"__id__": 1
43
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
45
"__id__": 1
51
}
],
"_prefab": null,
...
...
@@ -6697,7 +6987,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
44
"__id__": 1
50
},
"_enabled": true,
"_materials": [
...
...
@@ -6732,13 +7022,13 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 1
37
"__id__": 1
43
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
47
"__id__": 1
53
}
],
"_prefab": null,
...
...
@@ -6794,7 +7084,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
46
"__id__": 1
52
},
"_enabled": true,
"_materials": [
...
...
@@ -6827,13 +7117,13 @@
"_name": "color",
"_objFlags": 0,
"_parent": {
"__id__": 1
37
"__id__": 1
43
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
49
"__id__": 1
55
}
],
"_prefab": null,
...
...
@@ -6889,7 +7179,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
48
"__id__": 1
54
},
"_enabled": true,
"_materials": [],
...
...
@@ -6917,7 +7207,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
37
"__id__": 1
43
},
"_enabled": true,
"_materials": [
...
...
@@ -6949,29 +7239,29 @@
"_name": "item_active",
"_objFlags": 0,
"_parent": {
"__id__": 1
36
"__id__": 1
42
},
"_children": [
{
"__id__": 15
2
"__id__": 15
8
},
{
"__id__": 1
54
"__id__": 1
60
},
{
"__id__": 1
56
"__id__": 1
62
},
{
"__id__": 1
58
"__id__": 1
64
},
{
"__id__": 16
2
"__id__": 16
8
}
],
"_active": false,
"_components": [
{
"__id__": 1
64
"__id__": 1
70
}
],
"_prefab": null,
...
...
@@ -7027,13 +7317,13 @@
"_name": "cover_bg",
"_objFlags": 0,
"_parent": {
"__id__": 15
1
"__id__": 15
7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 15
3
"__id__": 15
9
}
],
"_prefab": null,
...
...
@@ -7089,7 +7379,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
2
"__id__": 15
8
},
"_enabled": true,
"_materials": [
...
...
@@ -7121,13 +7411,13 @@
"_name": "num",
"_objFlags": 0,
"_parent": {
"__id__": 15
1
"__id__": 15
7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
55
"__id__": 1
61
}
],
"_prefab": null,
...
...
@@ -7183,7 +7473,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
54
"__id__": 1
60
},
"_enabled": true,
"_materials": [
...
...
@@ -7218,13 +7508,13 @@
"_name": "img_audio_ske",
"_objFlags": 0,
"_parent": {
"__id__": 15
1
"__id__": 15
7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
57
"__id__": 1
63
}
],
"_prefab": null,
...
...
@@ -7280,7 +7570,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
56
"__id__": 1
62
},
"_enabled": true,
"_materials": [
...
...
@@ -7320,17 +7610,17 @@
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 15
1
"__id__": 15
7
},
"_children": [
{
"__id__": 1
59
"__id__": 1
65
}
],
"_active": true,
"_components": [
{
"__id__": 16
1
"__id__": 16
7
}
],
"_prefab": null,
...
...
@@ -7386,13 +7676,13 @@
"_name": "cover",
"_objFlags": 0,
"_parent": {
"__id__": 1
58
"__id__": 1
64
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
0
"__id__": 16
6
}
],
"_prefab": null,
...
...
@@ -7448,7 +7738,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
59
"__id__": 1
65
},
"_enabled": true,
"_materials": [
...
...
@@ -7480,7 +7770,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
58
"__id__": 1
64
},
"_enabled": true,
"_materials": [
...
...
@@ -7502,13 +7792,13 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 15
1
"__id__": 15
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
3
"__id__": 16
9
}
],
"_prefab": null,
...
...
@@ -7564,7 +7854,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 16
2
"__id__": 16
8
},
"_enabled": true,
"_materials": [
...
...
@@ -7597,7 +7887,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
1
"__id__": 15
7
},
"_enabled": true,
"_materials": [
...
...
@@ -7629,7 +7919,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
36
"__id__": 1
42
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -7638,7 +7928,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 1
66
"__id__": 1
72
}
],
"_N$interactable": true,
...
...
@@ -7694,7 +7984,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
36
"__id__": 1
42
},
"_id": "7aTx3B2HJO6oViYBGBm/73"
},
...
...
@@ -7713,7 +8003,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
35
"__id__": 1
41
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -7745,7 +8035,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
34
"__id__": 1
40
},
"_enabled": true,
"_materials": [
...
...
@@ -7765,7 +8055,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
3
"__id__": 13
9
},
"_enabled": true,
"_materials": [
...
...
@@ -7795,7 +8085,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
3
"__id__": 13
9
},
"_enabled": true,
"horizontal": true,
...
...
@@ -7807,10 +8097,10 @@
"scrollEvents": [],
"cancelInnerEvents": true,
"_N$content": {
"__id__": 1
35
"__id__": 1
41
},
"content": {
"__id__": 1
35
"__id__": 1
41
},
"_N$horizontalScrollBar": null,
"_N$verticalScrollBar": null,
...
...
@@ -7825,10 +8115,10 @@
},
"_children": [
{
"__id__": 17
2
"__id__": 17
8
},
{
"__id__": 1
77
"__id__": 1
83
}
],
"_active": true,
...
...
@@ -7886,19 +8176,19 @@
"_name": "btn_last",
"_objFlags": 0,
"_parent": {
"__id__": 17
1
"__id__": 17
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 17
3
"__id__": 17
9
},
{
"__id__": 1
74
"__id__": 1
80
},
{
"__id__": 1
76
"__id__": 1
82
}
],
"_prefab": null,
...
...
@@ -7954,7 +8244,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
2
"__id__": 17
8
},
"_enabled": true,
"_materials": [
...
...
@@ -7986,7 +8276,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
2
"__id__": 17
8
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -7995,7 +8285,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 1
75
"__id__": 1
81
}
],
"_N$interactable": true,
...
...
@@ -8051,7 +8341,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 17
2
"__id__": 17
8
},
"_id": "63sqlR0bVEJrqaAhyT+FzF"
},
...
...
@@ -8070,7 +8360,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 17
2
"__id__": 17
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -8099,19 +8389,19 @@
"_name": "btn_next",
"_objFlags": 0,
"_parent": {
"__id__": 17
1
"__id__": 17
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
78
"__id__": 1
84
},
{
"__id__": 1
79
"__id__": 1
85
},
{
"__id__": 18
1
"__id__": 18
7
}
],
"_prefab": null,
...
...
@@ -8167,7 +8457,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
77
"__id__": 1
83
},
"_enabled": true,
"_materials": [
...
...
@@ -8199,7 +8489,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
77
"__id__": 1
83
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -8208,7 +8498,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 18
0
"__id__": 18
6
}
],
"_N$interactable": true,
...
...
@@ -8264,7 +8554,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
77
"__id__": 1
83
},
"_id": "3aZJp/FzlONJO+/okrPRip"
},
...
...
@@ -8283,7 +8573,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
77
"__id__": 1
83
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -8318,10 +8608,10 @@
"_active": true,
"_components": [
{
"__id__": 18
3
"__id__": 18
9
},
{
"__id__": 1
84
"__id__": 1
90
}
],
"_prefab": null,
...
...
@@ -8377,7 +8667,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
2
"__id__": 18
8
},
"_enabled": true,
"_materials": [
...
...
@@ -8410,7 +8700,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 18
2
"__id__": 18
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -8443,7 +8733,7 @@
"_active": false,
"_components": [
{
"__id__": 1
86
"__id__": 1
92
}
],
"_prefab": null,
...
...
@@ -8499,7 +8789,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
85
"__id__": 1
91
},
"_enabled": true,
"_materials": [
...
...
@@ -8537,7 +8827,7 @@
"_active": false,
"_components": [
{
"__id__": 1
88
"__id__": 1
94
}
],
"_prefab": null,
...
...
@@ -8593,7 +8883,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
87
"__id__": 1
93
},
"_enabled": true,
"_materials": [
...
...
@@ -8710,7 +9000,7 @@
"__id__": 39
},
"loadingSprite": {
"__id__": 1
87
"__id__": 1
93
},
"noPlayCover": {
"__id__": 33
...
...
assets/sn03_playVideo/Scene/sn03_playVideo.ts
View file @
61c13b34
...
...
@@ -163,45 +163,25 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
videoPlayer
.
node
.
on
(
'
clicked
'
,
()
=>
{
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
);
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
);
},
6000
);
this
.
videoPlayer
.
stayOnBottom
=
true
;
}
});
this
.
videoPlayer
.
node
.
on
(
'
touchstarted
'
,
()
=>
{
console
.
log
(
'
touchstarted
'
);
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
);
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
);
},
6000
);
this
.
videoPlayer
.
stayOnBottom
=
true
;
}
});
this
.
videoPlayer
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
()
=>
{
console
.
log
(
'
touchstarted
'
);
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
);
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
);
},
6000
);
this
.
videoPlayer
.
stayOnBottom
=
true
;
}
});
...
...
@@ -256,6 +236,7 @@ export default class VideoPlayerComponent extends cc.Component {
}
}
// 初始化全屏视频控制条
initFullScreenControls
()
{
this
.
fullscreenVideoControls
.
on
(
"
play
"
,
()
=>
{
this
.
play
()
...
...
@@ -263,6 +244,9 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
fullscreenVideoControls
.
on
(
"
pause
"
,
()
=>
{
this
.
pause
()
})
this
.
fullscreenVideoControls
.
on
(
"
hide
"
,
()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
})
this
.
fullscreenVideoControls
.
on
(
"
exit_fullscreen
"
,
()
=>
{
this
.
exitFullScreen
()
})
...
...
@@ -270,6 +254,10 @@ export default class VideoPlayerComponent extends cc.Component {
const
{
percent
}
=
opt
;
const
dur
=
this
.
videoPlayer
.
getDuration
();
this
.
videoPlayer
.
currentTime
=
percent
*
dur
;
this
.
fullscreenVideoControls
.
emit
(
"
tips
"
,
{
startTime
:
this
.
videoPlayer
.
currentTime
,
endTime
:
dur
})
})
this
.
fullscreenVideoControls
.
on
(
"
switch_clarity
"
,
(
clarity
=
"
h
"
)
=>
{
...
...
@@ -493,6 +481,7 @@ export default class VideoPlayerComponent extends cc.Component {
}
this
.
initListener
();
this
.
initFullScreenControls
();
this
.
videoPlayer
.
stayOnBottom
=
true
;
}
updateBarByPos
(
newX
:
number
)
{
...
...
@@ -579,6 +568,7 @@ export default class VideoPlayerComponent extends cc.Component {
play
()
{
if
(
!
this
.
_isReadyToPlay
)
{
console
.
log
(
"
视频还未准备好
"
)
return
;
}
...
...
@@ -605,6 +595,7 @@ export default class VideoPlayerComponent extends cc.Component {
}
backward
()
{
}
replay
()
{
...
...
@@ -619,7 +610,6 @@ export default class VideoPlayerComponent extends cc.Component {
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
}
time1
:
any
=
null
;
isVideoFull
:
boolean
=
false
;
tempPos
:
any
=
null
;
...
...
@@ -637,6 +627,7 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
showHideMiddleLayerBackBtn
(
false
);
this
.
isVideoFull
=
true
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
);
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
videoControls
.
active
=
false
;
cc
.
find
(
`Canvas/title`
).
active
=
false
;
cc
.
find
(
'
Canvas/pageButton
'
).
active
=
false
;
...
...
@@ -647,7 +638,6 @@ export default class VideoPlayerComponent extends cc.Component {
})
},
1
);
this
.
videoPlayer
.
stayOnBottom
=
true
;
const
videoContainer
=
cc
.
find
(
'
Canvas/video_node
'
);
this
.
tempPos
.
videoPos
=
{
x
:
videoContainer
.
x
,
...
...
@@ -670,11 +660,7 @@ export default class VideoPlayerComponent extends cc.Component {
const
videoNode
=
cc
.
find
(
"
Canvas/VideoNode
"
);
const
widget
=
videoNode
.
getComponent
(
cc
.
Widget
)
widget
.
enabled
=
true
;
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
},
3000
);
widget
.
enabled
=
true
;
}
exitFullScreen
()
{
...
...
@@ -686,10 +672,6 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
showHideMiddleLayerBackBtn
(
true
);
// 标记退出全屏
this
.
isVideoFull
=
false
;
// 取消视频在最底部
this
.
videoPlayer
.
stayOnBottom
=
false
;
// 隐藏全屏视频控制条
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
);
// 显示正常视频控制条
this
.
videoControls
.
active
=
true
;
// 显示全屏按钮
...
...
@@ -731,15 +713,9 @@ export default class VideoPlayerComponent extends cc.Component {
controlBg
.
opacity
=
255
;
controlBg
.
width
=
1259
;
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
}
onDestroy
()
{
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
// 显示中间层返回按钮
this
.
showHideMiddleLayerBackBtn
(
true
);
}
...
...
assets/sn03_playVideo/Script/videoControl_sn03_playVideo.ts
View file @
61c13b34
...
...
@@ -40,12 +40,16 @@ export default class NewClass extends cc.Component {
@
property
(
cc
.
Node
)
endTime
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
centerInfo
:
cc
.
Node
=
null
;
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
currentTime
=
null
;
winWidth
=
0
;
hideSetTimeoutId
=
null
;
start
()
{
this
.
initdDrag
();
this
.
winWidth
=
cc
.
find
(
"
/Canvas
"
).
width
;
...
...
@@ -69,9 +73,20 @@ export default class NewClass extends cc.Component {
this
.
show
()
})
this
.
node
.
on
(
"
hide
"
,
(
opt
)
=>
{
this
.
hide
()
// this.node.on("hide", (opt)=>{
// this.hide()
// })
this
.
node
.
on
(
"
tips
"
,
(
opt
)
=>
{
const
{
message
,
startTime
,
endTime
}
=
opt
if
(
message
)
{
this
.
showTipInfo
(
message
?
message
:
""
)
}
else
if
(
this
.
checkNumber
(
startTime
)
&&
this
.
checkNumber
(
endTime
))
{
this
.
showTipInfo
(
`
${
this
.
formatTimeShow
(
startTime
)}
/
${
this
.
formatTimeShow
(
endTime
)}
`
)
}
})
}
onPlayClick
()
{
...
...
@@ -91,7 +106,9 @@ export default class NewClass extends cc.Component {
}
onExitFullscreenClick
()
{
this
.
node
.
emit
(
"
exit_fullscreen
"
)
this
.
node
.
emit
(
"
exit_fullscreen
"
);
this
.
hide
()
this
.
cleanMyTimeout
()
}
setProgress
(
percent
,
startTime
,
endTime
)
{
...
...
@@ -104,24 +121,54 @@ export default class NewClass extends cc.Component {
this
.
progressCurrent
.
width
=
this
.
progressBg
.
width
*
percent
;
this
.
progressDot
.
x
=
-
this
.
progressBg
.
width
/
2
+
this
.
progressCurrent
.
width
if
(
startTime
!=
undefined
&&
startTime
!=
null
)
{
this
.
startTime
.
getComponent
(
cc
.
Label
).
string
=
this
.
format
Seconds
(
startTime
);
this
.
startTime
.
getComponent
(
cc
.
Label
).
string
=
this
.
format
TimeShow
(
startTime
);
}
if
(
endTime
!=
undefined
&&
startTime
!=
null
)
{
this
.
endTime
.
getComponent
(
cc
.
Label
).
string
=
this
.
format
Seconds
(
endTime
);
this
.
endTime
.
getComponent
(
cc
.
Label
).
string
=
this
.
format
TimeShow
(
endTime
);
}
}
show
(){
this
.
node
.
opacity
=
255
;
this
.
node
.
x
=
0
;
this
.
cleanMyTimeout
()
this
.
hideSetTimeoutId
=
setTimeout
(()
=>
{
this
.
hide
()
},
5000
);
}
hide
(){
this
.
node
.
emit
(
"
hide
"
);
this
.
node
.
opacity
=
255
;
this
.
node
.
x
=
-
this
.
winWidth
;
}
formatSeconds
(
value
)
{
centerTipInfoSettimeoutId
=
null
;
showTipInfo
(
text
){
cc
.
find
(
"
/text
"
,
this
.
centerInfo
).
getComponent
(
cc
.
Label
).
string
=
text
;
this
.
centerInfo
.
active
=
true
;
if
(
this
.
centerTipInfoSettimeoutId
)
{
clearTimeout
(
this
.
centerTipInfoSettimeoutId
)
this
.
centerTipInfoSettimeoutId
=
null
;
}
this
.
centerTipInfoSettimeoutId
=
setTimeout
(()
=>
{
this
.
centerInfo
.
active
=
false
;
},
1000
)
}
cleanMyTimeout
()
{
if
(
this
.
hideSetTimeoutId
)
{
clearTimeout
(
this
.
hideSetTimeoutId
);
this
.
hideSetTimeoutId
=
null
;
}
}
checkNumber
(
val
)
{
const
reg
=
/^
[
0-9
]
+.
?[
0-9
]
*/
;
return
reg
.
test
(
val
)
}
formatTimeShow
(
value
)
{
const
checkZero
=
(
value
)
=>
{
if
(
value
<
1
)
{
return
0
...
...
@@ -170,7 +217,7 @@ export default class NewClass extends cc.Component {
this
.
progressDot
.
off
(
cc
.
Node
.
EventType
.
TOUCH_START
);
this
.
progressDot
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
(
e
)
=>
{
this
.
draging
=
true
;
this
.
node
.
emit
(
"
pause
"
)
this
.
node
.
emit
(
"
pause
"
)
;
});
this
.
progressDot
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
);
...
...
@@ -184,20 +231,23 @@ export default class NewClass extends cc.Component {
percent
=
1
;
}
this
.
node
.
emit
(
"
draging_progress
"
,
{
percent
});
this
.
centerInfo
.
active
=
true
;
this
.
setProgress
(
percent
,
null
,
null
);
this
.
show
()
});
this
.
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
(
e
)
=>
{
this
.
draging
=
false
;
this
.
node
.
emit
(
"
play
"
)
this
.
centerInfo
.
active
=
false
;
});
this
.
node
.
off
(
cc
.
Node
.
EventType
.
MOUSE_UP
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
MOUSE_UP
,
(
e
)
=>
{
this
.
draging
=
false
;
this
.
node
.
emit
(
"
play
"
);
this
.
centerInfo
.
active
=
false
;
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment