Section vs. custom HTML
Prefer theme sections for YouTube/Vimeo embeds. Use custom HTML when your provider or layout isn’t supported.
Keep third‑party scripts to a minimum to avoid blocking rendering.
Responsive and accessible
Maintain aspect ratio with CSS wrappers, provide captions/transcripts, and ensure keyboard controls work.
Follow WCAG guidance on media alternatives.
Refs: Captions.
Lazy loading and previews
Defer iframes until interaction, use lightweight preview thumbnails, and measure CLS to prevent layout shift.
Guide: Lazy loading.
Hosting choices
Use YouTube/Vimeo for distribution and analytics; self‑hosted MP4 for full control. Balance branding needs with speed.
Docs: YouTube player params.
Frequently Asked Questions
Can I autoplay video?
Autoplay is often blocked and can harm UX; prefer click‑to‑play.
Best video format?
Use streaming providers or compressed MP4 with optimized bitrates.