-
Notifications
You must be signed in to change notification settings - Fork 221
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
Can't set width and expect proportional auto height, nor vice versa #201
Comments
@ronenmagid whats the problem with also setting the height beforehand? A youtube video is always 16:9, so if you have |
@ronenmagid Add this change to your css file. 🙂 #widget2{
height: 100vh
width: 100vw
} Or however you want to set the height and width dimensions for mobile responsiveness. Kind of a hack but it gets the job done. |
Turns out the widgets were dynamic. to get around this I put the styling on iframe as a whole. iframe{
height: 100vh;
width: 100wv;
} |
Really the component should accept styles as props to be added to the parent div and the iframe. 🤷♂️ |
@MichaelDimmitt you can check out this comment with a solution for making the iframe responsive. |
@ronenmagid , consider looking at #242 as ruisaraiva19 mentioned |
another solution that works well enough but not ideal since the size will bounce:
Unfortunately getSize is not officially in the Youtube iframe API so its not in the type definitions...but it works! |
This component forces pre-knowledge of the exact video size or it cannot work.
I have a 500px width available for it, but specifying 500px width alone gives you a very short height, that's completely non-proportional to the width.
The text was updated successfully, but these errors were encountered: