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
bb5c7c3e
Commit
bb5c7c3e
authored
Dec 31, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试报错点
parent
fafe14e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
71 deletions
+126
-71
dg29_museum.ts
assets/dg29_museum/scene/dg29_museum.ts
+126
-71
No files found.
assets/dg29_museum/scene/dg29_museum.ts
View file @
bb5c7c3e
...
@@ -418,77 +418,77 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -418,77 +418,77 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
videoPlayer
.
node
.
x
=
-
10000
;
this
.
videoPlayer
.
node
.
x
=
-
10000
;
this
.
videoPlayer
.
node
.
y
=
-
10000
;
this
.
videoPlayer
.
node
.
y
=
-
10000
;
this
.
layout_video
.
active
=
false
;
this
.
layout_video
.
active
=
false
;
this
.
videoPlayer
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
//
this.videoPlayer.node.on('ready-to-play', () => {
console
.
log
(
'
ready-to-play
'
);
//
console.log('ready-to-play');
this
.
_isReadyToPlay
=
true
;
//
this._isReadyToPlay = true;
this
.
_isPlayComplated
=
false
;
//
this._isPlayComplated = false;
this
.
videoPlayer
.
currentTime
=
0
;
//
this.videoPlayer.currentTime = 0;
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
meta-loaded
'
,
()
=>
{
//
this.videoPlayer.node.on('meta-loaded', () => {
console
.
log
(
'
meta-loaded
'
);
//
console.log('meta-loaded');
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
clicked
'
,
()
=>
{
//
this.videoPlayer.node.on('clicked', () => {
if
(
!
this
.
node
)
return
;
//
if (!this.node) return;
if
(
!
this
.
videoPlayer
)
return
;
//
if (!this.videoPlayer) return;
if
(
!
this
.
layout_video
)
return
;
//
if (!this.layout_video) return;
this
.
videoPlayer
.
stayOnBottom
=
true
;
//
this.videoPlayer.stayOnBottom = true;
this
.
videoControls
.
active
=
true
;
//
this.videoControls.active = true;
if
(
this
.
time1
)
{
//
if (this.time1) {
clearTimeout
(
this
.
time1
);
//
clearTimeout(this.time1);
}
//
}
this
.
time1
=
setTimeout
(()
=>
{
//
this.time1 = setTimeout(() => {
if
(
!
this
.
node
)
return
;
//
if (!this.node) return;
if
(
!
this
.
videoPlayer
)
return
;
//
if (!this.videoPlayer) return;
if
(
!
this
.
layout_video
)
return
;
//
if (!this.layout_video) return;
this
.
videoPlayer
.
stayOnBottom
=
false
;
//
this.videoPlayer.stayOnBottom = false;
this
.
videoControls
.
active
=
false
;
//
this.videoControls.active = false;
},
6000
);
//
}, 6000);
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
touchstart
'
,
()
=>
{
//
this.videoPlayer.node.on('touchstart', () => {
if
(
!
this
.
node
)
return
;
//
if (!this.node) return;
if
(
!
this
.
videoPlayer
)
return
;
//
if (!this.videoPlayer) return;
if
(
!
this
.
layout_video
)
return
;
//
if (!this.layout_video) return;
this
.
videoPlayer
.
stayOnBottom
=
true
;
//
this.videoPlayer.stayOnBottom = true;
this
.
videoControls
.
active
=
true
;
//
this.videoControls.active = true;
if
(
this
.
time1
)
{
//
if (this.time1) {
clearTimeout
(
this
.
time1
);
//
clearTimeout(this.time1);
}
//
}
this
.
time1
=
setTimeout
(()
=>
{
//
this.time1 = setTimeout(() => {
if
(
!
this
.
node
)
return
;
//
if (!this.node) return;
if
(
!
this
.
videoPlayer
)
return
;
//
if (!this.videoPlayer) return;
if
(
!
this
.
layout_video
)
return
;
//
if (!this.layout_video) return;
this
.
videoPlayer
.
stayOnBottom
=
false
;
//
this.videoPlayer.stayOnBottom = false;
this
.
videoControls
.
active
=
false
;
//
this.videoControls.active = false;
},
6000
);
//
}, 6000);
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
playing
'
,
()
=>
{
//
this.videoPlayer.node.on('playing', () => {
this
.
playButton
.
active
=
false
;
//
this.playButton.active = false;
this
.
pauseButton
.
active
=
true
;
//
this.pauseButton.active = true;
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
paused
'
,
()
=>
{
//
this.videoPlayer.node.on('paused', () => {
console
.
log
(
'
paused
'
);
//
console.log('paused');
this
.
playButton
.
active
=
true
;
//
this.playButton.active = true;
this
.
pauseButton
.
active
=
false
;
//
this.pauseButton.active = false;
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
stopped
'
,
()
=>
{
//
this.videoPlayer.node.on('stopped', () => {
console
.
log
(
'
stopped
'
);
//
console.log('stopped');
this
.
playButton
.
active
=
true
;
//
this.playButton.active = true;
this
.
pauseButton
.
active
=
false
;
//
this.pauseButton.active = false;
});
//
});
this
.
videoPlayer
.
node
.
on
(
'
completed
'
,
async
()
=>
{
//
this.videoPlayer.node.on('completed', async () => {
console
.
log
(
'
completed
'
);
//
console.log('completed');
this
.
_isPlayComplated
=
true
;
//
this._isPlayComplated = true;
this
.
playButton
.
active
=
false
;
//
this.playButton.active = false;
this
.
pauseButton
.
active
=
false
;
//
this.pauseButton.active = false;
// 循环播放下一个
//
// 循环播放下一个
this
.
hideVideo
();
//
this.hideVideo();
});
//
});
cc
.
view
.
setResizeCallback
((
params
)
=>
{
//
cc.view.setResizeCallback((params) => {
console
.
log
(
'
Resize
'
,
params
);
//
console.log('Resize', params);
this
.
initdDrag
()
//
this.initdDrag()
});
//
});
this
.
initdDrag
();
//
this.initdDrag();
}
}
initdDrag
()
{
initdDrag
()
{
...
@@ -534,6 +534,61 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -534,6 +534,61 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
updateBarByPos
(
this
.
barTag
.
x
);
this
.
updateBarByPos
(
this
.
barTag
.
x
);
});
});
}
}
onVideoPlayerEvent
(
sender
,
event
)
{
cc
.
log
(
event
)
if
(
event
===
cc
.
VideoPlayer
.
EventType
.
CLICKED
)
{
}
else
if
(
event
===
cc
.
VideoPlayer
.
EventType
.
READY_TO_PLAY
||
event
===
cc
.
VideoPlayer
.
EventType
.
META_LOADED
)
{
}
else
if
(
event
===
cc
.
VideoPlayer
.
EventType
.
PLAYING
)
{
cc
.
log
(
"
=========
"
)
cc
.
log
(
sender
);
cc
.
log
(
sender
.
_impl
.
_h
)
cc
.
log
(
sender
.
_impl
.
_w
);
if
(
sender
?.
_impl
?.
_w
)
{
// this.vplayer.node.scale = cc.winSize.width / sender._impl._w;
}
}
else
if
(
event
===
cc
.
VideoPlayer
.
EventType
.
COMPLETED
)
{
this
.
_isPlayComplated
=
true
;
this
.
playButton
.
active
=
false
;
this
.
pauseButton
.
active
=
false
;
// 循环播放下一个
this
.
hideVideo
();
// this.videoCtrl.active = false;
// this.node.getChildByName("bg").active = true;
// cc.log("video completed");
// this.boyNode.active = true;
// this.vplayer.node.active = false;
// if (this.WrongList.length > 0) {
// this.initWorongLogic();
// } else {
// this.boyNode.getComponent(Boy).playtalk(-1);
// this.playAudioByUrl(this.data.audio_url_end, () => {
// this.boyNode.getComponent(Boy).playWave(-1);
// this.btn_next.active = true;
// })
// }
}
}
updateBarByPos
(
newX
)
{
updateBarByPos
(
newX
)
{
const
maxX
=
this
.
ProgressBar
.
width
;
const
maxX
=
this
.
ProgressBar
.
width
;
const
minX
=
0
;
const
minX
=
0
;
...
...
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