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

video_tag fallback image missing alt attribute #1720

Open
bigskillet opened this issue Jun 13, 2023 · 7 comments
Open

video_tag fallback image missing alt attribute #1720

bigskillet opened this issue Jun 13, 2023 · 7 comments

Comments

@bigskillet
Copy link

video_tag fallback image missing alt attribute and triggering Lighthouse accessibility error:
https://shopify.dev/docs/api/liquid/filters/video_tag

image

@bigskillet
Copy link
Author

...and why is there an image tag inside the video tag anyways? It doesn't render on any browsers if the poster is empty. Is it necessary and/or semantic?

@ryanm-bw
Copy link

@Shopify could we please get this one actioned? It should be a simple change and is then consistent with img_tag, as well as complying with Lighthouse.

@PreranaSunbowl
Copy link

Can this be fixed pelase?

@anthony-spain
Copy link

Found this while doing an ADA audit today, still an ongoing issue.

@mcvmel
Copy link

mcvmel commented Aug 29, 2024

Ran into this as well recently. This may depend on your theme, but after uploading the video in the theme customizer, you can click on the video thumbnail and a black overlay will appear. In that screen there is a space for alt text. This fixed my issue.

@andrewhawkes
Copy link

This is still an issue. Ideally is should be possible to pass an empty alt value or custom.

@0x15f
Copy link

0x15f commented Oct 21, 2024

+1

In Lighthouse 12.2.0 when the video is below the fold the <img /> gets flagged as an eagerly loaded offscreen image. It also lacks an alt. The video spec mentions nothing on the inclusion of an <img /> inside of <video />

The spec for video poster in Liquid either needs to be fixed or expanded to allow us to:

  • Remove it.
  • Specify an alt tag.
  • Specify media queries for poster.

This is not the way 👇

{% capture video_elem %}
  {{ video | video_tag: playsinline: '', muted: '', loop: '' }}
{% endcapture %}

{% if section.index < 2 %}
  {% comment %} make poster lazy {% endcomment %}
  {% assign video_elem = video_elem | replace: '<img', '<img loading="lazy"'  %}
{% endif %}

{{ video_elem }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants