It seems to work well for Chrome.
Snippet from WPT webcodecs. promise_test(async t => { // Test only valid for Window contexts. if (!('document' in self)) return; let video = document.createElement('video'); video.src = 'vp9.mp4'; video.autoplay = true; video.controls = false; video.muted = false; document.body.appendChild(video); const loadVideo = new Promise((resolve) => { if (video.requestVideoFrameCallback) { video.requestVideoFrameCallback(resolve); return; } video.onloadeddata = () => resolve(); }); await loadVideo; let frame = new VideoFrame(video, {timestamp: 10}); assert_equals(frame.codedWidth, 320, 'codedWidth'); assert_equals(frame.codedHeight, 240, 'codedHeight'); assert_equals(frame.timestamp, 10, 'timestamp'); frame.close(); }, 'Test we can construct a VideoFrame from a <video>.');
<rdar://problem/111216678>
Pull request: https://github.com/WebKit/WebKit/pull/15238
Committed 265574@main (fe5c478d8625): <https://commits.webkit.org/265574@main> Reviewed commits have been landed. Closing PR #15238 and removing active labels.