From cee318ed81f63e1f4a158ed65eb6b7e8fb900989 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 20 Jan 2016 15:47:28 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@36364 git-svn-id: http://core.svn.wordpress.org/trunk@36331 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/mediaelement/wp-mediaelement.js | 2 +- wp-includes/js/mediaelement/wp-playlist.js | 4 ++-- wp-includes/version.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/js/mediaelement/wp-mediaelement.js b/wp-includes/js/mediaelement/wp-mediaelement.js index 159794091b..17f80519a2 100644 --- a/wp-includes/js/mediaelement/wp-mediaelement.js +++ b/wp-includes/js/mediaelement/wp-mediaelement.js @@ -20,7 +20,7 @@ */ function initialize() { if ( typeof _wpmejsSettings !== 'undefined' ) { - settings = _wpmejsSettings; + settings = $.extend( true, {}, _wpmejsSettings ); } settings.success = settings.success || function (mejs) { diff --git a/wp-includes/js/mediaelement/wp-playlist.js b/wp-includes/js/mediaelement/wp-playlist.js index 90839a5da6..4dfccef991 100644 --- a/wp-includes/js/mediaelement/wp-playlist.js +++ b/wp-includes/js/mediaelement/wp-playlist.js @@ -31,7 +31,7 @@ _.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' ); if ( ! _.isUndefined( window._wpmejsSettings ) ) { - this.settings = _wpmejsSettings; + this.settings = _.clone( _wpmejsSettings ); } this.settings.success = this.bindPlayer; this.setPlayer(); @@ -172,4 +172,4 @@ window.WPPlaylistView = WPPlaylistView; -}(jQuery, _, Backbone)); \ No newline at end of file +}(jQuery, _, Backbone)); diff --git a/wp-includes/version.php b/wp-includes/version.php index f77927edfe..8ec4b29513 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-alpha-36359'; +$wp_version = '4.5-alpha-36364'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.