We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c07be69 commit 4d194fdCopy full SHA for 4d194fd
2 files changed
src/components/YoutubePlayer.tsx
@@ -0,0 +1,19 @@
1
+import React from "react";
2
+import styles from "@site/src/components/youTubePlayer.module.css";
3
+
4
+type YouTubePlayerTypes = {
5
+ videoId: string;
6
+};
7
8
+const YouTubePlayer = ({ videoId }: YouTubePlayerTypes) => (
9
+ <div className={styles.container}>
10
+ <iframe
11
+ allowFullScreen
12
+ height="480"
13
+ src={`https://www.youtube.com/embed/${videoId}?rel=0`}
14
+ width="853"
15
+ />
16
+ </div>
17
+);
18
19
+export default YouTubePlayer;
src/components/youtubePlayer.module.css
@@ -0,0 +1,16 @@
+.container {
+ position: relative;
+ overflow: hidden;
+ width: 100%;
+ padding-top: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
+}
+.container iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ height: 100%;
0 commit comments