Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

[BUG] YouTube videos break out of their container width #156

Open
jjsanderson opened this issue Jun 17, 2019 · 1 comment
Open

[BUG] YouTube videos break out of their container width #156

jjsanderson opened this issue Jun 17, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jjsanderson
Copy link

Describe the bug
A video embedded from YouTube breaks out of the container width, spanning to the right of the window.

To Reproduce
Steps to reproduce the behaviour:

  1. Add a video component, referencing a YouTube URL
  2. Publish page, view page as served.
  3. See huge video spanning to the right of the window.

Expected behaviour
Videos have consistent widths, irrespective of source (ie. locally-hosted or embedded from third-party site).

Additional context
Video embed size is a really common issue for Wordpress themes, and the web in general. It's often useful to be able to force 4:3 or 16:9 embed size ratios, though neither can be relied upon. On occasion, YouTube will do something utterly insane, like serve a 16:9 video letterboxed in a 4:3 frame but labeled as 16:9 content. Ugh.

@jjsanderson jjsanderson added the bug Something isn't working label Jun 17, 2019
@jjsanderson jjsanderson changed the title YouTube videos break out of the container width YouTube videos break out of their container width Jun 17, 2019
@jaymcp jaymcp self-assigned this Jun 17, 2019
@jaymcp jaymcp added this to the v1.1.1 milestone Jun 17, 2019
@jjsanderson
Copy link
Author

jjsanderson commented Jun 17, 2019

Looks like a fix here might be as simple as:

in includes/theme-supports.php add line to benenson_theme_support():

add_theme_support( 'responsive-embeds' );

reference: https://developer.wordpress.org/block-editor/developers/themes/theme-support/#responsive-embedded-content

Tricky for me to test robustly, but seems to be solving issues for me locally.

@jaymcp jaymcp changed the title YouTube videos break out of their container width [BUG] YouTube videos break out of their container width Jun 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants