检测用户是允许还是拒绝使用摄像头.
监听camera’s 的StatusEvent.STATUS事件就OK了
var cam:Camera = Camera.getCamera();
if (cam != null){
cam.addEventListener(StatusEvent.STATUS, statusHandler);
var vid:Video = new Video();
vid.attachCamera(cam);
addChild(vid);
}
function statusHandler(event:StatusEvent):void{
switch (event.code){
case “Camera.Muted”:
trace(”User clicked Deny.”);
break;
case “Camera.Unmuted”:
trace(”User clicked Accept.”);
break;
}
}
if (cam != null){
cam.addEventListener(StatusEvent.STATUS, statusHandler);
var vid:Video = new Video();
vid.attachCamera(cam);
addChild(vid);
}
function statusHandler(event:StatusEvent):void{
switch (event.code){
case “Camera.Muted”:
trace(”User clicked Deny.”);
break;
case “Camera.Unmuted”:
trace(”User clicked Accept.”);
break;
}
}
Camera.Muted代表禁止.
Camera.Unmuted代表语序.