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

Prioritize loading poster image of video LCP elements #1377

Closed
wants to merge 3 commits into from

Conversation

thelovekesh
Copy link
Member

Summary

Fixes #1183

Relevant technical choices

  • Preload poster images with high-priority video LCP elements.

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 <[email protected]>
Co-authored-by: westonruter <[email protected]>

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prioritize loading poster image of video LCP elements
2 participants