Add video player component

This commit is contained in:
Max Wofford 2024-03-15 13:30:33 -04:00 committed by Toby Brown
parent 3aee958d2b
commit 8c19a79e1b

View file

@ -0,0 +1,32 @@
const YoutubeVideo = ({
width=560,
height=315,
'youtube-id': youtubeID = 'dQw4w9WgXcQ',
title="YouTube video player",
}) => {
const src = `https://www.youtube.com/embed/${youtubeID}`
const allowlist = [
'accelerometer',
'autoplay',
'clipboard-write',
'encrypted-media',
'gyroscope',
'picture-in-picture',
'web-share',
'fullscreen'
].join('; ')
return (
<iframe width={width}
height={height}
src={src}
title={title}
frameborder="0"
allow={allowlist}
allowfullscreen>
</iframe>
)
}
export default YoutubeVideo