- md5
- 3fc9c567b4fe652008ea1c14428c9363
- sha1
- 2229d88577d37970f9734b30293cb64566f86c49
- sha256
- c4fe6b05b6ab3e4a2b8de91adddc2af53ce73189c2b765bb2977c10469475275
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
/* global mejs, _wpmejsSettings */
(function( window, $ ) {
window.wp = window.wp || {};
// add mime-type aliases to MediaElement plugin support
mejs.plugins.silverlight[0].types.push('video/x-ms-wmv');
mejs.plugins.silverlight[0].types.push('audio/x-ms-wma');
function wpMediaElement() {
var settings = {};
/**
* Initialize media elements.
*
* Ensures media elements that have already been initialized won't be
* processed again.
*
* @since 4.4.0
*/
function initialize() {
if ( typeof _wpmejsSettings !== 'undefined' ) {
settings = _wpmejsSettings;
}
settings.success = settings.success || function (mejs) {
var autoplay, loop;
if ( 'flash' === mejs.pluginType ) {
autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop;
autoplay && mejs.addEventListener( 'canplay', function () {
mejs.play();
}, false );
loop && mejs.addEventListener( 'ended', function () {
mejs.play();
}, false );
}
};
// Only initialize new media elements.
$( '.wp-audio-shortcode, .wp-video-shortcode' )
.not( '.mejs-container' )
.filter(function () {
return ! $( this ).parent().hasClass( '.mejs-mediaelement' );
})
.mediaelementplayer( settings );
}
return {
initialize: initialize
};
}
window.wp.mediaelement = new wpMediaElement();
$( document ).on( 'ready', window.wp.mediaelement.initialize );
})( window, jQuery );
The same content is in 40 releases, WordPress 4.4-beta1 to 4.4.34. See them all, or every version of this file.