w3ctag / design-reviews

W3C specs and API reviews
Creative Commons Zero v1.0 Universal
322 stars 55 forks source link

Autoplay Policy Detection API #810

Closed alastor0325 closed 1 year ago

alastor0325 commented 1 year ago

Wotcher TAG!

I'm requesting a TAG review of Autoplay Policy Detection API.

Most user agents have their own mechanisms to block autoplaying media, and those mechanisms are implementation-specific. Web developers need to have a way to detect if autoplaying media is allowed or not in order to make actions, such as selecting alternate content or improving the user experience while media is not allowed to autoplay. For instance, if a user agent only blocks audible autoplay, then web developers can replace audible media with inaudible media to keep media playing, instead of showing a blocked media which looks like a still image to users. If the user agent does not allow any autoplay media, then web developers could stop loading media resources and related tasks to save the bandwidth and CPU usage for users.

Further details:

You should also know that this API was already implemented in Firefox, which is currently only enabled on Nightly channel and haven't been pushed on the Release channel yet. Safari and Chrome expressed the interest during the past discussions but haven't express an explicit timeline when they would start prototyping this spec.

We'd prefer the TAG provide feedback as (please delete all but the desired option):

🐛 open issues in our GitHub repo for each point of feedback

rhiaro commented 1 year ago

@leaverou @cynthia and I reviewed this in our virtual face-to-face breakout today. We agreed that this will be a beneficial addition to the web platform, and delighted to see that there are multiple implementers interested.

We recall that in the past there was a disagreement about whether this API should be sync or async. Could you share how that was resolved in the end, or if there are any outstanding issues related to this?

We appreciate the quality of your explainer, and may add it to our list of examples of exemplary explainers. Thanks for the review request, and we look forward to seeing how you proceed with this work.

chrisn commented 1 year ago

Thank you @rhiaro @LeaVerou @cynthia for your review and positive feedback. Speaking as Media WG chair, the WG took on board at the time the TAG advice in https://github.com/w3ctag/design-reviews/issues/439#issuecomment-561902607 that a sync API is preferred. This is reflected in the current draft spec.