소스 검색

Merge pull request #314 from sdvcrx/fix-infinity-duration

fix video.duration is Infinity
DIYgod 7 년 전
부모
커밋
3744579a41
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/js/player.js

+ 2 - 1
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);
             }
         });