Make WordPress Core

Changeset 36364


Ignore:
Timestamp:
01/20/2016 03:46:59 PM (9 years ago)
Author:
wonderboymusic
Message:

Media: When reusing the initial values from the global MediaElement config object, the config object should first be cloned. Objects in JS are references that will retain any changes. This fixes an issue where player controls could get mixed up between instances when multiple players (namely, single audio and audio playlists, in a certain order) are on the same page.

Props Fab1en.
Fixes #34152.

Location:
trunk/src/wp-includes/js/mediaelement
Files:
2 edited

Legend:

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

    r36288 r36364  
    2121        function initialize() {
    2222            if ( typeof _wpmejsSettings !== 'undefined' ) {
    23                 settings = _wpmejsSettings;
     23                settings = $.extend( true, {}, _wpmejsSettings );
    2424            }
    2525
  • trunk/src/wp-includes/js/mediaelement/wp-playlist.js

    r31471 r36364  
    3232
    3333            if ( ! _.isUndefined( window._wpmejsSettings ) ) {
    34                 this.settings = _wpmejsSettings;
     34                this.settings = _.clone( _wpmejsSettings );
    3535            }
    3636            this.settings.success = this.bindPlayer;
Note: See TracChangeset for help on using the changeset viewer.