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
eb739a36
Commit
eb739a36
authored
Oct 18, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 全屏
parent
2a172259
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
576 additions
and
40 deletions
+576
-40
ngt_video.fire
assets/ngt_video/Scene/ngt_video.fire
+456
-32
ngt_video.js
assets/ngt_video/Scene/ngt_video.js
+47
-7
defaultData.js
assets/ngt_video/Script/defaultData.js
+1
-1
bg_empty.jpg
assets/ngt_video/Texture/video/bg_empty.jpg
+0
-0
btn_replay.png
assets/ngt_video/Texture/video/btn_replay.png
+0
-0
exitfull.png
assets/ngt_video/Texture/video/exitfull.png
+0
-0
exitfull.png.meta
assets/ngt_video/Texture/video/exitfull.png.meta
+36
-0
fullscreen.png
assets/ngt_video/Texture/video/fullscreen.png
+0
-0
fullscreen.png.meta
assets/ngt_video/Texture/video/fullscreen.png.meta
+36
-0
No files found.
assets/ngt_video/Scene/ngt_video.fire
View file @
eb739a36
This diff is collapsed.
Click to expand it.
assets/ngt_video/Scene/ngt_video.js
View file @
eb739a36
...
@@ -226,8 +226,9 @@ cc.Class({
...
@@ -226,8 +226,9 @@ cc.Class({
});
});
this
.
barTag
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
);
this
.
barTag
.
off
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
);
this
.
barTag
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,(
e
)
=>
{
this
.
barTag
.
on
(
cc
.
Node
.
EventType
.
TOUCH_MOVE
,(
e
)
=>
{
console
.
log
(
"
TOUCH_MOVE
"
);
var
delta
=
e
.
getDelta
();
var
delta
=
e
.
getDelta
();
let
newX
=
this
.
barTag
.
x
+
delta
.
x
*
2
;
let
newX
=
this
.
barTag
.
x
+
delta
.
x
;
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
newX
=
Math
.
min
(
maxX
,
Math
.
max
(
newX
,
minX
));
this
.
barTag
.
x
=
newX
;
this
.
barTag
.
x
=
newX
;
...
@@ -315,7 +316,6 @@ cc.Class({
...
@@ -315,7 +316,6 @@ cc.Class({
});
});
const
animaNode
=
animNode
[
'
animaNode
'
];
const
animaNode
=
animNode
[
'
animaNode
'
];
animaNode
.
scale
=
0.667
;
animaNode
.
x
=
500
;
animaNode
.
x
=
500
;
const
db
=
animaNode
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
db
=
animaNode
.
getComponent
(
dragonBones
.
ArmatureDisplay
);
const
anis
=
db
.
getAnimationNames
(
"
armatureName
"
);
const
anis
=
db
.
getAnimationNames
(
"
armatureName
"
);
...
@@ -389,7 +389,7 @@ cc.Class({
...
@@ -389,7 +389,7 @@ cc.Class({
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
;
this
.
barTag
.
x
=
newX
>=
(
maxX
-
90
)?(
maxX
-
90
):
newX
;
this
.
bar
.
width
=
newX
;
this
.
bar
.
width
=
newX
;
this
.
bar
.
x
=
0
-
(
maxX
/
2
);
this
.
bar
.
x
=
0
-
(
maxX
/
2
);
},
},
...
@@ -465,6 +465,43 @@ cc.Class({
...
@@ -465,6 +465,43 @@ cc.Class({
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
},
},
isVideoFull
:
false
,
fullScreen
()
{
if
(
this
.
isVideoFull
)
{
return
;
}
console
.
log
(
"
====进入全屏===
"
);
this
.
isVideoFull
=
true
;
cc
.
find
(
`Canvas/Controls/fullscreen`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/video_node`
).
width
=
this
.
node
.
width
;
cc
.
find
(
`Canvas/video_node`
).
height
=
this
.
node
.
height
;
cc
.
find
(
`Canvas/bg_empty`
).
width
=
this
.
node
.
width
;
cc
.
find
(
`Canvas/bg_empty`
).
height
=
this
.
node
.
height
;
this
.
videoPlayer
.
node
.
width
=
this
.
node
.
width
;
this
.
videoPlayer
.
node
.
height
=
this
.
node
.
height
;
},
exitFullScreen
()
{
if
(
!
this
.
isVideoFull
)
{
return
;
}
console
.
log
(
"
====退出全屏===
"
);
this
.
isVideoFull
=
false
;
cc
.
find
(
`Canvas/Controls/fullscreen`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/video_node`
).
width
=
1377
;
cc
.
find
(
`Canvas/video_node`
).
height
=
775
;
cc
.
find
(
`Canvas/bg_empty`
).
width
=
1377
;
cc
.
find
(
`Canvas/bg_empty`
).
height
=
775
;
this
.
videoPlayer
.
node
.
width
=
1377
;
this
.
videoPlayer
.
node
.
height
=
775
;
},
// called every frame
// called every frame
update
:
function
(
dt
)
{
update
:
function
(
dt
)
{
...
@@ -499,6 +536,9 @@ cc.Class({
...
@@ -499,6 +536,9 @@ cc.Class({
if
(
this
.
pauseButton
.
node
.
active
)
{
if
(
this
.
pauseButton
.
node
.
active
)
{
this
.
pauseButton
.
node
.
active
=
false
;
this
.
pauseButton
.
node
.
active
=
false
;
}
}
if
(
this
.
restartButton
.
node
.
active
)
{
this
.
playButton
.
node
.
active
=
false
;
}
}
}
}
}
...
...
assets/ngt_video/Script/defaultData.js
View file @
eb739a36
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
export
const
defaultData
=
{
export
const
defaultData
=
{
"
title
"
:
"
Hello Apples
"
,
"
title
"
:
"
Hello Apples
"
,
"
tipSwitch
"
:
1
,
"
tipSwitch
"
:
0
,
"
audio
"
:
"
https://staging-teach.cdn.ireadabc.com/c03129693e6cabf061661fba349fa031.mp3
"
,
"
audio
"
:
"
https://staging-teach.cdn.ireadabc.com/c03129693e6cabf061661fba349fa031.mp3
"
,
"
imgAni
"
:
{
"
imgAni
"
:
{
"
ske
"
:
{
"
ske
"
:
{
...
...
assets/ngt_video/Texture/video/bg_empty.jpg
View replaced file @
2a172259
View file @
eb739a36
186 KB
|
W:
|
H:
183 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/ngt_video/Texture/video/btn_replay.png
View replaced file @
2a172259
View file @
eb739a36
13.2 KB
|
W:
|
H:
12.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/ngt_video/Texture/video/exitfull.png
0 → 100644
View file @
eb739a36
2.45 KB
assets/ngt_video/Texture/video/exitfull.png.meta
0 → 100644
View file @
eb739a36
{
"ver": "2.3.5",
"uuid": "eca6275d-4886-4508-b957-b359c4d6c6b4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 64,
"platformSettings": {},
"subMetas": {
"exitfull": {
"ver": "1.0.4",
"uuid": "0a604615-4a1e-4bb1-b106-3a95f04d3e88",
"rawTextureUuid": "eca6275d-4886-4508-b957-b359c4d6c6b4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 1,
"trimY": 1,
"width": 62,
"height": 62,
"rawWidth": 64,
"rawHeight": 64,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/ngt_video/Texture/video/fullscreen.png
0 → 100644
View file @
eb739a36
2.83 KB
assets/ngt_video/Texture/video/fullscreen.png.meta
0 → 100644
View file @
eb739a36
{
"ver": "2.3.5",
"uuid": "2da91cfa-5880-4e41-bfbd-997e31f618c6",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 64,
"height": 64,
"platformSettings": {},
"subMetas": {
"fullscreen": {
"ver": "1.0.4",
"uuid": "e6977100-ddff-47b9-8887-5f6476bdca44",
"rawTextureUuid": "2da91cfa-5880-4e41-bfbd-997e31f618c6",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 64,
"height": 64,
"rawWidth": 64,
"rawHeight": 64,
"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