HTML5 Video Element — Alternative Text - Stack Overflow
Có thể bạn quan tâm
-
- Home
- Questions
- Tags
- Users
- Companies
- Labs
- Jobs
- Discussions
- Collectives
-
Communities for your favorite technologies. Explore all Collectives
- Teams
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Try Teams for free Explore Teams - Teams
-
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 CollectivesTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsGet 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 13Unlike 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 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
2 Answers
Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 3As 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 6,0309 gold badges51 silver badges71 bronze badges answered Aug 27, 2020 at 10:38 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
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 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
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 discardedSign up or log in
Sign up using Google Sign up using Email and Password SubmitPost as a guest
Name EmailRequired, but never shown
Post Your Answer DiscardBy 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
Related
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 VideoHot Network Questions
- Why does MS-DOS 6.22 boot so slowly?
- How to do the opposite of shift in zsh?
- How does FM preemphasis interact with maximum deviation?
- Algebraic equation to represent a triangle.
- How many hours of daylight can a planet in an elliptical orbit receive?
- Recreating lab integrator result in LTspice simulation
- Mama’s cookies too dry to bake
- Format of solution to AMM problem
- What is the origin of "litera" versus "littera"?
- What happened to 1T-SRAM?
- Poincaré and the principle of induction
- Closed form of function from recursive definition
- What use is SPF for email security in a cloud / SAAS world
- Is it necessary to report a researcher if you are sure of academic misconduct?
- What bladed melee weapon would be best suited for a warrior in zero-gravity?
- Helping daughter with taxes - How do I report some freelance work for her?
- Varying output from single file
- Would a thermometer calibrated for water also be accurate for measuring the air temperature (or vice versa)?
- Movie about dirty federal agents
- How do I recreate these shooting stars?
- Preventing icing in below zero conditions during taxiing
- Advice for creating a clean table with tabularray
- Why don't bicycles have the rear sprocket OUTSIDE of the frame spacing? (Single speed)
- What Battery Powered Part Is This?
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
lang-htmlTừ khóa » Html5 Video Alt Text
-
Can We Use An Alt Attribute With The Video Tag? - Codecademy Forums
-
Media Alt Technologies - HTML Accessibility Task Force Wiki
-
Optimizing For Accessibility: Alt Text, Videos, Images & More - Moz
-
HTML Alt Attribute - W3Schools
-
The Video Embed Element - HTML: HyperText Markup Language
-
Alt Content For Html5 Video Tag Sucks - HTML & CSS - SitePoint Forums
-
Why Is There No Alt Attribute Associated With The Poster ... - GitHub
-
HTML Img Alt Tags For SEO Best Practice - Search Engines Love ...
-
Image ALT Tag Tips For HTML - Accessibility At Penn State
-
HTML5 Video Tag » The Definitive Guide [2022] | Bitmovin
-
Adding A Video Alt Tag - YouTube
-
Use Alt Attributes Appropriately On All Images | UCOP
-
Image Alternative Text - Directive Consulting
-
HTML | Alt Attribute - GeeksforGeeks