Commit 05ab24fb authored by Xiaowu Zhang's avatar Xiaowu Zhang

avoid Nan affection

parent 7eda9335
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
canvasCtx.clearRect(0, 0, cwidth, cheight); canvasCtx.clearRect(0, 0, cwidth, cheight);
step = Math.round(array.length / meterNum); step = Math.round(array.length / meterNum);
bar_context.value = that.audio.currentTime; bar_context.value = that.audio.currentTime;
if (that.audio.duration !== Infinity) { if (isFinite(that.audio.duration)) {
bar_context.max = that.audio.duration; bar_context.max = that.audio.duration;
} }
time_context.innerHTML = timeFormat(that.audio.duration - that.audio.currentTime); time_context.innerHTML = timeFormat(that.audio.duration - that.audio.currentTime);
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
canvasCtx.clearRect(0, 0, cwidth, cheight); canvasCtx.clearRect(0, 0, cwidth, cheight);
step = Math.round(array.length / meterNum); step = Math.round(array.length / meterNum);
bar_context.value = that.audio.currentTime; bar_context.value = that.audio.currentTime;
if (that.audio.duration !== Infinity) { if (isFinite(that.audio.duration)) {
bar_context.max = that.audio.duration; bar_context.max = that.audio.duration;
} }
time_context.innerHTML = timeFormat(that.audio.duration - time_context.innerHTML = timeFormat(that.audio.duration -
......
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