diff --git a/src/assets/css/index.css b/src/assets/css/index.css index f32f26a9..74eb1270 100644 --- a/src/assets/css/index.css +++ b/src/assets/css/index.css @@ -4,7 +4,7 @@ html, body { - @apply bg-background-main font-open-sans text-type-text overflow-x-hidden; + @apply bg-background-main font-open-sans text-type-text; min-height: 100vh; min-height: 100dvh; } @@ -221,4 +221,4 @@ input[type=range].styled-slider.slider-progress::-ms-fill-lower { .tabbable:focus-visible { outline: 2px solid theme('colors.themePreview.primary'); box-shadow: 0 0 10px theme('colors.themePreview.secondary'); -} \ No newline at end of file +} diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 6ffd4ac5..8951793d 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -203,7 +203,8 @@ "quality": { "title": "Quality", "automaticLabel": "Automatic quality", - "hint": "You can try <0>switching source to get different quality options." + "hint": "You can try <0>switching source to get different quality options.", + "iosNoQuality": "Due to Apple-defined limitations, quality selection is not available on iOS for this source. You can try <0>switching to another source to get different quality options." } } }, diff --git a/src/components/player/atoms/settings/QualityView.tsx b/src/components/player/atoms/settings/QualityView.tsx index f3d048e0..3b311bca 100644 --- a/src/components/player/atoms/settings/QualityView.tsx +++ b/src/components/player/atoms/settings/QualityView.tsx @@ -1,5 +1,6 @@ +import Hls from "hls.js"; import { t } from "i18next"; -import { useCallback } from "react"; +import { useCallback, useMemo } from "react"; import { Trans } from "react-i18next"; import { Toggle } from "@/components/buttons/Toggle"; @@ -13,6 +14,7 @@ import { qualityToString, } from "@/stores/player/utils/qualities"; import { useQualityStore } from "@/stores/quality"; +import { canPlayHlsNatively } from "@/utils/detectFeatures"; const alwaysVisibleQualities: Record = { unknown: false, @@ -22,8 +24,21 @@ const alwaysVisibleQualities: Record = { "1080": true, }; +function useIsIosHls() { + const sourceType = usePlayerStore((s) => s.source?.type); + const result = useMemo(() => { + const videoEl = document.createElement("video"); + if (sourceType !== "hls") return false; + if (Hls.isSupported()) return false; + if (!canPlayHlsNatively(videoEl)) return false; + return true; + }, [sourceType]); + return result; +} + export function QualityView({ id }: { id: string }) { const router = useOverlayRouter(id); + const isIosHls = useIsIosHls(); const availableQualities = usePlayerStore((s) => s.qualities); const currentQuality = usePlayerStore((s) => s.currentQuality); const switchQuality = usePlayerStore((s) => s.switchQuality); @@ -61,7 +76,7 @@ export function QualityView({ id }: { id: string }) { router.navigate("/")}> {t("player.menus.quality.title")} - + {visibleQualities.map((v) => ( - + router.navigate("/source")}> text diff --git a/src/components/player/internals/ContextMenu/Cards.tsx b/src/components/player/internals/ContextMenu/Cards.tsx index 12225489..c650967e 100644 --- a/src/components/player/internals/ContextMenu/Cards.tsx +++ b/src/components/player/internals/ContextMenu/Cards.tsx @@ -1,7 +1,7 @@ export function Card(props: { children: React.ReactNode }) { return (
-
+
{props.children}
diff --git a/src/components/utils/Lightbar.css b/src/components/utils/Lightbar.css index 7fe7572b..06f7ffe8 100644 --- a/src/components/utils/Lightbar.css +++ b/src/components/utils/Lightbar.css @@ -1,6 +1,5 @@ .lightbar, .lightbar-visual { position: absolute; - top: 0; width: 500vw; height: 800px; pointer-events: none; diff --git a/src/components/utils/Lightbar.tsx b/src/components/utils/Lightbar.tsx index 0d30b5ad..f18e8ddf 100644 --- a/src/components/utils/Lightbar.tsx +++ b/src/components/utils/Lightbar.tsx @@ -1,4 +1,3 @@ -import classNames from "classnames"; import { useEffect, useRef } from "react"; import "./Lightbar.css"; @@ -162,15 +161,14 @@ function ParticlesCanvas() { export function Lightbar(props: { className?: string }) { return ( -
-
- -
+
+
+
+
+ +
+
+
);