The ActionScript property Camera.mutedis what you need. The source you contacted creates a private object Camerawith a name Camera. You can make it public or add a new method to check its property muted;
final public function has_access( ) : Boolean {
return !camera.muted;
}
As a rule, you should hide / disable the button until the muting is false (it is very unlikely that it will again become true, the user will have to manually open the settings window and disable access).
You can also use a listener to avoid constantly checking this value;
final public function add_access_listener( myFunc : Function ) : void {
camera.addEventListener( "status", myFunc );
}
What will be used as follows:
myWebcam.add_access_listener( myAccessFunc );
function myAccessFunc( ev : StatusEvent ) : void {
if( ev.code == "Camera.Unmuted" ) {
} else {
}
}
if( myWebcam.has_access( ) ) {
} else {
}
To avoid possible memory leaks, you should also call removeEventListenerif you ever remove the camera, but the library does not seem to be designed for this, and in any case (and does not delete its own listeners).