FIX: Stream management;

REFACTOR: Remove unnecessary console logs;
REFACTOR: Change "Show More" to "Show All";
REFACTOR: `CategoryPage` background set to default;
This commit is contained in:
Chris-1010
2025-02-27 16:00:10 +00:00
parent d31c7f579c
commit 4ea52c4679
3 changed files with 5 additions and 13 deletions

View File

@@ -30,8 +30,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
}
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<VideoPlayerProps> = ({
}
};
const fetchStreamKey = async () => {
const response = await fetch(`/api/user/${streamerName}/stream_key`);
const keyData = await response.json();
return keyData.stream_key;
};
setupPlayer();
return () => {

View File

@@ -92,7 +92,7 @@ const CategoryPage: React.FC = () => {
if (hasMoreData && !streams.length) return <LoadingScreen />;
return (
<DynamicPageContent className="min-h-screen bg-gradient-radial from-[#ff00f1] via-[#0400ff] to-[#ff0000]">
<DynamicPageContent className="min-h-screen">
<div className="pt-8">
<ListRow
ref={listRowRef}

View File

@@ -24,15 +24,14 @@ const HomePage: React.FC<HomePageProps> = ({ variant = "default" }) => {
navigate(`/category/${categoryName}`);
};
if (isLoadingStreams || isLoadingCategories) {
console.log("No content found yet");
if (isLoadingStreams || isLoadingCategories)
return <LoadingScreen>Loading Content...</LoadingScreen>;
}
return (
<DynamicPageContent
navbarVariant="home"
className="relative min-h-screen animate-moving_bg"
contentClassName="pb-[12vh]"
>
<ListRow
type="stream"
@@ -76,7 +75,7 @@ const HomePage: React.FC<HomePageProps> = ({ variant = "default" }) => {
extraClasses="absolute right-10"
onClick={() => navigate("/categories")}
>
Show More
Show All
</Button>
</ListRow>
<Footer />