demo · v138
VideoFrame { rotation, flip }
Create a VideoFrame with the new orientation metadata. The "raw" canvas draws ignoring orientation (pre-138 behaviour). The "respecting" canvas honours rotation and flip — this is what a 138+ renderer does by default for media-tunnelled frames from cameras and decoded files.
checking support…
raw — ignores orientation (pre-138 default)
respecting orientation (138+)
click "build VideoFrame & draw"
the code
const frame = new VideoFrame(canvas, {
timestamp: 0,
rotation: 90, // NEW in 138 (degrees clockwise)
flip: true, // NEW in 138 (boolean horizontal mirror)
});
// frame.rotation / frame.flip are then queryable. Most pipelines
// (canvas drawImage, MediaStreamTrack capture) honour them.
ctx.drawImage(frame, 0, 0); // automatically rotated & flipped
see also
- VideoFrame orientation metadata — feature index
- ChromeStatus entry
- WebCodecs spec