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

test permissions

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