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:
@@ -30,8 +30,7 @@ const VideoPlayer: React.FC<VideoPlayerProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setupPlayer = async () => {
|
const setupPlayer = async () => {
|
||||||
const streamKey = await fetchStreamKey();
|
const streamUrl = `/stream/${streamerName}/index.m3u8`;
|
||||||
const streamUrl = `/stream/${streamKey}/index.m3u8`;
|
|
||||||
|
|
||||||
if (!playerRef.current) {
|
if (!playerRef.current) {
|
||||||
const videoElement = document.createElement("video");
|
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();
|
setupPlayer();
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ const CategoryPage: React.FC = () => {
|
|||||||
if (hasMoreData && !streams.length) return <LoadingScreen />;
|
if (hasMoreData && !streams.length) return <LoadingScreen />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DynamicPageContent className="min-h-screen bg-gradient-radial from-[#ff00f1] via-[#0400ff] to-[#ff0000]">
|
<DynamicPageContent className="min-h-screen">
|
||||||
<div className="pt-8">
|
<div className="pt-8">
|
||||||
<ListRow
|
<ListRow
|
||||||
ref={listRowRef}
|
ref={listRowRef}
|
||||||
|
|||||||
@@ -24,15 +24,14 @@ const HomePage: React.FC<HomePageProps> = ({ variant = "default" }) => {
|
|||||||
navigate(`/category/${categoryName}`);
|
navigate(`/category/${categoryName}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isLoadingStreams || isLoadingCategories) {
|
if (isLoadingStreams || isLoadingCategories)
|
||||||
console.log("No content found yet");
|
|
||||||
return <LoadingScreen>Loading Content...</LoadingScreen>;
|
return <LoadingScreen>Loading Content...</LoadingScreen>;
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DynamicPageContent
|
<DynamicPageContent
|
||||||
navbarVariant="home"
|
navbarVariant="home"
|
||||||
className="relative min-h-screen animate-moving_bg"
|
className="relative min-h-screen animate-moving_bg"
|
||||||
|
contentClassName="pb-[12vh]"
|
||||||
>
|
>
|
||||||
<ListRow
|
<ListRow
|
||||||
type="stream"
|
type="stream"
|
||||||
@@ -76,7 +75,7 @@ const HomePage: React.FC<HomePageProps> = ({ variant = "default" }) => {
|
|||||||
extraClasses="absolute right-10"
|
extraClasses="absolute right-10"
|
||||||
onClick={() => navigate("/categories")}
|
onClick={() => navigate("/categories")}
|
||||||
>
|
>
|
||||||
Show More
|
Show All
|
||||||
</Button>
|
</Button>
|
||||||
</ListRow>
|
</ListRow>
|
||||||
<Footer />
|
<Footer />
|
||||||
|
|||||||
Reference in New Issue
Block a user