YouTube video height constrained

Posted in: Newspaper
Post count: 85

I’m having a problem with YouTube videos.

If I insert them by just inserting the YouTube URL, and let WordPress and/or the theme handle the embed, the video’s height is constrained when published.
If I manually build out my iFrame code, including height and width, they seem to work okay.

I built a test page and examined both the HTML source code and used Inspect Element to look at the page. Here’s what I found:

The HTML in View Source
<iframe title=”The Coronavirus Explained & What You Should Do” width=”1068″ height=”601″ src=”https://www.youtube.com/embed/BtN-goy9VOY?feature=oembed&#8221; frameborder=”0″ allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>

The code in Inspect Element
<iframe title=”The Coronavirus Explained & What You Should Do” width=”100%” height=”601″ src=”https://www.youtube.com/embed/BtN-goy9VOY?feature=oembed&#8221; frameborder=”0″ allow=”accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture” allowfullscreen=”” style=”/* height: 56.25px; */”></iframe>

If I uncheck the /* height: attribute in the Inspect window, the video displays properly, and appears to be responsive as well.

So, what is adding the /* height: attribute?

Here is the test page: https://forwardky.com/?p=25342&preview=true

Thanks!

Post count: 18283

Hello !

The embedded code is being made by Gutenberg / wordpress. Newspaper Theme only renders what wordpress “codes”.

Thank you !

Post count: 85

So that code isn’t some sort of CSS thing added by Newspaper?

Post count: 35449

Hi,

I just made a made some tests using the copy and past method for a Youtube video -> https://i.imgur.com/WV3AxlD.png -> https://i.imgur.com/zoS7PjS.png and for me this is working normal -> https://i.imgur.com/Qrc69ft.png if for you is different it can be a plugin conflict.
If this is not want you mean, please provide some more details and some screenshots.

Let me know the results!
Thank you!

Post count: 85

Well, I took the drastic step of changing to the Twenty Twenty theme, and the problem went away. So, it seems to me that there is something in Newspaper 9 that is causing the problem (or, some interaction with Newspaper and a plugin).

Late tonight, I will disable all the plugins and see if the problem disappears. Will let you know what I find.

Note that the problem goes away if I resize the browser window to force a redraw. But, if I refresh the page at the new size, it returns.

Post count: 35449

Hi,

If the problem persist, please provide again a link where we can inspect this problem.

Thank you for your understanding!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.