Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to record screen using js

async function startCapture(displayMediaOptions) {
  let captureStream = null;

  try {
    captureStream = await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
  } catch(err) {
    console.error("Error: " + err);
  }
  return captureStream;
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #record #screen #js
ADD COMMENT
Topic
Name
5+9 =