Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Responsive YouTube Embeds #132

Open
davidvkimball opened this issue Jul 22, 2024 · 1 comment
Open

Responsive YouTube Embeds #132

davidvkimball opened this issue Jul 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@davidvkimball
Copy link
Contributor

Here's a suggestion: currently YouTube embeds on mobile look strange (oddly tall) with the default suggested copy/paste embed code.

So from this website, I borrowed it and it works quite well:

<div style="width: 100%; min-width: 400px; max-width: 800px;">
<div style="position: relative; width: 100%; overflow: hidden; padding-top: 56.25%;">
<p><iframe style="position: absolute; top: 0; left: 0; right: 0; width: 100%; height: 100%; border: none;" src="https://www.youtube.com/embed/38uzvN-plOg" title="YouTube video player" width="560" height="315" allowfullscreen="allowfullscreen" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"></iframe></p>
</div>
</div>

I've been using it basically as-is for post embeds, maybe it could help someone else.

@saicaca saicaca added the enhancement New feature or request label Aug 8, 2024
@L4Ph
Copy link
Contributor

L4Ph commented Oct 29, 2024

It would be a destructive change, but personally I feel it would be better to use this component.
https://astro-embed.netlify.app/components/youtube/

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants