Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xy_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
xy_video
Commits
3269a629
Commit
3269a629
authored
Aug 12, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 答题
parent
e309141a
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1140 additions
and
1003 deletions
+1140
-1003
xy_video.fire
assets/xy_video/Scene/xy_video.fire
+460
-1001
xy_video.js
assets/xy_video/Scene/xy_video.js
+78
-2
util.js
assets/xy_video/Script/util.js
+593
-0
util.js.meta
assets/xy_video/Script/util.js.meta
+9
-0
No files found.
assets/xy_video/Scene/xy_video.fire
View file @
3269a629
This diff is collapsed.
Click to expand it.
assets/xy_video/Scene/xy_video.js
View file @
3269a629
import
{
buttonOnceClick
}
from
"
../Script/util
"
;
cc
.
Class
({
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
...
@@ -131,6 +133,7 @@ cc.Class({
...
@@ -131,6 +133,7 @@ cc.Class({
console
.
log
(
'
Resize
'
,
params
);
console
.
log
(
'
Resize
'
,
params
);
this
.
initdDrag
()
this
.
initdDrag
()
});
});
// this.initListener();
this
.
initdDrag
();
this
.
initdDrag
();
// console.log(11111)
// console.log(11111)
// this.videoPlayer = this.node.getComponent(cc.VideoPlayer);
// this.videoPlayer = this.node.getComponent(cc.VideoPlayer);
...
@@ -139,6 +142,9 @@ cc.Class({
...
@@ -139,6 +142,9 @@ cc.Class({
}
}
cc
.
debug
.
setDisplayStats
(
false
);
cc
.
debug
.
setDisplayStats
(
false
);
},
},
// initListener() {
// buttonOnClick(cc.find(`Canvas/btnbg/btn_again`), this.replay);
// },
initdDrag
()
{
initdDrag
()
{
const
maxX
=
this
.
ProgressBar
.
node
.
width
;
const
maxX
=
this
.
ProgressBar
.
node
.
width
;
const
minX
=
0
;
const
minX
=
0
;
...
@@ -358,7 +364,7 @@ cc.Class({
...
@@ -358,7 +364,7 @@ cc.Class({
replay
(){
replay
(){
this
.
videoPlayer
.
currentTime
=
0
;
this
.
videoPlayer
.
currentTime
=
0
;
this
.
videoPlayer
.
play
();
this
.
videoPlayer
.
play
();
this
.
triggerInteractive
()
this
.
triggerInteractive
()
;
},
},
preload
()
{
preload
()
{
...
@@ -371,6 +377,76 @@ cc.Class({
...
@@ -371,6 +377,76 @@ cc.Class({
}
}
});
});
},
},
isOver
:
null
,
onLeave
(
cb
)
{
if
(
!
this
.
isOver
)
{
this
.
videoPlayer
.
pause
();
this
.
triggerInteractive
();
this
.
videoPlayer
.
node
.
active
=
false
;
const
tips
=
cc
.
find
(
"
tips
"
,
this
.
node
);
cc
.
find
(
`continue`
,
tips
).
active
=
true
;
cc
.
find
(
`leave`
,
tips
).
active
=
true
;
cc
.
find
(
`btn_bl`
,
tips
).
active
=
false
;
cc
.
find
(
`btn_zcdt`
,
tips
).
active
=
false
;
tips
.
active
=
true
;
cc
.
find
(
`desc`
,
tips
).
getComponent
(
cc
.
Label
).
string
=
"
确定放弃本次答题么?
"
;
buttonOnceClick
(
cc
.
find
(
`continue`
,
tips
),
()
=>
{
tips
.
active
=
false
;
this
.
videoPlayer
.
node
.
active
=
true
;
this
.
videoPlayer
.
play
();
this
.
triggerInteractive
();
});
buttonOnceClick
(
cc
.
find
(
`leave`
,
tips
),
()
=>
{
tips
.
active
=
false
;
cb
();
});
}
else
{
cb
();
}
},
goBack
()
{
this
.
onLeave
(()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
mc
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
// 切换上一页
mc
.
goPrePage
();
}
else
{
console
.
log
(
"
==切换上一页==
"
);
}
});
},
goNext
()
{
this
.
onLeave
(()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
mc
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
// // 切换下一页
mc
.
goNextPage
();
}
else
{
console
.
log
(
"
==切换下一页==
"
);
}
});
},
goHome
()
{
this
.
onLeave
(()
=>
{
const
middleLayer
=
cc
.
find
(
'
middleLayer
'
);
if
(
middleLayer
)
{
const
mc
=
middleLayer
.
getComponent
(
'
middleLayer
'
);
// 回首页
mc
.
goTarIndexPage
(
0
);
}
else
{
console
.
log
(
"
==回首页==
"
);
}
});
},
// called every frame
// called every frame
update
:
function
(
dt
)
{
update
:
function
(
dt
)
{
// if (this._isReadyToPlay) {
// if (this._isReadyToPlay) {
...
...
assets/xy_video/Script/util.js
0 → 100644
View file @
3269a629
This diff is collapsed.
Click to expand it.
assets/xy_video/Script/util.js.meta
0 → 100644
View file @
3269a629
{
"ver": "1.0.8",
"uuid": "8b8f565c-a90c-4919-ab4a-7cec87e53873",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"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