HTML5 Video Element — Alternative Text - Stack Overflow

    1. Home
    2. Questions
    3. Tags
    4. Users
    5. Companies
    6. Labs
    7. Jobs
    8. Discussions
    9. Collectives
    10. Communities for your favorite technologies. Explore all Collectives

  1. Teams

    Ask questions, find answers and collaborate at work with Stack Overflow for Teams.

    Try Teams for free Explore Teams
  2. Teams
  3. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Get early access and see previews of new features.

Learn more about Labs HTML5 video element — alternative text Ask Question Asked 9 years, 4 months ago Modified 1 month ago Viewed 18k times 13

Unlike the img element, the video element doesn’t include an alt attribute for missing or inaccessible content. It seems to me that video is more likely to cause loading or accessibility problems than the humble image.

The note in the W3C Document Doesn’t make make clear a simple alternative.

Is there a recommended procedure for providing a suitable alternative text, or, say a link to a transcript?

Share Improve this question Follow asked Aug 20, 2015 at 22:08 Manngo's user avatar ManngoManngo 16.2k13 gold badges102 silver badges142 bronze badges 1
  • 1 have you looked at adding ARIA attributes to the content, and using javascript handlers to trap any loading errors – Offbeatmammal Commented Aug 21, 2015 at 1:47
Add a comment |

2 Answers 2

Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 3

As you pointed out, the tag <video> doesn't have an alt attribute.

I have two ideas to satisfy at least in part this need.

1) Adding a paragraph inside the <video> tag

<video> <source src="my-video-path.mp4" type="video/mp4"> <p>Description of the video...</p> </video>

2) Adding schema data

<video itemscope itemtype="http://schema.org/VideoObject"> <source src="my-video-path.mp4" type="video/mp4"> <meta itemprop="name" content="Name of the video"> <meta itemprop="description" content="Description of the video..."> <meta itemprop="duration" content="PT1M33S"> <meta itemprop="thumbnail" content="my-video-thumbnail-path.jpg"> </video> Share Improve this answer Follow edited Jan 17, 2024 at 9:39 ixany's user avatar ixany 6,0309 gold badges51 silver badges71 bronze badges answered Aug 27, 2020 at 10:38 Marco Panichi's user avatar Marco PanichiMarco Panichi 1,1871 gold badge20 silver badges31 bronze badges 1
  • 9 Any non-<source> and non-<track> content inside the <video> tag should only be a replacement for the video and not supplemental to it — it’s only intended for browsers that don’t support the video element. (kindof like <noscript>.) The spec even says “this content is not intended to address accessibility concerns.” – chharvey Commented May 25, 2023 at 21:03
Add a comment | 2

We can use ARIA attributes for accessibility on audio and video elements:

  • aria-label can serve in place of the alt attribute
  • aria-details can give the ID of an element holding the transcript, or the ID of a link to the transcript, or whatever other details you might have

Example:

<video controls src="/developers.mp4" aria-label="Steve Ballmer Going Crazy on Stage" aria-details="developers-transcript-link"> </video> <a id="developers-transcript-link" href="/developers-transcript.html">Transcript</a> Share Improve this answer Follow answered Dec 4, 2024 at 12:09 Sam Watkins's user avatar Sam WatkinsSam Watkins 8,2803 gold badges43 silver badges41 bronze badges 1
  • Thanks for this, do you happen to have any sources on whether this is considered a best practice to make videos accessible for blind or vision-impaired users? (I guess that there would also need to be a VTT track for deaf users.) It's surprisingly hard to find legible resources on this. – Robin Métral Commented Dec 20, 2024 at 6:38
Add a comment |

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid …

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Draft saved Draft discarded

Sign up or log in

Sign up using Google Sign up using Email and Password Submit

Post as a guest

Name Email

Required, but never shown

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.

  • The Overflow Blog
  • Developers want more, more, more: the 2024 results from Stack Overflow’s...
  • How AI apps are like Google Search
  • Featured on Meta
  • The December 2024 Community Asks Sprint has been moved to March 2025 (and...
  • Stack Overflow Jobs is expanding to more countries
2 HTML 5 Video Tag 1 Dynamic Text in HTML5 Video 9 HTML5 video: possible to place regular html content over video 2 video tag of html5 1 html 5 video element 0 Video element in HTML5 41 Add text above HTML5 Video 0 Video element in JavaScript 3 Add text to play button in Video.js 0 H1 Text Above HTML5 Video

Hot Network Questions

  • How many hours of daylight can a planet in an elliptical orbit receive?
  • Are NASA computers really that powerful?
  • QGIS labeling: Why do we need a primary key for the auxiliary storage?
  • Poincaré and the principle of induction
  • Why didn't Kafka use quotation marks in this dialogue?
  • LGPL-like license for 3D models
  • Varying output from single file
  • Can game companies detect pirated games and sue if the user obtained the games using legitimate ways in other platforms?
  • Closed form of function from recursive definition
  • Is it possible to discover a "Universal formula" that generates and generalizes all odd Collatz numbers?
  • On iOS, can i move or copy a file from "Notes"to "Files"?
  • Are informal nominee arrangements legal?
  • How to block all traffic on a Mac when “sshuttle” isn't running?
  • Why did the golden eagle attack Dirk Gently?
  • Why do we define the standard error to ignore bias (unlike MSE which includes bias)?
  • What is the precise meaning of signal and noise in finance
  • Working in another country by Nomad Visa while holding Germany Blue Card
  • How to model a stone sauna stove for game asset?
  • Correspondence of ancient 天关 in western astronomy
  • Recreating lab integrator result in LTspice simulation
  • Does gravity from a star go through a black hole's event horizon to affect objects on the other side?
  • Levelling mechanism for work table, how do I wire 4 linear actuators to operate independently?
  • Why does the engine prefer a5 (pass pawn) over axb5 (pass pawn+win a pawn)?
  • Extrapolate data to a straight line
more hot questions Question feed Subscribe to RSS Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

lang-html

Từ khóa » Html5 Video Alt Attribute