Hi All,

            I'm having an issue with the FLVPlayback component not
actually clearing from memory after use. My application plays multiple
videos over an extended period of time and I've noticed that as the user
progress from one section to another with video playing the memory usage
for the application continues to jump up higher. Garbage collection
seems to be working for all of the other elements of my application
except this... Deleting the variable does help remove some of it from
memory but its almost as if the video itself is still being stored by
the player. Anyone else encounter this problem?? Possible solutions?

 

Lori-

 

Excerpt of the class I wrote to handle video playback:

 

class com.scimedmedia.media.FLVController {

private var _videoClip:FLVPlayback;

private var _videoFile: String;

private var _currentState: String;

private var _videoListener: Object;

//

            private var _videoLoaded:Boolean;

            //

            //{ region dispatch event intializers

            public var dispatchEvent:Function;

            public var addEventListener:Function;

            public var removeEventListener:Function;

            //} endregion dispatch event intializers

 

            //

            public function FLVController() {

                        this.init();

            }

///         

            public function loadMovie (clip:MovieClip, path:String,
depth:Number, position:Object, dimensions:Object, autoPlay:Boolean,
alpha:Number):Void {

                        clip.attachMovie("FLVPlayback", "my_FLVPlybk",
depth, {x:position.x, y:position.y});

                        this._videoClip = clip.my_FLVPlybk;

                        this._videoClip.setSize(dimensions.width,
dimensions.height);

                        this._videoClip.playheadUpdateInterval = 1000;

                        this._videoClip.autoPlay = autoPlay;

                        this._videoClip._alpha = (alpha >= 0) ? alpha :
100;

                        //

                        this.addListeners();

                        //

                        this._videoClip.contentPath = path;

            }

            //

            private function addListeners(): Void {

                        this._videoClip.addEventListener("ready", this);

                        this._videoClip.addEventListener("complete",
this);

 
this._videoClip.addEventListener("playheadUpdate", this);

                        this._videoClip.addEventListener("cuePoint",
this);

                        this._videoClip.addEventListener("seek", this);

                        this._videoClip.addEventListener("stateChange",
this);

}

            //

            private function removeListeners(): Void {

                        this._videoClip.removeEventListener("ready",
this);

                        this._videoClip.removeEventListener("complete",
this);

 
this._videoClip.removeEventListener("playheadUpdate", this);

                        this._videoClip.removeEventListener("cuePoint",
this);

                        this._videoClip.removeEventListener("seek",
this);

 
this._videoClip.removeEventListener("stateChange", this);

}

//

public function unload(): Void {

            //Stops video playing.

            this._videoClip.stop();

            //

            this._videoClip.closeVideoPlayer();

            //Removes Listeners on video. 

            this.removeListeners();

            //Remove Video From Stage

            this._videoClip.removeMovieClip();

            //

            this._videoClip = null;

            delete this._videoClip;

}

}

 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to