Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Fix cleanup on the shim as well
Browse files Browse the repository at this point in the history
  • Loading branch information
odnamrataizem committed Mar 3, 2013
1 parent e13f9bf commit 96edf9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/js/me-mediaelements.js
Expand Up @@ -322,5 +322,6 @@ mejs.PluginMediaElement.prototype = {

remove: function() {
mejs.Utility.removeSwf(this.pluginElement.id);
mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id);
}
};
5 changes: 5 additions & 0 deletions src/js/me-shim.js
Expand Up @@ -9,6 +9,11 @@ mejs.MediaPluginBridge = {
this.htmlMediaElements[id] = htmlMediaElement;
},

unregisterPluginElement: function (id) {
delete this.pluginMediaElements[id];
delete this.htmlMediaElements[id];
},

// when Flash/Silverlight is ready, it calls out to this method
initPlugin: function (id) {

Expand Down
2 changes: 1 addition & 1 deletion src/js/me-utility.js
Expand Up @@ -110,7 +110,7 @@ mejs.Utility = {
/* borrowed from SWFObject: http://code.google.com/p/swfobject/source/browse/trunk/swfobject/src/swfobject.js#474 */
removeSwf: function(id) {
var obj = document.getElementById(id);
if (obj && obj.nodeName == "OBJECT") {
if (obj && /object|embed/i.test(obj.nodeName)) {
if (mejs.MediaFeatures.isIE) {
obj.style.display = "none";
(function(){
Expand Down

0 comments on commit 96edf9d

Please sign in to comment.