MDN self-hosted library · e01.org

Using the Captured Surface Control API

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
controller = new CaptureController();

const displayMediaOptions = {
  controller,
};

videoElem.srcObject =
  await navigator.mediaDevices.getDisplayMedia(displayMediaOptions);
js
controller.increaseZoomLevel();
html
<iframe allow="captured-surface-control" src="/some-other-document.html">
  ...
</iframe>