LazyLoad YouTube option changes size of video
In some cases, the YouTube option changes the dimenstions at which a video is displayed, compared to the original video, and even compared to normal iframes LazyLoad behaviour.
I think the video in this specific case is not a standard aspect ratio and maybe that's related to the problem.
HTML embed code: http://snippi.com/s/w55kkmq Sample page: http://mega.wp-rocket.me/nieuws/iframe-ll-ty-embed-with-url/
Sizing with online iframes LL active (correct): https://jmp.sh/FzJT7mW Sizing with YT option active (incorrect): https://jmp.sh/nx2YKJI
As a side note, you can see on the page above, the behaviour between embedding the video simply with the URL Vs. using HTML embed code, is different.
Related ticket: https://secure.helpscout.net/conversation/1184833616/170381?folderId=377611
Reproduce the issue ✅ Identified the issue on my localhost.
Identify the root cause ✅ The issue is that width and height from youtube iframe is not preserved.
Scope a solution ✅ A solution is to keep width & height for all youtube iframes and also apply the same width and height to the preview image. The default image used for youtube is the hqdefault which the default size is: 480 x 360px. If we change also the preview image (and is larger than the hqdefault size) then the preview image will be pixelated. However this will be a signal that the user will need to use other resolution for the preview image.
https://github.com/wp-media/rocket-lazyload-common/blob/c7268f7d2bab27cea5d09d03c5ad11eadb1bdedd/src/Iframe.php#L23
Effort ✅ I would assume this will be an [S].
Not enough feedback from customers, it'll not be implemented anywhere soon. Feel free to reopen this if needed.
Related ticket: https://secure.helpscout.net/conversation/2921601798/556969?viewId=8127840