Commit 14b30b16 authored by 李维's avatar 李维

修复时间进度错误的问题

parent efda089f
...@@ -1068,11 +1068,9 @@ cc.Class({ ...@@ -1068,11 +1068,9 @@ cc.Class({
console.log("this.curQues: ", this.curQues); console.log("this.curQues: ", this.curQues);
if (currentTime) { if (currentTime) {
video.currentTime = currentTime; video.currentTime = Number(currentTime);
console.log("Set video current time-1:", this.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:", this.video.currentTime);
} }
if (this.playTimes > 0) { if (this.playTimes > 0) {
...@@ -1114,7 +1112,6 @@ cc.Class({ ...@@ -1114,7 +1112,6 @@ 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:", this.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();
...@@ -1142,7 +1139,6 @@ cc.Class({ ...@@ -1142,7 +1139,6 @@ 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:", this.video.currentTime);
this.curEndTime = Number(this.curQues.wait_end); this.curEndTime = Number(this.curQues.wait_end);
delayCall(0.01, () => { delayCall(0.01, () => {
...@@ -1165,7 +1161,6 @@ cc.Class({ ...@@ -1165,7 +1161,6 @@ 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:", this.video.currentTime);
this.curEndTime = Number(this.curQues.right_end); this.curEndTime = Number(this.curQues.right_end);
delayCall(0.01, () => { delayCall(0.01, () => {
...@@ -1190,11 +1185,9 @@ cc.Class({ ...@@ -1190,11 +1185,9 @@ 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:", this.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:", this.video.currentTime);
this.curEndTime = Number(this.curQues.wrong_end); this.curEndTime = Number(this.curQues.wrong_end);
} }
...@@ -1223,7 +1216,6 @@ cc.Class({ ...@@ -1223,7 +1216,6 @@ 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:", this.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();
...@@ -1503,7 +1495,6 @@ cc.Class({ ...@@ -1503,7 +1495,6 @@ 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:", this.video.currentTime);
this.curEndTime = -1; this.curEndTime = -1;
this.curVideoPlayEnd(); this.curVideoPlayEnd();
// this.videoControlBar.active = false; // this.videoControlBar.active = false;
...@@ -1540,7 +1531,6 @@ cc.Class({ ...@@ -1540,7 +1531,6 @@ cc.Class({
this.curEndTime = -1; this.curEndTime = -1;
} }
this.video.currentTime = userDragTime; this.video.currentTime = userDragTime;
console.log("Set video current time-10:", this.video.currentTime);
}, },
// 是否正在拖动进度条 // 是否正在拖动进度条
...@@ -1656,7 +1646,6 @@ cc.Class({ ...@@ -1656,7 +1646,6 @@ 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:", this.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