You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature]: Add video captions validation check for core/video block #30
Currently, the "Core block accessibility rules" module validates several core blocks (core/image, core/button, core/table, core/heading, core/gallery), but lacks any accessibility validation for core/video.
According to WCAG 2.1 Success Criterion 1.2.2 (Captions - Prerecorded - Level A), prerecorded video content with audio must provide captions or subtitles for deaf or hard-of-hearing users. When content authors embed or upload videos into WordPress posts without text tracks, users who rely on assistive caption tracks are unable to comprehend the dialogue and critical audio information.
Describe the solution you'd like
Add a check_video_tracks validation check for the core/video block in the Core block accessibility rules module:
Starting Level:warning (advisory, to encourage accessibility best practices without hard-blocking publication on silent videos or background clips; administrators can elevate it to error via the Validation Settings admin screen if desired).
Behavior:
If a video block has a media source attached (src or id) but contains no caption or subtitle tracks (tracks), flag an advisory warning: "Consider adding captions or subtitles to this video."
If the block is unconfigured (empty placeholder without media), do not trigger false-positive warnings.
Once a caption or subtitle track (kind === 'captions' or kind === 'subtitles') is added, the warning automatically clears.
Describe alternatives you've considered
Defaulting to error level: Videos without audio (e.g., silent demo clips) do not strictly require captions under WCAG 1.2.2. Setting the default severity to warning encourages authors to add captions without blocking publishing.
Autoplay muting rule: Considered adding an autoplay/muted check, but Gutenberg's core Video block already automatically enforces muted: true whenever autoplay is enabled, making that rule redundant.
Checklist
I have searched existing issues to make sure this isn't a duplicate.
Activity
Add video captions validation check for core/video block