简体   繁体   English

拒绝后重新提示用户访问相机

[英]RePrompt user for camera access after deny

I am currently working on a project for a streaming application that prompts the users for features like: Permission for Microphone Access, Screen share access, microphone access, etc. Part of the parameters for the assignment is to re-prompt a user for permission if they accidentally pressed denied.我目前正在开发一个流媒体应用程序的项目,该应用程序会提示用户提供以下功能:麦克风访问权限、屏幕共享访问权限、麦克风访问权限等。分配的部分参数是重新提示用户获得权限,如果他们不小心按了否认。 From my understanding that permissions are session based and only after a deny the user can either refresh the page or manually make the change in settings.据我了解,权限是基于 session 的,只有在拒绝后,用户才能刷新页面或手动更改设置。

Is there a way in javascript to enforce a reprompt or is my initial session correct. javascript 中是否有办法强制重新提示,或者我最初的 session 是否正确。 From my understanding it is one of three "Always Allow" "Always Deny" "Session based".据我了解,它是三个“始终允许”“始终拒绝”“基于会话”之一。

We are working with Javascript, Node, and WebRTC.我们正在与 Javascript、Node 和 WebRTC 合作。

Thank you for your feedback!感谢您的反馈意见!

You can try refreshing the page using window.location.reload() .您可以尝试使用window.location.reload()刷新页面。 Even in this case it will only work if user has not pressed always deny .即使在这种情况下,它也只有在用户没有按下 always deny 时才会起作用

You cannot re-ask for permission without refreshing the page because the browser blocks the request automatically to protect the privacy of the user.您不能在不刷新页面的情况下重新请求权限,因为浏览器会自动阻止请求以保护用户的隐私。 But, you can write a script to not allow the user to join a meeting or a classroom if the user has not allowed Microphone / Camera access.但是,如果用户不允许麦克风/摄像头访问,您可以编写一个脚本来不允许用户加入会议或教室。 This is done in most cases.大多数情况下都会这样做。

Request to accept the answer if it helps...如果有帮助,请求接受答案...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM