w3c / w3c/webcodecs

constructing new VideoFrame(HTMLVideoElement,...) shouldn't rely on <video>.networkState

Open
#487 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

need-definition
Dominant language
HTML
Stars
1.3k
Forks
194
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Right now the constructor's steps say

If image’s networkState attribute is NETWORK_EMPTY, then throw an InvalidStateError DOMException.

This was a copy paste from createImageBitmap() steps.

But networkState really doesn't have any correspondence to "is your video element ready to render a frame".

There's a related discussion in Chrome's bug tracker where play() promise resolution (and thereby readyState > HAVE_CURRENT_DATA) is proposed as the signal that a frame is ready. Some unanswered questions there, and maybe some risk to making that change.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the VideoFrame(HTMLVideoElement,...) constructor steps and compare the NETWORK_EMPTY requirement with the referenced createImageBitmap() steps. Review the linked Chrome discussion about play() resolution and readyState; done means the readiness signal is resolved and the constructor steps are updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, audio-video-rtc
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.