Explorar o código

fix Hls is not supported in Safari Mobile

DIYgod %!s(int64=7) %!d(string=hai) anos
pai
achega
87e137e2c3
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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':