-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase frame size of embedded videos, allow full screen #927
Conversation
Your example doesn't fit in mobile screen, maybe try |
Thank you @hanubeki! I have tested and commited that change, and it is reflected by the example (https://mander.xyz/post/533860).
EDIT: I have found out how. We can use "aspect-ratio:16/9" instead of explicitly setting the height. |
@@ -75,7 +75,7 @@ export class MetadataCard extends Component< | |||
</div> | |||
)} | |||
{this.state.expanded && post.embed_video_url && ( | |||
<iframe src={post.embed_video_url}></iframe> | |||
<center><iframe allowFullscreen="allowfullscreen" src={post.embed_video_url} style="aspect-ratio:16/9;max-width:85vw" width="560px" frameborder="0"></iframe></center> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not hardcode widths or aspect ratios like this. Use bootstrap classes made for iframes: https://getbootstrap.com/docs/5.3/helpers/ratio/#example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the feature you linked appears to be new in Bootstrap v5. As the UI is still using bootstrap v4 the .ratio
helper is not available yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have opened a PR following the recommended approach #1437
A proposed change to the <iframe> of embedded videos in order to improve the browser experience.
This change will:
Example implementation: https://mander.xyz/post/533860
Fixes #926