Make WordPress Core

Changeset 28363


Ignore:
Timestamp:
05/11/2014 01:27:29 AM (11 years ago)
Author:
wonderboymusic
Message:

Support loop for [audio] and [video] shortcodes that specify files that are played using MediaElement's Flash plugin bridge.

Fixes #27368.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mediaelement/wp-mediaelement.js

    r27785 r28363  
    1717
    1818        settings.success = function (mejs) {
    19             var autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
    20             if ( 'flash' === mejs.pluginType && autoplay ) {
    21                 mejs.addEventListener( 'canplay', function () {
     19            var autoplay, loop;
     20
     21            if ( 'flash' === mejs.pluginType ) {
     22                autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay;
     23                loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop;
     24
     25                autoplay && mejs.addEventListener( 'canplay', function () {
     26                    mejs.play();
     27                }, false );
     28
     29                loop && mejs.addEventListener( 'ended', function () {
    2230                    mejs.play();
    2331                }, false );
Note: See TracChangeset for help on using the changeset viewer.