Easy to learn fms+php video chat room

Source: Internet
Author: User
Simple learning fms+php Video chat room

Simple learning fms+php Video chat room
April 02, 2010
Here's the start:
Use FlashMediaServer2 as a server for my learning phase, with Flash. Php+mysql+apache here not to mention, and so on in the future when the chat program is explained in detail. Today, the first simple application is implemented, which allows Flash to read the camera locally and publish to the server, and then to the server and back to the local.
1, install FlashMediaServer2, can go to
http://www.flashcom.com.cn/bbs/showthread.php?t=413
Download this post. The installation process needs to enter name and password (remember Kazakhstan), the next step is the server Port (1935), and the Administrator Management Server port (1111), by default, it is best to do one more thing, in the firewall to the two ports open, for later convenience. The next installation directory defaults to the end of installation.
2. Find C:\Program files\macromedia\flash Media Server 2\applications, create a new folder with the name Myfirstapp, Create a new Main.asc file in Myfirstapp and write load ("COMPONENTS.ASC") in it;
3. In Start menu \ program \flash Media server 2, after starting start Flash media Admin server 2 and start Flash Media server 2 respectively, click Management Console. LNK, this is the media Server 2 hypervisor that pops up. Enter Servername:akins,server address:127.0.0.1,username password. After landing, there is a new Instance in the bottom left of the program ..., click on the pop-up menu and click Myfirstapp. This is the application we set up in the 2nd section.
4. Create a new file under D:\Project: Test_060304.fla, pull in 2 video components, respectively named Local_video and Server_video. Write the following code on the frame:
var Client_cam:camera = Camera.get ();//Get the camera
Client_cam.setmode (176, 144, 20);//three parameters for camera-captured width height frame rate
Client_cam.setquality (57000, 1);//Set bandwidth and quality
Local_video.attachvideo (Client_cam);//Add camera image to local Local_video
_global. Username= "Akins";
Doconnect ();
Publishme ();
Playme (_global. Username);
function Doconnect () {
CLIENT_NC = new Netconnection ();//Establishing a Connection object
Client_nc.onstatus = function (info) {
Trace ("Level:" +info.level+newline+ "Code:" +info.code);
};
Client_nc.connect ("Rtmp://127.0.0.1/myfirstapp");
Out_ns = new NetStream (CLIENT_NC);
In_ns = new NetStream (CLIENT_NC);
}
function Publishme () {
Out_ns.attachvideo (Client_cam);
Out_ns.publish (_global. Username);
}
function Playme (toplay) {
Server_video.attachvideo (In_ns);
In_ns.play (Toplay);
}
  • 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.