Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg_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
dg_video
Commits
3e12b4fb
Commit
3e12b4fb
authored
Nov 02, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 循环播放
parent
d0ae7c80
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
192 additions
and
17 deletions
+192
-17
dg_video.fire
assets/dg_video/Scene/dg_video.fire
+117
-12
dg_video.js
assets/dg_video/Scene/dg_video.js
+27
-5
loading_ske.json
assets/dg_video/dragon/loading_ske.json
+1
-0
loading_ske.json.meta
assets/dg_video/dragon/loading_ske.json.meta
+5
-0
loading_tex.json
assets/dg_video/dragon/loading_tex.json
+1
-0
loading_tex.json.meta
assets/dg_video/dragon/loading_tex.json.meta
+5
-0
loading_tex.png
assets/dg_video/dragon/loading_tex.png
+0
-0
loading_tex.png.meta
assets/dg_video/dragon/loading_tex.png.meta
+36
-0
No files found.
assets/dg_video/Scene/dg_video.fire
View file @
3e12b4fb
...
...
@@ -100,18 +100,21 @@
},
{
"__id__": 112
},
{
"__id__": 114
}
],
"_active": true,
"_components": [
{
"__id__": 11
4
"__id__": 11
6
},
{
"__id__": 11
5
"__id__": 11
7
},
{
"__id__": 11
6
"__id__": 11
8
}
],
"_prefab": null,
...
...
@@ -2045,7 +2048,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1
3
5,
-1
53.88
5,
-3.5,
0,
0,
...
...
@@ -2259,7 +2262,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": -1
80.
5,
"_left": -1
99.38
5,
"_right": 0,
"_top": 0,
"_bottom": 0,
...
...
@@ -2319,7 +2322,7 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-1
35.692
,
-1
56.937
,
-4.481,
0,
0,
...
...
@@ -2533,7 +2536,7 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 8,
"_left": -
181.192
,
"_left": -
202.437
,
"_right": 0,
"_top": 0,
"_bottom": 0,
...
...
@@ -3125,8 +3128,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
5
37.028
,
-
2.99
2,
5
55.95
,
-
8.67
2,
0,
0,
0,
...
...
@@ -3194,7 +3197,7 @@
"_target": null,
"_alignFlags": 32,
"_left": 0,
"_right":
64.97199999999998
,
"_right":
46.049999999999955
,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
...
...
@@ -5112,8 +5115,8 @@
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-3
00.398
,
192.721
,
-3
49.97
,
270.168
,
0,
0,
0,
...
...
@@ -5169,6 +5172,108 @@
"_atlas": null,
"_id": "4eSLHdRBRFyp08vEy+C7J3"
},
{
"__type__": "cc.Node",
"_name": "loading",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 115
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 279,
"height": 180
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
332.841,
44.851,
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": "d0ZMTg0rxKCaL+r+EyWAkJ"
},
{
"__type__": "dragonBones.ArmatureDisplay",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_armatureName": "Armature",
"_animationName": "ufo",
"_preCacheMode": 0,
"_cacheMode": 0,
"playTimes": 0,
"premultipliedAlpha": false,
"_armatureKey": "288acd69-22c1-4220-a10c-2478978214fa#65279454-8940-4cc5-aebb-41989f70e57f",
"_accTime": 0,
"_playCount": 0,
"_frameCache": null,
"_curFrame": null,
"_playing": false,
"_armatureCache": null,
"_N$dragonAsset": {
"__uuid__": "288acd69-22c1-4220-a10c-2478978214fa"
},
"_N$dragonAtlasAsset": {
"__uuid__": "65279454-8940-4cc5-aebb-41989f70e57f"
},
"_N$_defaultArmatureIndex": 0,
"_N$_animationIndex": 1,
"_N$_defaultCacheMode": 0,
"_N$timeScale": 1,
"_N$debugBones": false,
"_N$enableBatch": false,
"_id": "85pbnJ3DhOO5vkZVP5GeAa"
},
{
"__type__": "cc.Canvas",
"_name": "",
...
...
assets/dg_video/Scene/dg_video.js
View file @
3e12b4fb
...
...
@@ -143,6 +143,7 @@ cc.Class({
// use this for initialization
_isPlayComplated
:
null
,
_isReadyToPlay
:
null
,
onLoad
()
{
cc
.
debug
.
setDisplayStats
(
false
);
...
...
@@ -160,8 +161,10 @@ cc.Class({
this
.
videoPlayer
.
node
.
on
(
'
meta-loaded
'
,
()
=>
{
console
.
log
(
'
meta-loaded
'
);
cc
.
find
(
`Canvas/bg_video_shadow`
).
active
=
false
;
this
.
_isReadyToPlay
=
tru
e
;
cc
.
find
(
`Canvas/loading`
).
active
=
fals
e
;
this
.
durationLabel
.
string
=
this
.
formatTime
(
this
.
videoPlayer
.
getDuration
());
this
.
_isReadyToPlay
=
true
;
this
.
_isPlayComplated
=
false
;
this
.
videoPlayer
.
currentTime
=
0
;
// this.videoPlayer.resume();
this
.
play
();
...
...
@@ -217,7 +220,15 @@ cc.Class({
this
.
_isPlayComplated
=
true
;
this
.
playButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
false
;
this
.
restartButton
.
node
.
active
=
true
;
this
.
restartButton
.
node
.
active
=
false
;
// 循环播放下一个
const
nextItem
=
this
.
videoItemList
[
this
.
videoPlayIndex
+
1
];
if
(
nextItem
)
{
nextItem
.
emit
(
'
my_item_click
'
);
}
else
{
this
.
videoItemList
[
0
].
emit
(
'
my_item_click
'
);
}
});
cc
.
view
.
setResizeCallback
((
params
)
=>
{
console
.
log
(
'
Resize
'
,
params
);
...
...
@@ -272,7 +283,11 @@ cc.Class({
this
.
updateBarByPos
(
this
.
barTag
.
x
);
});
},
videoItemList
:
null
,
videoPlayIndex
:
null
,
async
initView
()
{
this
.
videoItemList
=
[];
const
videoListContent
=
cc
.
find
(
`Canvas/videolist/view/content`
);
const
templateItem
=
cc
.
find
(
`item`
,
videoListContent
);
for
(
let
i
=
0
;
i
<
this
.
data
.
dataArr
.
length
;
i
++
)
{
...
...
@@ -293,7 +308,12 @@ cc.Class({
cc
.
find
(
`item_active/num`
,
itemClone
).
getComponent
(
cc
.
Label
).
string
=
(
i
+
1
>
9
?(
i
+
1
):
`0
${
i
+
1
}
`
);
cc
.
find
(
`item/num`
,
itemClone
).
getComponent
(
cc
.
Label
).
string
=
(
i
+
1
>
9
?(
i
+
1
):
`0
${
i
+
1
}
`
);
itemClone
.
attr
({
video_url
:
row
.
video_url
});
itemClone
.
attr
({
video_url
:
row
.
video_url
,
playIndex
:
i
});
itemClone
.
on
(
'
my_item_click
'
,
()
=>
{
// 无法用代码触发click事件,所以只能写一个自定义事件了
this
.
clickVideoItem
(
null
,
itemClone
);
});
this
.
videoItemList
.
push
(
itemClone
);
}
},
...
...
@@ -306,8 +326,8 @@ cc.Class({
}
},
// 选择视频播放
async
clickVideoItem
(
evt
)
{
const
item
=
evt
.
currentTarget
;
async
clickVideoItem
(
evt
,
_node
)
{
const
item
=
evt
?
evt
.
currentTarget
:
_node
;
if
(
!
item
.
video_url
)
{
this
.
showTips
(
"
视频不存在
"
);
return
;
...
...
@@ -316,7 +336,9 @@ cc.Class({
this
.
showTips
(
"
该视频正在播放
"
);
return
;
}
this
.
videoPlayIndex
=
item
.
playIndex
;
this
.
_isReadyToPlay
=
false
;
cc
.
find
(
`Canvas/loading`
).
active
=
true
;
cc
.
find
(
`Canvas/bg`
).
active
=
true
;
cc
.
find
(
`Canvas/bgwhite`
).
active
=
true
;
cc
.
find
(
`Canvas/bg_video_shadow`
).
active
=
true
;
...
...
assets/dg_video/dragon/loading_ske.json
0 → 100644
View file @
3e12b4fb
{
"name"
:
"loading"
,
"version"
:
"5.5"
,
"armature"
:[{
"name"
:
"Armature"
,
"ik"
:[],
"bone"
:[{
"name"
:
"root"
,
"transform"
:{}},{
"name"
:
"组_1"
,
"transform"
:{
"x"
:
2.05
,
"skY"
:
-90
,
"y"
:
40.15
,
"skX"
:
-90
},
"length"
:
65
,
"parent"
:
"root"
},{
"name"
:
"A"
,
"transform"
:{
"x"
:
74.1475
,
"skY"
:
90
,
"y"
:
-2.05
,
"skX"
:
90
},
"parent"
:
"组_1"
}],
"aabb"
:{
"x"
:
-139.5
,
"height"
:
180
,
"y"
:
-90
,
"width"
:
279
},
"defaultActions"
:[{
"gotoAndPlay"
:
"ufo"
}],
"animation"
:[{
"name"
:
"ufo"
,
"frame"
:[],
"bone"
:[{
"name"
:
"root"
,
"rotateFrame"
:[],
"translateFrame"
:[],
"scaleFrame"
:[]},{
"name"
:
"组_1"
,
"rotateFrame"
:[{
"duration"
:
15
,
"rotate"
:
8.3771
,
"curve"
:[
0
,
0
,
0.5
,
1
]},{
"duration"
:
15
,
"rotate"
:
10.9763
,
"tweenEasing"
:
0
},{
"duration"
:
0
,
"rotate"
:
8.3771
}],
"translateFrame"
:[{
"curve"
:[
0
,
0
,
0.5
,
1
],
"duration"
:
15
},{
"tweenEasing"
:
0
,
"y"
:
13.0573
,
"duration"
:
15
},{
"duration"
:
0
}],
"scaleFrame"
:[]},{
"name"
:
"A"
,
"rotateFrame"
:[{
"duration"
:
10
,
"tweenEasing"
:
0
},{
"duration"
:
10
,
"rotate"
:
-9.1133
,
"tweenEasing"
:
0
},{
"duration"
:
10
,
"rotate"
:
-13.9913
,
"tweenEasing"
:
0
},{
"duration"
:
0
}],
"translateFrame"
:[{
"tweenEasing"
:
0
,
"duration"
:
10
},{
"tweenEasing"
:
0
,
"x"
:
-6.4977
,
"y"
:
1.2205
,
"duration"
:
10
},{
"tweenEasing"
:
0
,
"x"
:
4.0509
,
"y"
:
-0.6604
,
"duration"
:
10
},{
"duration"
:
0
}],
"scaleFrame"
:[]}],
"playTimes"
:
0
,
"ffd"
:[],
"slot"
:[{
"name"
:
"组_1"
,
"displayFrame"
:[],
"colorFrame"
:[]},{
"name"
:
"A"
,
"displayFrame"
:[{
"duration"
:
10
},{
"duration"
:
10
,
"value"
:
1
},{
"duration"
:
10
,
"value"
:
2
},{
"duration"
:
0
}],
"colorFrame"
:[]}],
"ik"
:[],
"duration"
:
30
}],
"slot"
:[{
"name"
:
"组_1"
,
"color"
:{},
"parent"
:
"组_1"
},{
"name"
:
"A"
,
"color"
:{},
"z"
:
1
,
"parent"
:
"A"
}],
"skin"
:[{
"name"
:
""
,
"slot"
:[{
"name"
:
"A"
,
"display"
:[{
"name"
:
"ufo/A"
,
"transform"
:{
"skY"
:
-0.0263
,
"y"
:
-1.0025
,
"skX"
:
-0.0263
},
"type"
:
"image"
,
"path"
:
"ufo/A"
},{
"name"
:
"ufo/B"
,
"transform"
:{
"x"
:
4.5
,
"skY"
:
-0.0263
,
"y"
:
-1.0025
,
"skX"
:
-0.0263
},
"type"
:
"image"
,
"path"
:
"ufo/B"
},{
"name"
:
"ufo/C"
,
"transform"
:{
"x"
:
-4.5
,
"skY"
:
-0.0263
,
"y"
:
-0.5025
,
"skX"
:
-0.0263
},
"type"
:
"image"
,
"path"
:
"ufo/C"
}]},{
"name"
:
"组_1"
,
"display"
:[{
"name"
:
"ufo/组_1"
,
"transform"
:{
"x"
:
40.15
,
"skY"
:
89.9737
,
"y"
:
-2.05
,
"skX"
:
89.9737
},
"type"
:
"image"
,
"path"
:
"ufo/组_1"
}]}]}],
"frameRate"
:
24
,
"type"
:
"Armature"
}],
"frameRate"
:
24
,
"isGlobal"
:
0
}
\ No newline at end of file
assets/dg_video/dragon/loading_ske.json.meta
0 → 100644
View file @
3e12b4fb
{
"ver": "1.0.1",
"uuid": "288acd69-22c1-4220-a10c-2478978214fa",
"subMetas": {}
}
\ No newline at end of file
assets/dg_video/dragon/loading_tex.json
0 → 100644
View file @
3e12b4fb
{
"name"
:
"loading"
,
"imagePath"
:
"loading_tex.png"
,
"SubTexture"
:[{
"name"
:
"ufo/组_1"
,
"x"
:
1
,
"height"
:
180
,
"y"
:
1
,
"width"
:
279
},{
"name"
:
"ufo/A"
,
"x"
:
282
,
"height"
:
80
,
"y"
:
1
,
"width"
:
83
},{
"name"
:
"ufo/B"
,
"x"
:
282
,
"height"
:
80
,
"y"
:
83
,
"width"
:
60
},{
"name"
:
"ufo/C"
,
"x"
:
367
,
"height"
:
83
,
"y"
:
1
,
"width"
:
58
}],
"height"
:
256
,
"width"
:
512
}
\ No newline at end of file
assets/dg_video/dragon/loading_tex.json.meta
0 → 100644
View file @
3e12b4fb
{
"ver": "1.0.1",
"uuid": "65279454-8940-4cc5-aebb-41989f70e57f",
"subMetas": {}
}
\ No newline at end of file
assets/dg_video/dragon/loading_tex.png
0 → 100644
View file @
3e12b4fb
49.4 KB
assets/dg_video/dragon/loading_tex.png.meta
0 → 100644
View file @
3e12b4fb
{
"ver": "2.3.5",
"uuid": "f2d76ff5-c16f-4361-9362-661c20800248",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 512,
"height": 256,
"platformSettings": {},
"subMetas": {
"loading_tex": {
"ver": "1.0.4",
"uuid": "c8e21a8a-5f7f-4a9c-a0ba-4fefc26d652f",
"rawTextureUuid": "f2d76ff5-c16f-4361-9362-661c20800248",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -43,
"offsetY": 37,
"trimX": 1,
"trimY": 1,
"width": 424,
"height": 180,
"rawWidth": 512,
"rawHeight": 256,
"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