My actions:
-
I turned on the web camera
-
executed code:
Camera.getCamera()and got a normal camera object and camera event:Camera.Unmuted -
turned off the web camera
-
executed code in the same application:
Camera.getCamera()and got a normal camera bject and camera event: “Camera.Unmuted“ -
why?
The names used in that status event from the
Cameraare poorly chosen. When the event’scodeis “Camera.Unmuted” it only means that the user has allowed access to the camera (via Flash Player’s privacy dialog box). It does not imply anything else, like if the camera is working.The docs for the Camera.muted property, also confers this.
The use of muted/unmuted to communicate whether access to these devices is allowed seems like an even poorer choice when you consider the
Microphoneclass uses the same convention.[Edit]
You can deduce if the camera is working with some certainty using the activityLevel (in conjunction w/the motionLevel) and the currentFPS properties of the camera. Once you get the camera and are capturing video, these will have non zero values.
Some other info can be found in this question.