Media: Fix MEJS error when removing a media player.
This fixes a bug introduced by the upgrade to MediaElement.js, where code calling `wp.media.mixin.removePlayer()` would result in a JS error. Props rafa8626, afercia. Fixes #41787. git-svn-id: https://develop.svn.wordpress.org/trunk@41781 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b85fd6892c
commit
ea0481afdb
@ -129,18 +129,20 @@ wp.media.mixin = {
|
||||
}
|
||||
|
||||
if ( ! t.isDynamic ) {
|
||||
t.$node.remove();
|
||||
t.node.remove();
|
||||
}
|
||||
|
||||
if ( 'native' !== t.media.pluginType ) {
|
||||
t.$media.remove();
|
||||
if ( 'html5' !== t.media.rendererName ) {
|
||||
t.media.remove();
|
||||
}
|
||||
|
||||
delete window.mejs.players[t.id];
|
||||
|
||||
t.container.remove();
|
||||
t.globalUnbind();
|
||||
delete t.node.player;
|
||||
t.globalUnbind('resize', t.globalResizeCallback);
|
||||
t.globalUnbind('keydown', t.globalKeydownCallback);
|
||||
t.globalUnbind('click', t.globalClickCallback);
|
||||
delete t.media.player;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -60,18 +60,20 @@ wp.media.mixin = {
|
||||
}
|
||||
|
||||
if ( ! t.isDynamic ) {
|
||||
t.$node.remove();
|
||||
t.node.remove();
|
||||
}
|
||||
|
||||
if ( 'native' !== t.media.pluginType ) {
|
||||
t.$media.remove();
|
||||
if ( 'html5' !== t.media.rendererName ) {
|
||||
t.media.remove();
|
||||
}
|
||||
|
||||
delete window.mejs.players[t.id];
|
||||
|
||||
t.container.remove();
|
||||
t.globalUnbind();
|
||||
delete t.node.player;
|
||||
t.globalUnbind('resize', t.globalResizeCallback);
|
||||
t.globalUnbind('keydown', t.globalKeydownCallback);
|
||||
t.globalUnbind('click', t.globalClickCallback);
|
||||
delete t.media.player;
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user