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

Replace iframes with ResponsiveVideo component #427

Merged
merged 5 commits into from
Jun 14, 2023

Conversation

MartinMinkov
Copy link
Collaborator

@MartinMinkov MartinMinkov commented Jun 13, 2023

Description

The current approach for embedding YouTube videos into our content uses the iframe directly provided by YouTube's share functionality. While this method offers a straightforward solution for desktop viewers, it falls short regarding mobile-friendliness and proper scaling.

In response to these limitations, this Pull Request introduces a new component: ResponsiveVideo.

To utilize this component within a .mdx file, the following import statement needs to be added at the top of the file:

import ResponsiveVideo from '@site/src/components/common/ResponsiveVideo';

Subsequently, a responsive iframe can be rendered with the ResponsiveVideo component, as demonstrated below:

<ResponsiveVideo src="your_embed_link_here" />

By leveraging this new component, we aim to enhance the viewing experience across different devices, ensuring our embedded YouTube videos scale properly and maintain a mobile-friendly interface.

🔗 Preview Link: https://docs2-git-feat-add-responsive-iframe-minadocs.vercel.app/

@MartinMinkov MartinMinkov requested a review from a team as a code owner June 13, 2023 23:38
@vercel
Copy link

vercel bot commented Jun 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs2 ✅ Ready (Inspect) Visit Preview Jun 13, 2023 11:38pm

Copy link
Contributor

@ymekuria ymekuria left a comment

Choose a reason for hiding this comment

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

This is a great addition Martin! Thanks for adding this!

@MartinMinkov MartinMinkov merged commit c2b2c9b into main Jun 14, 2023
@MartinMinkov MartinMinkov deleted the feat/add-responsive-iframe branch June 14, 2023 02:01
@barriebyron
Copy link
Contributor

So great, Martin, and much cleaner for workflow and result! Excellent work.

I updated the Docs wiki with instructions https://github.com/o1-labs/docs2/wiki/Markdown-Syntax#adding-videos-in-docs
lmk if anything needs updating

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.

3 participants