mirror of
https://github.com/KevinMidboe/rohnenedre.git
synced 2025-10-29 17:50:37 +00:00
Initial commit. State 04.2021.
This commit is contained in:
34
wp-includes/js/mediaelement/wp-mediaelement.js
Normal file
34
wp-includes/js/mediaelement/wp-mediaelement.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* 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 ( 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 );
|
||||
}
|
||||
};
|
||||
|
||||
$('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings );
|
||||
});
|
||||
|
||||
}(jQuery));
|
||||
Reference in New Issue
Block a user