Day 97 of 100DaysOfSpec, media elements, contd.

I am reading and taking notes on the HTML specifications for 100 days as part of #The100DayProject. Read the initial intent/backstory. I am a Microsoft employee but all opinions, comments, etc on this site are my own. I do not speak on behalf of my employer, and thus no comments should be taken as representative of Microsoft’s official opinion of the spec. Subsections not listed below were read without comment.

UAs = user agents = browsers, etc.

Continuing to read in 4.7.10 Media elements

The resource fetch algorithm

Assumes an absolute URL has been provided by the resource selection algorithm.

Like the resource selection algorithm, this is also a long one, so here’s just some brief hmm-interesting notes:

  • There’s a set of substeps to the algorithm to allow UAs to implement preload=“none” (wait until user explicitly requests media resource).
  • UAs can throttle data downloads, as well as allow users to block or slow those downloads. If the user blocks the download, the UA has to treat it as stalled, as opposed to a scorched-earth closed connection.
  • UAs can choose whether or not to download more content at any given time. Use cases include long buffering times, waiting on user input, or when the user navigates away from the page containing the media element. If the UA chooses to suspend the download they fire an event called, well, suspend. The spec reminds us that the preload attribute the author set on the media element is a hint as to what might be an appropriate buffering time for the file; that can help inform the UA’s decision.
  • “The user agent may use whatever means necessary to fetch the resource”. Now THERE’S a thrilling action flick.
  • “This specification does not currently say whether or how to check the MIME types of the media resources, or whether or how to perform file type sniffing using the actual file data.” It’s interesting to see a spot in the spec where no guidance is given because everyone is doing it differently and can’t agree on how to proceed. I assume there’s more areas like this than are called out, but this one is a big one.

More on this algorithm tomorrow.