From fdf5d54b32dd08a0615ece2876dea48e2cadae94 Mon Sep 17 00:00:00 2001 From: Konsta Purtsi Date: Mon, 28 Oct 2024 19:43:33 +0200 Subject: [PATCH 1/2] chore: Update hls.js --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9980576..73ba83e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "date-fns": "^2.28.0", "google-auth-library": "^8.7.0", "graphql": "^16.3.0", - "hls.js": "^1.5.8", + "hls.js": "^1.5.17", "next": "^12.0.10", "ramda": "^0.28.0", "react": "17.0.2", @@ -8815,9 +8815,10 @@ "dev": true }, "node_modules/hls.js": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.5.8.tgz", - "integrity": "sha512-hJYMPfLhWO7/7+n4f9pn6bOheCGx0WgvVz7k3ouq3Pp1bja48NN+HeCQu3XCGYzqWQF/wo7Sk6dJAyWVJD8ECA==" + "version": "1.5.17", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.5.17.tgz", + "integrity": "sha512-wA66nnYFvQa1o4DO/BFgLNRKnBTVXpNeldGRBJ2Y0SvFtdwvFKCbqa9zhHoZLoxHhZ+jYsj3aIBkWQQCPNOhMw==", + "license": "Apache-2.0" }, "node_modules/hoist-non-react-statics": { "version": "3.3.2", diff --git a/package.json b/package.json index 79408c9..8a4ec62 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "date-fns": "^2.28.0", "google-auth-library": "^8.7.0", "graphql": "^16.3.0", - "hls.js": "^1.5.8", + "hls.js": "^1.5.17", "next": "^12.0.10", "ramda": "^0.28.0", "react": "17.0.2", From 3d27ee7b6e1e85fd7a474a27e3b1bcda145cbf5a Mon Sep 17 00:00:00 2001 From: Konsta Purtsi Date: Mon, 28 Oct 2024 19:51:49 +0200 Subject: [PATCH 2/2] 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';