Changeset 29429
- Timestamp:
- 08/07/2014 05:52:03 AM (12 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
-
media-template.php (modified) (3 diffs)
-
media.php (modified) (1 diff)
-
post-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media-template.php
r29416 r29429 51 51 $video_types = wp_get_video_extensions(); 52 52 ?> 53 <# var w, h, settings = wp.media.view.settings, 53 <# var w_rule = '', h_rule = '', 54 w, h, settings = wp.media.view.settings, 54 55 isYouTube = ! _.isEmpty( data.model.src ) && data.model.src.match(/youtube|youtu\.be/); 55 56 … … 65 66 h = data.model.height; 66 67 } 68 69 if ( w ) { 70 w_rule = ' width: ' + w + 'px;'; 71 } 72 73 if ( h ) { 74 h_rule = ' height: ' + h + 'px;'; 75 } 67 76 #> 68 <div style="max-width: 100%; width: {{ w }}px">77 <div style="max-width: 100%;{{ w_rule }}{{ h_rule }}"> 69 78 <video controls 70 79 class="wp-video-shortcode{{ isYouTube ? ' youtube-video' : '' }}" 71 width="{{ w }}"72 height="{{ h }}"80 <# if ( w ) { #>width="{{ w }}"<# } #> 81 <# if ( h ) { #>height="{{ h }}"<# } #> 73 82 <?php 74 83 $props = array( 'poster' => '', 'preload' => 'metadata' ); … … 281 290 </audio> 282 291 </div> 283 <# } else if ( 'video' === data.type ) { #> 284 <div style="max-width: 100%; width: {{ data.width }}px" class="wp-media-wrapper"> 292 <# } else if ( 'video' === data.type ) { 293 var w_rule = h_rule = ''; 294 if ( data.width ) { 295 w_rule = ' width: ' + data.width + 'px;'; 296 } else if ( wp.media.view.settings.contentWidth ) { 297 w_rule = ' width: ' + wp.media.view.settings.contentWidth + 'px;'; 298 } 299 if ( data.height ) { 300 h_rule = ' height: ' + data.height + 'px;'; 301 } 302 #> 303 <div style="max-width: 100%; {{ w_rule }}{{ h_rule }}" class="wp-media-wrapper"> 285 304 <video controls class="wp-video-shortcode" preload="metadata" 286 width="{{ data.width }}" height="{{ data.height }}" 305 <# if ( data.width ) { #>width="{{ data.width }}"<# } #> 306 <# if ( data.height ) { #>height="{{ data.height }}"<# } #> 287 307 <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>> 288 308 <source type="{{ data.mime }}" src="{{ data.url }}"/> -
trunk/src/wp-includes/media.php
r29428 r29429 1875 1875 $html .= '</video>'; 1876 1876 1877 $output = sprintf( '<div style="width: %dpx; max-width: 100%%;" class="wp-video">%s</div>', $atts['width'], $html ); 1877 $width_rule = $height_rule = ''; 1878 if ( ! empty( $atts['width'] ) ) { 1879 $width_rule = sprintf( ' width: %dpx;', $atts['width'] ); 1880 } 1881 if ( ! empty( $atts['height'] ) ) { 1882 $height_rule = sprintf( ' height: %dpx;', $atts['height'] ); 1883 } 1884 $output = sprintf( '<div style="max-width: 100%%;%s%s" class="wp-video">%s</div>', $width_rule, $height_rule, $html ); 1878 1885 1879 1886 /** -
trunk/src/wp-includes/post-template.php
r29235 r29429 1521 1521 $atts['height'] = (int) $meta['height']; 1522 1522 } 1523 if ( has_post_thumbnail() ) { 1524 $atts['poster'] = wp_get_attachment_url( get_post_thumbnail_id() ); 1525 } 1523 1526 $p = wp_video_shortcode( $atts ); 1524 1527 } elseif ( 0 === strpos( $post->post_mime_type, 'audio' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.