// Create controller and start capture
const controller = new CaptureController();
videoElem.srcObject = await navigator.mediaDevices.getDisplayMedia({
controller,
});
// ...
startForwarding();CaptureController: forwardWheel() method / notebook
CaptureController: forwardWheel() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
async function startForwarding() {
try {
await controller.forwardWheel(videoElem);
} catch (e) {
console.log(e);
}
}