Skip to content

Prioritize loading poster image of video LCP elements#1377

Closed
thelovekesh wants to merge 3 commits intotrunkfrom
feature/lcp-poster-image-prioritize
Closed

Prioritize loading poster image of video LCP elements#1377
thelovekesh wants to merge 3 commits intotrunkfrom
feature/lcp-poster-image-prioritize

Conversation

@thelovekesh
Copy link
Member

Summary

Fixes #1183

Relevant technical choices

  • Preload poster images with high-priority video LCP elements.
@github-actions
Copy link

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@thelovekesh thelovekesh added [Type] Feature A new feature within an existing module [Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) labels Jul 18, 2024
@thelovekesh thelovekesh marked this pull request as draft July 18, 2024 21:01
Comment on lines +78 to +81
$crossorigin = $processor->get_attribute( 'crossorigin' );
if ( is_string( $crossorigin ) ) {
$link_attributes['crossorigin'] = 'use-credentials' === $crossorigin ? 'use-credentials' : 'anonymous';
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@westonruter The Poster image uses the crossorigin from the video tag, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume so, yes.

@thelovekesh thelovekesh added this to the image-prioritizer n.e.x.t milestone Jul 18, 2024
);

$crossorigin = $processor->get_attribute( 'crossorigin' );
if ( is_string( $crossorigin ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of <video src="..." crossorigin> then it would actually be true. So I think what you want there is:

Suggested change
if ( is_string( $crossorigin ) ) {
if ( null !== $crossorigin ) {
@thelovekesh
Copy link
Member Author

Closing in favor of #1498. cc @westonruter

@westonruter westonruter removed this from the image-prioritizer n.e.x.t milestone Sep 20, 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) [Type] Feature A new feature within an existing module

2 participants