Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn03_playVideo
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
sn03_playVideo
Commits
e73c5be5
Commit
e73c5be5
authored
Nov 13, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化背景显示
parent
61c13b34
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
541 additions
and
273 deletions
+541
-273
sn03_playVideo.fire
assets/sn03_playVideo/Scene/sn03_playVideo.fire
+514
-262
sn03_playVideo.ts
assets/sn03_playVideo/Scene/sn03_playVideo.ts
+2
-0
videoControl_sn03_playVideo.ts
assets/sn03_playVideo/Script/videoControl_sn03_playVideo.ts
+25
-11
No files found.
assets/sn03_playVideo/Scene/sn03_playVideo.fire
View file @
e73c5be5
This diff is collapsed.
Click to expand it.
assets/sn03_playVideo/Scene/sn03_playVideo.ts
View file @
e73c5be5
...
@@ -570,6 +570,8 @@ export default class VideoPlayerComponent extends cc.Component {
...
@@ -570,6 +570,8 @@ export default class VideoPlayerComponent extends cc.Component {
if
(
!
this
.
_isReadyToPlay
)
{
if
(
!
this
.
_isReadyToPlay
)
{
console
.
log
(
"
视频还未准备好
"
)
console
.
log
(
"
视频还未准备好
"
)
return
;
return
;
}
else
{
console
.
log
(
"
播放
"
)
}
}
cc
.
find
(
`Canvas/text_tips`
).
active
=
false
;
cc
.
find
(
`Canvas/text_tips`
).
active
=
false
;
...
...
assets/sn03_playVideo/Script/videoControl_sn03_playVideo.ts
View file @
e73c5be5
...
@@ -93,12 +93,14 @@ export default class NewClass extends cc.Component {
...
@@ -93,12 +93,14 @@ export default class NewClass extends cc.Component {
this
.
node
.
emit
(
"
play
"
)
this
.
node
.
emit
(
"
play
"
)
this
.
btn_play
.
active
=
false
;
this
.
btn_play
.
active
=
false
;
this
.
btn_pause
.
active
=
true
;
this
.
btn_pause
.
active
=
true
;
this
.
scheduleHideProgressBar
();
}
}
onPauseClick
()
{
onPauseClick
()
{
this
.
node
.
emit
(
"
pause
"
)
this
.
node
.
emit
(
"
pause
"
)
this
.
btn_pause
.
active
=
false
;
this
.
btn_pause
.
active
=
false
;
this
.
btn_play
.
active
=
true
;
this
.
btn_play
.
active
=
true
;
this
.
scheduleHideProgressBar
();
}
}
onFuscreenClick
()
{
onFuscreenClick
()
{
...
@@ -131,10 +133,7 @@ export default class NewClass extends cc.Component {
...
@@ -131,10 +133,7 @@ export default class NewClass extends cc.Component {
show
(){
show
(){
this
.
node
.
opacity
=
255
;
this
.
node
.
opacity
=
255
;
this
.
node
.
x
=
0
;
this
.
node
.
x
=
0
;
this
.
cleanMyTimeout
()
this
.
scheduleHideProgressBar
();
this
.
hideSetTimeoutId
=
setTimeout
(()
=>
{
this
.
hide
()
},
5000
);
}
}
hide
(){
hide
(){
...
@@ -156,6 +155,13 @@ export default class NewClass extends cc.Component {
...
@@ -156,6 +155,13 @@ export default class NewClass extends cc.Component {
},
1000
)
},
1000
)
}
}
scheduleHideProgressBar
()
{
this
.
cleanMyTimeout
()
this
.
hideSetTimeoutId
=
setTimeout
(()
=>
{
this
.
hide
()
},
5000
);
}
cleanMyTimeout
()
{
cleanMyTimeout
()
{
if
(
this
.
hideSetTimeoutId
)
{
if
(
this
.
hideSetTimeoutId
)
{
clearTimeout
(
this
.
hideSetTimeoutId
);
clearTimeout
(
this
.
hideSetTimeoutId
);
...
@@ -238,16 +244,24 @@ export default class NewClass extends cc.Component {
...
@@ -238,16 +244,24 @@ export default class NewClass extends cc.Component {
this
.
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
);
this
.
node
.
off
(
cc
.
Node
.
EventType
.
TOUCH_END
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
(
e
)
=>
{
this
.
node
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
(
e
)
=>
{
if
(
this
.
draging
)
{
this
.
draging
=
false
;
this
.
draging
=
false
;
this
.
node
.
emit
(
"
play
"
)
this
.
node
.
emit
(
"
play
"
)
this
.
btn_play
.
active
=
false
;
this
.
btn_pause
.
active
=
true
;
this
.
centerInfo
.
active
=
false
;
this
.
centerInfo
.
active
=
false
;
}
});
});
this
.
node
.
off
(
cc
.
Node
.
EventType
.
MOUSE_UP
);
this
.
node
.
off
(
cc
.
Node
.
EventType
.
MOUSE_UP
);
this
.
node
.
on
(
cc
.
Node
.
EventType
.
MOUSE_UP
,
(
e
)
=>
{
this
.
node
.
on
(
cc
.
Node
.
EventType
.
MOUSE_UP
,
(
e
)
=>
{
if
(
this
.
draging
)
{
this
.
draging
=
false
;
this
.
draging
=
false
;
this
.
node
.
emit
(
"
play
"
);
this
.
node
.
emit
(
"
play
"
)
this
.
btn_play
.
active
=
false
;
this
.
btn_pause
.
active
=
true
;
this
.
centerInfo
.
active
=
false
;
this
.
centerInfo
.
active
=
false
;
}
});
});
}
}
...
...
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