Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MRBR_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
MRBR_video
Commits
14cec8da
Commit
14cec8da
authored
Nov 15, 2022
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复最后一题跳转错误的问题
parent
0503c238
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
59 deletions
+63
-59
MRBR_video.fire
assets/MRBR_video/scene/MRBR_video.fire
+2
-0
MRBR_video.js
assets/MRBR_video/scene/MRBR_video.js
+61
-59
No files found.
assets/MRBR_video/scene/MRBR_video.fire
View file @
14cec8da
...
...
@@ -1687,6 +1687,8 @@
"__id__": 15
},
"_enabled": true,
"setTimeoutIDs": [],
"setIntervalIDs": [],
"_id": "42XWQfk9tE94NY0efe9K5z"
},
{
...
...
assets/MRBR_video/scene/MRBR_video.js
View file @
14cec8da
...
...
@@ -448,10 +448,8 @@ cc.Class({
console
.
log
(
"
preloadArr:
"
,
JSON
.
stringify
(
preloadArr
));
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
// console.log(' preload data, ', data);
// this.loadEnd();
this
.
addServerListener
();
if
(
window
&&
window
[
"
air
"
])
{
window
[
"
air
"
].
hideAirClassLoading
();
}
...
...
@@ -550,10 +548,8 @@ cc.Class({
// return;
console
.
log
(
"
in getState 1
"
);
callMiddleLayerFunction
(
"
PSQS_get_course_info
"
,
{},
(
data
)
=>
{
console
.
log
(
"
PSQS_get_course_info
"
,
data
.
first
,
data
.
last
,
data
.
playTime
,
JSON
.
stringify
(
data
.
saveData
));
this
.
isFirst
=
data
.
first
;
//this.checkIsFirst();
this
.
isLast
=
data
.
last
// this.checkIsLast();
this
.
playTimes
=
data
.
playTime
// this.checkPlayTimes();
...
...
@@ -585,7 +581,7 @@ cc.Class({
},
getJumpData
()
{
return
{
step
:
1
};
return
{
step
:
7
};
},
maskSpr
:
null
,
...
...
@@ -694,9 +690,8 @@ cc.Class({
addServerListener
()
{
console
.
log
(
"
in addServerListener
"
);
const
c
=
window
.
courseware
;
// this.loadEnd(()=>{});
const
c
=
window
.
courseware
;
if
(
!
c
)
{
return
;
}
...
...
@@ -1053,7 +1048,7 @@ cc.Class({
},
startQuesVideo
(
currentTime
=
null
)
{
console
.
log
(
"
in startQuesVideo
"
);
console
.
log
(
"
in startQuesVideo
"
,
currentTime
);
this
.
wrongTimes
=
0
;
const
video
=
this
.
video
;
...
...
@@ -1073,6 +1068,11 @@ cc.Class({
}
}
// 如果是最后一题
if
(
this
.
isTheEndVideo
)
{
this
.
curEndTime
=
-
1
;
}
delayCall
(
0.01
,
()
=>
{
video
.
play
();
this
.
videoControlBar
.
emit
(
"
update_video_status
"
,
1
);
...
...
@@ -1081,7 +1081,7 @@ cc.Class({
isWaitingUserAction
:
false
,
startWaitVideo
()
{
console
.
log
(
"
in startWaitVideo
"
);
console
.
log
(
"
in startWaitVideo
"
);
this
.
isWaitingUserAction
=
true
;
this
.
curQues
.
hotZoneBg
.
active
=
true
;
this
.
hand
.
active
=
true
;
...
...
@@ -1137,7 +1137,7 @@ cc.Class({
},
startRightVideo
()
{
console
.
log
(
"
in startRightVideo
"
);
console
.
log
(
"
in startRightVideo
"
);
// const videoNode = this.curQues?.videoObj?.right_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
...
...
@@ -1159,7 +1159,7 @@ cc.Class({
},
startWrongVideo
()
{
console
.
log
(
"
in startWrongVideo
"
);
console
.
log
(
"
in startWrongVideo
"
);
// const videoNode = this.curQues?.videoObj?.wrong_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
...
...
@@ -1187,7 +1187,7 @@ cc.Class({
},
startEndVideo
()
{
console
.
log
(
"
in startEndVideo
"
);
console
.
log
(
"
in startEndVideo
"
);
// const videoNode = this.curQues?.videoObj?.end_video;
// const video = videoNode.getComponent(cc.VideoPlayer);
...
...
@@ -1225,11 +1225,12 @@ cc.Class({
},
initCurQues
()
{
if
(
this
.
quesIndex
>=
0
)
{
if
(
this
.
quesIndex
>=
0
)
{
this
.
curQues
=
this
.
data
.
quesArr
[
this
.
quesIndex
];
console
.
log
(
"
curQues:
"
,
this
.
curQues
);
}
else
{
console
.
log
(
'
题目序号不能为负数
'
);
this
.
curQues
=
this
.
data
.
quesArr
[
this
.
data
.
quesArr
.
length
-
1
];
console
.
log
(
'
题目序号为负 - 跳转到最后一段音频
'
);
}
},
...
...
@@ -1363,6 +1364,7 @@ cc.Class({
this
.
startQuesVideo
(
this
.
jumpTime
);
},
isTheEndVideo
:
false
,
setJumpTime
()
{
let
isFind
=
false
;
for
(
let
i
=
0
;
i
<
this
.
data
.
quesArr
.
length
;
i
++
)
{
...
...
@@ -1377,8 +1379,10 @@ cc.Class({
}
if
(
!
isFind
)
{
// 没有找到就是最后一题
const
lastQuesData
=
this
.
data
.
quesArr
[
this
.
data
.
quesArr
.
length
-
1
];
this
.
jumpTime
=
lastQuesData
.
ques_end
;
this
.
isTheEndVideo
=
true
;
}
},
...
...
@@ -1386,7 +1390,6 @@ cc.Class({
if
(
this
.
playTimes
==
0
)
{
return
;
}
switch
(
this
.
video
.
node
.
name
)
{
case
"
ques_video
"
:
this
.
startWaitVideo
();
...
...
@@ -2925,7 +2928,6 @@ cc.Class({
console
.
log
(
"
clicked
"
);
this
.
video
.
pause
();
this
.
videoControlBar
.
emit
(
"
update_video_status
"
,
0
);
this
.
curQues
.
isRight
=
isRight
;
if
(
isRight
)
{
this
.
startRightVideo
();
...
...
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