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