How to get control on security privacy pop up in f

2020-03-31 05:23发布

问题:

We are working on flash camera project. We want to ask user to allow or deny camera access first on page load. then after few seconds we want to start camera and take photo. If User deny camera (or flash) access, we do not want to start camera. and If user allows permission for camera (or flash) access, we want to start camera and take photo.

For this, We are using "Security.showSettings(SecurityPanel.PRIVACY);". This code is user for ask permission to user about their camera access.

So, it is show Privacy Pop up in flash. But, how we can have control on that pop up. I mean, how we can know that is user checked on allow or deny check Box when user close pop up?

Thank You.

回答1:

Have a look at Camera.getCamera().muted - if it's false the user has allowed access to the camera, if not, he's not allowing access to it.

You can also listen to the status event on the camera object. When it changes from muted to unmuted, you'll get an event and can start the camera.