Skip to content

Commit 70ebb9b

Browse files
author
ci-bot
committed
fix aspect ratio for learnEth Video
1 parent 387a672 commit 70ebb9b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

apps/learneth/src/pages/StepDetail/index.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,16 @@ function StepDetailPage() {
8888
<iframe width="560" height="315" src="https://www.youtube.com/embed/Eh1qgOurDxU?si=lz1JypmIJZ15OY4g" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
8989
*/
9090
return (
91-
<iframe
92-
/*width="560"
93-
height="315"*/
94-
src={src}
95-
title="YouTube video player"
96-
frameBorder="0"
97-
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
98-
allowFullScreen
99-
/>
91+
<div className="position-relative overflow-hidden" style={{ paddingBottom: '56.25%', maxWidth: '100%', height: '0' }}>
92+
<iframe
93+
style={{ width: '100%', height: '100%', position: 'absolute', top: 0, left: 0 }}
94+
src={src}
95+
title="YouTube video player"
96+
frameBorder="0"
97+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
98+
allowFullScreen
99+
/>
100+
</div>
100101
);
101102
}
102103
if (alt === 'video') {
@@ -137,9 +138,7 @@ function StepDetailPage() {
137138
</>
138139
)}
139140
<div className="container-fluid">
140-
<Markdown components={{
141-
img: VideoRenderer
142-
}} rehypePlugins={[rehypeRaw]}>{clonedStep.markdown?.content}</Markdown>
141+
<Markdown components={{ img:VideoRenderer }} rehypePlugins={[rehypeRaw]}>{clonedStep.markdown?.content}</Markdown>
143142
</div>
144143
{clonedStep.test?.content ? (
145144
<>

0 commit comments

Comments
 (0)