Skip to content

Commit fb470b5

Browse files
authored
fix: make the courseId come from url (#1574)
1 parent 315bba1 commit fb470b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/VideoPlayer2.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export const VideoPlayer: FunctionComponent<VideoPlayerProps> = ({
4646
const [player, setPlayer] = useState<any>(null);
4747
const searchParams = useSearchParams();
4848
const vidUrl = options.sources[0].src;
49+
const href = window.location.href;
50+
const courseId = href.split('/')[4];
4951

5052
const togglePictureInPicture = async () => {
5153
try {
@@ -476,9 +478,8 @@ export const VideoPlayer: FunctionComponent<VideoPlayerProps> = ({
476478

477479
if (isYoutubeUrl(vidUrl)) return <YoutubeRenderer url={vidUrl} />;
478480

479-
//TODO: Figure out how to get the courseId
480481
if (appxVideoId)
481-
return <AppxVideoPlayer courseId={'14'} videoId={appxVideoId} />;
482+
return <AppxVideoPlayer courseId={courseId} videoId={appxVideoId} />;
482483

483484
return (
484485
<div

0 commit comments

Comments
 (0)