-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add scaffolding for new YouTubeEmbed component
resolves #18
- Loading branch information
Showing
3 changed files
with
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import '../styles/youtube.css'; | ||
|
||
// import LiteYouTubeEmbed from 'react-lite-youtube-embed'; | ||
// import 'react-lite-youtube-embed/dist/LiteYouTubeEmbed.css'; | ||
|
||
interface YouTubeEmbedProps { | ||
videoId: string; | ||
title?: string; | ||
width?: string; | ||
height?: string; | ||
} | ||
|
||
export default function YouTubeEmbed({ videoId, title, width = "560", height = "315" }: YouTubeEmbedProps) { | ||
|
||
const src = `https://www.youtube.com/embed/${videoId}?si=NT6nO5iaFP_2BEKp`; | ||
|
||
return ( | ||
<div className="youtube-container"> | ||
<iframe | ||
width={width} | ||
height={height} | ||
src={src} //{`https://www.youtube.com/embed/${videoId}`} | ||
title={title} | ||
frameBorder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
referrerPolicy="strict-origin-when-cross-origin" | ||
allowFullScreen | ||
></iframe> | ||
{/* <LiteYouTubeEmbed | ||
id={videoId || ''} | ||
title={title || ''} | ||
params='' | ||
adNetwork={true} | ||
playlist={false} | ||
poster='hqdefault' | ||
noCookie={true} | ||
ref={null} | ||
/> */} | ||
</div> | ||
); | ||
} |
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,11 @@ | ||
.youtube-container { | ||
display: flex; | ||
justify-content: center; | ||
padding: 20px; | ||
background-color: #f0f0f0; | ||
} | ||
|
||
iframe { | ||
border: 2px solid #000; | ||
border-radius: 8px; | ||
} |