AS3检测视像头

来源:互联网 发布:易知投资 编辑:程序博客网 时间:2024/05/29 19:58

camera=Camera.getCamera();
            
            if(camera!=null){
                camera.addEventListener(StatusEvent.STATUS,statusHandler);
                camera.addEventListener(ActivityEvent.ACTIVITY,activityHandler);

        private function statusHandler(evt:StatusEvent):void{
            if(camera.muted) label.text="不能使用";
        }
        
        private function activityHandler(evt:ActivityEvent):void{
            if(evt.activating){
                label.text="检测开始";
            }
            else{
                label.text="检测停止";
            }
        }

原创粉丝点击