是否可以检测到用户已经“启用”了网页的麦克风/视频,而无需让用户在拒绝访问后手动刷新页面。手动用户启用?
基本上它被禁用,当用户启用它时我想自动刷新页面。
navigator.getUserMedia (
// constraints
{
video: true,
audio: true
},
// successCallback
function(localMediaStream) {
var video = document.querySelector('video');
video.src = window.URL.createObjectURL(localMediaStream);
video.onloadedmetadata = function(e) {
// Do something with the video here.
};
},
// errorCallback
function(err) {
if(err === PERMISSION_DENIED) {
// Explain why you need permission and how to update the permission setting
}
}
);