Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ngt_video
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
ngt_video
Commits
aef7ab70
Commit
aef7ab70
authored
Oct 24, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 进度条
parent
b53b83f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
131 additions
and
228 deletions
+131
-228
ngt_video.fire
assets/ngt_video/Scene/ngt_video.fire
+121
-221
ngt_video.js
assets/ngt_video/Scene/ngt_video.js
+6
-3
process.png
assets/ngt_video/Texture/video/process.png
+0
-0
process.png.meta
assets/ngt_video/Texture/video/process.png.meta
+4
-4
processbg.png
assets/ngt_video/Texture/video/processbg.png
+0
-0
No files found.
assets/ngt_video/Scene/ngt_video.fire
View file @
aef7ab70
...
...
@@ -90,25 +90,25 @@
"__id__": 21
},
{
"__id__":
72
"__id__":
69
},
{
"__id__": 7
6
"__id__": 7
3
},
{
"__id__": 7
8
"__id__": 7
5
}
],
"_active": true,
"_components": [
{
"__id__": 8
4
"__id__": 8
1
},
{
"__id__": 8
5
"__id__": 8
2
},
{
"__id__": 8
6
"__id__": 8
3
}
],
"_prefab": null,
...
...
@@ -933,16 +933,16 @@
"__id__": 22
},
{
"__id__": 6
1
"__id__": 6
0
},
{
"__id__": 6
6
"__id__": 6
4
}
],
"_active": true,
"_components": [
{
"__id__":
71
"__id__":
68
}
],
"_prefab": null,
...
...
@@ -1005,31 +1005,31 @@
"__id__": 23
},
{
"__id__": 2
8
"__id__": 2
7
},
{
"__id__": 3
5
"__id__": 3
4
},
{
"__id__": 4
2
"__id__": 4
1
},
{
"__id__": 4
9
"__id__": 4
8
},
{
"__id__": 5
3
"__id__": 5
2
},
{
"__id__": 5
6
"__id__": 5
5
}
],
"_active": true,
"_components": [
{
"__id__": 5
9
"__id__": 5
8
},
{
"__id__":
60
"__id__":
59
}
],
"_prefab": null,
...
...
@@ -1043,19 +1043,19 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 137
7
,
"width": 137
6
,
"height": 25
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0
.5
,
"x": 0,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-
0.12699999999995
27,
-
688.6
27,
-2.42,
0,
0,
...
...
@@ -1096,9 +1096,6 @@
"_components": [
{
"__id__": 26
},
{
"__id__": 27
}
],
"_prefab": null,
...
...
@@ -1112,7 +1109,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1
0
,
"width": 1
376
,
"height": 21
},
"_anchorPoint": {
...
...
@@ -1125,7 +1122,7 @@
"ctor": "Float64Array",
"array": [
0,
-0.676
,
0
,
0,
0,
0,
...
...
@@ -1179,7 +1176,7 @@
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"x": 0
.5
,
"y": 0.5
},
"_trs": {
...
...
@@ -1261,7 +1258,7 @@
"_spriteFrame": {
"__uuid__": "b035c74f-9f28-4698-8325-8fe9ec6e3db0"
},
"_type":
1
,
"_type":
3
,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
...
...
@@ -1275,33 +1272,6 @@
"_atlas": null,
"_id": "6aEBayL25NCYjiR2AaURHr"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 23
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 0,
"_left": 14.937999999999988,
"_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": "7310XIrRBLaaz4w9xVlqLd"
},
{
"__type__": "cc.Node",
"_name": "Play",
...
...
@@ -1311,16 +1281,16 @@
},
"_children": [
{
"__id__": 2
9
"__id__": 2
8
}
],
"_active": true,
"_components": [
{
"__id__": 3
2
"__id__": 3
1
},
{
"__id__": 3
4
"__id__": 3
3
}
],
"_prefab": null,
...
...
@@ -1346,7 +1316,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-
821.1
06,
-
132.6
06,
5.519,
0,
0,
...
...
@@ -1376,16 +1346,16 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 2
8
"__id__": 2
7
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
30
"__id__":
29
},
{
"__id__": 3
1
"__id__": 3
0
}
],
"_prefab": null,
...
...
@@ -1441,7 +1411,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
9
"__id__": 2
8
},
"_enabled": true,
"_materials": [
...
...
@@ -1473,7 +1443,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
9
"__id__": 2
8
},
"_enabled": true,
"alignMode": 0,
...
...
@@ -1500,7 +1470,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
8
"__id__": 2
7
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1509,7 +1479,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 3
3
"__id__": 3
2
}
],
"_N$interactable": true,
...
...
@@ -1575,7 +1545,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 2
9
"__id__": 2
8
},
"_id": "a8bWaLdnFKA5ITxJunB2R2"
},
...
...
@@ -1594,7 +1564,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
8
"__id__": 2
7
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1625,16 +1595,16 @@
},
"_children": [
{
"__id__": 3
6
"__id__": 3
5
}
],
"_active": false,
"_components": [
{
"__id__": 3
9
"__id__": 3
8
},
{
"__id__": 4
1
"__id__": 4
0
}
],
"_prefab": null,
...
...
@@ -1690,16 +1660,16 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 3
5
"__id__": 3
4
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
7
"__id__": 3
6
},
{
"__id__": 3
8
"__id__": 3
7
}
],
"_prefab": null,
...
...
@@ -1755,7 +1725,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
6
"__id__": 3
5
},
"_enabled": true,
"_materials": [
...
...
@@ -1787,7 +1757,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
6
"__id__": 3
5
},
"_enabled": true,
"alignMode": 0,
...
...
@@ -1814,7 +1784,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
4
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -1823,7 +1793,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__":
40
"__id__":
39
}
],
"_N$interactable": true,
...
...
@@ -1879,7 +1849,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 3
6
"__id__": 3
5
},
"_id": "94dhG7VhpIZZJp5e+IJuYc"
},
...
...
@@ -1898,7 +1868,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
5
"__id__": 3
4
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -1929,16 +1899,16 @@
},
"_children": [
{
"__id__": 4
3
"__id__": 4
2
}
],
"_active": false,
"_components": [
{
"__id__": 4
6
"__id__": 4
5
},
{
"__id__": 4
8
"__id__": 4
7
}
],
"_prefab": null,
...
...
@@ -1994,16 +1964,16 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 4
2
"__id__": 4
1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
4
"__id__": 4
3
},
{
"__id__": 4
5
"__id__": 4
4
}
],
"_prefab": null,
...
...
@@ -2059,7 +2029,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
3
"__id__": 4
2
},
"_enabled": true,
"_materials": [
...
...
@@ -2091,7 +2061,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
3
"__id__": 4
2
},
"_enabled": true,
"alignMode": 0,
...
...
@@ -2118,7 +2088,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
2
"__id__": 4
1
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -2127,7 +2097,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 4
7
"__id__": 4
6
}
],
"_N$interactable": true,
...
...
@@ -2183,7 +2153,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 4
3
"__id__": 4
2
},
"_id": "23rFQGz+tCTpq6+bq4cJzR"
},
...
...
@@ -2202,7 +2172,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
2
"__id__": 4
1
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2235,13 +2205,13 @@
"_active": true,
"_components": [
{
"__id__":
50
"__id__":
49
},
{
"__id__": 5
1
"__id__": 5
0
},
{
"__id__": 5
2
"__id__": 5
1
}
],
"_prefab": null,
...
...
@@ -2267,7 +2237,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-625.6339999999999
,
62.86600000000004
,
-63.637,
0,
0,
...
...
@@ -2297,7 +2267,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
9
"__id__": 4
8
},
"_enabled": true,
"_materials": [
...
...
@@ -2332,7 +2302,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
9
"__id__": 4
8
},
"_enabled": false,
"_color": {
...
...
@@ -2350,7 +2320,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 4
9
"__id__": 4
8
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2383,10 +2353,10 @@
"_active": true,
"_components": [
{
"__id__": 5
4
"__id__": 5
3
},
{
"__id__": 5
5
"__id__": 5
4
}
],
"_prefab": null,
...
...
@@ -2412,7 +2382,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
602.1619999999999
,
1289.662
,
-57.424,
0,
0,
...
...
@@ -2442,7 +2412,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
3
"__id__": 5
2
},
"_enabled": true,
"_materials": [
...
...
@@ -2477,7 +2447,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
3
"__id__": 5
2
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2510,10 +2480,10 @@
"_active": true,
"_components": [
{
"__id__": 5
7
"__id__": 5
6
},
{
"__id__": 5
8
"__id__": 5
7
}
],
"_prefab": null,
...
...
@@ -2539,7 +2509,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-
829.5
540000000001,
-
141.0
540000000001,
129.536,
0,
0,
...
...
@@ -2569,7 +2539,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
6
"__id__": 5
5
},
"_enabled": true,
"_materials": [
...
...
@@ -2601,7 +2571,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
6
"__id__": 5
5
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2656,31 +2626,21 @@
"_id": "70MH/+uAVLfpCHqg4yKrpK"
},
{
"__type__": "cc.
Widget
",
"__type__": "cc.
ProgressBar
",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 22
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 44,
"_left": -0.12699999999997869,
"_right": 0.12699999999997869,
"_top": 0,
"_bottom": -14.92,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 2057,
"_originalHeight": 0,
"_id": "70m+PVzhhBpKXNmtdvKZ+d"
"_N$totalLength": 1,
"_N$barSprite": {
"__id__": 26
},
"_N$mode": 2,
"_N$progress": 1,
"_N$reverse": false,
"_id": "3dF8PkMLxEpKSPDwGAi86W"
},
{
"__type__": "cc.Node",
...
...
@@ -2693,13 +2653,10 @@
"_active": true,
"_components": [
{
"__id__": 62
},
{
"__id__": 63
"__id__": 61
},
{
"__id__": 6
4
"__id__": 6
2
}
],
"_prefab": null,
...
...
@@ -2726,7 +2683,7 @@
"ctor": "Float64Array",
"array": [
751.628,
0
,
-2.882
,
0,
0,
0,
...
...
@@ -2755,7 +2712,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
1
"__id__": 6
0
},
"_enabled": true,
"_materials": [
...
...
@@ -2782,39 +2739,12 @@
"_atlas": null,
"_id": "06ezJzYdpJt5zSfzWdMn2m"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 61
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -95.12800000000004,
"_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": "b7Ro9KwAtNfIUBPHuaYp3Q"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
1
"__id__": 6
0
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -2823,7 +2753,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 6
5
"__id__": 6
3
}
],
"_N$interactable": true,
...
...
@@ -2902,13 +2832,10 @@
"_active": false,
"_components": [
{
"__id__": 67
},
{
"__id__": 68
"__id__": 65
},
{
"__id__": 6
9
"__id__": 6
6
}
],
"_prefab": null,
...
...
@@ -2964,7 +2891,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
6
"__id__": 6
4
},
"_enabled": true,
"_materials": [
...
...
@@ -2991,39 +2918,12 @@
"_atlas": null,
"_id": "c4iYlOEjlP2r3+A4Sc9aCx"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 66
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right": -94.12800000000004,
"_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": "53meCrSy1LOaAujWL+Wt8W"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 6
6
"__id__": 6
4
},
"_enabled": true,
"_normalMaterial": null,
...
...
@@ -3032,7 +2932,7 @@
"zoomScale": 1.2,
"clickEvents": [
{
"__id__":
70
"__id__":
67
}
],
"_N$interactable": true,
...
...
@@ -3138,13 +3038,13 @@
"_active": false,
"_components": [
{
"__id__": 7
3
"__id__": 7
0
},
{
"__id__": 7
4
"__id__": 7
1
},
{
"__id__": 7
5
"__id__": 7
2
}
],
"_prefab": null,
...
...
@@ -3200,7 +3100,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
72
"__id__":
69
},
"_enabled": true,
"_materials": [
...
...
@@ -3232,7 +3132,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
72
"__id__":
69
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -3259,7 +3159,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
72
"__id__":
69
},
"_enabled": true,
"_id": "beaGv1g0JBZ59RUOJpzt0W"
...
...
@@ -3275,7 +3175,7 @@
"_active": false,
"_components": [
{
"__id__": 7
7
"__id__": 7
4
}
],
"_prefab": null,
...
...
@@ -3331,7 +3231,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
6
"__id__": 7
3
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -3362,16 +3262,16 @@
},
"_children": [
{
"__id__": 7
9
"__id__": 7
6
}
],
"_active": true,
"_components": [
{
"__id__":
82
"__id__":
79
},
{
"__id__": 8
3
"__id__": 8
0
}
],
"_prefab": null,
...
...
@@ -3427,16 +3327,16 @@
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 7
8
"__id__": 7
5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__":
80
"__id__":
77
},
{
"__id__":
81
"__id__":
78
}
],
"_prefab": null,
...
...
@@ -3492,7 +3392,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
9
"__id__": 7
6
},
"_enabled": true,
"_materials": [
...
...
@@ -3527,7 +3427,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
9
"__id__": 7
6
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -3554,7 +3454,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
8
"__id__": 7
5
},
"_enabled": true,
"_materials": [
...
...
@@ -3586,7 +3486,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
8
"__id__": 7
5
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -3667,21 +3567,21 @@
"__id__": 22
},
"playButton": {
"__id__": 3
2
"__id__": 3
1
},
"pauseButton": {
"__id__": 3
9
"__id__": 3
8
},
"restartButton": {
"__id__": 4
6
"__id__": 4
5
},
"backButton": null,
"forwardButton": null,
"durationLabel": {
"__id__": 5
4
"__id__": 5
3
},
"currentTimeLabel": {
"__id__":
50
"__id__":
49
},
"barTag": {
"__id__": 24
...
...
assets/ngt_video/Scene/ngt_video.js
View file @
aef7ab70
...
...
@@ -350,14 +350,17 @@ cc.Class({
this
.
currentTimeLabel
.
string
=
this
.
formatTime
(
ct
);
const
dur
=
this
.
videoPlayer
.
getDuration
();
const
percent
=
ct
/
dur
;
if
(
percent
>
1
)
{
percent
=
1
}
this
.
ProgressBar
.
getComponent
(
cc
.
ProgressBar
).
progress
=
percent
;
const
maxX
=
this
.
ProgressBar
.
width
;
const
minX
=
0
;
let
newX
=
percent
*
maxX
;
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
this
.
barTag
.
x
=
newX
>=
(
maxX
-
90
)?(
maxX
-
90
):(
newX
-
15
);
this
.
bar
.
width
=
newX
;
this
.
bar
.
x
=
0
-
(
maxX
/
2
);
this
.
barTag
.
x
=
newX
;
},
formatTime
(
time
)
{
if
(
time
===
undefined
)
{
return
''
;
...
...
assets/ngt_video/Texture/video/process.png
View replaced file @
b53b83f6
View file @
aef7ab70
852 Bytes
|
W:
|
H:
1.44 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/ngt_video/Texture/video/process.png.meta
View file @
aef7ab70
...
...
@@ -22,14 +22,14 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width":
211
,
"width":
1376
,
"height": 21,
"rawWidth":
211
,
"rawWidth":
1376
,
"rawHeight": 21,
"borderTop": 0,
"borderBottom": 0,
"borderLeft":
11
,
"borderRight":
9
,
"borderLeft":
8
,
"borderRight":
8
,
"subMetas": {}
}
}
...
...
assets/ngt_video/Texture/video/processbg.png
View replaced file @
b53b83f6
View file @
aef7ab70
988 Bytes
|
W:
|
H:
1004 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
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