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
c4902839
Commit
c4902839
authored
Oct 20, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 控制条的显隐
parent
1cb849ab
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
258 additions
and
160 deletions
+258
-160
ngt_video.fire
assets/ngt_video/Scene/ngt_video.fire
+219
-148
ngt_video.js
assets/ngt_video/Scene/ngt_video.js
+27
-1
defaultData.js
assets/ngt_video/Script/defaultData.js
+12
-11
No files found.
assets/ngt_video/Scene/ngt_video.fire
View file @
c4902839
This diff is collapsed.
Click to expand it.
assets/ngt_video/Scene/ngt_video.js
View file @
c4902839
...
@@ -176,6 +176,17 @@ cc.Class({
...
@@ -176,6 +176,17 @@ cc.Class({
});
});
this
.
videoPlayer
.
node
.
on
(
'
clicked
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
clicked
'
,
()
=>
{
console
.
log
(
'
clicked
'
);
console
.
log
(
'
clicked
'
);
if
(
this
.
isVideoFull
)
{
this
.
videoPlayer
.
stayOnBottom
=
true
;
cc
.
find
(
`Canvas/Controls`
).
active
=
true
;
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
cc
.
find
(
`Canvas/Controls`
).
active
=
false
;
},
6000
);
}
});
});
this
.
videoPlayer
.
node
.
on
(
'
playing
'
,
()
=>
{
this
.
videoPlayer
.
node
.
on
(
'
playing
'
,
()
=>
{
console
.
log
(
'
playing
'
);
console
.
log
(
'
playing
'
);
...
@@ -465,6 +476,7 @@ cc.Class({
...
@@ -465,6 +476,7 @@ cc.Class({
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
},
},
time1
:
null
,
isVideoFull
:
false
,
isVideoFull
:
false
,
fullScreen
()
{
fullScreen
()
{
if
(
this
.
isVideoFull
)
{
if
(
this
.
isVideoFull
)
{
...
@@ -472,6 +484,7 @@ cc.Class({
...
@@ -472,6 +484,7 @@ cc.Class({
}
}
console
.
log
(
"
====进入全屏===
"
);
console
.
log
(
"
====进入全屏===
"
);
this
.
isVideoFull
=
true
;
this
.
isVideoFull
=
true
;
this
.
videoPlayer
.
stayOnBottom
=
true
;
cc
.
find
(
`Canvas/Controls/fullscreen`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/fullscreen`
).
active
=
!
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
cc
.
find
(
`Canvas/Controls/exitfull`
).
active
=
this
.
isVideoFull
;
...
@@ -482,6 +495,11 @@ cc.Class({
...
@@ -482,6 +495,11 @@ cc.Class({
this
.
videoPlayer
.
node
.
width
=
this
.
node
.
width
;
this
.
videoPlayer
.
node
.
width
=
this
.
node
.
width
;
this
.
videoPlayer
.
node
.
height
=
this
.
node
.
height
;
this
.
videoPlayer
.
node
.
height
=
this
.
node
.
height
;
this
.
time1
=
setTimeout
(()
=>
{
this
.
videoPlayer
.
stayOnBottom
=
false
;
cc
.
find
(
`Canvas/Controls`
).
active
=
false
;
},
3000
);
},
},
exitFullScreen
()
{
exitFullScreen
()
{
...
@@ -500,6 +518,14 @@ cc.Class({
...
@@ -500,6 +518,14 @@ cc.Class({
this
.
videoPlayer
.
node
.
width
=
1377
;
this
.
videoPlayer
.
node
.
width
=
1377
;
this
.
videoPlayer
.
node
.
height
=
775
;
this
.
videoPlayer
.
node
.
height
=
775
;
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
},
onDestroy
()
{
if
(
this
.
time1
)
{
clearTimeout
(
this
.
time1
);
}
},
},
...
...
assets/ngt_video/Script/defaultData.js
View file @
c4902839
export
const
defaultData
=
{
export
const
defaultData
=
{
"
title
"
:
"
Hello Apples
"
,
"
title
"
:
"
Look,count and say and.
"
,
"
tipSwitch
"
:
0
,
"
tipSwitch
"
:
"
1
"
,
"
audio
"
:
"
http
s://staging-teach.cdn.ireadabc.com/c03129693e6cabf061661fba349fa031
.mp3
"
,
"
audio
"
:
"
http
://staging-teach.cdn.ireadabc.com/af5208a0e0d869f6be410c46e50bb501_l
.mp3
"
,
"
imgAni
"
:
{
"
imgAni
"
:
{
"
ske
"
:
{
"
ske
"
:
{
"
url
"
:
"
http
s://teach.cdn.ireadabc.com/e13afca23d37ba33489c0aaa61a515f5
.json
"
,
"
url
"
:
"
http
://staging-teach.cdn.ireadabc.com/a7dc36aa85121807bb7e049642192cec
.json
"
,
"
name
"
:
"
川阅阅
_ske.json
"
"
name
"
:
"
niao
_ske.json
"
},
},
"
tex
"
:
{
"
tex
"
:
{
"
url
"
:
"
http
s://teach.cdn.ireadabc.com/7afcddbb7f0127613059e574638a9f3e
.json
"
,
"
url
"
:
"
http
://staging-teach.cdn.ireadabc.com/c635daaa86b4c5c39f4af88e826d3433
.json
"
,
"
name
"
:
"
川阅阅
_tex.json
"
"
name
"
:
"
niao
_tex.json
"
},
},
"
png
"
:
{
"
png
"
:
{
"
url
"
:
"
http
s://teach.cdn.ireadabc.com/63699fcef6053eef4f58b89dad35af0b
.png
"
,
"
url
"
:
"
http
://staging-teach.cdn.ireadabc.com/75c87beb2b7d79033ace8978edc91a12
.png
"
,
"
name
"
:
"
川阅阅
_tex.png
"
"
name
"
:
"
niao
_tex.png
"
}
}
},
},
"
video_url
"
:
"
http://staging-teach.cdn.ireadabc.com/1dde63cee33e4445fbab13297479e733.mp4
"
"
video_url
"
:
"
http://staging-teach.cdn.ireadabc.com/c8b49f6f032bd91a637df072c01ccaf7.mp4
"
,
}
"
audioName
"
:
""
\ No newline at end of file
};
\ 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