Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cartoon_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
cartoon_video
Commits
6e114f90
Commit
6e114f90
authored
Sep 26, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加重开
parent
229d6e20
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
355 additions
and
29 deletions
+355
-29
cartoon_video.meta
assets/cartoon_video.meta
+15
-1
cartoon_video.fire
assets/cartoon_video/Scene/cartoon_video.fire
+334
-25
cartoon_video.js
assets/cartoon_video/Scene/cartoon_video.js
+6
-3
No files found.
assets/cartoon_video.meta
View file @
6e114f90
{"ver":"1.1.2","uuid":"4f557179-a05f-4891-bac0-6a3d0275c8ce","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "4f557179-a05f-4891-bac0-6a3d0275c8ce",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/cartoon_video/Scene/cartoon_video.fire
View file @
6e114f90
...
...
@@ -90,13 +90,13 @@
"_active": true,
"_components": [
{
"__id__":
58
"__id__":
65
},
{
"__id__":
59
"__id__":
66
},
{
"__id__": 6
0
"__id__": 6
7
}
],
"_prefab": null,
...
...
@@ -1054,7 +1054,7 @@
"_active": true,
"_components": [
{
"__id__":
57
"__id__":
64
}
],
"_prefab": null,
...
...
@@ -1126,19 +1126,22 @@
"__id__": 45
},
{
"__id__":
49
"__id__":
52
},
{
"__id__": 52
"__id__": 56
},
{
"__id__": 59
}
],
"_active": true,
"_components": [
{
"__id__":
55
"__id__":
62
},
{
"__id__":
56
"__id__":
63
}
],
"_prefab": null,
...
...
@@ -2029,6 +2032,310 @@
"_originalHeight": 0,
"_id": "63E/r5Pw5MfYZmJfXTJ6bG"
},
{
"__type__": "cc.Node",
"_name": "Restart",
"_objFlags": 0,
"_parent": {
"__id__": 25
},
"_children": [
{
"__id__": 46
}
],
"_active": false,
"_components": [
{
"__id__": 49
},
{
"__id__": 51
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 209,
"height": 218
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1180,
16,
0,
0,
0,
0,
1,
1,
1,
0.5
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8drp6fHuFLyphSJlVtbhhf"
},
{
"__type__": "cc.Node",
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 47
},
{
"__id__": 48
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 238,
"height": 256
},
"_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,
0
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "4fztIuEW5Eqqs6ZXr0imzF"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "16ea0a4c-9fd6-4334-8f5a-56b9ec1673f8"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "eequwmnWdCoIc1Uk/eXoss"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
},
"_enabled": true,
"alignMode": 0,
"_target": null,
"_alignFlags": 45,
"_left": -14.5,
"_right": -14.5,
"_top": -19,
"_bottom": -19,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 40,
"_id": "c9E0ZHd6ZEfomfQxBaI53I"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 50
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_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": {
"__id__": 46
},
"_id": "23rFQGz+tCTpq6+bq4cJzR"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "280c3rsZJJKnZ9RqbALVwtK",
"handler": "replay",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 45
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": -256,
"_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": "84W8oDETlDNKQpFEh8y23S"
},
{
"__type__": "cc.Node",
"_name": "CurrentLabel",
...
...
@@ -2040,13 +2347,13 @@
"_active": true,
"_components": [
{
"__id__":
46
"__id__":
53
},
{
"__id__":
47
"__id__":
54
},
{
"__id__":
48
"__id__":
55
}
],
"_prefab": null,
...
...
@@ -2102,7 +2409,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
45
"__id__":
52
},
"_enabled": true,
"_materials": [
...
...
@@ -2135,7 +2442,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
45
"__id__":
52
},
"_enabled": false,
"_color": {
...
...
@@ -2153,7 +2460,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
45
"__id__":
52
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2186,10 +2493,10 @@
"_active": true,
"_components": [
{
"__id__": 5
0
"__id__": 5
7
},
{
"__id__": 5
1
"__id__": 5
8
}
],
"_prefab": null,
...
...
@@ -2245,7 +2552,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
49
"__id__":
56
},
"_enabled": true,
"_materials": [
...
...
@@ -2278,7 +2585,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__":
49
"__id__":
56
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2311,10 +2618,10 @@
"_active": true,
"_components": [
{
"__id__":
53
"__id__":
60
},
{
"__id__":
54
"__id__":
61
}
],
"_prefab": null,
...
...
@@ -2370,7 +2677,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
2
"__id__": 5
9
},
"_enabled": true,
"_materials": [
...
...
@@ -2402,7 +2709,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
2
"__id__": 5
9
},
"_enabled": true,
"alignMode": 1,
...
...
@@ -2574,14 +2881,16 @@
"pauseButton": {
"__id__": 42
},
"restartButton": null,
"restartButton": {
"__id__": 49
},
"backButton": null,
"forwardButton": null,
"durationLabel": {
"__id__": 5
0
"__id__": 5
7
},
"currentTimeLabel": {
"__id__":
46
"__id__":
53
},
"barTag": {
"__id__": 27
...
...
assets/cartoon_video/Scene/cartoon_video.js
View file @
6e114f90
...
...
@@ -179,6 +179,7 @@ cc.Class({
console
.
log
(
'
playing
'
);
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
this
.
playButton
.
node
.
active
=
false
;
this
.
restartButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
true
;
});
this
.
videoPlayer
.
node
.
on
(
'
paused
'
,
()
=>
{
...
...
@@ -193,9 +194,10 @@ cc.Class({
});
this
.
videoPlayer
.
node
.
on
(
'
completed
'
,
async
()
=>
{
console
.
log
(
'
completed
'
);
this
.
videoPlayer
.
currentTime
=
0
;
// this.playButton.node.active = true;
// this.pauseButton.node.active = false;
// this.videoPlayer.currentTime = 0;
this
.
playButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
false
;
this
.
restartButton
.
node
.
active
=
true
;
});
cc
.
view
.
setResizeCallback
((
params
)
=>
{
console
.
log
(
'
Resize
'
,
params
);
...
...
@@ -448,6 +450,7 @@ cc.Class({
if
(
this
.
videoPlayer
.
isPlaying
())
{
if
(
this
.
playButton
.
node
.
active
)
{
this
.
playButton
.
node
.
active
=
false
;
this
.
restartButton
.
node
.
active
=
false
;
}
if
(
!
this
.
pauseButton
.
node
.
active
)
{
this
.
pauseButton
.
node
.
active
=
true
;
...
...
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