video embeds and shortcodes default size

  1. Andrea Fercia

    I recently discovered thx to this Jetpack bug:
    that when embeds or shortcodes don't have proper width/height set, the default size is given by wp_embed_defaults() in media.php which returns the smaller between 1.5 times the width, or 1000px
    $height = min( ceil( $width * 1.5 ), 1000 );
    the width is given by $content_width or set to 500 if $content_width is not set.

    I don't know if this 1.5 ratio is there for historical reasons and yes I know there are embeds that are not videos (e.g. twitter embeds) but about *videos* a 1.5 ratio fallback is not so good.
    There are many plugins and JS libraries (for example fitvids.js) that rely on the original iframe/object ratio to properly display videos.
    We're in the "responsive era", plugins and JS libraries that try to make videos responsive need a proper ratio.
    Please consider giving videos a fallback ratio of 16:9 (0.5625) and you could also extend the idea and be prepared for the future when probably we will have new video ratios to support.
    thx very much

    Posted: 6 years ago #

RSS feed for this topic


You must log in to post.

  • Rating

    0 Votes
  • Status

    This idea is under consideration