WordPress.org

Ready to get started?Download WordPress

Ideas

video embeds and shortcodes default size

  1. Andrea Fercia
    Member

    I recently discovered thx to this Jetpack bug:
    http://plugins.trac.wordpress.org/ticket/2030
    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
    Andrea

    Posted: 8 months ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    0 Votes
  • Status

    This idea is under consideration