summaryrefslogtreecommitdiff
path: root/test.js
blob: 78768542ccb61c76f05b57a910c494415f641ab2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const perm = require('./index')

for (let mediaType of ['camera', 'microphone']) {
  let access = perm.getMediaAccessStatus(mediaType)
  if (access == 'not-determined') {
    perm.askForMediaAccess(mediaType, (granted) => {
      console.log(mediaType + ' askForMediaAccess result:', granted)
    })
  } else {
    console.log(`${mediaType} access status: ${access}`)
  }
}