YouTube videos are not responsive in posts

sumple
17 Posts
sumple posted this 07 November 2016

How can I make the videos responsive on mobile in posts?

Example URL:
http://krzysztofblas.com/2016/04/15/polski-krzysztof-blas-w-duecie-z-michalem-kowalonkiem-na-targach-musicmesse-we-frankfurcie-2/

How can I make the videos responsive on mobile in posts? Example URL: http://krzysztofblas.com/2016/04/15/polski-krzysztof-blas-w-duecie-z-michalem-kowalonkiem-na-targach-musicmesse-we-frankfurcie-2/
Vote to pay developers attention to this features or issue.
4 Comments
Order By: Standard | Newest
Support Team
Support Team posted this 08 November 2016

Hi,

The iframe that includes the video has the fixed width parameters that are preventing it from resizing. Use the width 100% parameters.

Sincerely,
Hella

Hi, The `iframe` that includes the video has the fixed width parameters that are preventing it from resizing. Use the width 100% parameters. Sincerely, Hella
sumple
17 Posts
Is Solution
sumple posted this 08 November 2016

This doesn't help because the height looks bad then, check this out:
http://i.imgur.com/WsmyWCm.png

It should look like this:
http://i.imgur.com/Cb6Zt47.png

Also there is no iframe set here, it's a standard Wordpress shortcode:

[embed]https://youtu.be/3OfIvOGBeZA[/embed]

Any ideas on how to make it work with the shortcode? Where do I style it?

This doesn't help because the height looks bad then, check this out: http://i.imgur.com/WsmyWCm.png It should look like this: http://i.imgur.com/Cb6Zt47.png Also there is no iframe set here, it's a standard Wordpress shortcode: [embed]https://youtu.be/3OfIvOGBeZA[/embed] Any ideas on how to make it work with the shortcode? Where do I style it?

Last edited 08 November 2016 by sumple

Support Team
Support Team posted this 10 November 2016

Hi,

This shortcode creates iframe.
Please try the following solution which uses bootstrap responsive embed:

<div style="min-width: 200px; max-width: 500px;">
<div class="embed-responsive embed-responsive-16by9">
[embed]https://youtu.be/3OfIvOGBeZA[/embed]
</div>
</div>

This should help.

Please let us know the result.

As alternative solution you can try using Themler Video control.

Thank you,
Olivia

Hi, This shortcode creates iframe. Please try the following solution which uses bootstrap responsive embed: `<div style="min-width: 200px; max-width: 500px;">` `<div class="embed-responsive embed-responsive-16by9">` `[embed]https://youtu.be/3OfIvOGBeZA[/embed]` `</div> </div>` This should help. Please let us know the result. As alternative solution you can try using Themler Video control. Thank you, Olivia
Stagger Lee
1818 Posts
Stagger Lee posted this 10 November 2016

Add this to your Home - Settings - CMS Code:

function bootstrap_wrap_oembed( $html ){
  $html = preg_replace( '/(width|height)="d*"s/', "", $html ); // Strip width and height #1
  return'<div class="embed-responsive embed-responsive-16by9">'.$html.'</div>'; // Wrap in div element and return #3 and #4
}
add_filter( 'embed_oembed_html','bootstrap_wrap_oembed',10,1);

Add this to your Home - Settings - CMS Code: function bootstrap_wrap_oembed( $html ){ $html = preg_replace( '/(width|height)="d*"s/', "", $html ); // Strip width and height #1 return'<div class="embed-responsive embed-responsive-16by9">'.$html.'</div>'; // Wrap in div element and return #3 and #4 } add_filter( 'embed_oembed_html','bootstrap_wrap_oembed',10,1);
You must log in or register to leave comments