与元素不同img,video元素不包含alt缺失或无法访问的内容的属性。在我看来,视频比不起眼的图像更有可能导致加载或可访问性问题。
W3C 文档中的注释并未明确说明一个简单的替代方案。
\n\n是否有推荐的程序来提供合适的替代文本,或者说转录文本的链接?
\n正如您所指出的,该标签<video>没有alt属性。
我有两个想法至少可以部分满足这种需求。
<video>1)在标签内添加段落
<video>
<source src="my-video-path.mp4" type="video/mp4">
<p>Description of the video...</p>
</video>
Run Code Online (Sandbox Code Playgroud)
2)添加模式数据
<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>
Run Code Online (Sandbox Code Playgroud)