structuredClone track

My starting point.

by jib1

HTML

<div id="div" style="white-space: pre;"></div>

JavaScript

const console = { log: msg => div.innerHTML += msg + "<br>" };
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));

(async () => {
  try {
    const stream = await navigator.mediaDevices.getUserMedia({video: true});
    const [track] = stream.getVideoTracks();
    const clone = structuredClone(track);
    console.log(clone);
  } catch(e) {
    console.log(e);
  }
})();