-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
170 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use client"; | ||
import { GetAppxVideoPlayerUrl } from "@/actions/user"; | ||
import { useEffect, useState } from "react"; | ||
|
||
export const AppxVideoPlayer = ({ | ||
courseId, | ||
videoId, | ||
}: { | ||
courseId: string; | ||
videoId: string; | ||
}) => { | ||
const [url, setUrl] = useState(""); | ||
|
||
useEffect(() => { | ||
(async () => { | ||
try { | ||
const videoUrl = await GetAppxVideoPlayerUrl(courseId, videoId) | ||
setUrl(videoUrl) | ||
} catch { | ||
if (window === undefined) return; | ||
location.href = '/api/auth/signin'; | ||
} | ||
})(); | ||
}, []) | ||
|
||
if (!url.length) { | ||
return <p>Loading...</p>; | ||
} | ||
|
||
return ( | ||
<iframe | ||
src={url} | ||
className="w-[80vw] h-[80vh] rounded-lg" | ||
></iframe> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ca57ad8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the name of this PR, "feat: figure out stuff." It's a great name for a PR that has some great learning and complex stuff. paaji tusi kamal ho. I have a lot to learn from you.
ca57ad8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you bhai. It's nothing great. You will also get there soon enough if you put in enough time and focus on understanding things 🙏