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
431000f3
Commit
431000f3
authored
Aug 12, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 上报和获取成绩
parent
3269a629
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
6 deletions
+28
-6
xy_video.js
assets/xy_video/Scene/xy_video.js
+28
-6
No files found.
assets/xy_video/Scene/xy_video.js
View file @
431000f3
...
...
@@ -92,7 +92,7 @@ cc.Class({
this
.
_isReadyToPlay
=
false
;
window
[
'
vv
'
]
=
this
;
cc
.
macro
.
ENABLE_TRANSPARENT_CANVAS
=
true
;
this
.
node
.
on
(
'
ready-to-play
'
,
()
=>
{
...
...
@@ -128,6 +128,12 @@ cc.Class({
this
.
videoPlayer
.
currentTime
=
0
;
// this.playButton.node.active = true;
// this.pauseButton.node.active = false;
// 上报答题结果
if
(
window
&&
window
.
courseware
)
{
window
.
courseware
.
sendAnswer
({
isOver
:
true
});
}
});
cc
.
view
.
setResizeCallback
((
params
)
=>
{
console
.
log
(
'
Resize
'
,
params
);
...
...
@@ -254,20 +260,36 @@ cc.Class({
// this.videoPlayer.keepAspectRatio = false;
if
(
window
&&
window
.
courseware
)
{
}
let
getData
=
this
.
getData
.
bind
(
this
);
let
getData
=
this
.
getData
.
bind
(
this
);
let
getAnswer
;
if
(
window
&&
window
.
courseware
)
{
// console.log('has window');
getData
=
window
.
courseware
.
getData
;
getData
=
window
.
courseware
.
getData
;
getAnswer
=
window
.
courseware
.
getAnswer
;
}
getData
((
data
)
=>
{
console
.
log
(
'
data:
'
,
JSON
.
stringify
(
data
));
this
.
data
=
data
||
this
.
getDefaultData
();
this
.
videoPlayer
.
remoteURL
=
this
.
data
.
video_url
;
// this.preload()
if
(
window
&&
window
[
"
air
"
])
{
window
[
"
air
"
].
hideAirClassLoading
();
}
if
(
getAnswer
)
{
getAnswer
((
ans
)
=>
{
if
(
ans
)
{
this
.
isOver
=
JSON
.
parse
(
ans
).
isOver
;
}
if
(
window
&&
window
[
"
air
"
])
{
window
[
"
air
"
].
hideAirClassLoading
();
}
});
}
else
{
if
(
window
&&
window
[
"
air
"
])
{
window
[
"
air
"
].
hideAirClassLoading
();
}
}
});
if
(
window
.
CustomEvent
){
window
.
dispatchEvent
(
new
CustomEvent
(
'
resize
'
),
true
)
...
...
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