mirror of
https://github.com/movie-web/movie-web.git
synced 2025-02-03 05:42:42 +01:00
Add info text for ios and HLS + fix lightbar overflows
This commit is contained in:
parent
a2c114d93f
commit
17b9a8d674
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
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: 100vh;
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
}
|
}
|
||||||
@ -221,4 +221,4 @@ input[type=range].styled-slider.slider-progress::-ms-fill-lower {
|
|||||||
.tabbable:focus-visible {
|
.tabbable:focus-visible {
|
||||||
outline: 2px solid theme('colors.themePreview.primary');
|
outline: 2px solid theme('colors.themePreview.primary');
|
||||||
box-shadow: 0 0 10px theme('colors.themePreview.secondary');
|
box-shadow: 0 0 10px theme('colors.themePreview.secondary');
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,8 @@
|
|||||||
"quality": {
|
"quality": {
|
||||||
"title": "Quality",
|
"title": "Quality",
|
||||||
"automaticLabel": "Automatic quality",
|
"automaticLabel": "Automatic quality",
|
||||||
"hint": "You can try <0>switching source</0> to get different quality options."
|
"hint": "You can try <0>switching source</0> 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</0> to get different quality options."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
import Hls from "hls.js";
|
||||||
import { t } from "i18next";
|
import { t } from "i18next";
|
||||||
import { useCallback } from "react";
|
import { useCallback, useMemo } from "react";
|
||||||
import { Trans } from "react-i18next";
|
import { Trans } from "react-i18next";
|
||||||
|
|
||||||
import { Toggle } from "@/components/buttons/Toggle";
|
import { Toggle } from "@/components/buttons/Toggle";
|
||||||
@ -13,6 +14,7 @@ import {
|
|||||||
qualityToString,
|
qualityToString,
|
||||||
} from "@/stores/player/utils/qualities";
|
} from "@/stores/player/utils/qualities";
|
||||||
import { useQualityStore } from "@/stores/quality";
|
import { useQualityStore } from "@/stores/quality";
|
||||||
|
import { canPlayHlsNatively } from "@/utils/detectFeatures";
|
||||||
|
|
||||||
const alwaysVisibleQualities: Record<SourceQuality, boolean> = {
|
const alwaysVisibleQualities: Record<SourceQuality, boolean> = {
|
||||||
unknown: false,
|
unknown: false,
|
||||||
@ -22,8 +24,21 @@ const alwaysVisibleQualities: Record<SourceQuality, boolean> = {
|
|||||||
"1080": true,
|
"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 }) {
|
export function QualityView({ id }: { id: string }) {
|
||||||
const router = useOverlayRouter(id);
|
const router = useOverlayRouter(id);
|
||||||
|
const isIosHls = useIsIosHls();
|
||||||
const availableQualities = usePlayerStore((s) => s.qualities);
|
const availableQualities = usePlayerStore((s) => s.qualities);
|
||||||
const currentQuality = usePlayerStore((s) => s.currentQuality);
|
const currentQuality = usePlayerStore((s) => s.currentQuality);
|
||||||
const switchQuality = usePlayerStore((s) => s.switchQuality);
|
const switchQuality = usePlayerStore((s) => s.switchQuality);
|
||||||
@ -61,7 +76,7 @@ export function QualityView({ id }: { id: string }) {
|
|||||||
<Menu.BackLink onClick={() => router.navigate("/")}>
|
<Menu.BackLink onClick={() => router.navigate("/")}>
|
||||||
{t("player.menus.quality.title")}
|
{t("player.menus.quality.title")}
|
||||||
</Menu.BackLink>
|
</Menu.BackLink>
|
||||||
<Menu.Section>
|
<Menu.Section className="flex flex-col pb-4">
|
||||||
{visibleQualities.map((v) => (
|
{visibleQualities.map((v) => (
|
||||||
<SelectableLink
|
<SelectableLink
|
||||||
key={v}
|
key={v}
|
||||||
@ -81,7 +96,13 @@ export function QualityView({ id }: { id: string }) {
|
|||||||
{t("player.menus.quality.automaticLabel")}
|
{t("player.menus.quality.automaticLabel")}
|
||||||
</Menu.Link>
|
</Menu.Link>
|
||||||
<Menu.SmallText>
|
<Menu.SmallText>
|
||||||
<Trans i18nKey="player.menus.quality.hint">
|
<Trans
|
||||||
|
i18nKey={
|
||||||
|
isIosHls
|
||||||
|
? "player.menus.quality.iosNoQuality"
|
||||||
|
: "player.menus.quality.hint"
|
||||||
|
}
|
||||||
|
>
|
||||||
<Menu.Anchor onClick={() => router.navigate("/source")}>
|
<Menu.Anchor onClick={() => router.navigate("/source")}>
|
||||||
text
|
text
|
||||||
</Menu.Anchor>
|
</Menu.Anchor>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
export function Card(props: { children: React.ReactNode }) {
|
export function Card(props: { children: React.ReactNode }) {
|
||||||
return (
|
return (
|
||||||
<div className="h-full grid grid-rows-[1fr]">
|
<div className="h-full grid grid-rows-[1fr]">
|
||||||
<div className="px-6 h-full overflow-y-auto overflow-x-hidden">
|
<div className="px-6 h-full flex flex-col justify-start overflow-y-auto overflow-x-hidden">
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
.lightbar, .lightbar-visual {
|
.lightbar, .lightbar-visual {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
|
||||||
width: 500vw;
|
width: 500vw;
|
||||||
height: 800px;
|
height: 800px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import classNames from "classnames";
|
|
||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import "./Lightbar.css";
|
import "./Lightbar.css";
|
||||||
|
|
||||||
@ -162,15 +161,14 @@ function ParticlesCanvas() {
|
|||||||
|
|
||||||
export function Lightbar(props: { className?: string }) {
|
export function Lightbar(props: { className?: string }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div className="absolute inset-0 w-full h-screen overflow-hidden -mt-64">
|
||||||
className={classNames(
|
<div className="max-w-screen w-full h-screen relative pt-64">
|
||||||
"grid grid-cols-[100%] w-full overflow-x-hidden",
|
<div className={props.className}>
|
||||||
props.className
|
<div className="lightbar">
|
||||||
)}
|
<ParticlesCanvas />
|
||||||
>
|
<div className="lightbar-visual" />
|
||||||
<div className="lightbar">
|
</div>
|
||||||
<ParticlesCanvas />
|
</div>
|
||||||
<div className="lightbar-visual" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user