content icon indicating copy to clipboard operation
content copied to clipboard

feat: improvements to page viz API page, add see also to related docs

Open bsmth opened this issue 1 year ago • 1 comments
trafficstars

Description

Follow-up to https://github.com/mdn/content/pull/33177 where I added some checks that are not necessary. I over-complicated the "pause on page hide" audio examples, so we can simplify it and get rid of some other cases where we do:

  • pause media on page hide
  • play on page visible

So that there's a check if the user started media first.

changes:

  • simplify "Pausing audio on page hide" example
  • modify other examples using this pattern

additions:

  • See also for Page Viz API in some related pages

removals:

  • prerendered and unloaded are long-gone from the spec, so I'm removing a reference saying "A page wants to detect when it is being prerendered"

Motivation

We can avoid propagating examples that autoplay media unless there's user interaction on some level.

Related issues and pull requests

  • [x] https://github.com/mdn/content/pull/33177

bsmth avatar May 07 '24 15:05 bsmth

Thank you!

bsmth avatar May 08 '24 16:05 bsmth