This is apparently a IE9 bug.
This happens when a Flash object interacts with an HTML document using JavaScript (ExternalInterface from the Flash / ActionScript side) and returns its ugly head when an IFRAME containing an HTML document with Flash Object is launched into the game.
After seeing how you indicate that you are using the YouTube API, you have nothing to do to make sure Flash has canceled itself and will not call JavaScript functions (or vice versa) when the time comes to uninstall it, as you rely on third-party software running outside your application domain.
If you donβt need the YouTube API, but just a quick way to get the video in your application, the safest option is to use the old style object for IE9 and the API / IFRAME attachment for the rest of the healthy world.
<object width="{WIDTH}" height="{HEIGHT}"> <embed src="https://www.youtube.com/v/{VIDEO_ID}?version=3&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" width="{WIDTH}" height="{HEIGHT}"></embed> </object>
Removing the above object (you can use SWFObject "embedSWF" and "removeSWF", which is great for this by the way), remove the video player from your page without throwing any _flash_remove warnings ..
If you need the YouTube API / video player control:
Have you tried calling the destroy method on ytplayer? Unvoke the destroy, and while I donβt want to post βresponsesβ using timeouts, give the Flash object some time to unregister before you set the iframe source to an empty line (so that the document is unloaded), then clear the iframe or its parent container.
Although I remember from a previous project, it drove us crazy (the context was a one-page interface where the video was dynamically added and removed), and we resorted to writing our own backup Flash player using AS3 YT code. That's how annoying it is.
source share