Bug 258450

Summary: Constructing a VideoFrame from a video element inside the loadeddata event does not always succeed in Safari
Product: WebKit Reporter: youenn fablet <youennf>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: karlcow, webkit-bug-importer
Priority: P2 Keywords: BrowserCompat, InRadar, WPTImpact
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description youenn fablet 2023-06-23 04:39:31 PDT
It seems to work well for Chrome.
Comment 1 youenn fablet 2023-06-23 04:40:09 PDT
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>.');
Comment 2 Radar WebKit Bug Importer 2023-06-23 08:00:46 PDT
<rdar://problem/111216678>
Comment 3 youenn fablet 2023-06-23 08:09:11 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15238
Comment 4 EWS 2023-06-27 23:51:25 PDT
Committed 265574@main (fe5c478d8625): <https://commits.webkit.org/265574@main>

Reviewed commits have been landed. Closing PR #15238 and removing active labels.