From 3d27ee7b6e1e85fd7a474a27e3b1bcda145cbf5a Mon Sep 17 00:00:00 2001 From: Konsta Purtsi Date: Mon, 28 Oct 2024 19:51:49 +0200 Subject: [PATCH] fix: Disable HLS on Safari --- pages/_app.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pages/_app.tsx b/pages/_app.tsx index 6def3bc..f29bf83 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -8,8 +8,11 @@ import { ChatWrapper } from '@/components/ShoutBox/shoutbox'; import VideoPlayer from '@/components/videoPlayer'; import { ShoutBoxAndVideoProvider } from '@/hooks/useShoutboxAndVideo'; +// Check if the user is on WebKit. +const isSafari = typeof window !== 'undefined' && CSS.supports('-webkit-hyphens:none'); + const isHlsLive = - Hls.isSupported() && process.env.NEXT_PUBLIC_HLS_MODE === 'live'; + !isSafari && Hls.isSupported() && process.env.NEXT_PUBLIC_HLS_MODE === 'live'; const AUDIO_STREAM_URL = 'https://player.turunwappuradio.com/wappuradio.mp3'; const HLS_STREAM_URL = 'https://stream.turunwappuradio.com/twr_chunklist.m3u8';