var MediaDetails = wp.media.view.MediaDetails, AudioDetails; /** * wp.media.view.AudioDetails * * @memberOf wp.media.view * * @class * @augments wp.media.view.MediaDetails * @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ AudioDetails = MediaDetails.extend(/** @lends wp.media.view.AudioDetails.prototype */{ className: 'audio-details', template: wp.template('audio-details'), setMedia: function() { var audio = this.$('.wp-audio-shortcode'); if ( audio.find( 'source' ).length ) { if ( audio.is(':hidden') ) { audio.show(); } this.media = MediaDetails.prepareSrc( audio.get(0) ); } else { audio.hide(); this.media = false; } return this; } }); module.exports = AudioDetails;