demo · v136
Zoom Coach
Captured Surface Control zoom uses CaptureController, not MediaStreamTrack. Read getSupportedZoomLevels(), observe the zoomLevel attribute, then use the trusted increaseZoomLevel(), decreaseZoomLevel(), and resetZoomLevel() buttons. The planner slider shows why the current API does not accept arbitrary zoom percentages.
Origin trial / flag: ChromeStatus lists Captured Surface Control as an origin trial in Chrome 136. A real capture may require the origin trial token or
chrome://flags/#captured-surface-control. The probes and rejection examples below still explain the contract when the API is unavailable.
CaptureController
checking
zoom methods
checking
legacy setZoomLevel()
checking
current zoom
controller.zoomLevel:
—
zoomlevelchange updates this readout when the captured surface changes zoom.
supported levels and planner
requested:
100
nearest:
—
the API
const controller = new CaptureController();
const stream = await navigator.mediaDevices.getDisplayMedia({
video: true,
controller,
});
const levels = controller.getSupportedZoomLevels();
const current = controller.zoomLevel;
button.addEventListener("click", () => controller.increaseZoomLevel());
input.addEventListener("input", () => controller.resetZoomLevel());
controller.onzoomlevelchange = () => {
console.log(controller.zoomLevel);
};