Flex VideoDisplay just flat leaks?

Just use the original flash.media.Video. You'll have to also create a NetStream seperately, a NetConnection,and also run your own timer if you want to have functionality like in VideoDisplay that automatically updates the play head time while running. (You need to do that and track load progress yourself with your own timer.) You also need to do some things in a removedFromStage handler to avoid leaks.

That's really the crucial part, but to initialize everything, something like the following.

Just use the original flash.media.Video. You'll have to also create a NetStream seperately, a NetConnection,and also run your own timer if you want to have functionality like in VideoDisplay that automatically updates the play head time while running. (You need to do that and track load progress yourself with your own timer.) You also need to do some things in a removedFromStage handler to avoid leaks.

That's really the crucial part, but to initialize everything, something like the following: var uic:UIComponent = new UIComponent(); var ns:NetStream; var v:Video = new Video(); var nc:NetConnection = new NetConnection(); var timer:Timer = new Timer(250); ... uic. AddChild(v); this. AddChild(uic); v.

Width=Number(parameters. W); v. Height=Number(parameters.

H); nc. Connect(null); ns = new NetStream(nc); ns. AddEventListener("netStatus",play_end); uic.

AddEventListener("removedFromStage",v_remove); v. AttachNetStream(ns); ns. Play(session.

Source); ns.pause(); timer. AddEventListener("timer",load_handlr); timer.start(); And in the removedFromStage handler: private function v_remove(e:Event) { ns.close(); nc.close(); v. AttachNetStream(null); timer.stop() } That's it.

So, interestingly, none of the eventlisteners I created had to be removed, just that one timer had to be stopped. And also the call to nc. Close, etc. (Not sure actually if the v.

AttachNetStream(null); is strictly necessary). VideoDisplay has its own close() method, but I had tried it and no effect on the leak in VideoDisplay. So the above stops the video and prevents the leak.

In my case I want the video to keep playing until the end though, and for that I did have to remove the other event listeners, so it wouldn't keep restarting in a loop (and the memory not released for that reason), and then take out the call to ns. Close so it will play to the end: private function v_remove(e:Event) { nc.close(); v. AttachNetStream(null); timer.stop() timer.

RemoveEventListener("timer",timer_handlr); ns. RemoveEventListener("netStatus",play_end); uic. RemoveEventListener("removedFromStage",v_remove); } So just some useful arcane alchemy for anyone still doing flash development I guess.

Why Adobe could not provide some general purpose method to completely nuke an arbitrary object at your own risk I guess we'll never know.

Not sure if this will help you but I've had success unloading the video (in Flash, not Flex) when using the video component. It doesn't empty out the video (and leaks) unless you do this this (videoPlayer is my Component instance)... try{ for each(var v: VideoPlayer in videoPlayer. Flvplayback_internal::videoPlayers){ log("Cleaning up VideoPlayer:" + v); v.close(); v.clear(); } }catch(e:Error){ log("EndVideo Failed: " + e); }.

Its definitely a Flex problem, as I point out below, flash.media. Video can be deallocated successfully. I don't actually have access to a class called VideoPlayer in the Flex/AS3 hierarchy I'm looking at.

– Mark Nov 25 at 20:37.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions