Skip to content
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

[gh46] Resize the YouTube video #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ahaywood
Copy link
Collaborator

GitHub Issue #46

Feature description

There was a bug where YouTube videos weren't being displayed correctly.

Solution description

Code looks to see if there are any embeds and then uses the YouTube API to determine and set the aspect ratio of the video.

Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if I ripped out similar code previously in a foolhardy manner when I moved to mdx!

Tested locally and the video resizes to the appropriate aspect ratio.

@Josh-Walker-GM
Copy link
Collaborator

Is there one particular aspect ratio that is by far the most common? If so we could set that as the default to lessen the potential layout shift when the resize happens.

@ahaywood
Copy link
Collaborator Author

@Josh-Walker-GM Thanks for taking a look at this! 🙏

I'd guess the standard is 16:9 or 1920 x 1080. But, code tutorials are notorious for not following standard video conventions and basing it off the developers own screen resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants