I have a suite which records the user\'s webcam and mic. It works great on a webpage, but in a Chrome Extension the line:
navigator.mediaDevices.getUserMedia
Utkanos answer is great but don't forget to add
frame.setAttribute("allow", "microphone; camera");