[Webkit-unassigned] [Bug 258450] Constructing a VideoFrame from a video element inside the loadeddata event does not always succeed in Safari

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 23 04:40:09 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=258450

--- Comment #1 from youenn fablet <youennf at gmail.com> ---
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>.');

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230623/940fc65f/attachment.htm>


More information about the webkit-unassigned mailing list