Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
ns_video_map
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
ns_video_map
Commits
13c30981
Commit
13c30981
authored
May 01, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 新UI
parent
c48ab451
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
747 additions
and
48 deletions
+747
-48
progressScript.js
assets/ns_video_map/prefab/js/progressScript.js
+10
-0
bg_di.png
assets/ns_video_map/prefab/res/bg_di.png
+0
-0
bg_di.png.meta
assets/ns_video_map/prefab/res/bg_di.png.meta
+36
-0
bg_tiao.png
assets/ns_video_map/prefab/res/bg_tiao.png
+0
-0
bg_tiao.png.meta
assets/ns_video_map/prefab/res/bg_tiao.png.meta
+36
-0
ns_video_map.fire
assets/ns_video_map/scene/ns_video_map.fire
+513
-37
ns_video_map.ts
assets/ns_video_map/scene/ns_video_map.ts
+44
-11
btn_play.png
assets/ns_video_map/textures/btn_play.png
+0
-0
btn_play.png.meta
assets/ns_video_map/textures/btn_play.png.meta
+36
-0
btn_stop.png
assets/ns_video_map/textures/btn_stop.png
+0
-0
btn_stop.png.meta
assets/ns_video_map/textures/btn_stop.png.meta
+36
-0
icon_point.png
assets/ns_video_map/textures/icon_point.png
+0
-0
icon_point.png.meta
assets/ns_video_map/textures/icon_point.png.meta
+36
-0
No files found.
assets/ns_video_map/prefab/js/progressScript.js
View file @
13c30981
...
...
@@ -46,6 +46,7 @@ cc.Class({
this
.
barBaseW
=
this
.
bar
.
width
;
this
.
barSpr
=
this
.
bar
.
getComponent
(
cc
.
Sprite
);
this
.
barSf
=
this
.
barSpr
.
spriteFrame
;
this
.
barBtn
=
cc
.
find
(
"
barBtn
"
,
this
.
node
);
this
.
setProgress
(
0
);
},
...
...
@@ -62,9 +63,18 @@ cc.Class({
rect
.
width
=
w
;
this
.
bar
.
width
=
w
;
this
.
barSpr
.
spriteFrame
.
setRect
(
rect
);
this
.
setBarBtn
(
w
);
},
1
);
},
setBarBtn
(
w
)
{
if
(
!
this
.
barBtn
)
{
return
;
}
this
.
barBtn
.
x
=
w
;
},
// update (dt) {},
});
assets/ns_video_map/prefab/res/bg_di.png
0 → 100644
View file @
13c30981
1.37 KB
assets/ns_video_map/prefab/res/bg_di.png.meta
0 → 100644
View file @
13c30981
{
"ver": "2.3.5",
"uuid": "e47c7377-6024-4d80-bdaa-08f6128d6e09",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1136,
"height": 22,
"platformSettings": {},
"subMetas": {
"bg_di": {
"ver": "1.0.4",
"uuid": "e8357659-1266-4376-88ef-a3121f71ee34",
"rawTextureUuid": "e47c7377-6024-4d80-bdaa-08f6128d6e09",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1136,
"height": 22,
"rawWidth": 1136,
"rawHeight": 22,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ns_video_map/prefab/res/bg_tiao.png
0 → 100644
View file @
13c30981
1.37 KB
assets/ns_video_map/prefab/res/bg_tiao.png.meta
0 → 100644
View file @
13c30981
{
"ver": "2.3.5",
"uuid": "4808ebb7-71dc-437e-94bb-b3bbc856c79b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1136,
"height": 22,
"platformSettings": {},
"subMetas": {
"bg_tiao": {
"ver": "1.0.4",
"uuid": "60a74a74-2d69-49e3-ba49-b1f31fb0f5a1",
"rawTextureUuid": "4808ebb7-71dc-437e-94bb-b3bbc856c79b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1136,
"height": 22,
"rawWidth": 1136,
"rawHeight": 22,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ns_video_map/scene/ns_video_map.fire
View file @
13c30981
This diff is collapsed.
Click to expand it.
assets/ns_video_map/scene/ns_video_map.ts
View file @
13c30981
...
...
@@ -48,22 +48,52 @@ export default class SceneComponent extends MyCocosSceneComponent {
// this.initIcon();
}
playBtn
;
pauseBtn
;
initBtn
()
{
const
canvas
=
cc
.
find
(
"
Canvas
"
);
const
jumpBtn
=
cc
.
find
(
"
Canvas/btn_skip
"
);
//this.getSprNode('btn_right');
jumpBtn
.
on
(
'
touchstart
'
,
()
=>
{
this
.
videoPlayEnd
();
})
// jumpBtn.parent = canvas;
// jumpBtn.anchorX = 1;
// jumpBtn.anchorY = 1;
// jumpBtn.x = canvas.width / 2;
// jumpBtn.y = canvas.height / 2;
const
playBtn
=
cc
.
find
(
'
Canvas/btn_play
'
);
playBtn
.
on
(
'
click
'
,
()
=>
{
console
.
log
(
'
in click 1
'
)
this
.
video
.
play
();
this
.
refreshBtnState
();
})
playBtn
.
zIndex
=
10
;
this
.
playBtn
=
playBtn
;
this
.
playBtn
.
active
=
false
;
const
pauseBtn
=
cc
.
find
(
'
Canvas/btn_pause
'
);
pauseBtn
.
on
(
'
click
'
,
()
=>
{
console
.
log
(
'
in click 2
'
)
this
.
video
.
pause
();
this
.
refreshBtnState
();
})
pauseBtn
.
zIndex
=
10
;
this
.
pauseBtn
=
pauseBtn
;
this
.
pauseBtn
.
active
=
false
;
}
async
refreshBtnState
()
{
await
asyncDelay
(
0.01
);
if
(
this
.
video
.
isPlaying
())
{
this
.
pauseBtn
.
active
=
true
;
this
.
playBtn
.
active
=
false
;
}
else
{
this
.
pauseBtn
.
active
=
false
;
this
.
playBtn
.
active
=
true
;
}
}
...
...
@@ -152,7 +182,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
// return;
// }
video
.
play
();
checkIsPlaying
();
this
.
refreshBtnState
();
// checkIsPlaying();
})
const
checkIsPlaying
=
()
=>
{
...
...
@@ -227,7 +259,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
// return;
// }
video
.
play
();
checkIsPlaying
();
this
.
refreshBtnState
();
// checkIsPlaying();
})
const
checkIsPlaying
=
()
=>
{
...
...
@@ -450,9 +483,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
percent
=
percent
<
0
?
0
:
percent
;
percent
=
percent
>
1
?
1
:
percent
;
console
.
log
(
'
this.video.currentTime:
'
,
this
.
video
.
currentTime
);
console
.
log
(
'
this.video.getDuration():
'
,
this
.
video
.
getDuration
());
console
.
log
(
'
percent:
'
,
percent
);
//
console.log('this.video.currentTime: ', this.video.currentTime);
//
console.log('this.video.getDuration(): ', this.video.getDuration());
//
console.log('percent: ', percent);
this
.
progressJs
.
setProgress
(
percent
);
}
}
...
...
assets/ns_video_map/textures/btn_play.png
0 → 100644
View file @
13c30981
2.72 KB
assets/ns_video_map/textures/btn_play.png.meta
0 → 100644
View file @
13c30981
{
"ver": "2.3.5",
"uuid": "c1e47358-d474-4fa5-bc0c-c0fe545374fc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 90,
"height": 90,
"platformSettings": {},
"subMetas": {
"btn_play": {
"ver": "1.0.4",
"uuid": "b3f36e9c-7645-4a72-b831-b3456be17fc7",
"rawTextureUuid": "c1e47358-d474-4fa5-bc0c-c0fe545374fc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 90,
"height": 90,
"rawWidth": 90,
"rawHeight": 90,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ns_video_map/textures/btn_stop.png
0 → 100644
View file @
13c30981
3.17 KB
assets/ns_video_map/textures/btn_stop.png.meta
0 → 100644
View file @
13c30981
{
"ver": "2.3.5",
"uuid": "9134e709-56e6-4504-ad19-a7b5ef3f7519",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 90,
"height": 90,
"platformSettings": {},
"subMetas": {
"btn_stop": {
"ver": "1.0.4",
"uuid": "fde96e9d-780a-4322-a13a-88a834e944d2",
"rawTextureUuid": "9134e709-56e6-4504-ad19-a7b5ef3f7519",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 90,
"height": 90,
"rawWidth": 90,
"rawHeight": 90,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ns_video_map/textures/icon_point.png
0 → 100644
View file @
13c30981
1.65 KB
assets/ns_video_map/textures/icon_point.png.meta
0 → 100644
View file @
13c30981
{
"ver": "2.3.5",
"uuid": "da9aa884-5886-4107-89c8-e87509b435bd",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 35,
"height": 35,
"platformSettings": {},
"subMetas": {
"icon_point": {
"ver": "1.0.4",
"uuid": "726627f7-8e16-48da-9461-d69400adcd48",
"rawTextureUuid": "da9aa884-5886-4107-89c8-e87509b435bd",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 35,
"height": 35,
"rawWidth": 35,
"rawHeight": 35,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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