From 87e137e2c3be7120407b3900c2e1b37c96e2b1b9 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 14 Jun 2018 00:00:19 +0800 Subject: [PATCH] fix Hls is not supported in Safari Mobile --- src/js/player.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/player.js b/src/js/player.js index 918be07..d780369 100644 --- a/src/js/player.js +++ b/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':