英文:
a11y: What is the correct `<track>` element for video chats?
问题
我正在使用React构建一个视频聊天应用程序。
当我使用<video />
元素时,我的用于编写可访问UI的ESLint插件会警告我缺少一个<track />
元素。
代码:
function Video({ autoPlay, playsInline, videoEl }) {
return <video autoPlay={autoPlay} playsInline={playsInline} ref={videoEl} />;
}
警告:
error 媒体元素,如<音频>和<视频>,必须具有<track>以显示字幕 jsx-a11y/media-has-caption
在查找了<track />
之后,似乎它期望具有.vtt
文件的src
属性。但在视频聊天中,没有字幕。在使视频聊天的HTML可访问性最高的方式是什么?
英文:
I'm building a video chat app with React.
When I'm using the <video />
element my ESLint plugin for writing accessible UI yells at me that a <track />
element is missing.
Code:
function Video({ autoPlay, playsInline, videoEl }) {
return <video autoPlay={autoPlay} playsInline={playsInline} ref={videoEl} />;
}
Warning:
error Media elements such as <audio> and <video> must have a <track> for captions jsx-a11y/media-has-caption
After I looked up <track />
it seems to expect a src
attribute with .vtt
file. But in a video chat, there are no captions. What would be the most accessible way to make a video chat's HTML accessible?
答案1
得分: 5
你可以完全忽略这条消息。
这涉及到WCAG准则:理解成功标准1.2.4:字幕(实时)
该准则明确规定:
此成功标准旨在适用于同步媒体的广播,并不旨在要求通过Web应用程序进行的两个或多个个体之间的双向多媒体通话必须提供字幕,无论用户的需求如何。
英文:
You can then perfectly ignore this message
This refers to the WCAG Guideline : Understanding Success Criterion 1.2.4: Captions (Live)
The guideline specifically states that:
> This success criterion was intended to apply to broadcast of synchronized media and is not intended to require that two-way multimedia calls between two or more individuals through web apps must be captioned regardless of the needs of users.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论