Sha256: e3ad336937d8654ac3e989b8290e855cb74d7e36409f33bca97aa64ca8ec40d5

Contents?: true

Size: 906 Bytes

Versions: 3

Compression:

Stored size: 906 Bytes

Contents

/* 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 = 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));

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stump-cli-0.1.3 lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js
stump-cli-0.1.2 lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js
stump-cli-0.1.1 lib/wp/wp-includes/js/mediaelement/wp-mediaelement.js