gpt4 book ai didi

reactjs - a11y : What is the correct `` element for video chats?

转载 作者:行者123 更新时间:2023-12-04 01:35:49 26 4
gpt4 key购买 nike

我正在用 React 构建一个视频聊天应用程序。

当我使用 <video /> 时元素我ESLint plugin for writing accessible UI对我大喊 <track />缺少元素。

代码:

function Video({ autoPlay, playsInline, videoEl }) {
return <video autoPlay={autoPlay} playsInline={playsInline} ref={videoEl} />;
}

警告:
error  Media elements such as <audio> and <video> must have a <track> for captions  jsx-a11y/media-has-caption 

我查了之后 <track />它似乎期待一个 src属性与 .vtt文件。但是在视频聊天中,没有字幕。使视频聊天的 HTML 可访问的最容易访问的方法是什么?

最佳答案

然后您可以完全忽略此消息

这是指 WCAG 指南:Understanding Success Criterion 1.2.4: Captions (Live)

该指南特别指出:

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.

关于reactjs - a11y : What is the correct `<track>` element for video chats?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59610417/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com