Skip to main content

Figma Plugin with Microphone Access

  • March 2, 2023
  • 1 reply
  • 659 views

Rohan_Kapoor

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?

Thanks!

1 reply

Gorkem_YILDIZ

hi did you find a solution to this blocking?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings