检测用户的相机设置 [英] Detecting user's camera settings

查看:87
本文介绍了检测用户的相机设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有正确检测到用户的摄像头设置有问题。

I am having a problem with correctly detecting a user's camera settings.

如果用户选择允许和记住,那么则Camera.muted设置为false(不静音)

If the user has selected "allow" and "remember", then the camera.muted setting is false (not muted)

然而,如果用户选择了拒绝和记住,那么则Camera.muted设置为真。 (摄像头已静音用户)

However, if the user has selected "deny" and "remember", then the camera.muted setting is true. (camera has been muted by the user)

但是,如果用户没有选择任何东西,记住复选框被选中,则Camera.muted设置也是如此(相机又是沉默,但是那只是因为有人不允许相机还)

BUT, if the user hasn't selected anything and the "remember" checkbox is unchecked, the camera.muted setting is ALSO TRUE (the camera is again muted, but it's only because someone hasn't "allowed" the camera yet)

有没有一种方法,当用户选择了否定的摄像机永远特定网站(通过选中记住复选框),或者当他们只是没有让相机在首位区分?

Is there a way to differentiate between when a user has chosen to deny a camera forever for a particular site (by checking the "remember" check box) OR when they just haven't allowed the camera in the first place?

推荐答案

据我所知,没有办法来检测,如果记住复选框,之前已经检查。解决方法是检测是否请求时相机静音与否。如:

As far as I can tell, there is no way to detect if the "remember" checkbox has been checked before. The workaround is to detect if the camera is muted or not when requested. Such as:

camera = Camera.getCamera();
if (camera.muted) {
    // "remember" checkbox was not checked, or user needs to allow access
}
else {
    // "remember" checkbox was checked, access is already granted
}

这篇关于检测用户的相机设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆