From ad3f6ef9d9a971094dfc8b4cbcd45ce97732620c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Thu, 6 Mar 2014 20:12:39 +0000 Subject: [PATCH] Call the correct `remove()` method on the MEjs instance when exiting the media modal. See #27016. git-svn-id: https://develop.svn.wordpress.org/trunk@27443 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index 862ec7bf59..1a9328d1ef 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -6280,7 +6280,7 @@ template: media.template('video-details'), initialize: function() { - _.bindAll(this, 'player'); + _.bindAll(this, 'success'); this.listenTo( this.controller, 'close', this.close ); @@ -6301,15 +6301,16 @@ close : function() { this.mejs.pause(); + this.player.remove(); }, - player : function (mejs) { + success : function (mejs) { this.mejs = mejs; }, render: function() { var video, self = this, settings = { - success : this.player + success : this.success }; if ( ! _.isUndefined( window._wpmejsSettings ) ) { @@ -6326,7 +6327,7 @@ (new Date()).getTime() ].join(''); - new MediaElementPlayer( video, settings ); + this.player = new MediaElementPlayer( video, settings ); return this; },