]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/mediaelement/wp-mediaelement.js
WordPress 4.0
[autoinstalls/wordpress.git] / wp-includes / js / mediaelement / wp-mediaelement.js
index 72ea6bde31ba57ec30d20a80c7e1e944519d3596..6e20b90058430cf2429c7128ab5ef8db539a495d 100644 (file)
@@ -7,18 +7,22 @@
        $(function () {
                var settings = {};
 
-               if ( $( document.body ).hasClass( 'mce-content-body' ) ) {
-                       return;
-               }
-
                if ( typeof _wpmejsSettings !== 'undefined' ) {
-                       settings.pluginPath = _wpmejsSettings.pluginPath;
+                       settings = _wpmejsSettings;
                }
 
                settings.success = function (mejs) {
-                       var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
-                       if ( 'flash' === mejs.pluginType && autoplay ) {
-                               mejs.addEventListener( 'canplay', function () {
+                       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 );
                        }