<div>
  <video autoplay></video>
</div>

<button>start screen share</button>
video {
  border: 1px solid #999;
  width: 200px;
}
document.querySelector('button').addEventListener("click", async () => {
  document.querySelector('video').srcObject = await navigator.mediaDevices.getDisplayMedia({
    video: true,
    audio: true
  });
}, false);

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.