Changeset 49195
- Timestamp:
- 10/18/2020 05:37:19 PM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/media/views/attachment/details-two-column.js
r43309 r49195 36 36 * Noop this from parent class, doesn't apply here. 37 37 */ 38 toggleSelectionHandler: function() {} ,38 toggleSelectionHandler: function() {} 39 39 40 render: function() {41 Details.prototype.render.apply( this, arguments );42 43 wp.media.mixin.removeAllPlayers();44 this.$( 'audio, video' ).each( function (i, elem) {45 var el = wp.media.view.MediaDetails.prepareSrc( elem );46 new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings );47 } );48 }49 40 }); 50 41 -
trunk/src/js/media/views/attachment/details.js
r48309 r49195 199 199 } 200 200 }, 201 201 202 /** 202 203 * Untrashes an attachment. … … 258 259 return false; 259 260 } 261 }, 262 263 render: function() { 264 Attachment.prototype.render.apply( this, arguments ); 265 266 wp.media.mixin.removeAllPlayers(); 267 this.$( 'audio, video' ).each( function (i, elem) { 268 var el = wp.media.view.MediaDetails.prepareSrc( elem ); 269 new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings ); 270 } ); 260 271 } 261 272 }); -
trunk/src/wp-includes/css/media-views.css
r49064 r49195 1766 1766 } 1767 1767 1768 .attachment-info .wp-media-wrapper { 1769 margin-bottom: 8px; 1770 } 1771 1772 .attachment-info .wp-media-wrapper.wp-audio { 1773 margin-top: 13px; 1774 } 1775 1768 1776 .attachment-info .filename { 1769 1777 font-weight: 600; -
trunk/src/wp-includes/media-template.php
r49064 r49195 367 367 368 368 <# if ( 'audio' === data.type ) { #> 369 <div class="wp-media-wrapper ">369 <div class="wp-media-wrapper wp-audio"> 370 370 <audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none"> 371 371 <source type="{{ data.mime }}" src="{{ data.url }}"/> … … 596 596 </h2> 597 597 <div class="attachment-info"> 598 <div class="thumbnail thumbnail-{{ data.type }}"> 599 <# if ( data.uploading ) { #> 600 <div class="media-progress-bar"><div></div></div> 601 <# } else if ( 'image' === data.type && data.size && data.size.url ) { #> 602 <img src="{{ data.size.url }}" draggable="false" alt="" /> 603 <# } else { #> 604 <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> 605 <# } #> 606 </div> 598 599 <# if ( 'audio' === data.type ) { #> 600 <div class="wp-media-wrapper wp-audio"> 601 <audio style="visibility: hidden" controls class="wp-audio-shortcode" width="100%" preload="none"> 602 <source type="{{ data.mime }}" src="{{ data.url }}"/> 603 </audio> 604 </div> 605 <# } else if ( 'video' === data.type ) { 606 var w_rule = ''; 607 if ( data.width ) { 608 w_rule = 'width: ' + data.width + 'px;'; 609 } else if ( wp.media.view.settings.contentWidth ) { 610 w_rule = 'width: ' + wp.media.view.settings.contentWidth + 'px;'; 611 } 612 #> 613 <div style="{{ w_rule }}" class="wp-media-wrapper wp-video"> 614 <video controls="controls" class="wp-video-shortcode" preload="metadata" 615 <# if ( data.width ) { #>width="{{ data.width }}"<# } #> 616 <# if ( data.height ) { #>height="{{ data.height }}"<# } #> 617 <# if ( data.image && data.image.src !== data.icon ) { #>poster="{{ data.image.src }}"<# } #>> 618 <source type="{{ data.mime }}" src="{{ data.url }}"/> 619 </video> 620 </div> 621 <# } else { #> 622 <div class="thumbnail thumbnail-{{ data.type }}"> 623 <# if ( data.uploading ) { #> 624 <div class="media-progress-bar"><div></div></div> 625 <# } else if ( 'image' === data.type && data.size && data.size.url ) { #> 626 <img src="{{ data.size.url }}" draggable="false" alt="" /> 627 <# } else { #> 628 <img src="{{ data.icon }}" class="icon" draggable="false" alt="" /> 629 <# } #> 630 </div> 631 <# } #> 632 607 633 <div class="details"> 608 634 <div class="filename">{{ data.filename }}</div>
Note: See TracChangeset
for help on using the changeset viewer.