On Wed, 2 Nov 2016, at 01:08, Chris Harrelson wrote:
> Hi, some comments below.
>
> On Tue, Nov 1, 2016 at 10:55 AM, Mounir Lamouri <
mou...@lamouri.fr>
> wrote:
>
> > *Contact emails*
> >
mlam...@chromium.org
> >
> > *Spec*
> >
https://html.spec.whatwg.org/multipage/embedded-content.
> > html#attr-media-preload
> > The specification is loose with regards to the preload behaviour. The
> > attribute is merely a hint that the user agent is allowed to ignore.
> >
> > *Summary*
> > Allow preloading metadata over cellular connection unless some
> > restrictions apply such as Data Saver being enabled (already the case). We
> > will also never preload for low end devices that have stability issues when
> > media players are created (already the case). We will use this change to
> > make the autoplay behaviour more consistent with Safari iOS by allowing
> > autoplay for <video> with no audio track.
> >
>
> Could you explain in some more detail about the current behavior and how
> this differs? Also, could you explain how this manifests for the web
> developer? Is it observable from script?
At the moment, on cellular networks we never preload. In other words, we
never download any bytes of the video until the user starts the
playback. Downloading metadata is not data hungry (roughly the size of
an image) and we would not do this in the conditions stated above (incl.
data saver).
Scripts can observe this in different ways: Blink and Edge exposes the
effective preload behaviour (see HTML issue [1] to require it per spec).
On Android, Chromium will always return `none` for `preload`, with the
change, it will return `metadata` unless the website explicitly set
`preload` to `none`. In practice, that will unlikely have impact on
websites.
However, websites sometimes trip over by listening to load events to set
up their experience. For example, when they receive the `loadedmetadata`
event. If a website is tested on wifi or desktop, it will work but it
will not over a cellular network. Preloading metadata will make that
kind of mistake less common. This was advertised as one of the reason
why Safari changed this behaviour in iOS 8 [2].
HTH :)
[1]
https://github.com/whatwg/html/issues/1932
[2]
https://developer.apple.com/videos/play/wwdc2014/504/
-- Mounir