oopchoi's Profile
| Name |
Bryan Choi
|
| About Me |
<p>I am a flex and air developer in Korea.</p>
|
| Company |
WithFlex
|
| Position |
Flex Architect
|
| Interests |
<p>the RIA is my life.</p>
|
| Recent Code |
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="middle" layout="vertical" creationComplete="initComp()" xmlns:local="*"> <mx:Script> <![CDATA[ private var nc:NetConnection; private var ns:NetStream; private var cam:Camera; /** * NetConnection로 서버에서 RED5연결하기 */ public function initComp():void { setingCamera(); // 캠 세팅하기 nc = new NetConnection(); nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler); // net_status 연결상태확인 이벤트 nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); // 보안 오류 처리 nc.connect("rtmp://192.168.0.43/oflaDemo"); } /** * 이걸 RED5에서서 해출하는것 같음 */ NetConnection.prototype.onBWDone = function(p_bw) { trace("onBWDone: "+p_bw); }; /** * 연결 상태 확인 이벤트 */ private function netStatusHandler(event:NetStatusEvent):void { trace(event.info.code); switch (event.info.code) { case "NetConnection.Connect.Success": ns = new NetStream(nc); break; } } /** * 보안오류 출력 */ private function securityErrorHandler(event:SecurityErrorEvent):void { trace("보안오류 : "+event); } /** * 캠 세팅하기 */ public function setingCamera():void { cam = Camera.getCamera(); cam.setMode(550,550,30) // 높이,너비,fps cam.setQuality(0,70); // motion, leval } /** * BroadCaster 캐스팅 */ public function clickStart():void { if(ns){ ns.attachCamera(cam); // NetStream에 캠연결 videoContainer.video.attachCamera(cam); // ns.publish("Broadcast", "live"); // 스트림 이름, live(라이브) start.enabled = false; rec.enabled = false; stop.enabled = true; }else { initComp(); } } /** * BroadCaster 캐스팅 정지 */ public function clickStop():void { start.enabled = true; rec.enabled = true; stop.enabled = false; ns.attachCamera(null); // 초기화 ns.close(); // 연결해제 videoContainer.video.attachCamera(null); // 비디오 객체의 캠 초기화 videoContainer.video.clear(); // 제거 } // 캠 레코드 하기 private function recordCam():void { start.enabled = false; rec.enabled = false; stop.enabled = true; ns.attachCamera(cam); // 캠 연결 videoContainer.video.attachCamera(cam); // 비디오 객체에 캠 추가하기 var lastVideoName:String = "SosRecord_" + (getTimer()*Math.random()).toFixed(0); //램덤 파일명 만들기 ns.publish(lastVideoName, "record"); // 파일이름, 레코드하기명령 } ]]> </mx:Script> <mx:Panel width="600" height="600"> <local:Red5VideoDisplay id="videoContainer" width="100%" height="100%" /> <mx:ControlBar> <mx:Button id="start" label="시작" click="clickStart()"/> <mx:Button id = "rec" label="녹화하기" click="recordCam()"/> <mx:Button id="stop" label="종료" click="clickStop()"/> <local:FullScrBtn /> </mx:ControlBar> </mx:Panel></mx:Application>
|
|
Stats
Last online 07/11/11
Groups
oopchoi is a member of the following Groups:
9ria.com
Group - Asia 405 Members
Bangalore Flex User Group
Group - India 234 Members
Hong Kong Adobe Flex and AIR User Group
Group - Asia 112 Members
Malaysia Flex User Group
Group - Asia 38 Members
Zagreb Flex User Group
Group - Europe 99 Members
|