一聚教程网:一个值得你收藏的教程网站

热门教程

用 flashmediaserver 做在线视频录音

时间:2022-07-02 17:08:09 编辑:袖梨 来源:一聚教程网

flashmediaserver 非常好实现的

给你几段AS代码吧.

播放
nc = new NetConnection();
nc.connect("rtmp://127.0.0.1/cam02");
res = new NetStream(nc);
view.attachVideo(res);
view.attachAudio(res);
res.play("2");

录象
var cam = Camera.get();
if (cam == null)
{
    nocamerror.text = "没有摄像头n或设备正被占用中";
}
else
{
//从麦和设像头显示视频
my_video.attachVideo(cam);
my_video.attachAudio(Microphone.get());
//连接
nc = new NetConnection();
nc.connect("rtmp://127.0.0.1/flash");
nsOut = new NetStream(nc);
nsOut.attachVideo(cam);
nsOut.attachAudio(Microphone.get());
//发布2.flv
nsOut.publish("2");
}

热门栏目