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
121122e9
Commit
121122e9
authored
Nov 13, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化全屏进度条
parent
ada264be
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1085 additions
and
271 deletions
+1085
-271
sn03_playVideo.fire
assets/sn03_playVideo/Scene/sn03_playVideo.fire
+883
-257
sn03_playVideo.ts
assets/sn03_playVideo/Scene/sn03_playVideo.ts
+18
-9
videoControl_sn03_playVideo.ts
assets/sn03_playVideo/Script/videoControl_sn03_playVideo.ts
+143
-0
icon_player_back.png.meta
...sn03_playVideo/Texture/controls/icon_player_back.png.meta
+1
-1
icon_player_dot.png
assets/sn03_playVideo/Texture/controls/icon_player_dot.png
+0
-0
icon_player_dot.png.meta
.../sn03_playVideo/Texture/controls/icon_player_dot.png.meta
+36
-0
icon_player_exit_fullscreen.png.meta
...deo/Texture/controls/icon_player_exit_fullscreen.png.meta
+1
-1
icon_player_fullscreen.png.meta
...layVideo/Texture/controls/icon_player_fullscreen.png.meta
+1
-1
icon_player_pause.png.meta
...n03_playVideo/Texture/controls/icon_player_pause.png.meta
+1
-1
icon_player_play.png.meta
...sn03_playVideo/Texture/controls/icon_player_play.png.meta
+1
-1
No files found.
assets/sn03_playVideo/Scene/sn03_playVideo.fire
View file @
121122e9
...
...
@@ -93,31 +93,31 @@
"__id__": 81
},
{
"__id__": 1
21
"__id__": 1
33
},
{
"__id__": 1
59
"__id__": 1
71
},
{
"__id__": 1
70
"__id__": 1
82
},
{
"__id__": 1
73
"__id__": 1
85
},
{
"__id__": 1
75
"__id__": 1
87
}
],
"_active": true,
"_components": [
{
"__id__": 1
77
"__id__": 1
89
},
{
"__id__": 1
78
"__id__": 1
90
},
{
"__id__": 1
79
"__id__": 1
91
}
],
"_prefab": null,
...
...
@@ -3632,10 +3632,10 @@
"_active": true,
"_components": [
{
"__id__": 1
19
"__id__": 1
31
},
{
"__id__": 1
20
"__id__": 1
32
}
],
"_prefab": null,
...
...
@@ -3661,7 +3661,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
-900
0,
0,
0,
0,
...
...
@@ -3719,7 +3719,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -3731,7 +3731,7 @@
"ctor": "Float64Array",
"array": [
0,
4
90
,
4
65
,
0,
0,
0,
...
...
@@ -3784,7 +3784,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -3915,7 +3915,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -3926,7 +3926,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-7
6
0,
-7
1
0,
0,
0,
0,
...
...
@@ -4236,7 +4236,7 @@
"_layoutSize": {
"__type__": "cc.Size",
"width": 300,
"height": 1
0
0
"height": 1
5
0
},
"_resize": 0,
"_N$layoutType": 1,
...
...
@@ -4268,7 +4268,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left":
5
0,
"_left":
10
0,
"_right": 810,
"_top": 0,
"_bottom": 0,
...
...
@@ -4327,12 +4327,15 @@
},
{
"__id__": 111
},
{
"__id__": 123
}
],
"_active": true,
"_components": [
{
"__id__": 1
18
"__id__": 1
30
}
],
"_prefab": null,
...
...
@@ -4347,7 +4350,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -4359,7 +4362,7 @@
"ctor": "Float64Array",
"array": [
0,
-4
90
,
-4
65
,
0,
0,
0,
...
...
@@ -4412,7 +4415,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -4543,7 +4546,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 95,
"height": 1
0
0
"height": 1
5
0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
...
...
@@ -4554,7 +4557,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-
91
0,
-
86
0,
0,
0,
0,
...
...
@@ -4948,7 +4951,7 @@
"_layoutSize": {
"__type__": "cc.Size",
"width": 95,
"height": 1
0
0
"height": 1
5
0
},
"_resize": 1,
"_N$layoutType": 1,
...
...
@@ -4980,7 +4983,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 12,
"_left":
5
0,
"_left":
10
0,
"_right": 0,
"_top": 0,
"_bottom": 0,
...
...
@@ -4998,7 +5001,7 @@
},
{
"__type__": "cc.Node",
"_name": "
right
",
"_name": "
center
",
"_objFlags": 0,
"_parent": {
"__id__": 96
...
...
@@ -5009,14 +5012,81 @@
}
],
"_active": true,
"_components": [
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "1cLkEshexGNadHvt7m/VPK"
},
{
"__type__": "cc.Node",
"_name": "progress",
"_objFlags": 0,
"_parent": {
"__id__": 111
},
"_children": [
{
"__id__": 116
"__id__": 113
},
{
"__id__": 115
},
{
"__id__": 117
},
{
"__id__": 119
},
{
"__id__": 121
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
...
...
@@ -5028,19 +5098,19 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
56
,
"height":
10
0
"width":
0
,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 0
.5
,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
853
,
0
,
0,
0,
0,
...
...
@@ -5063,27 +5133,24 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "
aaxi5jM7NIlZlLmcR+KTYG
"
"_id": "
7dnOlEqHdEJ5wIPY2f5nWj
"
},
{
"__type__": "cc.Node",
"_name": "b
tn_exit_fullscreen
",
"_name": "b
g
",
"_objFlags": 0,
"_parent": {
"__id__": 11
1
"__id__": 11
2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 113
},
{
"__id__": 114
}
],
"_prefab": null,
"_opacity": 2
55
,
"_opacity": 2
20
,
"_color": {
"__type__": "cc.Color",
"r": 255,
...
...
@@ -5093,12 +5160,12 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width":
56
,
"height":
57
"width":
800
,
"height":
15
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 0
.5
,
"y": 0.5
},
"_trs": {
...
...
@@ -5128,14 +5195,14 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "
27hF0adqNBH71Crh0MdxJi
"
"_id": "
6cyi+d5J1B6p6bEdFNEdWq
"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
2
"__id__": 11
3
},
"_enabled": true,
"_materials": [
...
...
@@ -5146,10 +5213,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "
ece9ff2a-0eed-41cc-acc9-a6253b0dec64
"
"__uuid__": "
a23235d1-15db-4b95-8439-a2e005bfff91
"
},
"_type": 0,
"_sizeMode":
1
,
"_sizeMode":
0
,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
...
...
@@ -5160,130 +5227,674 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "
07modpeilKXZ0Vu19br3/c
"
"_id": "
69GyIqVfhBcaPgsT8XVo5S
"
},
{
"__type__": "cc.
Button
",
"_name": "",
"__type__": "cc.
Node
",
"_name": "
current_bg
",
"_objFlags": 0,
"
node
": {
"
_parent
": {
"__id__": 112
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
"_children": [],
"_active": true,
"_components": [
{
"__id__": 11
5
"__id__": 11
6
}
],
"_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": {
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r":
255
,
"g":
255
,
"b": 2
55
,
"r":
0
,
"g":
161
,
"b": 2
14
,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 15
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "4e+DBKHEJBhoyAGe74ljdw"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 81
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-400,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"component": "",
"_componentId": "b725dcISF1EWaft2PrOCwvR",
"handler": "onExitFullscreenClick",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 111
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left": 0,
"_right": 51,
"_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": "baRZKS+JFBO6bmhHD8S3UY"
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcqyPfPx1BUYIDOwsCap2R"
},
{
"__type__": "cc.
Layout
",
"__type__": "cc.
Sprite
",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
1
"__id__": 11
5
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 56,
"height": 100
},
"_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": "bbpU8EzbtPE4y5gEX1B9iD"
},
{
"__type__": "cc.Node",
"_name": "dot",
"_objFlags": 0,
"_parent": {
"__id__": 112
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 118
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 32,
"height": 32
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1.5,
1.5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "83FquatsBGorAwtr/InwlP"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 117
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 1,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ecafbd46-ac07-42d6-9ce3-d0e67da4e817"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "6fiDKH70xHJpd/wp/ku4tC"
},
{
"__type__": "cc.Node",
"_name": "time_s",
"_objFlags": 0,
"_parent": {
"__id__": 112
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 120
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80.08,
"height": 40.32
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-500,
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": "8c+2MmhjRI/6EaH5+aGQBP"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 119
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "00:00",
"_N$string": "00:00",
"_fontSize": 32,
"_lineHeight": 32,
"_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": "7e0xElRUZDsYKJQ5/bbkmB"
},
{
"__type__": "cc.Node",
"_name": "time_e",
"_objFlags": 0,
"_parent": {
"__id__": 112
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 122
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80.08,
"height": 40.32
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
500,
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": "114wmYhS5IOZY20flgnFFn"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 121
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "00:00",
"_N$string": "00:00",
"_fontSize": 32,
"_lineHeight": 32,
"_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": "d1Wa8aW/1CoZJXj7YLyfC6"
},
{
"__type__": "cc.Node",
"_name": "right",
"_objFlags": 0,
"_parent": {
"__id__": 96
},
"_children": [
{
"__id__": 124
}
],
"_active": true,
"_components": [
{
"__id__": 128
},
{
"__id__": 129
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 56,
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
804,
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": "aaxi5jM7NIlZlLmcR+KTYG"
},
{
"__type__": "cc.Node",
"_name": "btn_exit_fullscreen",
"_objFlags": 0,
"_parent": {
"__id__": 123
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 125
},
{
"__id__": 126
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 56,
"height": 57
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"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": "27hF0adqNBH71Crh0MdxJi"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 124
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "ece9ff2a-0eed-41cc-acc9-a6253b0dec64"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "07modpeilKXZ0Vu19br3/c"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 124
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 127
}
],
"_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": "4e+DBKHEJBhoyAGe74ljdw"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 81
},
"component": "",
"_componentId": "b725dcISF1EWaft2PrOCwvR",
"handler": "onExitFullscreenClick",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 123
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 36,
"_left": 0,
"_right": 100,
"_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": "baRZKS+JFBO6bmhHD8S3UY"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 123
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 56,
"height": 150
},
"_resize": 1,
"_N$layoutType": 1,
"_N$cellSize": {
...
...
@@ -5341,8 +5952,8 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_left":
-900
0,
"_right":
900
0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
...
...
@@ -5372,12 +5983,27 @@
"__id__": 105
},
"btn_fullscreen": {
"__id__": 1
12
"__id__": 1
24
},
"btn_exit_fullscreen": null,
"label_title": {
"__id__": 91
},
"progressBg": {
"__id__": 113
},
"progressCurrent": {
"__id__": 115
},
"progressDot": {
"__id__": 117
},
"startTime": {
"__id__": 119
},
"endTime": {
"__id__": 121
},
"_id": "31vAPhl1xCbb7SgXfkJ5yi"
},
{
...
...
@@ -5389,16 +6015,16 @@
},
"_children": [
{
"__id__": 1
22
"__id__": 1
34
}
],
"_active": true,
"_components": [
{
"__id__": 1
57
"__id__": 1
69
},
{
"__id__": 1
58
"__id__": 1
70
}
],
"_prefab": null,
...
...
@@ -5454,17 +6080,17 @@
"_name": "view",
"_objFlags": 0,
"_parent": {
"__id__": 1
21
"__id__": 1
33
},
"_children": [
{
"__id__": 1
23
"__id__": 1
35
}
],
"_active": true,
"_components": [
{
"__id__": 1
56
"__id__": 1
68
}
],
"_prefab": null,
...
...
@@ -5520,17 +6146,17 @@
"_name": "content",
"_objFlags": 0,
"_parent": {
"__id__": 1
22
"__id__": 1
34
},
"_children": [
{
"__id__": 1
24
"__id__": 1
36
}
],
"_active": true,
"_components": [
{
"__id__": 1
55
"__id__": 1
67
}
],
"_prefab": null,
...
...
@@ -5586,20 +6212,20 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 1
23
"__id__": 1
35
},
"_children": [
{
"__id__": 1
25
"__id__": 1
37
},
{
"__id__": 1
39
"__id__": 1
51
}
],
"_active": false,
"_components": [
{
"__id__": 1
53
"__id__": 1
65
}
],
"_prefab": null,
...
...
@@ -5655,29 +6281,29 @@
"_name": "item",
"_objFlags": 0,
"_parent": {
"__id__": 1
24
"__id__": 1
36
},
"_children": [
{
"__id__": 1
26
"__id__": 1
38
},
{
"__id__": 1
28
"__id__": 1
40
},
{
"__id__": 1
32
"__id__": 1
44
},
{
"__id__": 1
34
"__id__": 1
46
},
{
"__id__": 1
36
"__id__": 1
48
}
],
"_active": true,
"_components": [
{
"__id__": 1
38
"__id__": 1
50
}
],
"_prefab": null,
...
...
@@ -5733,13 +6359,13 @@
"_name": "cover_bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
25
"__id__": 1
37
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
27
"__id__": 1
39
}
],
"_prefab": null,
...
...
@@ -5795,7 +6421,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
26
"__id__": 1
38
},
"_enabled": true,
"_materials": [
...
...
@@ -5827,17 +6453,17 @@
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 1
25
"__id__": 1
37
},
"_children": [
{
"__id__": 1
29
"__id__": 1
41
}
],
"_active": true,
"_components": [
{
"__id__": 1
31
"__id__": 1
43
}
],
"_prefab": null,
...
...
@@ -5893,13 +6519,13 @@
"_name": "cover",
"_objFlags": 0,
"_parent": {
"__id__": 1
28
"__id__": 1
40
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
30
"__id__": 1
42
}
],
"_prefab": null,
...
...
@@ -5955,7 +6581,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
29
"__id__": 1
41
},
"_enabled": true,
"_materials": [
...
...
@@ -5987,7 +6613,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
28
"__id__": 1
40
},
"_enabled": true,
"_materials": [
...
...
@@ -6009,13 +6635,13 @@
"_name": "num",
"_objFlags": 0,
"_parent": {
"__id__": 1
25
"__id__": 1
37
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
33
"__id__": 1
45
}
],
"_prefab": null,
...
...
@@ -6071,7 +6697,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
32
"__id__": 1
44
},
"_enabled": true,
"_materials": [
...
...
@@ -6106,13 +6732,13 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 1
25
"__id__": 1
37
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
35
"__id__": 1
47
}
],
"_prefab": null,
...
...
@@ -6168,7 +6794,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
34
"__id__": 1
46
},
"_enabled": true,
"_materials": [
...
...
@@ -6201,13 +6827,13 @@
"_name": "color",
"_objFlags": 0,
"_parent": {
"__id__": 1
25
"__id__": 1
37
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
37
"__id__": 1
49
}
],
"_prefab": null,
...
...
@@ -6263,7 +6889,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
36
"__id__": 1
48
},
"_enabled": true,
"_materials": [],
...
...
@@ -6291,7 +6917,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
25
"__id__": 1
37
},
"_enabled": true,
"_materials": [
...
...
@@ -6323,29 +6949,29 @@
"_name": "item_active",
"_objFlags": 0,
"_parent": {
"__id__": 1
24
"__id__": 1
36
},
"_children": [
{
"__id__": 1
40
"__id__": 1
52
},
{
"__id__": 1
42
"__id__": 1
54
},
{
"__id__": 1
44
"__id__": 1
56
},
{
"__id__": 1
46
"__id__": 1
58
},
{
"__id__": 1
50
"__id__": 1
62
}
],
"_active": false,
"_components": [
{
"__id__": 1
52
"__id__": 1
64
}
],
"_prefab": null,
...
...
@@ -6401,13 +7027,13 @@
"_name": "cover_bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
39
"__id__": 1
51
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
41
"__id__": 1
53
}
],
"_prefab": null,
...
...
@@ -6463,7 +7089,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
40
"__id__": 1
52
},
"_enabled": true,
"_materials": [
...
...
@@ -6495,13 +7121,13 @@
"_name": "num",
"_objFlags": 0,
"_parent": {
"__id__": 1
39
"__id__": 1
51
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
43
"__id__": 1
55
}
],
"_prefab": null,
...
...
@@ -6557,7 +7183,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
42
"__id__": 1
54
},
"_enabled": true,
"_materials": [
...
...
@@ -6592,13 +7218,13 @@
"_name": "img_audio_ske",
"_objFlags": 0,
"_parent": {
"__id__": 1
39
"__id__": 1
51
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 1
45
"__id__": 1
57
}
],
"_prefab": null,
...
...
@@ -6654,7 +7280,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
44
"__id__": 1
56
},
"_enabled": true,
"_materials": [
...
...
@@ -6694,17 +7320,17 @@
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 1
39
"__id__": 1
51
},
"_children": [
{
"__id__": 1
47
"__id__": 1
59
}
],
"_active": true,
"_components": [
{
"__id__": 1
49
"__id__": 1
61
}
],
"_prefab": null,
...
...
@@ -6760,13 +7386,13 @@
"_name": "cover",
"_objFlags": 0,
"_parent": {
"__id__": 1
46
"__id__": 1
58
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
48
"__id__": 1
60
}
],
"_prefab": null,
...
...
@@ -6822,7 +7448,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
47
"__id__": 1
59
},
"_enabled": true,
"_materials": [
...
...
@@ -6854,7 +7480,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
46
"__id__": 1
58
},
"_enabled": true,
"_materials": [
...
...
@@ -6876,13 +7502,13 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 1
39
"__id__": 1
51
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
51
"__id__": 1
63
}
],
"_prefab": null,
...
...
@@ -6938,7 +7564,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
50
"__id__": 1
62
},
"_enabled": true,
"_materials": [
...
...
@@ -6971,7 +7597,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
39
"__id__": 1
51
},
"_enabled": true,
"_materials": [
...
...
@@ -7003,7 +7629,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
24
"__id__": 1
36
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -7012,7 +7638,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 1
54
"__id__": 1
66
}
],
"_N$interactable": true,
...
...
@@ -7068,7 +7694,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
24
"__id__": 1
36
},
"_id": "7aTx3B2HJO6oViYBGBm/73"
},
...
...
@@ -7087,7 +7713,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
23
"__id__": 1
35
},
"_enabled": true,
"_layoutSize": {
...
...
@@ -7119,7 +7745,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
22
"__id__": 1
34
},
"_enabled": true,
"_materials": [
...
...
@@ -7139,7 +7765,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
21
"__id__": 1
33
},
"_enabled": true,
"_materials": [
...
...
@@ -7169,7 +7795,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
21
"__id__": 1
33
},
"_enabled": true,
"horizontal": true,
...
...
@@ -7181,10 +7807,10 @@
"scrollEvents": [],
"cancelInnerEvents": true,
"_N$content": {
"__id__": 1
23
"__id__": 1
35
},
"content": {
"__id__": 1
23
"__id__": 1
35
},
"_N$horizontalScrollBar": null,
"_N$verticalScrollBar": null,
...
...
@@ -7199,10 +7825,10 @@
},
"_children": [
{
"__id__": 1
60
"__id__": 1
72
},
{
"__id__": 1
65
"__id__": 1
77
}
],
"_active": true,
...
...
@@ -7260,19 +7886,19 @@
"_name": "btn_last",
"_objFlags": 0,
"_parent": {
"__id__": 1
59
"__id__": 1
71
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
61
"__id__": 1
73
},
{
"__id__": 1
62
"__id__": 1
74
},
{
"__id__": 1
64
"__id__": 1
76
}
],
"_prefab": null,
...
...
@@ -7328,7 +7954,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
60
"__id__": 1
72
},
"_enabled": true,
"_materials": [
...
...
@@ -7360,7 +7986,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
60
"__id__": 1
72
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -7369,7 +7995,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 1
63
"__id__": 1
75
}
],
"_N$interactable": true,
...
...
@@ -7425,7 +8051,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
60
"__id__": 1
72
},
"_id": "63sqlR0bVEJrqaAhyT+FzF"
},
...
...
@@ -7444,7 +8070,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
60
"__id__": 1
72
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -7473,19 +8099,19 @@
"_name": "btn_next",
"_objFlags": 0,
"_parent": {
"__id__": 1
59
"__id__": 1
71
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 1
66
"__id__": 1
78
},
{
"__id__": 1
67
"__id__": 1
79
},
{
"__id__": 1
69
"__id__": 1
81
}
],
"_prefab": null,
...
...
@@ -7541,7 +8167,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
65
"__id__": 1
77
},
"_enabled": true,
"_materials": [
...
...
@@ -7573,7 +8199,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
65
"__id__": 1
77
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -7582,7 +8208,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 1
68
"__id__": 1
80
}
],
"_N$interactable": true,
...
...
@@ -7638,7 +8264,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 1
65
"__id__": 1
77
},
"_id": "3aZJp/FzlONJO+/okrPRip"
},
...
...
@@ -7657,7 +8283,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
65
"__id__": 1
77
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -7692,10 +8318,10 @@
"_active": true,
"_components": [
{
"__id__": 1
71
"__id__": 1
83
},
{
"__id__": 1
72
"__id__": 1
84
}
],
"_prefab": null,
...
...
@@ -7751,7 +8377,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
70
"__id__": 1
82
},
"_enabled": true,
"_materials": [
...
...
@@ -7784,7 +8410,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
70
"__id__": 1
82
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -7817,7 +8443,7 @@
"_active": false,
"_components": [
{
"__id__": 1
74
"__id__": 1
86
}
],
"_prefab": null,
...
...
@@ -7873,7 +8499,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
73
"__id__": 1
85
},
"_enabled": true,
"_materials": [
...
...
@@ -7911,7 +8537,7 @@
"_active": false,
"_components": [
{
"__id__": 1
76
"__id__": 1
88
}
],
"_prefab": null,
...
...
@@ -7967,7 +8593,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
75
"__id__": 1
87
},
"_enabled": true,
"_materials": [
...
...
@@ -8084,7 +8710,7 @@
"__id__": 39
},
"loadingSprite": {
"__id__": 1
75
"__id__": 1
87
},
"noPlayCover": {
"__id__": 33
...
...
assets/sn03_playVideo/Scene/sn03_playVideo.ts
View file @
121122e9
...
...
@@ -164,13 +164,13 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
videoPlayer
.
node
.
on
(
'
clicked
'
,
()
=>
{
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
fullscreenVideoControls
.
opacity
=
255
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
)
;
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
fullscreenVideoControls
.
opacity
=
0
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
)
;
},
6000
);
}
});
...
...
@@ -179,13 +179,13 @@ export default class VideoPlayerComponent extends cc.Component {
console
.
log
(
'
touchstarted
'
);
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
fullscreenVideoControls
.
opacity
=
255
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
)
;
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
fullscreenVideoControls
.
opacity
=
0
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
)
;
},
6000
);
}
});
...
...
@@ -194,13 +194,13 @@ export default class VideoPlayerComponent extends cc.Component {
console
.
log
(
'
touchstarted
'
);
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
fullscreenVideoControls
.
opacity
=
255
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
)
;
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
this
.
fullscreenVideoControls
.
opacity
=
0
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
)
;
},
6000
);
}
});
...
...
@@ -266,6 +266,11 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
fullscreenVideoControls
.
on
(
"
exit_fullscreen
"
,
()
=>
{
this
.
exitFullScreen
()
})
this
.
fullscreenVideoControls
.
on
(
"
draging_progress
"
,
(
opt
)
=>
{
const
{
percent
}
=
opt
;
const
dur
=
this
.
videoPlayer
.
getDuration
();
this
.
videoPlayer
.
currentTime
=
percent
*
dur
;
})
this
.
fullscreenVideoControls
.
on
(
"
switch_clarity
"
,
(
clarity
=
"
h
"
)
=>
{
})
...
...
@@ -513,6 +518,11 @@ export default class VideoPlayerComponent extends cc.Component {
percent
=
1
;
}
this
.
ProgressBar
.
getComponent
(
cc
.
ProgressBar
).
progress
=
percent
;
this
.
fullscreenVideoControls
.
emit
(
"
setProgress
"
,
{
percent
:
percent
,
startTime
:
ct
,
endTime
:
dur
,
})
const
maxX
=
this
.
ProgressBar
.
width
;
const
minX
=
0
;
let
newX
=
percent
*
maxX
;
...
...
@@ -583,7 +593,6 @@ export default class VideoPlayerComponent extends cc.Component {
this
.
playButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
true
;
}
pause
()
{
...
...
@@ -627,7 +636,7 @@ export default class VideoPlayerComponent extends cc.Component {
// 隐藏中间层返回按钮
this
.
showHideMiddleLayerBackBtn
(
false
);
this
.
isVideoFull
=
true
;
this
.
fullscreenVideoControls
.
opacity
=
255
;
this
.
fullscreenVideoControls
.
emit
(
"
show
"
)
;
this
.
videoControls
.
active
=
false
;
cc
.
find
(
`Canvas/title`
).
active
=
false
;
cc
.
find
(
'
Canvas/pageButton
'
).
active
=
false
;
...
...
@@ -680,7 +689,7 @@ export default class VideoPlayerComponent extends cc.Component {
// 取消视频在最底部
this
.
videoPlayer
.
stayOnBottom
=
false
;
// 隐藏全屏视频控制条
this
.
fullscreenVideoControls
.
opacity
=
0
;
this
.
fullscreenVideoControls
.
emit
(
"
hide
"
)
;
// 显示正常视频控制条
this
.
videoControls
.
active
=
true
;
// 显示全屏按钮
...
...
assets/sn03_playVideo/Script/videoControl_sn03_playVideo.ts
View file @
121122e9
...
...
@@ -25,11 +25,30 @@ export default class NewClass extends cc.Component {
@
property
(
cc
.
Node
)
label_title
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
progressBg
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
progressCurrent
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
progressDot
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
startTime
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
endTime
:
cc
.
Node
=
null
;
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
currentTime
=
null
;
winWidth
=
0
;
start
()
{
this
.
initdDrag
();
this
.
winWidth
=
cc
.
find
(
"
/Canvas
"
).
width
;
this
.
node
.
off
(
"
inFullscreen
"
)
this
.
node
.
on
(
"
inFullscreen
"
,
(
opt
)
=>
{
const
{
isPlaying
,
title
}
=
opt
;
...
...
@@ -37,6 +56,22 @@ export default class NewClass extends cc.Component {
this
.
btn_play
.
active
=
!
isPlaying
;
this
.
btn_pause
.
active
=
isPlaying
;
})
this
.
node
.
on
(
"
setProgress
"
,
(
opt
)
=>
{
const
{
percent
,
startTime
,
endTime
}
=
opt
;
if
(
this
.
currentTime
!=
Math
.
floor
(
startTime
))
{
this
.
setProgress
(
percent
,
startTime
,
endTime
)
this
.
currentTime
=
Math
.
floor
(
startTime
)
}
})
this
.
node
.
on
(
"
show
"
,
(
opt
)
=>
{
this
.
show
()
})
this
.
node
.
on
(
"
hide
"
,
(
opt
)
=>
{
this
.
hide
()
})
}
onPlayClick
()
{
...
...
@@ -58,5 +93,113 @@ export default class NewClass extends cc.Component {
onExitFullscreenClick
()
{
this
.
node
.
emit
(
"
exit_fullscreen
"
)
}
setProgress
(
percent
,
startTime
,
endTime
)
{
if
(
percent
<
0
)
{
percent
=
0
}
else
if
(
percent
>
1
)
{
percent
=
1
;
}
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
.
formatSeconds
(
startTime
);
}
if
(
endTime
!=
undefined
&&
startTime
!=
null
)
{
this
.
endTime
.
getComponent
(
cc
.
Label
).
string
=
this
.
formatSeconds
(
endTime
);
}
}
show
(){
this
.
node
.
opacity
=
255
;
this
.
node
.
x
=
0
;
}
hide
(){
this
.
node
.
opacity
=
255
;
this
.
node
.
x
=
-
this
.
winWidth
;
}
formatSeconds
(
value
)
{
const
checkZero
=
(
value
)
=>
{
if
(
value
<
1
)
{
return
0
}
else
{
return
Math
.
floor
(
value
)
}
}
const
fix2
=
(
value
)
=>
{
if
(
value
<
10
)
{
return
`0
${
value
}
`
}
else
{
return
`
${
value
}
`
}
}
const
hourSec
=
60
*
60
;
const
minuteSec
=
60
;
const
secSec
=
1
;
let
hour
=
checkZero
(
value
/
hourSec
);
let
minute
=
checkZero
((
value
-
(
hour
*
hourSec
))
/
minuteSec
)
let
second
=
checkZero
((
value
-
(
hour
*
hourSec
+
minute
*
minuteSec
))
/
secSec
)
let
timeStr
=
""
if
(
hour
>
0
)
{
timeStr
+=
fix2
(
hour
)
+
"
:
"
;
}
if
(
minute
>
0
)
{
timeStr
+=
fix2
(
minute
)
+
"
:
"
;
}
else
{
timeStr
+=
"
00:
"
;
}
if
(
second
>
0
)
{
timeStr
+=
fix2
(
second
);
}
else
{
timeStr
+=
"
00
"
;
}
return
timeStr
}
draging
=
false
;
initdDrag
()
{
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
.
progressDot
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
);
this
.
progressDot
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,
(
e
)
=>
{
const
worldPos
=
e
.
getLocation
();
const
localPos
=
this
.
progressDot
.
parent
.
convertToNodeSpaceAR
(
worldPos
);
let
percent
=
(
localPos
.
x
+
this
.
progressBg
.
width
/
2
)
/
this
.
progressBg
.
width
;
if
(
percent
<
0
)
{
percent
=
0
}
else
if
(
percent
>
1
)
{
percent
=
1
;
}
this
.
node
.
emit
(
"
draging_progress
"
,
{
percent
});
this
.
setProgress
(
percent
,
null
,
null
);
});
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
.
node
.
off
(
cc
.
Node
.
EventType
.
MOUSE_UP
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
MOUSE_UP
,
(
e
)
=>
{
this
.
draging
=
false
;
this
.
node
.
emit
(
"
play
"
);
});
}
// update (dt) {}
}
assets/sn03_playVideo/Texture/controls/icon_player_back.png.meta
View file @
121122e9
...
...
@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"packable": true,
"width": 64,
...
...
assets/sn03_playVideo/Texture/controls/icon_player_dot.png
0 → 100644
View file @
121122e9
249 Bytes
assets/sn03_playVideo/Texture/controls/icon_player_dot.png.meta
0 → 100644
View file @
121122e9
{
"ver": "2.3.5",
"uuid": "4b46edb4-08e6-4d09-9ae8-4f9daeec2d4c",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": true,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 64,
"platformSettings": {},
"subMetas": {
"icon_player_dot": {
"ver": "1.0.4",
"uuid": "ecafbd46-ac07-42d6-9ce3-d0e67da4e817",
"rawTextureUuid": "4b46edb4-08e6-4d09-9ae8-4f9daeec2d4c",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 16,
"trimY": 16,
"width": 32,
"height": 32,
"rawWidth": 64,
"rawHeight": 64,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/sn03_playVideo/Texture/controls/icon_player_exit_fullscreen.png.meta
View file @
121122e9
...
...
@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"packable": true,
"width": 64,
...
...
assets/sn03_playVideo/Texture/controls/icon_player_fullscreen.png.meta
View file @
121122e9
...
...
@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"packable": true,
"width": 64,
...
...
assets/sn03_playVideo/Texture/controls/icon_player_pause.png.meta
View file @
121122e9
...
...
@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"packable": true,
"width": 64,
...
...
assets/sn03_playVideo/Texture/controls/icon_player_play.png.meta
View file @
121122e9
...
...
@@ -4,7 +4,7 @@
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha":
fals
e,
"premultiplyAlpha":
tru
e,
"genMipmaps": false,
"packable": true,
"width": 64,
...
...
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