Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg29_museum
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
dg29_museum
Commits
05d776d4
Commit
05d776d4
authored
Dec 31, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试安卓兼容
parent
9dad377b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
dg29_museum.ts
assets/dg29_museum/scene/dg29_museum.ts
+17
-7
dg29_museum_game.ts
assets/dg29_museum/scene/dg29_museum_game.ts
+4
-4
No files found.
assets/dg29_museum/scene/dg29_museum.ts
View file @
05d776d4
...
...
@@ -81,7 +81,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
vplayer
.
resourceType
=
cc
.
VideoPlayer
.
ResourceType
.
REMOTE
;
this
.
vplayer
.
node
.
scale
=
0.01
pg
.
event
.
on
(
'
play_video
'
,
(
)
=>
{
this
.
playVideo
(
)
})
pg
.
event
.
on
(
'
play_video
'
,
(
state
)
=>
{
this
.
playVideo
(
state
)
})
}
tryPlayVideo
()
{
...
...
@@ -115,16 +115,26 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
playVideo
()
{
playVideo
(
state
)
{
this
.
videoCtrl
.
active
=
true
;
this
.
node
.
getChildByName
(
"
bg
"
).
active
=
false
;
this
.
vplayer
.
node
.
active
=
true
;
this
.
videoCtrl
.
getComponent
(
videoCtrl
).
setVideCom
(
this
.
vplayer
);
this
.
vplayer
.
volume
=
1
;
this
.
vplayer
.
node
.
scale
=
1
;
this
.
vplayer
.
currentTime
=
0
;
this
.
vplayer
.
play
();
if
(
state
==
1
)
{
this
.
videoCtrl
.
getComponent
(
videoCtrl
).
setVideCom
(
this
.
vplayer
);
this
.
vplayer
.
volume
=
1
;
this
.
vplayer
.
node
.
scale
=
1
;
this
.
vplayer
.
currentTime
=
0
;
this
.
vplayer
.
play
();
}
else
{
this
.
vplayer
.
volume
=
1
;
this
.
vplayer
.
node
.
scale
=
1
;
this
.
vplayer
.
currentTime
=
0
;
this
.
vplayer
.
pause
();
this
.
scheduleOnce
(()
=>
{
this
.
vplayer
.
play
();
},
0.1
)
}
}
playLocalAudio
(
audioName
)
{
...
...
assets/dg29_museum/scene/dg29_museum_game.ts
View file @
05d776d4
...
...
@@ -252,7 +252,7 @@ export default class dg29_museum_game extends cc.Component {
}
onTouchRestart
()
{
// 处理展示视频内容
this
.
showVideo
().
then
(()
=>
{
this
.
showVideo
(
2
).
then
(()
=>
{
// 底部显示为重新查看
this
.
btn_restart
.
active
=
true
;
// 播放小迪结束的动作与gameOver相关内容
...
...
@@ -273,7 +273,7 @@ export default class dg29_museum_game extends cc.Component {
this
.
label_tip_ing
.
active
=
false
;
// 处理展示视频内容
this
.
showVideo
().
then
(()
=>
{
this
.
showVideo
(
1
).
then
(()
=>
{
// 底部显示为重新查看
this
.
btn_restart
.
active
=
true
;
// 播放小迪结束的动作与gameOver相关内容
...
...
@@ -301,10 +301,10 @@ export default class dg29_museum_game extends cc.Component {
}
private
timeCtrl
:
TimeCtrl
;
showVideo
()
{
showVideo
(
state
)
{
return
new
Promise
(
async
(
reslove
)
=>
{
this
.
hideUI
();
pg
.
event
.
emit
(
"
play_video
"
)
pg
.
event
.
emit
(
"
play_video
"
,
state
)
this
.
timeCtrl
=
pg
.
time
.
delayCtrl
()
this
.
timeCtrl
.
fillTime
(
99999
);
await
this
.
timeCtrl
.
wait
();
...
...
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