Hello,
The AS3 Youtube player will still not unload, causing a memory leak. The AS3 Vimeo player, by contrast, shuts down correctly and does not create a memory leak. I've updated the example swf to show both players for reference, with code.
Thanks for your attention.
-Matt
-- The AS3 Youtube player will still not unload, causing a memory leak. The AS3 Vimeo player, by contrast, shuts down correctly and does not create a memory leak. I've updated the example swf to show both players for reference, with code.
Thanks for your attention.
-Matt
On Thu, Apr 19, 2012 at 12:47 PM, Matthew Woomer <matt@bluemammothgames.com> wrote:
Hello,
The AS3 Youtube player will not unload, causing a memory leak. I've attached a very simple runnable example of the problem with the code. Click the blue button to load and unload the video (let the player fully load, I removed the player-not-yet-loaded checks for readability)
Here is the relevant AS3 unloading code, in case anyone could see a problem on my end with it:
if (mVideoLoader)
{
mVideoLoader.contentLoaderInfo.removeEventListener(Event.INIT, LoaderInitHandler);
mVideoLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, LoaderNoOp);
mVideoLoader.contentLoaderInfo.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, LoaderNoOp);
var player:Object = mVideoLoader.content;
player.removeEventListener("onReady", PlayerReadyHandler);
player.stopVideo();
player.destroy();
player = null;
mVideoLoader.unloadAndStop(true);
if (mVideoLoader.parent)
mVideoLoader.parent.removeChild(mVideoLoader);
mVideoLoader = null;
}
My current best guess is that the loader is a victim of this Flash bug: https://bugbase.adobe.com/index.cfm?event=bug&id=3071138 in which case the workaround in the player would be very simple.
Thanks, Matt
--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/EPRVjF_6EtEJ.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.
No comments:
Post a Comment