我试图在Chrome中玩navigator.getUserMedia;但是,在本地服务时(file:///whatever/index.html)并没有请求许可,而是在JSfiddle(
http://jsfiddle.net/EBsvq/)和其他站点上进行请求。
有人知道这个的原因吗?我需要以某种方式重置我的权限吗?
这是我在本地使用的
<html> <head></head> <body> <button id="btn">Start</button> <script type="text/javascript"> /*! jQuery v1.8.3 jquery.com | jquery.org/license */ //JQuery goes here </script> <script type="text/javascript"> navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.getUserMedia; $(function(){ $('#btn').click(function(){ navigator.getUserMedia({audio: true},function(){ alert('success'); },function (err) { alert('fail: ' + JSON.stringify(err)); }); }); }); </script> </body> </html>
解决方法
原文地址:https://www.jb51.cc/html5/168971.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。