Causa se si imposta "Ricorda" nel Pannello impostazioni (tasto destro), non ci sarà il popup e quindi nessuna notifica di cambiamento di stato.
Così, al fine di sapere se è consentita la fotocamera (e microfono se bisogno), è possibile controllare la muted
attribut:
var camera:Camera = Camera.getCamera();
if (camera.muted)
{
camera.addEventListener(StatusEvent.STATUS, handleCameraStatus, false, 0, true);
}
else
{
camAllowed = true;
handleWebcam();
}
e nel vostro gestore di stato
private function handleCameraStatus(e:StatusEvent):void
{
witch (e.code)
{
case 'Camera.Muted':
{
camAllowed = false;
trace("Camera muted");
break;
}
case 'Camera.Unmuted':
{
camAllowed = true;
trace("Camera unmuted");
handleWebcam();
break;
}
}
}
(si fare lo stesso per il microfono se necessario)
quindi, quando si chiama il metodo per gestire
private function handleWebcam()
{
if (camAllowed && micAllowed)
{
// Do what you need when all is OK
}
else
{
// Either wait for the 2 status to switch to true, either you got a problem !? ...
}
}
fonte
2013-08-11 14:43:27