I have 1.flv, 2.flv, 3.flv, and so on… I need play them in order and stitch them seamlessly. To do this, I was thinking of buffering X.flv while playing (X-1).flv. The problem is I don’t know how to buffer a video and not play it until the previous video has finished playing.
public function playingTest():void {
this.vid = new Video();
this.container.addChild(this.vid);
this.vidConnection = new NetConnection();
this.vidConnection.connect(null);
this.vidStream = new NetStream(this.vidConnection);
this.vidStream.addEventListener(NetStatusEvent.NET_STATUS, this.statusChange);
this.vid.attachNetStream(this.vidStream);
this.vidStream.play("3.flv");
}
public function statusChange(event:NetStatusEvent):void {
trace(event.info.code);
}
This would trace something like:
NetStream.Play.Start
NetStream.Buffer.Full
NetStream.Buffer.Flush
NetStream.Buffer.Flush
NetStream.Play.Stop
When running the program, I see the video play right when NetStream.Play.Start happens. The video will not wait for NetStream.Buffer.Full. This is not what I want. How do I make the video buffer indefinitely until I explicitly tell it to play? I will listen for NetStream.Play.Stop of (X-1).flv and then play X.flv.