- From: Eric Carlson <eric.carlson@apple.com>
- Date: Tue, 14 Oct 2008 07:26:30 -0700
On Oct 13, 2008, at 4:47 PM, Robert O'Callahan wrote: > On Tue, Oct 14, 2008 at 12:10 PM, Ian Hickson <ian at hixie.ch> wrote: > Try to play all the videos you have available, and catch errors: > > <video id=a> > <source src="video.mp4" type="video/mp4; codecs="avc1.42E01E, > mp4a.40.2""> > <source src="video.3gp" type="video/3gpp; codecs="mp4v.20.8, > samr""> > <source src="video.ogv" type="video/ogg; codecs="theora, > vorbis""> > <source src="video.mkv" type="video/x-matroska; > codecs="theora, vorbis""> > </video> > <script> > document.getElementById('a').load(); > if (document.getElementById('a').currentSrc == "") { > // failed to find a video that would play > // do whatever fallback you want to do here > ... > } > </script> > > This will reliably work, because load() blocks until a decision about > which video to play is made. > > We may have to change this (e.g. to allow UAs to asynchronously > fetch and > try each video) > > We definitely have to change that! Having load() synchronous would > be a disaster. > I agree! A truly synchronous load() will result in a terrible user experience as a UA may need to download a significant amount of data before it knows if a file is playable. Eric
Received on Tuesday, 14 October 2008 07:26:30 UTC