From e847fea2dd0faa8bcc4da585fbefc8408df0ca3e Mon Sep 17 00:00:00 2001 From: ArabCoders Date: Fri, 28 Feb 2025 01:06:58 +0300 Subject: [PATCH] for iOS devices fallback directly to m3u8 --- ui/components/VideoPlayer.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/components/VideoPlayer.vue b/ui/components/VideoPlayer.vue index c1244291..63d0e18c 100644 --- a/ui/components/VideoPlayer.vue +++ b/ui/components/VideoPlayer.vue @@ -52,6 +52,7 @@ const thumbnail = ref('') const artist = ref('') const title = ref('') const isAudio = ref(false) +const isApple = /(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent) let player = null; let hls = null; @@ -70,8 +71,8 @@ onMounted(async () => { } sources.value.push({ - src: makeDownload(config, props.item, 'api/download'), - type: response.mimetype, + src: makeDownload(config, props.item, isApple ? 'm3u8' : 'api/download'), + type: isApple ? response.mimetype : 'application/x-mpegURL', onerror: e => src_error(e), }) @@ -100,7 +101,7 @@ onMounted(async () => { }) }) - if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent)) { + if (isApple) { document.documentElement.style.setProperty('--webkit-text-track-display', 'block'); }