Make WordPress Core


Ignore:
Timestamp:
02/28/2014 09:27:40 PM (11 years ago)
Author:
wonderboymusic
Message:
  • Videos should always render at the same aspect ratio.
  • Don't force a pseudo-mime-type for .m4v files
  • Uniformly adapt to $content_width when setting video dimensions on the front end
  • Add the height attribute to the initial <video> in the video playlist JS template
  • Add some defensive/responsive CSS for a/v on the Edit Media page

See #27243.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r27316 r27328  
    26412641
    26422642        $meta = wp_get_attachment_metadata( $attachment_id );
    2643         $w = ! empty( $meta['width'] ) ? min( $meta['width'], 600 ) : 0;
    2644         $h = 0;
    2645         if ( ! empty( $meta['height'] ) )
    2646             $h = $meta['height'];
    2647         if ( $h && $w < $meta['width'] )
     2643        $w = ! empty( $meta['width'] ) ? min( $meta['width'], 640 ) : 0;
     2644        $h = ! empty( $meta['height'] ) ? $meta['height'] : 0;
     2645        if ( $h && $w < $meta['width'] ) {
    26482646            $h = round( ( $meta['height'] * $w ) / $meta['width'] );
     2647        }
    26492648
    26502649        $attr = array( 'src' => $att_url );
    2651 
    2652         if ( ! empty( $meta['width' ] ) )
     2650        if ( ! empty( $w ) && ! empty( $h ) ) {
    26532651            $attr['width'] = $w;
    2654 
    2655         if ( ! empty( $meta['height'] ) )
    26562652            $attr['height'] = $h;
     2653        }
    26572654
    26582655        echo wp_video_shortcode( $attr );
Note: See TracChangeset for help on using the changeset viewer.