In [30082], hardcoded heights were removed on the front end for videos rendered via shortcode. These values were not removed from the admin, which was an oversight.

See #33798.


git-svn-id: https://develop.svn.wordpress.org/trunk@34048 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2015-09-11 18:26:53 +00:00
parent 523550c223
commit 9a80acf25d

View File

@@ -50,7 +50,7 @@ function wp_underscore_audio_template() {
function wp_underscore_video_template() {
$video_types = wp_get_video_extensions();
?>
<# var w_rule = h_rule = '', classes = [],
<# var w_rule = '', classes = [],
w, h, settings = wp.media.view.settings,
isYouTube = isVimeo = false;
@@ -67,16 +67,11 @@ function wp_underscore_video_template() {
if ( w !== data.model.width ) {
h = Math.ceil( ( data.model.height * w ) / data.model.width );
} else {
h = data.model.height;
}
if ( w ) {
w_rule = 'width: ' + w + 'px; ';
}
if ( h ) {
h_rule = 'height: ' + h + 'px;';
}
if ( isYouTube ) {
classes.push( 'youtube-video' );
@@ -87,7 +82,7 @@ function wp_underscore_video_template() {
}
#>
<div style="{{ w_rule }}{{ h_rule }}" class="wp-video">
<div style="{{ w_rule }}" class="wp-video">
<video controls
class="wp-video-shortcode {{ classes.join( ' ' ) }}"
<# if ( w ) { #>width="{{ w }}"<# } #>
@@ -308,17 +303,14 @@ function wp_print_media_templates() {
</audio>
</div>
<# } else if ( 'video' === data.type ) {
var w_rule = h_rule = '';
var w_rule = '';
if ( data.width ) {
w_rule = 'width: ' + data.width + 'px;';
} else if ( wp.media.view.settings.contentWidth ) {
w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;';
}
if ( data.height ) {
h_rule = 'height: ' + data.height + 'px;';
}
#>
<div style="{{ w_rule }}{{ h_rule }}" class="wp-media-wrapper wp-video">
<div style="{{ w_rule }}" class="wp-media-wrapper wp-video">
<video controls="controls" class="wp-video-shortcode" preload="metadata"
<# if ( data.width ) { #>width="{{ data.width }}"<# } #>
<# if ( data.height ) { #>height="{{ data.height }}"<# } #>