正确的 `` 元素用于视频聊天是什么?

huangapple go评论67阅读模式
英文:

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 &lt;video /&gt; element my ESLint plugin for writing accessible UI yells at me that a &lt;track /&gt; element is missing.

Code:

function Video({ autoPlay, playsInline, videoEl }) {
  return &lt;video autoPlay={autoPlay} playsInline={playsInline} ref={videoEl} /&gt;;
}

Warning:

error  Media elements such as &lt;audio&gt; and &lt;video&gt; must have a &lt;track&gt; for captions  jsx-a11y/media-has-caption 

After I looked up &lt;track /&gt; 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.

huangapple
  • 本文由 发表于 2020年1月6日 18:27:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/59610417.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定