Make WordPress Core

Opened 22 months ago

Closed 22 months ago

Last modified 22 months ago

#58434 closed enhancement (wontfix)

Use Page Visibility API to improve performance

Reported by: milindmore22's profile milindmore22 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: 2nd-opinion close
Focuses: performance Cc:

Description

The Page Visibility API is around for a while, can we utilize this to optimize WordPress Core

  1. Video - Pause the video when the screen is not visible
  2. Audio - Pause Audio when the screen is not visible
  3. Heartbeat (#55491)

Change History (3)

#1 @desrosj
22 months ago

  • Component changed from General to Media
  • Keywords 2nd-opinion close added

Since the Heartbeat API has it's own ticket, I'm only going to address the first two.

I'm not sure that it's always the desired behavior for video and audio to stop when a window is hidden, especially for audio. From personal experience, I frequently start a video or audio embed and then leave the browser to work on other things.

Marking as a close candidate but also marking for a second opinion.

#2 @jorbin
22 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I agree with @desrosj. Changing the default behavior to pause on blur would hurt the users that want to have something playing in the background. If a site owner wanted to enforce viewing, they could do that with a plugin and if a user wanted to enforce viewing on themselves, they could do it with a browser extension.

Discussion can continue with the ticket closed, but as I don't think this is a change that should be made to core, I am closing the ticket.

#3 @milindmore22
22 months ago

I agree that using PageVisibilityAPI to pause audio or video may not be ideal for every user but some users who are hosted on a basic hosting (shared hosting) where users open multiple tabs and keep draining bandwidth and resources through videos or audio can benefit from it

We can add a filter that can be used to turn on Page Visibility API optimizations ON, I would love to see this in the core but if not then this may be a great addition to the Performance Lab plugin

Note: See TracTickets for help on using tickets.