-
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.
Merge pull request #461 from VK-RED/youtube-support
feat: add Youtube Renderer in VideoPlayer
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { FunctionComponent } from 'react'; | ||
|
||
interface YoutubeRendererProps { | ||
url: string; | ||
} | ||
|
||
export const YoutubeRenderer: FunctionComponent<YoutubeRendererProps> = ({ | ||
url, | ||
}) => { | ||
return ( | ||
<div className="mt-2 flex justify-center"> | ||
<iframe | ||
width="100%" | ||
className="h-[80vh]" | ||
height="500px" | ||
src={url} | ||
title="YouTube video player" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
allowFullScreen | ||
></iframe> | ||
</div> | ||
); | ||
}; |