Flash video recording + catch map

Source: Internet
Author: User
Tags connect
Source file:
video recording. RAR
Code:
Stop ();
Instance name begin_btn,view_btn,norm_btn,photo_btn Four buttons, an instance of a video called Mybox (Library-new video),
Set the button to Disabled
begin_btn.enabled = false;
view_btn.enabled = false;
Norm_btn.enabled=false;
CLIENT_NC = new Netconnection ();
Client_nc.onstatus = function (info) {
Visualize the information returned by the server with the trace feature
Trace ("Level:" +info.level+newline+ "Code:" +info.code);
};
Client_nc.connect ("Rtmp://192.168.0.10/chat");
Rec_so.connect (CLIENT_NC);
Begin_btn.enabled = true;
View_btn.enabled = true;
norm_btn.enabled = false;
This.cam = Camera.get ();
Mybox.attachvideo (This.cam);
This.cam.setMode (180, 140, true);
Out_ns = new NetStream (CLIENT_NC);
Out_ns.attachvideo (This.cam);
Begin_flag=true;
Start/Stop Video
Begin_btn.onrelease = function () {

if (begin_flag==true)
{
view_btn.enabled = false;
norm_btn.enabled = false;
Out_ns.publish ("Cigarette butts", "record");
Begin_btn.label= "Stop the video";
Begin_flag=false;
}
Else
{
Begin_flag=true;
Begin_btn.label= "Start video";
Stop playing a camera image inside a video object
Mybox.attachvideo (NULL);
Out_ns.close ();
View_btn.enabled=true;
}
}
Watch the video
View_btn.onrelease = function () {
View_btn.enabled=false
Begin_btn.enabled=false;
Norm_btn.enabled=true;
The name of a label label is the name of the video file.
var playfilename = "Cigarette butts";
Creates a new NetStream stream object that will be used to play message messages
In_ns = new NetStream (CLIENT_NC);
To play FLV files on the server via the Netstream.play method
In_ns.play (Playfilename);
Video Object Mybox is used as the broadcast carrier of the stream, which makes the media flow visualization
Mybox.attachvideo (In_ns);
}
Normal
Norm_btn.onrelease = function () {
This.cam = Camera.get ();
Mybox.attachvideo (This.cam);
Out_ns.attachvideo (This.cam);
Begin_btn.enabled = true;
View_btn.enabled = true;
Norm_btn.enabled = true;
}
Photo
Photo_btn.onrelease=function ()
{
Mybox.attachvideo (NULL);
Mybitmap = new Flash.display.BitmapData (160, A, true, 0);
Mybitmap.draw (Mybox);
var tempobj = _root.createemptymovieclip ("photo", 100);
tempobj._x = 300;
tempobj._y = 100;
Tempobj.attachbitmap (Mybitmap, 1, "always", true);
for (i=0;i<160;i++)
{
for (j=0;j<120;j++)
Trace (Mybitmap.getpixel (i,j));//record information for each pixel
}
The code that sent a FLASH+FMS video chat
This is a video and a catch.
Mybitmap.getpixel (i,j) record pixel information, need to save words, use an array to save all the pixel information and then use ASP or JSP in the background into the picture and save, if the frame can also be implemented through the asp/jsp and so on, their own pondering it, can achieve the effect of the big head, Oh

The FMS end is the same as that one.
Have a problem mentioning ...
ASP does not ... The JSP can

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.