search
HomeBackend DevelopmentPHP Tutorial 容易学习FMS+PHP视频聊天室

简单学习FMS+PHP视频聊天室

简单学习FMS+PHP视频聊天室
2010年04月02日
  下面就开始:
  用FlashMediaServer2做为我的学习阶段使用的服务器,用flash。PHP+MYSQL+APACHE在这里先不提了,等在以后做聊天程序的时候再详细说明。今天就先弄第一个简单的application,实现flash在本地读取摄像头,并且publish到服务器,通过服务器再显示到本地。
  1、安装FlashMediaServer2,可以到
  http://www.flashcom.com.cn/bbs/showthread.php?t=413
  这个帖子下载。安装过程中需要输入name和password(记住哈),下一步是服务器的端口(1935),和管理员管理服务器的端口(1111),默认就可以了,到这里最好再做一件事情,在防火墙中把这两个端口打开,为了以后方便。下一步安装目录默认,安装结束。
  2、找到C:\Program Files\Macromedia\Flash Media Server 2\applications ,新建文件夹,取名字为myfirstApp,在myfirstApp里新建main.asc文件,在里边写上load("components.asc");就可以了。
  3、在「开始」菜单\程序\Flash Media Server 2里,分别启动Start Flash Media Admin Server 2和Start Flash Media Server 2之后,点击Management Console.lnk,此时弹出的就是Media Server 2的管理程序。输入serverName:akins,Server Address:127.0.0.1,username password。登陆后,在程序左下方有个New Instance...,点击后向上弹出菜单,点击myfirstApp。这个就是在第2部我们建立的application。
  4、在D:\Project下新建文件:test_060304.fla,拉入2个video组件,分别起名字为local_video和server_video。在帧上写上如下代码:
  var client_cam:Camera = Camera.get();//获取摄像头
  client_cam.setMode(176, 144, 20);//三个参数分别为摄像头捕捉的宽度高度帧率
  client_cam.setQuality(57000, 1);//设置带宽和质量
  local_video.attachVideo(client_cam);//向本地local_video添加摄像头图像
  _global.Username="akins";
  doConnect();
  publishMe();
  playMe(_global.Username);
  function doConnect() {
  client_nc = new NetConnection();//建立连接对象
  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);
  }

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何在 Windows 11 中修复 VIDEO DXGKRNL 致命错误如何在 Windows 11 中修复 VIDEO DXGKRNL 致命错误Apr 13, 2023 pm 08:22 PM

点击进入:ChatGPT工具插件导航大全一些用户抱怨他们的计算机经常崩溃,停止代码为VIDEO DXGKRNL FATAL ERROR。此特定问题仅偶尔发生,并且错误检查值为 0x00000113,这表明 Microsoft DirectX 图形内核子系统中存在违规,如错误检查值所示。通常,当损坏的驱动程序干扰图形卡图形处理器的正常运行时,就会出现错误。如果您目前正在努力解决此特定问题,我们的文章将为您提供各种高质量的故障排除技巧。您会在下面找到遇到完全相同错误的其他用户已成功使用的各种方法。是

如何安装、卸载、重置Windows服务器备份如何安装、卸载、重置Windows服务器备份Mar 06, 2024 am 10:37 AM

WindowsServerBackup是WindowsServer操作系统自带的一个功能,旨在帮助用户保护重要数据和系统配置,并为中小型和企业级企业提供完整的备份和恢复解决方案。只有运行Server2022及更高版本的用户才能使用这一功能。在本文中,我们将介绍如何安装、卸载或重置WindowsServerBackup。如何重置Windows服务器备份如果您的服务器备份遇到问题,备份所需时间过长,或无法访问已存储的文件,那么您可以考虑重新设置WindowsServer备份设置。要重置Windows

Motorola Razr 50 Ultra shows up in leaked teaser video with waterproof case and huge secondary displayMotorola Razr 50 Ultra shows up in leaked teaser video with waterproof case and huge secondary displayJun 20, 2024 pm 09:31 PM

Over the past few weeks, the most important specifications and the euro prices of the Motorola Razr 50 and the Razr 50 Ultra have been leaked. Now the enormously reliable leaker @MysteryLupin was able to publish the teaser video embedded below, which

Windows Server 2025预览版迎来更新,微软改善Insiders测试体验Windows Server 2025预览版迎来更新,微软改善Insiders测试体验Feb 19, 2024 pm 02:36 PM

在发布WindowsServer的build26040版本之际,微软公布了该产品的官方名称:WindowsServer2025。一同推出的,还有Windows11WindowsInsiderCanaryChannel版本的build26040。有些朋友可能还记得,多年前有人成功将WindowsNT从工作站模式转换为服务器模式,显示微软操作系统各版本之间的共性。尽管现在微软的服务器操作系统版本和Windows11之间有明显区别,但关注细节的人可能会好奇:为什么WindowsServer更新了品牌,

Snapdragon X Elite CPU performance nearly identical on battery and plugged-in in Vivobook S15 benchmarksSnapdragon X Elite CPU performance nearly identical on battery and plugged-in in Vivobook S15 benchmarksJun 20, 2024 pm 03:59 PM

Despite the hype surrounding the Qualcomm Snapdragon X Elite, it has been a rather mediocre launch. In our review, we found that the most impressive part of the new Qualcomm Snapdragon X Elite X1E-78-100-powered Asus Vivobook S 15 was the seamlessnes

Snapdragon X Elite CPU performance nearly identical on battery vs AC power in Vivobook S15 benchmarksSnapdragon X Elite CPU performance nearly identical on battery vs AC power in Vivobook S15 benchmarksJun 21, 2024 am 06:50 AM

Despite the hype surrounding the Qualcomm Snapdragon X Elite, it has been a rather mediocre launch. In our review, we found that the most impressive part of the new Qualcomm Snapdragon X Elite X1E-78-100-powered Asus Vivobook S 15 was the seamlessnes

html5的video标签不能播放怎么办html5的video标签不能播放怎么办Jan 28, 2023 am 09:36 AM

html5的video标签不能播放的解决办法:1、使用视频截图做一个播放按钮,占位视频原有位置;2、监听占位按钮的click事件,使用“video.play()”;3、把占位图和loading隐藏即可。

flash是什么flash是什么Aug 10, 2023 am 10:16 AM

Flash是一种用于创建多媒体和互动内容的软件,具有矢量图形、时间轴动画、交互性和多媒体处理能力等特点。尽管曾经非常流行,但随着新技术的崛起,Flash逐渐被淘汰,并且在2020年停止了官方支持。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools