wrap video embeds in the ratio container
This should correctly size the embedded video iframe to the full available width, which looks better and is compatible with mobile devices. Also add the "allowfullscreen" modifier to the iframe so that the video can be expanded to the browser's fullscreen mode. Also add the post.embed_title as the iframe "title" attribute.
This commit is contained in:
parent
bc658a80a4
commit
9858514bb4
1 changed files with 8 additions and 4 deletions
|
@ -75,10 +75,14 @@ export class MetadataCard extends Component<
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{this.state.expanded && post.embed_video_url && (
|
{this.state.expanded && post.embed_video_url && (
|
||||||
<iframe
|
<div className="ratio ratio-16x9">
|
||||||
className="post-metadata-iframe"
|
<iframe
|
||||||
src={post.embed_video_url}
|
allowFullScreen
|
||||||
></iframe>
|
className="post-metadata-iframe"
|
||||||
|
src={post.embed_video_url}
|
||||||
|
title={post.embed_title}
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue