diff options
author | evgeny <me@ch1p.com> | 2018-12-25 18:16:30 +0300 |
---|---|---|
committer | evgeny <me@ch1p.com> | 2018-12-25 18:16:30 +0300 |
commit | f3a37f1d38179032e6374332261af24975237dc0 (patch) | |
tree | e7ea2eef0cb37e2ad6ac4e1a44301585060a045c /test.js |
initial commit
Diffstat (limited to 'test.js')
-rw-r--r-- | test.js | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -0,0 +1,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}`) + } +} |