2013-11-15 07:52:09 +01:00
|
|
|
/* global mejs, _wpmejsSettings */
|
2013-03-16 06:25:44 +01:00
|
|
|
(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');
|
|
|
|
|
2013-08-01 15:15:14 +02:00
|
|
|
$(function () {
|
|
|
|
var settings = {};
|
|
|
|
|
2014-03-27 18:58:15 +01:00
|
|
|
if ( $( document.body ).hasClass( 'mce-content-body' ) ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-03-07 06:52:14 +01:00
|
|
|
if ( typeof _wpmejsSettings !== 'undefined' ) {
|
2013-08-01 15:15:14 +02:00
|
|
|
settings.pluginPath = _wpmejsSettings.pluginPath;
|
2014-03-07 06:52:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
};
|
2013-08-01 15:15:14 +02:00
|
|
|
|
|
|
|
$('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings );
|
2013-03-16 06:25:44 +01:00
|
|
|
});
|
|
|
|
|
2013-08-01 15:15:14 +02:00
|
|
|
}(jQuery));
|