Figma Plugin with Microphone Access

I’m building a figma plugin where I’m giving the user a button to record their audio. I’m using the Web Audio API with the following code snippet:

**var** audioContext = **new** **AudioContext**();
navigator.mediaDevices.**getUserMedia**({ audio: true })
.**then**(**function**(stream) {
**var** source = audioContext.**createMediaStreamSource**(stream);
.**catch**(**function**(err) {
console.**log**('Error: ' + err);

’m able to console.log(navigator), but there’s no mediaDevices field showing up. I think the issue is that the plugin window is an iframe and in order to get mic access from an iframe, I have to add an attribute to the iframe tag (javascript - Cam access for embedded iframe - Stack Overflow 1). However, I don’t see how I can get access to the tag. Would anyone be able to answer this?