⬆️ ⬇️

FLV software control

Hello.



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:



.



An example of using onStatus:



NetStream.onStatus = function(infoObject)

{

status.text += "Status (NetStream)" + newline;

status.text += "Level: "+infoObject.level + newline;

status.text += "Code: "+infoObject.code + newline;

};




Event options:





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.

Source: https://habr.com/ru/post/48848/



All Articles