Commit 385e4fe5 authored by Xiaowu Zhang's avatar Xiaowu Zhang

fix video loop can't set currentTime bug

parent 184b6211
...@@ -117,8 +117,8 @@ ...@@ -117,8 +117,8 @@
} }
}; };
showTime = function() { showTime = function() {
bar_context.value = that.video.currentTime; bar_context.value = that.audio.currentTime;
time_context.innerHTML = timeFormat(that.video.duration - that.video.currentTime); time_context.innerHTML = timeFormat(that.audio.duration - that.audio.currentTime);
that.video.volume = 0; that.video.volume = 0;
}; };
if (that.type !== "video/mp4") { if (that.type !== "video/mp4") {
...@@ -255,7 +255,9 @@ ...@@ -255,7 +255,9 @@
requestFullScreen(); requestFullScreen();
} }
}), loopEventListener(video, "play", false, function(event) { }), loopEventListener(video, "play", false, function(event) {
if (g.video.currentTime) {
g.audio.currentTime = g.video.currentTime; g.audio.currentTime = g.video.currentTime;
}
}), loopEventListener(bar_context, "mousemove", false, function(event) { }), loopEventListener(bar_context, "mousemove", false, function(event) {
var time = getTime(bar_context, event.clientX); var time = getTime(bar_context, event.clientX);
box_context.style.left = (event.clientX - 20) / 16 + "em"; box_context.style.left = (event.clientX - 20) / 16 + "em";
......
...@@ -159,9 +159,9 @@ ...@@ -159,9 +159,9 @@
} }
}; };
showTime = function () { showTime = function () {
bar_context.value = that.video.currentTime; bar_context.value = that.audio.currentTime;
time_context.innerHTML = timeFormat(that.video.duration - time_context.innerHTML = timeFormat(that.audio.duration -
that.video.currentTime); that.audio.currentTime);
that.video.volume = 0; that.video.volume = 0;
}; };
if (that.type !== "video/mp4") { if (that.type !== "video/mp4") {
...@@ -349,7 +349,9 @@ ...@@ -349,7 +349,9 @@
}), }),
loopEventListener(video, "play", false, function (event) { loopEventListener(video, "play", false, function (event) {
if (g.video.currentTime) {
g.audio.currentTime = g.video.currentTime; g.audio.currentTime = g.video.currentTime;
}
}), }),
loopEventListener(bar_context, "mousemove", loopEventListener(bar_context, "mousemove",
......
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