Commit c189ee98 by Иван Кубота

more permissions

parent d4a63a95
......@@ -389,26 +389,13 @@ Screen.Conference = function() {
try{
await new Promise(((resolve, reject) => {
navigator.permissions.query( { name: 'camera' } )
.then(function(result) {
.then(async function(result) {
if (result.state === 'granted') {
console.log(result.state);
resolve();
} else if (result.state === 'prompt') {
console.log('waiting permission')
}else{
reject();
}
// Don't do anything if the permission was denied.
})
.catch((error) => {
console.log('Got error :', error);
reject(error);
});
}));
}catch(error){
console.log('Got error :', error);
}
try{
await new Promise(((resolve, reject) => {
navigator.mediaDevices.getUserMedia( { video: { width: 1280, height: 720 } } )
......@@ -424,6 +411,22 @@ Screen.Conference = function() {
console.log('Got error :', e);
}
}else{
reject();
}
// Don't do anything if the permission was denied.
})
.catch((error) => {
console.log('Got error :', error);
reject(error);
});
}));
}catch(error){
console.log('Got error :', error);
}
navigator.mediaDevices.enumerateDevices().then(gotDevices).catch(handleError);
var soundDisablerID = setInterval(function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment