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
Expand all
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
This diff is collapsed.
Click to expand it.
assets/ngt_video/Scene/ngt_video.js
View file @
aef7ab70
...
@@ -350,14 +350,17 @@ cc.Class({
...
@@ -350,14 +350,17 @@ cc.Class({
this
.
currentTimeLabel
.
string
=
this
.
formatTime
(
ct
);
this
.
currentTimeLabel
.
string
=
this
.
formatTime
(
ct
);
const
dur
=
this
.
videoPlayer
.
getDuration
();
const
dur
=
this
.
videoPlayer
.
getDuration
();
const
percent
=
ct
/
dur
;
const
percent
=
ct
/
dur
;
if
(
percent
>
1
)
{
percent
=
1
}
this
.
ProgressBar
.
getComponent
(
cc
.
ProgressBar
).
progress
=
percent
;
const
maxX
=
this
.
ProgressBar
.
width
;
const
maxX
=
this
.
ProgressBar
.
width
;
const
minX
=
0
;
const
minX
=
0
;
let
newX
=
percent
*
maxX
;
let
newX
=
percent
*
maxX
;
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
this
.
barTag
.
x
=
newX
>=
(
maxX
-
90
)?(
maxX
-
90
):(
newX
-
15
);
this
.
barTag
.
x
=
newX
;
this
.
bar
.
width
=
newX
;
this
.
bar
.
x
=
0
-
(
maxX
/
2
);
},
},
formatTime
(
time
)
{
formatTime
(
time
)
{
if
(
time
===
undefined
)
{
if
(
time
===
undefined
)
{
return
''
;
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 @@
...
@@ -22,14 +22,14 @@
"offsetY": 0,
"offsetY": 0,
"trimX": 0,
"trimX": 0,
"trimY": 0,
"trimY": 0,
"width":
211
,
"width":
1376
,
"height": 21,
"height": 21,
"rawWidth":
211
,
"rawWidth":
1376
,
"rawHeight": 21,
"rawHeight": 21,
"borderTop": 0,
"borderTop": 0,
"borderBottom": 0,
"borderBottom": 0,
"borderLeft":
11
,
"borderLeft":
8
,
"borderRight":
9
,
"borderRight":
8
,
"subMetas": {}
"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