Переглянути джерело

Merge pull request #357 from A-Circle-Zhang/master

fix #307 and #298
DIYgod 7 роки тому
батько
коміт
f8514ba789
2 змінених файлів з 6 додано та 2 видалено
  1. 4 0
      src/js/player.js
  2. 2 2
      src/js/user.js

+ 4 - 0
src/js/player.js

@@ -436,6 +436,10 @@ class DPlayer {
 
         // video download error: an error occurs
         this.on('error', () => {
+            if (!this.video.error) {
+                // Not a video load error, may be poster load failed, see #307
+                return
+            }
             this.tran && this.notice && this.type !== 'webtorrent' & this.notice(this.tran('Video load failed'), -1);
         });
 

+ 2 - 2
src/js/user.js

@@ -11,7 +11,7 @@ class User {
         };
         this.default = {
             opacity: 0.7,
-            volume: player.options.volume || 0.7,
+            volume: player.options.hasOwnProperty('volume') ? player.options.volume : 0.7,
             unlimited: (player.options.danmaku && player.options.danmaku.unlimited ? 1 : 0) || 0,
             danmaku: 1,
             subtitle: 1
@@ -38,4 +38,4 @@ class User {
     }
 }
 
-export default User;
+export default User;