检测用户的相机设置
我在正确检测用户的相机设置时遇到问题。
如果用户选择了“允许”和“记住”,则camera.muted 设置为假(不静音)。
但是,如果用户选择了“拒绝”和“记住”,则camera.muted 设置为true。 (相机已被用户静音)
但是,如果用户没有选择任何内容并且未选中“记住”复选框,则camera.muted设置也为真(相机再次静音,但这只是因为有人没有'还没有“允许”摄像头)
有没有办法区分用户选择永远拒绝特定站点的摄像头(通过选中“记住”复选框)或他们只是不允许摄像头进入第一名?
I am having a problem with correctly detecting a user's camera settings.
If the user has selected "allow" and "remember", then the camera.muted setting is false (not muted)
However, if the user has selected "deny" and "remember", then the camera.muted setting is true. (camera has been muted by the user)
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
据我所知,没有办法检测“记住”复选框之前是否已被选中。解决方法是根据请求检测相机是否静音。例如:
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:
在与 Flash 中的网络摄像头进行过战斗之后,我建议每个人都使用这个库。
https://github.com/cataclysmicrewind/CameraDetection/
Flash + 网络摄像头应该 = 简单 + 很棒。
不幸的是,这是痛苦+折磨。
Having done battle with webcams in flash, I would suggest that everyone use this library.
https://github.com/cataclysmicrewind/CameraDetection/
Flash + webcam should = easy + awesome.
Unfortunately, it is pain + suffering.
您也许可以使用此解决方法来检测安全对话框是否打开。
https://gist.github.com/1266104 中引用了 https://bugbase.adobe.com/index.cfm?event=bug&id=2993848
然后你可以做类似的事情:
You might be able to use this workaround which can detect whether the security dialog is open.
https://gist.github.com/1266104 referenced in https://bugbase.adobe.com/index.cfm?event=bug&id=2993848
Then you could do something like:
对于所有使用 CameraDetection 类的人要小心...这仅适用于在安全面板打开时尝试绘制舞台的解决方法。如果您尝试绘制舞台,而舞台上的某些元素会出现安全沙箱问题(从其他位置加载的图像,甚至当前正在流式传输的视频),您将会遇到问题。基本上,解决方法会自动继续失败并给出错误的结果。
就我而言,当我在舞台上播放视频时,我在尝试使用 CameraDetection 时遇到了困难。无论安全面板是否打开,都会发生 try/catch。
For all those that use the CameraDetection class be cautious... This only works because of a workaround that tries to draw the stage while the security panel is open. You will run into problems if you try to draw the stage while it has certain elements on it that present a security sandbox problem(loaded images from other locations, or even videos thats that are currently streaming). Basically the workaround will automatically continue to fail and give false results.
In my case I was stuck trying to use the CameraDetection while I had a video on the stage that was being streamed. The try/catch happens regardless of the security panel being open.