getUserMedia权限对话框在FireFox中消失 [英] getUserMedia permission dialog disappears in FireFox

查看:397
本文介绍了getUserMedia权限对话框在FireFox中消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我访问getUserMedia时,会弹出一个权限对话框,我的网站会一直等到用户接受或阻止请求。然而,在FireFox 43(至少),当对话框可见时,用户可以点击任何地方,它会消失, getUserMedia的回调将永远不会被调用。然后,用户不能给予许可,我的网站被卡住等待。而且在其他地方也很容易点击,所以我预计很多麦克风不能工作的支持电话。



(这似乎是一个因为Chrome会保持对话框可见,直到用户点击它。)但无论如何,有没有办法?

例如,有没有办法检测权限对话框当前是否可见?



或者有什么方法可以在javascript中使用setTimeout重新召唤对话框?



有没有人有关于如何使这个用户体验更好的另一个建议?



我能想到的唯一的东西是张贴消息等待使用麦克风的权限,如果您没有看到权限对话框,请刷新此页面。



谢谢!

解决方案

权限对话框只是最小化。点击灰色麦克风(或摄像机)图标,对话框挂起,这仍然在URL栏中,对话框增长回来,可以回答。



这不是一个错误,因为它被设计成比Chrome更少侵入,所以不让网站把用户当作人质,可以这么说,直到他们放弃权限,但这种行为似乎混淆了很多人。请参阅 https://bugzil.la/1004055



没有确定的方法来检测权限对话框是否可见,但是如果你在页面的任何地方检测到鼠标点击,并且你没有得到响应,那么很可能不是。

一个解决方法是发出另一个 getUserMedia 调用(通过 setTimeout 或其他)。它不应该崩溃。如果是,请请提交错误



另一个解决方法是使用 location.refresh()以编程方式刷新页面。



如果您的网站没有设计成没有麦克风的情况下工作,或者您检测到表明用户被卡住的用户操作,则可能是等待使用麦克风的权限。请点击网址栏中的麦克风图标,以便在权限对话框不可见的情况下召唤。


When I access getUserMedia, a permission dialog pops up and my website waits until the user either accepts or blocks the request. That part works in Chrome 47.

However, in FireFox 43, (at least), when the dialog is visible, the user can click anywhere else and it will disappear and getUserMedia's callback will never be invoked. Then the user can't give permission and my site is stuck waiting. And it is pretty easy to click somewhere else, too, so I'm anticipating lots of "the microphone doesn't work" support calls.

(That seems like a bug in FireFox to me, since Chrome keeps the dialog visible until the user clicks it.) But anyway, is there a work around?

For instance, is there a way to detect whether the permission dialog is currently visible?

Or is there a way to re-summon that dialog in javascript by using a setTimeout?

Does anyone have another suggestion about how to make this user experience better?

The only thing I can think of is to put up a message something to the effect of, "Waiting for permission to use the microphone. If you don't see a permission dialog please refresh this page." There must be something better than that.

Thanks!

解决方案

The permission dialog is merely minimized. Click on the gray microphone (or camera) icon that the dialog hung off, which is still there in the URL bar, and the dialog grows back and can be answered.

It is not a bug, as it was designed to be less intrusive than Chrome, to not let sites keep users hostage, so to speak, until they give up permissions, but the behavior does seem to confuse a lot of people. See https://bugzil.la/1004055.

There is no surefire way to detect whether the permission dialog is currently visible, though if you detect a mouseclick anywhere on the page, and you have not gotten a response, then chances are it is not.

One workaround is to issue another getUserMedia call (through setTimeout or otherwise). It should not crash. If it does then please file a bug.

Another workaround is to programmatically refresh the page, using location.refresh().

If your site is not designed to work without a microphone, or you detect a user-action that suggests the user is stuck, then maybe something like "Waiting for permission to use the microphone. Please click the microphone icon in the URL bar to summon the permission dialog if it is not visible."

这篇关于getUserMedia权限对话框在FireFox中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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