mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-27 03:27:46 +01:00
4f868ad882
See #27552. Leaving open for comments and potential bugs. Built from https://develop.svn.wordpress.org/trunk@27785 git-svn-id: http://core.svn.wordpress.org/trunk@27621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
31 lines
821 B
JavaScript
31 lines
821 B
JavaScript
/* 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));
|