From b1f4f412059760d85f531c3d6e2ee626c9002d28 Mon Sep 17 00:00:00 2001 From: real-zephex Date: Mon, 18 Mar 2024 14:03:32 +0530 Subject: fixes: change the file extension to .jsx and fixed the video player sizes for tablets --- src/app/video/[animeId]/page.js | 46 ---------------------------------------- src/app/video/[animeId]/page.jsx | 46 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 src/app/video/[animeId]/page.js create mode 100644 src/app/video/[animeId]/page.jsx (limited to 'src/app/video') diff --git a/src/app/video/[animeId]/page.js b/src/app/video/[animeId]/page.js deleted file mode 100644 index d7e68f9..0000000 --- a/src/app/video/[animeId]/page.js +++ /dev/null @@ -1,46 +0,0 @@ -import { MediaPlayer, MediaProvider } from "@vidstack/react"; -import "@vidstack/react/player/styles/base.css"; -import "@vidstack/react/player/styles/plyr/theme.css"; -import { - PlyrLayout, - plyrLayoutIcons, -} from "@vidstack/react/player/layouts/plyr"; -import "../video.css"; - -export default async function Video({ params }) { - const id = params.animeId; - const words = id.split("-"); - const last_two = words.slice(-2).join(" "); - const remainingWords = words.slice(0, -2).join(" "); - const data = await getVideoLink(id); - const link = data.sources[3].url; - - return ( -
-
-

- {last_two} - {remainingWords} -

- - - - -
-
- ); -} - -async function getVideoLink(id) { - const res = await fetch( - "https://anime-sensei-api.vercel.app/anime/gogoanime/watch/" + id - ); - const data = res.json(); - return data; -} diff --git a/src/app/video/[animeId]/page.jsx b/src/app/video/[animeId]/page.jsx new file mode 100644 index 0000000..d7e68f9 --- /dev/null +++ b/src/app/video/[animeId]/page.jsx @@ -0,0 +1,46 @@ +import { MediaPlayer, MediaProvider } from "@vidstack/react"; +import "@vidstack/react/player/styles/base.css"; +import "@vidstack/react/player/styles/plyr/theme.css"; +import { + PlyrLayout, + plyrLayoutIcons, +} from "@vidstack/react/player/layouts/plyr"; +import "../video.css"; + +export default async function Video({ params }) { + const id = params.animeId; + const words = id.split("-"); + const last_two = words.slice(-2).join(" "); + const remainingWords = words.slice(0, -2).join(" "); + const data = await getVideoLink(id); + const link = data.sources[3].url; + + return ( +
+
+

+ {last_two} - {remainingWords} +

+ + + + +
+
+ ); +} + +async function getVideoLink(id) { + const res = await fetch( + "https://anime-sensei-api.vercel.app/anime/gogoanime/watch/" + id + ); + const data = res.json(); + return data; +} -- cgit v1.2.3