Software control of FLV video can be done using NetStream.
To begin with, we will create a new symbol in the library - a video. Next, drag it onto the stage and this empty box will serve as our container where we will upload our video. We set its size according to the size of the video that we are going to play. Let's name the videoContainer symbol.
In the frame we write:
var n:NetConnection = new NetConnection(); // NetConnection:
n.connect(null); //
var ns:NetStream = new NetStream(n); // NetStream
videoContainer.attachVideo(nc); //
ns.play("video.flv"); // .
')
Functions for working with video:
NetStream.play (“filename”) - The name and path to the file.
code = NetStream.Buffer.Empty, level = Status - the date does not load quickly enough to fill the buffer. When the buffer is full and NetStream.Buffer.Full status comes, the playback will continue.
code = NetStream.Buffer.Full, level = Status - the buffer is full, the stream is running
code = NetStream.Play.Start = Status - playback started
code = NetStream.Play.Stop = Status - playback stopped
code = NetStream.Play.StreamNotFound = Error - failure. Skip play () (Maybe the stream is already busy)
Then you can create a couple of buttons, set a play and stop event in them and our player is ready.
You can also synchronize the video with the timeline and manage it, or simply upload via setMedia (); Look like that's it.