Open hazratgs opened 4 years ago
Did you try this?
navigator.mediaDevices.getUserMedia({
audio: true,
video: true
}).then(function() {
DetectRTC.load(function() {
alert('isWebsiteHasMicrophonePermissions: ' + DetectRTC.isWebsiteHasMicrophonePermissions);
});
}).catch(function() {
DetectRTC.load(function() {
alert('isWebsiteHasMicrophonePermissions: ' + DetectRTC.isWebsiteHasMicrophonePermissions);
});
});
i.e. execute DetectRTC.load
inside getUserMedia error-success callbacks.
Did you try this?
navigator.mediaDevices.getUserMedia({ audio: true, video: true }).then(function() { DetectRTC.load(function() { alert('isWebsiteHasMicrophonePermissions: ' + DetectRTC.isWebsiteHasMicrophonePermissions); }); }).catch(function() { DetectRTC.load(function() { alert('isWebsiteHasMicrophonePermissions: ' + DetectRTC.isWebsiteHasMicrophonePermissions); }); });
i.e. execute
DetectRTC.load
inside getUserMedia error-success callbacks.
Thanks for the quick response navigator.mediaDevices.getUserMedia method does not work in Safari 11 and below
and besides, there is a bug described above, it also does not work, for example:
navigator.mediaDevices.getUserMedia({ audio: true, video: true })
.then(() => this.getStatusUserMedia())
.catch((err) => {
this.getStatusUserMedia()
console.log('mediaDevices', err)
})
getStatusUserMedia = () => DetectRTC.load(() => {
console.log('getStatusUserMedia ', {
hasMicrophonePermissions: DetectRTC.isWebsiteHasMicrophonePermissions,
hasWebcamPermissions: DetectRTC.isWebsiteHasWebcamPermissions,
})
this.setState({
hasMicrophonePermissions: DetectRTC.isWebsiteHasMicrophonePermissions,
hasWebcamPermissions: DetectRTC.isWebsiteHasWebcamPermissions,
})
})
if you enable the microfon and disable the camera in Safari settings (as well as in Chrome), the following occurs, I can’t determine in .catch what exactly the microfon or camera was blocked for me
the most amazing thing is that in this case, DetectRTC will return true for both the microfone and the camera, that is, it does not work (
I have the same issue. In the Chrome browser 78.0.3904.87 (Mac), I am denied access to the camera, but I get:
DetectRTC.isWebsiteHasMicrophonePermissions: true DetectRTC.isWebsiteHasWebcamPermissions: true
:(
I had the same issue. Even if I removed the Webcam and Microphone, I still received "true" for both.. (tested in Firefox and Chrome latest versions in different machines, results are same). (tested script is https://raw.githubusercontent.com/muaz-khan/DetectRTC/master/DetectRTC.js)
However, when I use the script directly provided in , it works perfectly.
I did not understand what is the problem. Release works fine, but the same versioned DetectRTC.js scriptprovided in main repository do not work properly. I did not compare the scripts, but I believe that, there is a difference in these two scripts.
Greetings friends, I noticed that in a particular case, DetectRTC does not work at all, for example
although isWebsiteHasWebcamPermissions should be false