diff --git a/.github/scripts/check-video-accessibility.py b/.github/scripts/check-video-accessibility.py new file mode 100755 index 00000000..813d159a --- /dev/null +++ b/.github/scripts/check-video-accessibility.py @@ -0,0 +1,282 @@ +#!/usr/bin/env python3 + +""" +Video Accessibility Checker for Jupyter Book HTML + +This script scans built HTML files (typically in _build/html) +and flags accessibility issues related to video embeds. + +Why this exists: +Automated tools like axe-core do not reliably detect: +- Missing iframe titles +- Poor iframe labeling +- Missing transcripts near videos +- Platform-based caption issues (YouTube, YuJa, Kaltura, etc.) +- Autoplay and hidden control risks + +This script supplements those gaps. + +What it checks: +1. Iframe embeds (YouTube, Vimeo, etc.) + - Missing title or aria-label (WCAG 4.1.2) + - Generic titles like "video" + - Autoplay usage (WCAG 2.2.2) + - Hidden controls (WCAG 2.1.1) + - Missing nearby transcript/caption indicators (WCAG 1.2.x) + +2. Native