fix: responsive youtube embed (closes #1167)

This commit is contained in:
Jacky Zhao 2024-08-05 19:14:09 -07:00
parent 6c4ed249ba
commit ca3943b500
2 changed files with 9 additions and 4 deletions

View file

@ -616,11 +616,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
// YouTube video (with optional playlist)
node.tagName = "iframe"
node.properties = {
class: "external-embed",
class: "external-embed youtube",
allow: "fullscreen",
frameborder: 0,
width: "600px",
height: "350px",
src: playlistId
? `https://www.youtube.com/embed/${videoId}?list=${playlistId}`
: `https://www.youtube.com/embed/${videoId}`,
@ -629,11 +628,10 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
// YouTube playlist only.
node.tagName = "iframe"
node.properties = {
class: "external-embed",
class: "external-embed youtube",
allow: "fullscreen",
frameborder: 0,
width: "600px",
height: "350px",
src: `https://www.youtube.com/embed/videoseries?list=${playlistId}`,
}
}

View file

@ -541,3 +541,10 @@ ol.overflow {
overflow-x: auto;
overflow-y: hidden;
}
.external-embed.youtube {
aspect-ratio: 16 / 9;
height: 100%;
width: 100%;
border-radius: 5px;
}