This commit is contained in:
EvanLin3141
2025-02-27 16:05:19 +00:00
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 () => {