whatwg / whatwg/html

HTMLMediaElement's load() should return a Promise

Open
#554 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

addition/proposal topic: media
Dominant language
HTML
Stars
9.4k
Forks
3.2k
Avg merge
3d 9h
Merged PRs (30d)
38

Description

As proposed by @cpearce in https://github.com/whatwg/html/issues/505#issuecomment-171229898

The tricky part is when the promise should be resolved. The spec has a number of steps under "Once enough of the media data has been fetched to determine the duration of the media resource, its dimensions, and other metadata" where it would make sense. At the end it says "Once the readyState attribute reaches HAVE_CURRENT_DATA, after the loadeddata event has been fired, set the element's delaying-the-load-event flag to false. This stops delaying the load event." Also resolving the load() promise at this point would probably work.

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 HTMLMediaElement load() algorithm and the cited WHATWG issue comment. Determine when the promise should resolve, considering the metadata-fetching steps and the HAVE_CURRENT_DATA state after loadeddata; done means the specification defines this behavior clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.