On Wed, 19 Jan 2011 17:14:23 +0100, Zachary Ozer <[email protected]>
wrote:
Two ideas just struck me:
== Network API calls ==
What if, instead of trying to solve this problem, we leave it up to
the publishers. The current behavior would be unchanged, but we could
add explicit bandwidth management API calls, ie startBuffer() and
stopBuffer(). This would let developers / site publishers control how
much to buffer and when.
If we want to support this behavior, we already have the API that does
this:
startBuffer() => preload = "auto"
stopBuffer() => preload = "metadata" (or "none", once playing the are
synonymous)
To be clear, my intentions with dynamically changing preload states is to
only ever go from lower to higher states, where the states are:
none < metadata < invoked < auto
(Invoked is the state after the video has begun playing.)
I've tried to imagine a use case for going back from auto to invoked, but
all I can think of is toggling it back and forth in an attempt to patch
over broken buffering heuristics in browsers. If the buffering heuristics
are broken, I'd rather fix them or provide authors with a way to give
additional relevant hints, like maybe downloadBufferTarget, some soft
min/max buffer limits, etc.
However, at the moment it's not entirely clear what the problem we're
trying to solve is. Maybe after more browsers have implemented the various
preload states and some kind of conservative buffering heuristics it'll be
clearer, or there won't be a problem at all.
== User Behavior ==
We might also consider leaning on users a bit to tell us what they
want. For example, I think people are pretty used to hitting play and
then pause to buffer until the end of the video. What if we just used
our bandwidth heuristics while in the play state, and buffered blindly
when a pause occurs less than X seconds into a video? I won't argue
that this is a wonderful solution (or a habit we should encourage),
but I figured I'd throw a random idea out there…
This is in fact exactly what Chrome does, and what I called "Cause an
invoked but paused video to behave like preload=auto".
--
Philip Jägenstedt
Core Developer
Opera Software