1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| var nTimer:Number;
var index:Number = 0;
btnPlay.enabled = false;
mcRecordInfo._visible = false;
var camLive:Camera = Camera.get();
oVideo1.attachVideo(camLive);
var nc:NetConnection = new NetConnection();
nc.connect( "rtmp://127.0.0.1/videooo/");
var ns:NetStream = new NetStream(nc);
btnRecord.onRelease = function():Void {
ns.attachVideo(camLive);
ns.publish("demo","record");
btnPlay.enabled = false;
mcRecordInfo._visible = true;
nTimer = setInterval(stopRecording, 10000);
};
function stopRecording():Void {
ns.close();
clearInterval(nTimer);
btnPlay.enabled = true;
mcRecordInfo._visible = false;
}
btnPlay.onRelease = function():Void {
oVideo1.attachVideo(ns);
ns.play("demo");
}; |
Partager