Discussion on: Screen Recording in 10 lines of Vanilla JS

sebastianstamm profile image
Sebastian Stamm Author

Sure! Instead of calling getDisplayMedia you would need to call getUserMedia, like this:

const stream = await navigator.mediaDevices.getUserMedia({
  audio: true

You can then plug this stream into the MediaRecorder like described in the post.