Talk:Pp

From Noisebridge
Revision as of 16:00, 29 March 2013 by Thex (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

[edit] Ball Module Dev

VideoPreview

package 
{
	import flash.display.Sprite;
	import flash.media.Camera;
	import flash.media.Video;
	import flash.media.Microphone;
	import flash.events.ActivityEvent;
	import flash.events.StatusEvent;
	
	public class VideoPreview extends Sprite
	{
		public var video:Video;
		
		private var cam:Camera;
		private var mic:Microphone;

		public function VideoPreview() 
		{
			initMic();
			initCam();
		}
		
		private function initMic():void
		{
			mic = Microphone.getMicrophone();
			mic.addEventListener(ActivityEvent.ACTIVITY, micActivityHandler);
			mic.addEventListener(StatusEvent.STATUS, micStatusHandler);
		}
		
		private function micActivityHandler(e:ActivityEvent):void
		{
			trace("Activity", e);
		}
		
		private function micStatusHandler(e:StatusEvent):void
		{
			trace("Status", e);
		}
		
		private function initCam():void
		{
			cam = Camera.getCamera();
			video.attachCamera(cam);
		}

	}
	
}
Personal tools