From 4ea52c467988dff9a1b1c6bf230e190a0a0c8b97 Mon Sep 17 00:00:00 2001 From: Chris-1010 <122332721@umail.ucc.ie> Date: Thu, 27 Feb 2025 16:00:10 +0000 Subject: [PATCH] FIX: Stream management; REFACTOR: Remove unnecessary console logs; REFACTOR: Change "Show More" to "Show All"; REFACTOR: `CategoryPage` background set to default; --- frontend/src/components/Stream/VideoPlayer.tsx | 9 +-------- frontend/src/pages/CategoryPage.tsx | 2 +- frontend/src/pages/HomePage.tsx | 7 +++---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/Stream/VideoPlayer.tsx b/frontend/src/components/Stream/VideoPlayer.tsx index b0b7ac6..fb4133d 100644 --- a/frontend/src/components/Stream/VideoPlayer.tsx +++ b/frontend/src/components/Stream/VideoPlayer.tsx @@ -30,8 +30,7 @@ const VideoPlayer: React.FC = ({ } const setupPlayer = async () => { - const streamKey = await fetchStreamKey(); - const streamUrl = `/stream/${streamKey}/index.m3u8`; + const streamUrl = `/stream/${streamerName}/index.m3u8`; if (!playerRef.current) { const videoElement = document.createElement("video"); @@ -87,12 +86,6 @@ const VideoPlayer: React.FC = ({ } }; - const fetchStreamKey = async () => { - const response = await fetch(`/api/user/${streamerName}/stream_key`); - const keyData = await response.json(); - return keyData.stream_key; - }; - setupPlayer(); return () => { diff --git a/frontend/src/pages/CategoryPage.tsx b/frontend/src/pages/CategoryPage.tsx index 8562c72..5657677 100644 --- a/frontend/src/pages/CategoryPage.tsx +++ b/frontend/src/pages/CategoryPage.tsx @@ -92,7 +92,7 @@ const CategoryPage: React.FC = () => { if (hasMoreData && !streams.length) return ; return ( - +
= ({ variant = "default" }) => { navigate(`/category/${categoryName}`); }; - if (isLoadingStreams || isLoadingCategories) { - console.log("No content found yet"); + if (isLoadingStreams || isLoadingCategories) return Loading Content...; - } return ( = ({ variant = "default" }) => { extraClasses="absolute right-10" onClick={() => navigate("/categories")} > - Show More + Show All