const stream = await navigator.mediaDevices.getUserMedia({ video: true });
const track = stream.getTracks()[0];
const trackProcessor = new MediaStreamTrackProcessor(track);
const reader = trackProcessor.readable.getReader();
while (true) {
const result = await reader.read();
if (result.done) break;
const frameFromCamera = result.value;
// Returns 0, 90, 180, or 270 indicating the frame's rotation
console.log(frameFromCamera.rotation);
}VideoFrame: rotation property / notebook
VideoFrame: rotation property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.