From f4d4f747b1c3c67a700c6dd537930f519e3e88e2 Mon Sep 17 00:00:00 2001 From: sdvcrx Date: Mon, 13 Aug 2018 14:59:23 +0800 Subject: [PATCH] fix video.duration is Infinity Fix #282 question 1 --- src/js/player.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/player.js b/src/js/player.js index 0686fd1..f0073ef 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -422,7 +422,8 @@ class DPlayer { */ // show video time: the metadata has loaded or changed this.on('durationchange', () => { - if (video.duration !== 1) { // compatibility: Android browsers will output 1 at first + // compatibility: Android browsers will output 1 or Infinity at first + if (video.duration !== 1 && video.duration !== Infinity) { this.template.dtime.innerHTML = utils.secondToTime(video.duration); } });