Intent to Implement and Ship: preload metadata on cellular connections

65 views
Skip to first unread message

Mounir Lamouri

unread,
Nov 1, 2016, 1:56:02 PM11/1/16
to blin...@chromium.org
Contact emails

Spec
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.

Motivation
Metadata represents a low amount of data and can improve the user experience significantly (the video has the right size with the first frame showing up). Some web pages sometime will have behaviour triggered by loading events that will or will not happen depending on the effective preload behaviour.

Interoperability risk
Firefox: Shipped
Edge: No public signals (not sure what they do on mobile)
Safari: Shipped
Web developers: No signals

Compatibility risk
None.

Ongoing technical constraints
None.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Really mostly apply to Android but the code isn't Android specific.

OWP launch tracking bug

Link to entry on the Chrome Platform Status

Requesting approval to ship?
Yes.

-- Mounir

Chris Harrelson

unread,
Nov 1, 2016, 9:08:48 PM11/1/16
to Mounir Lamouri, blink-dev
Hi, some comments below.

On Tue, Nov 1, 2016 at 10:55 AM, Mounir Lamouri <mou...@lamouri.fr> wrote:
Contact emails

Spec
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?


Motivation
Metadata represents a low amount of data and can improve the user experience significantly (the video has the right size with the first frame showing up). Some web pages sometime will have behaviour triggered by loading events that will or will not happen depending on the effective preload behaviour.

Interoperability risk
Firefox: Shipped
Edge: No public signals (not sure what they do on mobile)
Safari: Shipped
Web developers: No signals

Compatibility risk
None.

Ongoing technical constraints
None.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Really mostly apply to Android but the code isn't Android specific.

OWP launch tracking bug

Link to entry on the Chrome Platform Status

Requesting approval to ship?
Yes.

-- Mounir

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Mounir Lamouri

unread,
Nov 2, 2016, 10:42:33 AM11/2/16
to Chris Harrelson, blink-dev
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

Chris Harrelson

unread,
Nov 2, 2016, 12:48:11 PM11/2/16
to Mounir Lamouri, blink-dev
If data saver is on and the developer requested a preload value *other than* 'none', will Android report 'none'? IOW, will the preload behavior exposed to script always be accurate?

Mounir Lamouri

unread,
Nov 2, 2016, 7:13:59 PM11/2/16
to Chris Harrelson, blink-dev
Yes.

-- Mounir

Chris Harrelson

unread,
Nov 2, 2016, 8:42:04 PM11/2/16
to Mounir Lamouri, blink-dev
Cool.

LGTM1!

Yes.

-- Mounir

Philip Jägenstedt

unread,
Nov 3, 2016, 12:42:00 PM11/3/16
to Chris Harrelson, Mounir Lamouri, blink-dev
LGTM2

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Dimitri

unread,
Nov 9, 2016, 11:32:24 AM11/9/16
to blink-dev, chri...@chromium.org, mou...@lamouri.fr
LGTM3.
Reply all
Reply to author
Forward
0 new messages