Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve autoplay for videos outside initial viewport #1590

Closed
swissspidy opened this issue Oct 15, 2024 · 2 comments · Fixed by #1596
Closed

Improve autoplay for videos outside initial viewport #1590

swissspidy opened this issue Oct 15, 2024 · 2 comments · Fixed by #1596
Assignees
Labels
[Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@swissspidy
Copy link
Member

swissspidy commented Oct 15, 2024

This is a follow-up to #1498 / #1183

autoplay takes precedence over preload. When we know that a video is not in the initial viewport, we could remove autoplay in favor of an IntersectionObserver-based implementation that only autoplays the video when actually visible.

Related to #1035 which involves IntersectionObserver to lazy-load background images.

@swissspidy swissspidy added [Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature labels Oct 15, 2024
@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Oct 15, 2024
@westonruter
Copy link
Member

Also related, we can lazy-load the poster image when video enters the viewport: #1591.

@westonruter
Copy link
Member

westonruter commented Oct 15, 2024

Conversely, as I've noted now in the description of #1592:

When a video is in all initial viewports, it should probably get preload=auto especially when it is the LCP element. It may even make sense to add fetchpriority=high preload links when it is the LCP element, particularly when the video has autoplay.

@swissspidy swissspidy self-assigned this Oct 16, 2024
@swissspidy swissspidy moved this from Not Started/Backlog 📆 to Code Review 👀 in WP Performance 2024 Oct 16, 2024
@westonruter westonruter added this to the image-prioritizer n.e.x.t milestone Oct 18, 2024
@github-project-automation github-project-automation bot moved this from Code Review 👀 to Done 😃 in WP Performance 2024 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Status: Done 😃
Development

Successfully merging a pull request may close this issue.

2 participants