Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created October 28, 2021 15:59
Show Gist options
  • Select an option

  • Save GaetanoPiazzolla/205bccb49ac0cbc7801c53ade24b2ac6 to your computer and use it in GitHub Desktop.

Select an option

Save GaetanoPiazzolla/205bccb49ac0cbc7801c53ade24b2ac6 to your computer and use it in GitHub Desktop.
let btn = document.querySelector("#record-button")
btn.addEventListener("click", async function () {
let stream = await navigator.mediaDevices.getDisplayMedia({
video: true
})
let mediaRecorder = new MediaRecorder(stream, {
mimeType: "video/webm"
})
// ...
mediaRecorder.start()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment