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

1 line
28 KiB
JavaScript
Raw Normal View History

!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=0)}({"./src/js/_enqueues/wp/media/audiovideo.js":function(module,exports,__webpack_require__){eval("/**\n * @output wp-includes/js/media-audiovideo.js\n */\n\nvar media = wp.media,\n\tbaseSettings = window._wpmejsSettings || {},\n\tl10n = window._wpMediaViewsL10n || {};\n\n/**\n *\n * Defines the wp.media.mixin object.\n *\n * @mixin\n *\n * @since 4.2.0\n */\nwp.media.mixin = {\n\tmejsSettings: baseSettings,\n\n\t/**\n\t * Pauses and removes all players.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @return {void}\n\t */\n\tremoveAllPlayers: function() {\n\t\tvar p;\n\n\t\tif ( window.mejs && window.mejs.players ) {\n\t\t\tfor ( p in window.mejs.players ) {\n\t\t\t\twindow.mejs.players[p].pause();\n\t\t\t\tthis.removePlayer( window.mejs.players[p] );\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Removes the player.\n\t *\n\t * Override the MediaElement method for removing a player.\n\t * MediaElement tries to pull the audio/video tag out of\n\t * its container and re-add it to the DOM.\n\t *\n\t * @since 4.2.0\n\t *\n\t * @return {void}\n\t */\n\tremovePlayer: function(t) {\n\t\tvar featureIndex, feature;\n\n\t\tif ( ! t.options ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// invoke features cleanup\n\t\tfor ( featureIndex in t.options.features ) {\n\t\t\tfeature = t.options.features[featureIndex];\n\t\t\tif ( t['clean' + feature] ) {\n\t\t\t\ttry {\n\t\t\t\t\tt['clean' + feature](t);\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! t.isDynamic ) {\n\t\t\tt.node.remove();\n\t\t}\n\n\t\tif ( 'html5' !== t.media.rendererName ) {\n\t\t\tt.media.remove();\n\t\t}\n\n\t\tdelete window.mejs.players[t.id];\n\n\t\tt.container.remove();\n\t\tt.globalUnbind('resize', t.globalResizeCallback);\n\t\tt.globalUnbind('keydown', t.globalKeydownCallback);\n\t\tt.globalUnbind('click', t.globalClickCallback);\n\t\tdelete t.media.player;\n\t},\n\n\t/**\n\t *\n\t * Removes and resets all players.\n\t *\n\t * Allows any class that has set 'player' to a MediaElementPlayer\n\t * instance to remove the player when listening to events.\n\t *\n\t * Examples: modal closes, shortcode properties are removed, etc.\n\t *\n\t * @since 4.2.0\n\t */\n\tunsetPlayers : function() {\n\t\tif ( this.players && this.players.length ) {\n\t\t\t_.each( this.players, function (player) {\n\t\t\t\tplayer.pause();\n\t\t\t\twp.media.mixin.removePlayer( player );\n\t\t\t} );\n\t\t\tthis.players = [];\n\t\t}\n\t}\n};\n\n/**\n * Shortcode modeling for playlists.\n *\n * @since 4.2.0\n */\nwp.media.playlist = new wp.media.collection({\n\ttag: 'playlist',\n\teditTitle : l10n.editPlaylistTitle,\n\tdefaults : {\n\t\tid: wp.media.view.settings.post.id,\n\t\tstyle: 'light',\n\t\ttracklist: true,\n\t\ttracknumbers: true,\n\t\timages: true,\n\t\tartists: true,\n\t\ttype: 'audio'\n\t}\n});\n\n/**\n * Shortcode modeling for audio.\n *\n * `edit()` prepares the shortcode for the media modal.\n * `shortcode()` builds the new shortcode after an update.\n *\n * @namespace\n *\n * @since 4.2.0\n */\nwp.media.audio = {\n\tcoerce : wp.media.coerce,\n\n\tdefaults : {\n\t\tid : wp.media.view.settings.post.id,\n\t\tsrc : '',\n\t\tloop : false,\n\t\tautoplay : false,\n\t\tpreload : 'none',\n\t\twidth : 400\n\t},\n\n\t