Stop embedded player from streaming....?

Ok guys, got a problem, been searching for two days and have yet to find an answer. Hope someone can help.

I’ve created an AS3 FLV / Loader player that can accept either swf or flv format. Everything works great except for one thing…

I allow for uploading of a YouTube Player URL which looks like this ([I][/I])
For those of you wondering, this does not violate their terms and conditions of use. Actually all it does is embed their player and video, not just the video.
The problem I’m having is the video is not recognized by flash as a flv because it does not have a .flv extension. So instead flash will load the YouTube Player inside a parent container using var ldr:Loader = new Loader(); Here is where the actual problem lies, I can click the stop button and remove the youtube player from the container, but the audio continues streaming. I have tried everything I know to get it to stop, but it won’t until the video is completely finished. As you can tell, this can get pretty annoying if you decided you’d like to watch another video. You’d still have the audio of the previous one playing in the background. As far as standard .flv extension urls’, the player works perfectly. Has anyone got any ideas? Besides using the YouTube API. I’ve already been working on this player for a couple of days, and I really don’t have the time to code a new one using their API. All suggestions are greatly appreciated.

Sounds like you need to be more thorough in clearing/stopping the netstream before removing the loaded swf, though if you’re just loading a youtube swf and not creating a netstream yourself then you likely won’t be able to do anything that specific.

From the loader documentation

“As a best practice, before you unload a child SWF file, you should explicitly close any streams in the child SWF file’s objects, such as LocalConnection, NetConnection, NetStream, and Sound objects. Otherwise, audio in the child SWF file might continue to play, even though the child SWF file was unloaded.”