Re: [問題] FMS視訊錄像
錄製自己影像
<!-- start code -->
var sim_cam:Camera = Camera.get();
var sim_mic:Microphone = Microphone.get();
local_video.attachVideo(sim_cam);
var rtmp:String = new String("rtmp://MyDNS/FMSapp/");
var nc:NetConnection = new NetConnection();
nc.onStatus = function(info) {
if (info.code == "NetConnection.Connect.Success") {
flv_ti.text = "Connected";
} else {
flv_ti.text = "No Connection!";
}
};
nc.connect(rtmp);
var ns:NetStream = new NetStream(nc);
var recordFLV:Object = new Object();
recordFLV.click = function() {
if (record_btn.label == "Record") {
record_btn.label = "Recording";
ns.attachAudio(sim_mic);
ns.attachVideo(sim_cam);
ns.publish(flv_ti.text,"record");
} else {
ns.close();
record_btn.label = "Record";
}
};
record_btn.addEventListener("click",recordFLV);
var playFLV:Object = new Object();
playFLV.click = function() {
if (play_btn.label == "Play") {
play_btn.label = "Playing";
ns.play(flv_ti.text);
flv_video.attachVideo(ns);
} else {
ns.close();
play_btn.label = "Play";
flv_video.clear();
}
};
play_btn.addEventListener("click",playFLV);
play_btn.label = "Play";
<!-- code end -->
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.134.207.127
討論串 (同標題文章)
Flash 近期熱門文章
PTT數位生活區 即時熱門文章