[html5] Autoplay and preload insufficient for proper video playback.
Eric Carlson
eric.carlson at apple.com
Wed Aug 25 21:58:58 PDT 2010
On Aug 25, 2010, at 6:06 PM, Herman Hassel wrote:
> On 24.08.2010 01:17, Ian Hickson wrote:
>> On Wed, 30 Jun 2010, Herman Hassel wrote:
>>> I keep finding the media attributes "preload" and "autoplay"
>>> insufficient for video playback.
>> Before considering proposed alternatives, could you elaborate on how
>> "preload" is insufficient? (It's impossible for me to evaluate how the
>> proposed alternatives are better without knowing how the existing
>> solutions are bad!)
> Sure! At the moment I need to set preload to "none" or "metadata". Often we do use more than one video or audio element on the same page, and we do want the initial load of each page to be as low as possible. We do have some visitors with low bandwidth, or people who use their phones and are charged by their ISP by the MB. If we had only high bandwidth users and few elements on a page, we'd just use auto. We don't limit our media files to ranges or anything like that, we just want our users to have the best possible experience viewing the videos provided on the websites we make.
>
> Whenever an end user starts a video or audio element that hasn't been preloaded, and the end user doesn't have good enough bandwidth to match the progressive download of the video file, we tend to get very stuttered and broken video for the first seconds, until either the speed of the stream picks up or the end users pause the playback themselves and wait for it to buffer up a bit. Now with audio this isn't such a big issue since the KB/s rate of audio files is so much smaller, but it's very noticeable with video.
>
> I can also imagine scenarios where autoplay is set to "on" but the end user has low bandwidth, or scenarios where preload is set to "auto" but the end user clicks the play button too fast for the file to load. (yes, some of our end users are ninja's!)
> We had the same issue with the experience of progressively downloaded media years ago, when I first started our early experiments with flash video (before every user had broadband), that was until we set the buffer attribute in flash, which fixed the whole issue.
>
A static attribute that specifies a minimum buffer size or duration will only help users with exactly the bandwidth the for the attribute value - anyone with less bandwidth will still run out of data, and anyone with more bandwidth will have to wait longer than necessary.
> It's in the few starting seconds of cases like this that the end user experience would be enhanced by us having a buffer attribute in our toolbox. We need to make sure a few seconds of a media file always gets loaded before any actual playback begins. The buffer attribute wouldn't break anything already in place, it would only enhance the attributes already existing. :)
>
If you want to prevent users from starting playback too early, use a custom controller and wait for the 'canplaythrough' event. It is fired when the UA estimates that the amount of time it takes to play the movie is less than the time it will take to download the rest of the movie. How can a static attribute be more accurate than this?
eric
More information about the Help
mailing list