useMediaCaption
此内容尚不支持你的语言。
Diagnostic Category: lint/a11y/useMediaCaption
Since: v1.0.0
Sources:
- Same as:
jsx-a11y/media-has-caption
Enforces that audio
and video
elements must have a track
for captions.
Examples
Section titled ExamplesInvalid
Section titled Invalidcode-block.jsx:1:2 lint/a11y/useMediaCaption ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Provide a track for captions when using audio or video elements.
> 1 │ <video />
│ ^^^^^^^^^
2 │
ℹ Captions support users with hearing-impairments. They should be a transcription or translation of the dialogue, sound effects, musical cues, and other relevant audio information.
code-block.jsx:1:2 lint/a11y/useMediaCaption ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Provide a track for captions when using audio or video elements.
> 1 │ <audio>child</audio>
│ ^^^^^^^^^^^^^^^^^^^^
2 │
ℹ Captions support users with hearing-impairments. They should be a transcription or translation of the dialogue, sound effects, musical cues, and other relevant audio information.