Commit 249ee1e9 by Иван Кубота

test permissions

parent 490638d6
......@@ -366,15 +366,39 @@ Screen.Conference = function() {
;(async function() {
try{
var permissionObj = await navigator.permissions.query( { name: 'microphone' } )
console.log(permissionObj.state);
await new Promise(((resolve, reject) => {
navigator.permissions.query( { name: 'microphone' } ).then(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);
}
try{
var permissionObj = await navigator.permissions.query( { name: 'camera' } )
console.log(permissionObj.state);
await new Promise(((resolve, reject) => {
navigator.permissions.query( { name: 'camera' } ).then(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);
}
......
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