WordPress/wp-includes/js/media-audiovideo.min.js

1 line
12 KiB
JavaScript
Raw Permalink Normal View History

!function a(s,o,n){function d(t,e){if(!o[t]){if(!s[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(r)return r(t,!0);throw(i=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",i}i=o[t]={exports:{}},s[t][0].call(i.exports,function(e){return d(s[t][1][e]||e)},i,i.exports,a,s,o,n)}return o[t].exports}for(var r="function"==typeof require&&require,e=0;e<n.length;e++)d(n[e]);return d}({1:[function(e,t,i){var a=wp.media,s=window._wpmejsSettings||{},o=window._wpMediaViewsL10n||{};wp.media.mixin={mejsSettings:s,removeAllPlayers:function(){if(window.mejs&&window.mejs.players)for(var e in window.mejs.players)window.mejs.players[e].pause(),this.removePlayer(window.mejs.players[e])},removePlayer:function(e){var t,i;if(e.options){for(t in e.options.features)if(e["clean"+(i=e.options.features[t])])try{e["clean"+i](e)}catch(e){}e.isDynamic||e.$node.remove(),"native"!==e.media.pluginType&&e.$media.remove(),delete window.mejs.players[e.id],e.container.remove(),e.globalUnbind(),delete e.node.player}},unsetPlayers:function(){this.players&&this.players.length&&(_.each(this.players,function(e){e.pause(),wp.media.mixin.removePlayer(e)}),this.players=[])}},wp.media.playlist=new wp.media.collection({tag:"playlist",editTitle:o.editPlaylistTitle,defaults:{id:wp.media.view.settings.post.id,style:"light",tracklist:!0,tracknumbers:!0,images:!0,artists:!0,type:"audio"}}),wp.media.audio={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",loop:!1,autoplay:!1,preload:"none",width:400},edit:function(e){e=wp.shortcode.next("audio",e).shortcode;return wp.media({frame:"audio",state:"audio-details",metadata:_.defaults(e.attrs.named,this.defaults)})},shortcode:function(i){var e;return _.each(this.defaults,function(e,t){i[t]=this.coerce(i,t),e===i[t]&&delete i[t]},this),e=i.content,delete i.content,new wp.shortcode({tag:"audio",attrs:i,content:e})}},wp.media.video={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",poster:"",loop:!1,autoplay:!1,preload:"metadata",content:"",width:640,height:360},edit:function(e){var t=wp.shortcode.next("video",e).shortcode,e=t.attrs.named;return e.content=t.content,wp.media({frame:"video",state:"video-details",metadata:_.defaults(e,this.defaults)})},shortcode:function(i){var e;return _.each(this.defaults,function(e,t){i[t]=this.coerce(i,t),e===i[t]&&delete i[t]},this),e=i.content,delete i.content,new wp.shortcode({tag:"video",attrs:i,content:e})}},a.model.PostMedia=e("./models/post-media.js"),a.controller.AudioDetails=e("./controllers/audio-details.js"),a.controller.VideoDetails=e("./controllers/video-details.js"),a.view.MediaFrame.MediaDetails=e("./views/frame/media-details.js"),a.view.MediaFrame.AudioDetails=e("./views/frame/audio-details.js"),a.view.MediaFrame.VideoDetails=e("./views/frame/video-details.js"),a.view.MediaDetails=e("./views/media-details.js"),a.view.AudioDetails=e("./views/audio-details.js"),a.view.VideoDetails=e("./views/video-details.js")},{"./controllers/audio-details.js":2,"./controllers/video-details.js":3,"./models/post-media.js":4,"./views/audio-details.js":5,"./views/frame/audio-details.js":6,"./views/frame/media-details.js":7,"./views/frame/video-details.js":8,"./views/media-details.js":9,"./views/video-details.js":10}],2:[function(e,t,i){var a=wp.media.controller.State,s=wp.media.view.l10n,s=a.extend({defaults:{id:"audio-details",toolbar:"audio-details",title:s.audioDetailsTitle,content:"audio-details",menu:"audio-details",router:!1,priority:60},initialize:function(e){this.media=e.media,a.prototype.initialize.apply(this,arguments)}});t.exports=s},{}],3:[function(e,t,i){var a=wp.media.controller.State,s=wp.media.view.l10n,s=a.extend({defaults:{id:"video-details",toolbar:"video-details",title:s.videoDetailsTitle,content:"video-details",menu:"video-details",router:!1,priority:60},initialize:function(e){this.media=e.media,a.prototype.initialize.apply(this,arguments)}});t.exports=s},{}],4:[function(e,t,i){var a=Backbone.Model.extend({initialize:function(){this.attachment=!1},setSource:function(e){this.attachment=e,this.ex