W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2010

[whatwg] HTML5 video <source> dimensions and bitrate

From: Chris Double <chris.double@double.co.nz>
Date: Tue, 10 Aug 2010 12:23:35 +1200
Message-ID: <AANLkTikFYHPCx+mQ1SWpMkML8w3D9hyW43ZztTB=f2Vf@mail.gmail.com>
On Tue, Aug 10, 2010 at 11:00 AM, Zachary Ozer <zach at longtailvideo.com> wrote:
> As a result, I was wondering if there's some way to attach metadata
> like the dimensions and bitrate to <source> elements of
> HTMLMediaElements in the DOM. I realize that we could wait for
> metadata to arrive for each source, but it would be nice if it was
> possible to make an intelligent choice before attempting to play all
> of them.

You don't get metadata for each source, you only get the metadata for
the source that is actually selected to play. I don't think listing
video's which are only different due to bitrate in the source as being
a good approach since most players will iterate through all sources
trying to play them. So if you have 5 '.ogg' videos first in the
source list, different only by bitrate, a non-ogg player is going to
check each of those, possibly sniffing them and causing network

Since your player is already JavaScript is having a JS object holding
the URL, dimensions and bitrate not an option? Or you could have a
seperate file that is retrieved via XMLHttpRequest that is parsed to
extract these details and dynamically adjust 'source' elements after

How are you working out the current playback rate to decide when to
switch to a different bitrate version? Is having an attribute of the
media element that contains this information useful?

Received on Monday, 9 August 2010 17:23:35 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:26 UTC