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"> |
| 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 | |