From fb470b5a6c4a7a5bfa6de732b17ab638da7a5948 Mon Sep 17 00:00:00 2001 From: Sargam Date: Thu, 21 Nov 2024 18:12:39 +0530 Subject: [PATCH] fix: make the courseId come from url (#1574) --- src/components/VideoPlayer2.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/VideoPlayer2.tsx b/src/components/VideoPlayer2.tsx index 3916917d..20521be9 100644 --- a/src/components/VideoPlayer2.tsx +++ b/src/components/VideoPlayer2.tsx @@ -46,6 +46,8 @@ export const VideoPlayer: FunctionComponent = ({ const [player, setPlayer] = useState(null); const searchParams = useSearchParams(); const vidUrl = options.sources[0].src; + const href = window.location.href; + const courseId = href.split('/')[4]; const togglePictureInPicture = async () => { try { @@ -476,9 +478,8 @@ export const VideoPlayer: FunctionComponent = ({ if (isYoutubeUrl(vidUrl)) return ; - //TODO: Figure out how to get the courseId if (appxVideoId) - return ; + return ; return (