lazy-load-for-videos
lazy-load-for-videos copied to clipboard
Video height and width
Maybe I am just missing something but when I use the Wordpress embed shortcode and include a height and width the plugin seems to ignore them. Instead is sized the width to the parent element and the height just seems to be the default youtube video height. We have videos on our site that are 720x405 but they just end up displaying at 720x363.
Hi Bear, this plugin doesn't support a custom height/width. If you want to change the height/width, you'll have to take the appropriate CSS classes from the video element and add custom CSS. Here's a related answer: https://wordpress.org/support/topic/wrong-aspect-ratio-with-embedded-videos/
On Fri, Mar 29, 2019 at 5:49 AM Code-Bear [email protected] wrote:
Maybe I am just missing something but when I use the Wordpress embed shortcode and include a height and width the plugin seems to ignore them. Instead is sized the width to the parent element and the height just seems to be the default youtube video height. We have videos on our site that are 720x405 but they just end up displaying at 720x363.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kevinweber/lazy-load-for-videos/issues/16, or mute the thread https://github.com/notifications/unsubscribe-auth/ACqB_5joRsq7svzkPR-DhdjgIkc4WZ-Yks5vbSrYgaJpZM4cRHD4 .
I was able to control the size with CSS but it does look like the plugin overrides my speficied size fromt he shortcode. I am thankful for the plugin but it seems it would be easy enough to get the size params from the shortcode and at least use those for the size of the video instead of overriding/ignoring any size settings and simply setting the video to load with the Youtube's default size.
Below is an example that I would normally use to insert a video into a post but these params are ignored which requires me to create a custom CSS for every video on the size. Using the embed code from Youtube directly doesn't seem to work with your plugin so I am not able to set a style to the iframe either so I am left with a bunch of videos with IDs and custom CSS since many of them are set to different sizes.
[embed height="405px" width="720px"]https://youtu.be/n4Xp6g-_UUw[/embed]
Tried using it on a page that is built with WPBakery page builder. But when you click on Play, you can hear the video start, but the player only ever gets a height of 0. Setting it to "100%" in CSS does not work, so I would have to set a dedicated px height for every single embedded video.