Commit f2bf3fe7 authored by 李维's avatar 李维

测试

parent ff60f5a9
...@@ -1069,8 +1069,10 @@ cc.Class({ ...@@ -1069,8 +1069,10 @@ cc.Class({
if (currentTime) { if (currentTime) {
video.currentTime = currentTime; video.currentTime = currentTime;
console.log("Set video current time-1:", video.currentTime);
} else { } else {
video.currentTime = Number(this.curQues.ques_start); video.currentTime = Number(this.curQues.ques_start);
console.log("Set video current time-2:", video.currentTime);
} }
if (this.playTimes > 0) { if (this.playTimes > 0) {
...@@ -1112,6 +1114,7 @@ cc.Class({ ...@@ -1112,6 +1114,7 @@ cc.Class({
const video = this.video; const video = this.video;
video.node.name = "wait_video"; video.node.name = "wait_video";
video.currentTime = Number(this.curQues.wait_start); video.currentTime = Number(this.curQues.wait_start);
console.log("Set video current time-3:", video.currentTime);
this.curEndTime = Number(this.curQues.wait_end); this.curEndTime = Number(this.curQues.wait_end);
delayCall(0.01, () => { delayCall(0.01, () => {
video.play(); video.play();
...@@ -1139,6 +1142,7 @@ cc.Class({ ...@@ -1139,6 +1142,7 @@ cc.Class({
console.log(" in continueWaitVideo "); console.log(" in continueWaitVideo ");
this.video.currentTime = Number(this.curQues.wait_start); this.video.currentTime = Number(this.curQues.wait_start);
console.log("Set video current time-4:", video.currentTime);
this.curEndTime = Number(this.curQues.wait_end); this.curEndTime = Number(this.curQues.wait_end);
delayCall(0.01, () => { delayCall(0.01, () => {
...@@ -1161,6 +1165,7 @@ cc.Class({ ...@@ -1161,6 +1165,7 @@ cc.Class({
const video = this.video; const video = this.video;
video.node.name = "right_video"; video.node.name = "right_video";
video.currentTime = Number(this.curQues.right_start); video.currentTime = Number(this.curQues.right_start);
console.log("Set video current time-5:", video.currentTime);
this.curEndTime = Number(this.curQues.right_end); this.curEndTime = Number(this.curQues.right_end);
delayCall(0.01, () => { delayCall(0.01, () => {
...@@ -1185,9 +1190,11 @@ cc.Class({ ...@@ -1185,9 +1190,11 @@ cc.Class({
if (this.wrongStartTime && this.wrongEndTime) { if (this.wrongStartTime && this.wrongEndTime) {
video.currentTime = this.wrongStartTime; video.currentTime = this.wrongStartTime;
console.log("Set video current time-6:", video.currentTime);
this.curEndTime = this.wrongEndTime; this.curEndTime = this.wrongEndTime;
} else { } else {
video.currentTime = Number(this.curQues.wrong_start); video.currentTime = Number(this.curQues.wrong_start);
console.log("Set video current time-7:", video.currentTime);
this.curEndTime = Number(this.curQues.wrong_end); this.curEndTime = Number(this.curQues.wrong_end);
} }
...@@ -1216,6 +1223,7 @@ cc.Class({ ...@@ -1216,6 +1223,7 @@ cc.Class({
const video = this.video; const video = this.video;
video.node.name = "end_video"; video.node.name = "end_video";
video.currentTime = Number(this.curQues.end_start); video.currentTime = Number(this.curQues.end_start);
console.log("Set video current time-8:", video.currentTime);
this.curEndTime = Number(this.curQues.end_end); this.curEndTime = Number(this.curQues.end_end);
delayCall(0.01, () => { delayCall(0.01, () => {
video.play(); video.play();
...@@ -1495,6 +1503,7 @@ cc.Class({ ...@@ -1495,6 +1503,7 @@ cc.Class({
this.video.pause(); this.video.pause();
this.videoControlBar.emit("update_video_status", 0); this.videoControlBar.emit("update_video_status", 0);
this.video.currentTime = this.curEndTime; this.video.currentTime = this.curEndTime;
console.log("Set video current time-9:", video.currentTime);
this.curEndTime = -1; this.curEndTime = -1;
this.curVideoPlayEnd(); this.curVideoPlayEnd();
// this.videoControlBar.active = false; // this.videoControlBar.active = false;
...@@ -1531,6 +1540,7 @@ cc.Class({ ...@@ -1531,6 +1540,7 @@ cc.Class({
this.curEndTime = -1; this.curEndTime = -1;
} }
this.video.currentTime = userDragTime; this.video.currentTime = userDragTime;
console.log("Set video current time-10:", video.currentTime);
}, },
// 是否正在拖动进度条 // 是否正在拖动进度条
...@@ -1646,6 +1656,7 @@ cc.Class({ ...@@ -1646,6 +1656,7 @@ cc.Class({
// 监听组件发来的拖动百分比 // 监听组件发来的拖动百分比
this.videoControlBar.on("on_drag_percent", (percent)=>{ this.videoControlBar.on("on_drag_percent", (percent)=>{
this.video.currentTime = percent * this.videoDuration; this.video.currentTime = percent * this.videoDuration;
console.log("Set video current time-11:", video.currentTime);
}) })
// 监听组件发来视频播放、暂停事件 // 监听组件发来视频播放、暂停事件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment