/
VideoThing.jsx
42 lines (39 loc) · 1.61 KB
/
VideoThing.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
import Admonition from '@theme/Admonition';
const Component = ({ videoUrls, children }) => {
return (
<article className="unleash-video-wrapper">
<div className="unleash-video-container">
<Admonition type="tip" title="Video content">
{children}
Hey! Did you know that the content in this guide is also
available in video format? If that's more your speed, feel
free to check out one of these related videos 🍿📽
</Admonition>
<div className="videos">
{videoUrls ? (
videoUrls.map((url) => (
<div className="video-wrapper">
<iframe
key={url}
width="100%"
height="auto"
src={url}
title="YouTube video player"
frameBorder="0"
allowFullScreen
></iframe>
</div>
))
) : (
<Admonition type="danger">
You need to provide YouTube video URLs for this
component to work properly.
</Admonition>
)}
</div>
</div>
</article>
);
};
export default Component;