W3C home > Mailing lists > Public > w3c-wai-ua@w3.org > January to March 2011

Re: Media: Question about autoplay (video in browsers)

From: Eric Carlson <eric.carlson@apple.com>
Date: Thu, 27 Jan 2011 14:12:43 -0800
Cc: david.bolter@gmail.com, Charles McCathieNevile <chaals@opera.com>, Sean Hayes <Sean.Hayes@microsoft.com>, WAI-UA list <w3c-wai-ua@w3.org>, HTML Accessibility Task Force <public-html-a11y@w3.org>, Philip Jägenstedt <philipj@opera.com>
Message-id: <A6827E2B-4B53-4712-9E11-E9CF79B7EC89@apple.com>
To: Jim Allan <jimallan@tsbvi.edu>

On Jan 27, 2011, at 12:06 PM, Eric Carlson wrote:

> 
> On Jan 27, 2011, at 10:39 AM, Philip Jägenstedt wrote:
> 
>> 
>> Short answer: Yes, it's possible.
>> 
>> I've recently added a user preference to Opera to disable autoplay, and this should be in a not too distant release of our desktop browser. If it turns out that it's common with sites that use script to force autoplay, then it's possible to go further. Specifically, one could use the same techniques that are used for pop-up blockers to see if the play() request was from user interaction or a background script. If isn't from direct user interaction, one could ask the user to explicitly allow the media to play, perhaps remembering the choice for the site.
>> 
>> However, this kind of thing would be an opt-in setting, since we don't want to bother users with lots of dialogs by default.
> 
>  iOS devices have this restriction - playback of a <video> or <audio> element can only be triggered in response to a user gesture (like pop-up blockers). This has caused no end of bug reports because it is impossible to differentiate script originated "auto play" from playback triggered by a script after a delay, eg. 
> 
> 	onclick= "setTimeout(function(){ video.play() }, 200)"
> 
> or in response to another event, eg. to start playback after something else happens:
> 
> 	button.addEventListener('webkitAnimationEnd', function (){ video.play) }, false);
> 
>  Neither of these is a much of an edge case as you might think, I get bug reports all the time about web sites where <video> "doesn't work on the iPhone" because they use script to trigger playback.
> 
  I meant to add that one real danger with this kind of change is that many (most?) developers won't test with the setting enabled, so audio and video on their pages won't just not auto-play - it won't play at all.

eric
Received on Thursday, 27 January 2011 22:13:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 27 January 2011 22:13:19 GMT