-
-
+ <>
+
+ navigate("/season")}
+ backText={`To ${currentSeasonInfo?.title.toLowerCase()}`}
+ />
+
+ {currentSeasonInfo
+ ? meta?.seasons?.map?.((season) => (
+ setSeason(season.id)}
+ >
+ {season.title}
+
+ ))
+ : "No season"}
+
+
+
+ navigate("/season/episodes")}
+ className="flex cursor-pointer items-center space-x-2 transition-colors duration-200 hover:text-white"
>
-
+ Other seasons
+
-
- {currentSeasonInfo?.title || ""}
-
-
- {t("videoPlayer.popouts.seasons")}
-
-
-
-
-
- {currentSeasonInfo
- ? meta?.seasons?.map?.((season) => (
- setSeason(season.id)}
- isOnDarkBackground
- >
- {season.title}
-
- ))
- : "No season"}
-
-
- {loading ? (
-
-
+ }
+ />
+
+ {loading ? (
+
+
+
+ ) : error ? (
+
+
+
+
+ {t("videoPLayer.popouts.errors.loadingWentWrong", {
+ seasonTitle: currentSeasonInfo?.title?.toLowerCase(),
+ })}
+
- ) : error ? (
-
-
-
-
- {t("videoPLayer.popouts.errors.loadingWentWrong", {
- seasonTitle: currentSeasonInfo?.title?.toLowerCase(),
- })}
-
-
-
- ) : (
-
- {currentSeasonEpisodes && currentSeasonInfo
- ? currentSeasonEpisodes.map((e) => (
-
{
- if (e.id === meta?.episode?.episodeId)
- controls.closePopout();
- else setCurrent(currentSeasonInfo.id, e.id);
- }}
- percentageCompleted={
- watched.items.find(
- (item) =>
- item.item?.series?.seasonId ===
- currentSeasonInfo.id &&
- item.item?.series?.episodeId === e.id
- )?.percentage
- }
- >
- {t("videoPlayer.popouts.episode", {
- index: e.number,
- title: e.title,
- })}
-
- ))
- : "No episodes"}
-
- )}
-
-
-
-
+
+ ) : (
+
+ {currentSeasonEpisodes && currentSeasonInfo
+ ? currentSeasonEpisodes.map((e) => (
+
{
+ if (e.id === meta?.episode?.episodeId)
+ controls.closePopout();
+ else setCurrent(currentSeasonInfo.id, e.id);
+ }}
+ percentageCompleted={
+ watched.items.find(
+ (item) =>
+ item.item?.series?.seasonId ===
+ currentSeasonInfo.id &&
+ item.item?.series?.episodeId === e.id
+ )?.percentage
+ }
+ >
+ {t("videoPlayer.popouts.episode", {
+ index: e.number,
+ title: e.title,
+ })}
+
+ ))
+ : "No episodes"}
+
+ )}
+
+
+ >
+ //
+ //
+ //
+ //
+ //
+ //
+ // {currentSeasonInfo?.title || ""}
+ //
+ //
+ // {t("videoPlayer.popouts.seasons")}
+ //
+ //
+ //
+ //
+ //
+ // {currentSeasonInfo
+ // ? meta?.seasons?.map?.((season) => (
+ // setSeason(season.id)}
+ // isOnDarkBackground
+ // >
+ // {season.title}
+ //
+ // ))
+ // : "No season"}
+ //
+ //
+ // {loading ? (
+ //
+ //
+ //
+ // ) : error ? (
+ //
+ //
+ //
+ //
+ // {t("videoPLayer.popouts.errors.loadingWentWrong", {
+ // seasonTitle: currentSeasonInfo?.title?.toLowerCase(),
+ // })}
+ //
+ //
+ //
+ // ) : (
+ //
+ // {currentSeasonEpisodes && currentSeasonInfo
+ // ? currentSeasonEpisodes.map((e) => (
+ //
{
+ // if (e.id === meta?.episode?.episodeId)
+ // controls.closePopout();
+ // else setCurrent(currentSeasonInfo.id, e.id);
+ // }}
+ // percentageCompleted={
+ // watched.items.find(
+ // (item) =>
+ // item.item?.series?.seasonId ===
+ // currentSeasonInfo.id &&
+ // item.item?.series?.episodeId === e.id
+ // )?.percentage
+ // }
+ // >
+ // {t("videoPlayer.popouts.episode", {
+ // index: e.number,
+ // title: e.title,
+ // })}
+ //
+ // ))
+ // : "No episodes"}
+ //
+ // )}
+ //
+ //
+ //
+ //
);
}
diff --git a/src/video/components/popouts/PopoutProviderAction.tsx b/src/video/components/popouts/PopoutProviderAction.tsx
index 104b0703..3c90d46d 100644
--- a/src/video/components/popouts/PopoutProviderAction.tsx
+++ b/src/video/components/popouts/PopoutProviderAction.tsx
@@ -1,7 +1,5 @@
import { useSyncPopouts } from "@/video/components/hooks/useSyncPopouts";
import { EpisodeSelectionPopout } from "@/video/components/popouts/EpisodeSelectionPopout";
-import { SourceSelectionPopout } from "@/video/components/popouts/SourceSelectionPopout";
-import { CaptionSelectionPopout } from "@/video/components/popouts/CaptionSelectionPopout";
import { SettingsPopout } from "@/video/components/popouts/SettingsPopout";
import { useVideoPlayerDescriptor } from "@/video/state/hooks";
import { useControls } from "@/video/state/logic/controls";
@@ -14,8 +12,6 @@ import "./Popouts.css";
function ShowPopout(props: { popoutId: string | null; onClose: () => void }) {
const popoutMap = {
- source:
,
- captions:
,
settings:
,
episodes:
,
};
diff --git a/src/video/components/popouts/SettingsPopout.tsx b/src/video/components/popouts/SettingsPopout.tsx
index 1777b1e3..9640397d 100644
--- a/src/video/components/popouts/SettingsPopout.tsx
+++ b/src/video/components/popouts/SettingsPopout.tsx
@@ -1,49 +1,29 @@
+import { FloatingCardView } from "@/components/popout/FloatingCard";
+import { FloatingDragHandle } from "@/components/popout/FloatingDragHandle";
import { FloatingView } from "@/components/popout/FloatingView";
import { useFloatingRouter } from "@/hooks/useFloatingRouter";
import { DownloadAction } from "@/video/components/actions/list-entries/DownloadAction";
-import { CaptionsSelectionAction } from "../actions/CaptionsSelectionAction";
-import { SourceSelectionAction } from "../actions/SourceSelectionAction";
+import { CaptionsSelectionAction } from "@/video/components/actions/list-entries/CaptionsSelectionAction";
+import { SourceSelectionAction } from "@/video/components/actions/list-entries/SourceSelectionAction";
import { CaptionSelectionPopout } from "./CaptionSelectionPopout";
-import { PopoutSection } from "./PopoutUtils";
import { SourceSelectionPopout } from "./SourceSelectionPopout";
-function TestPopout(props: { router: ReturnType
}) {
- const isCollapsed = props.router.isLoaded("embed");
-
- return (
-
-
props.router.navigate("/")}>go back
-
{isCollapsed ? "opened" : "closed"}
-
props.router.navigate("/source/embed")}>Open
-
- );
-}
-
export function SettingsPopout() {
const floatingRouter = useFloatingRouter();
- const { pageProps, navigate, isLoaded, isActive } = floatingRouter;
+ const { pageProps, navigate } = floatingRouter;
return (
<>
-
+
+
navigate("/source")} />
navigate("/captions")} />
-
-
-
- {/* */}
-
-
-
-
+
+
+
>
);
}
diff --git a/src/video/components/popouts/SourceSelectionPopout.tsx b/src/video/components/popouts/SourceSelectionPopout.tsx
index 2eee6339..fe2d5ca2 100644
--- a/src/video/components/popouts/SourceSelectionPopout.tsx
+++ b/src/video/components/popouts/SourceSelectionPopout.tsx
@@ -1,5 +1,5 @@
import { useMemo, useRef, useState } from "react";
-import { Icon, Icons } from "@/components/Icon";
+import { Icons } from "@/components/Icon";
import { useLoading } from "@/hooks/useLoading";
import { Loading } from "@/components/layout/Loading";
import { IconPatch } from "@/components/buttons/IconPatch";
@@ -15,7 +15,10 @@ import { runEmbedScraper, runProvider } from "@/backend/helpers/run";
import { MWProviderScrapeResult } from "@/backend/helpers/provider";
import { useTranslation } from "react-i18next";
import { MWEmbed, MWEmbedType } from "@/backend/helpers/embed";
-import { PopoutListEntry, PopoutSection } from "./PopoutUtils";
+import { FloatingCardView } from "@/components/popout/FloatingCard";
+import { FloatingView } from "@/components/popout/FloatingView";
+import { useFloatingRouter } from "@/hooks/useFloatingRouter";
+import { PopoutListEntry } from "./PopoutUtils";
interface EmbedEntryProps {
name: string;
@@ -49,7 +52,10 @@ export function EmbedEntry(props: EmbedEntryProps) {
);
}
-export function SourceSelectionPopout() {
+export function SourceSelectionPopout(props: {
+ router: ReturnType;
+ prefix: string;
+}) {
const { t } = useTranslation();
const descriptor = useVideoPlayerDescriptor();
@@ -66,7 +72,6 @@ export function SourceSelectionPopout() {
const [selectedProvider, setSelectedProvider] = useState(null);
const [scrapeResult, setScrapeResult] =
useState(null);
- const showingProvider = !!selectedProvider;
const selectedProviderPopulated = useMemo(
() => providers.find((v) => v.id === selectedProvider) ?? null,
[providers, selectedProvider]
@@ -106,6 +111,7 @@ export function SourceSelectionPopout() {
if (!providerId) {
providerRef.current = null;
setSelectedProvider(null);
+ props.router.navigate(`/${props.prefix}/source`);
return;
}
@@ -135,16 +141,9 @@ export function SourceSelectionPopout() {
});
providerRef.current = providerId;
setSelectedProvider(providerId);
+ props.router.navigate(`/${props.prefix}/source/embeds`);
};
- const titlePositionClass = useMemo(() => {
- const offset = !showingProvider ? "left-0" : "left-10";
- return [
- "absolute w-full transition-[left,opacity] duration-200",
- offset,
- ].join(" ");
- }, [showingProvider]);
-
const visibleEmbeds = useMemo(() => {
const embeds = scrapeResult?.embeds || [];
@@ -174,45 +173,43 @@ export function SourceSelectionPopout() {
return (
<>
-
-
-
-
- {selectedProviderPopulated?.displayName ?? ""}
-
-
- {t("videoPlayer.popouts.sources")}
-
-
-
-
-
+ {/* List providers */}
+
+ props.router.navigate("/")}
+ />
+
+ {providers.map((v) => (
+ {
+ selectProvider(v.id);
+ }}
+ >
+ {v.displayName}
+
+ ))}
+
+
+
+ {/* List embeds */}
+
+ props.router.navigate(`/${props.prefix}`)}
+ />
+
{loading ? (
@@ -268,22 +265,8 @@ export function SourceSelectionPopout() {
)}
>
)}
-
-
-
- {providers.map((v) => (
-
{
- selectProvider(v.id);
- }}
- >
- {v.displayName}
-
- ))}
-
-
-
+
+
>
);
}