Browse Source

fix Hls is not supported in Safari Mobile

DIYgod 7 years ago
parent
commit
87e137e2c3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/js/player.js

+ 4 - 0
src/js/player.js

@@ -333,6 +333,10 @@ class DPlayer {
                 }
             }
 
+            if (this.type === 'hls' && (video.canPlayType('application/x-mpegURL') || video.canPlayType('application/vnd.apple.mpegURL'))) {
+                this.type = 'normal';
+            }
+
             switch (this.type) {
             // https://github.com/video-dev/hls.js
             case 'hls':