Skip to content

Commit 509bed6

Browse files
committed
Replace VimeoEmbed component with VideoEmbed for YouTube videos in architecture documentation; add VideoEmbed component for responsive YouTube video embedding.
Signed-off-by: Pete Cheslock <[email protected]>
1 parent 67819a5 commit 509bed6

File tree

3 files changed

+63
-54
lines changed

3 files changed

+63
-54
lines changed

docs/architecture/00_architecture.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Built by leaders in the Kubernetes and vLLM projects, `llm-d` is a community-dri
1111

1212
## Video Demonstration
1313

14-
import VimeoEmbed from '@site/src/components/VimeoEmbed';
14+
import VideoEmbed from '@site/src/components/VideoEmbed';
1515

16-
<VimeoEmbed videoId="1084693051" hash="f92f0d6b1d" />
16+
<VideoEmbed videoId="32MqYC3OydE" />
1717

1818
## Architecture
1919

src/components/VideoEmbed.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import React from 'react';
2+
3+
const VideoEmbed = ({
4+
videoId,
5+
width = '100%',
6+
height = '360',
7+
responsive = true,
8+
autoplay = false,
9+
modestbranding = true,
10+
rel = false
11+
}) => {
12+
// Construct the URL with optional parameters
13+
const params = new URLSearchParams({
14+
autoplay: autoplay ? 1 : 0,
15+
modestbranding: modestbranding ? 1 : 0,
16+
rel: rel ? 1 : 0
17+
});
18+
19+
const src = `https://www.youtube.com/embed/${videoId}?${params.toString()}`;
20+
21+
const iframe = (
22+
<iframe
23+
src={src}
24+
style={responsive ? {
25+
width: '100%',
26+
height: '100%'
27+
} : {
28+
width,
29+
height
30+
}}
31+
frameBorder="0"
32+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
33+
allowFullScreen
34+
/>
35+
);
36+
37+
if (responsive) {
38+
return (
39+
<div style={{
40+
position: 'relative',
41+
paddingBottom: '56.25%',
42+
height: 0,
43+
overflow: 'hidden'
44+
}}>
45+
<div style={{
46+
position: 'absolute',
47+
top: 0,
48+
left: 0,
49+
width: '100%',
50+
height: '100%'
51+
}}>
52+
{iframe}
53+
</div>
54+
</div>
55+
);
56+
}
57+
58+
return iframe;
59+
};
60+
61+
export default VideoEmbed;

src/components/VimeoEmbed.js

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)