mirror of
https://github.com/System-End/site.git
synced 2026-04-19 23:22:49 +00:00
Add video player component
This commit is contained in:
parent
3aee958d2b
commit
8c19a79e1b
1 changed files with 32 additions and 0 deletions
32
components/onboard/youtube-video.js
Normal file
32
components/onboard/youtube-video.js
Normal 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
|
||||
Loading…
Add table
Reference in a new issue