From 92a38d2c0a8524e15833916d5654360e91456eeb Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 12 Oct 2022 17:07:59 +0900 Subject: [PATCH] Add remote cast page --- front/src/pages/remote/index.jsx | 32 +++++++++ front/src/player/cast/cast-remote.tsx | 98 +++++++++++++++++++++++++++ 2 files changed, 130 insertions(+) create mode 100644 front/src/pages/remote/index.jsx create mode 100644 front/src/player/cast/cast-remote.tsx diff --git a/front/src/pages/remote/index.jsx b/front/src/pages/remote/index.jsx new file mode 100644 index 00000000..c5dd28f7 --- /dev/null +++ b/front/src/pages/remote/index.jsx @@ -0,0 +1,32 @@ +/* + * Kyoo - A portable and vast media library solution. + * Copyright (c) Kyoo. + * + * See AUTHORS.md and LICENSE file in the project root for full license information. + * + * Kyoo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Kyoo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Kyoo. If not, see . + */ + +import { CastRemote } from "~/player/cast/cast-remote"; +import { Navbar } from "~/components/navbar"; + +CastRemote.getLayout = (page) => { + return ( + <> + +
{page}
+ + ); +}; +export default CastRemote; diff --git a/front/src/player/cast/cast-remote.tsx b/front/src/player/cast/cast-remote.tsx new file mode 100644 index 00000000..64381b97 --- /dev/null +++ b/front/src/player/cast/cast-remote.tsx @@ -0,0 +1,98 @@ +/* + * Kyoo - A portable and vast media library solution. + * Copyright (c) Kyoo. + * + * See AUTHORS.md and LICENSE file in the project root for full license information. + * + * Kyoo is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * Kyoo is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Kyoo. If not, see . + */ + +import { ClosedCaption, Pause, PlayArrow, SkipNext, SkipPrevious } from "@mui/icons-material"; +import { IconButton, Tooltip, Typography } from "@mui/material"; +import { Box } from "@mui/system"; +import useTranslation from "next-translate/useTranslation"; +import { useRouter } from "next/router"; +import { Poster } from "~/components/poster"; +import { ProgressBar } from "../components/progress-bar"; +import NextLink from "next/link"; + +export const CastRemote = () => { + const name = "Ansatsu Kyoushitsu"; + const episodeName = "S1:E1 Assassination Time"; + const poster = "/api/show/ansatsu-kyoushitsu/poster"; + const previousSlug = "toto"; + const nextSlug = "toto"; + const isPlaying = false; + const subtitles: never[] = []; + const setPlay = (obol: boolean) => {}; + + const { t } = useTranslation("browse"); + const router = useRouter(); + + return ( + + + {name} + {episodeName && {episodeName}} + + + {previousSlug && ( + + + + + + + + )} + + setPlay(!isPlaying)} + aria-label={isPlaying ? t("pause") : t("play")} + sx={{ color: "white" }} + > + {isPlaying ? : } + + + {nextSlug && ( + + + + + + + + )} + {subtitles && ( + + { + /* setSubtitleAnchor(event.currentTarget); */ + /* onMenuOpen(); */ + }} + sx={{ color: "white" }} + > + + + + )} + + + ); +};