You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
821 B

/* global mejs, _wpmejsSettings */
(function ($) {
// 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 () {
var settings = {};
if ( $( document.body ).hasClass( 'mce-content-body' ) ) {
return;
}
if ( typeof _wpmejsSettings !== 'undefined' ) {
settings.pluginPath = _wpmejsSettings.pluginPath;
}
settings.success = function (mejs) {
var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
if ( 'flash' === mejs.pluginType && autoplay ) {
mejs.addEventListener( 'canplay', function () {
mejs.play();
}, false );
}
};
$('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings );
});
}(jQuery));