Skip to content

Commit

Permalink
doc: fix video overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
idiotWu committed Apr 26, 2024
1 parent 6810cd8 commit 071253f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/components/youtube/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import YouTube from 'react-youtube';
import cn from "./style.module.css";

export function YouTubeComponent({videoId}: { videoId: string }) {
const opts = {
height: '360',
height: 'auto',
width: '640',
playerVars: {
// https://developers.google.com/youtube/player_parameters
autoplay: 0,
},
};
return (
<YouTube videoId={videoId} opts={opts} />
<YouTube className={cn.video} videoId={videoId} opts={opts} />
);
}

8 changes: 8 additions & 0 deletions docs/components/youtube/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.video {
max-width: 100%;
}

.video iframe {
max-width: 100%;
aspect-ratio: 16/9;
}

0 comments on commit 071253f

Please sign in to comment.