Space Lightplay
Every embedded YouTube video adds weight to your page — external scripts, iframes, tracking pixels — even if the visitor never presses Play. Space Lightplay fixes that.
Drop the block into any post or page, paste a YouTube video URL, and Space Lightplay renders a static preview image with a customizable Play button. The actual iframe is injected only when the visitor clicks. No JavaScript frameworks, no third-party requests until interaction.
Why it matters:
- Pages with 3–5 embedded videos can save 2–4 MB of initial page weight and dozens of network requests.
- Largest Contentful Paint (LCP) and Time to Interactive (TTI) improve because heavy iframes no longer block rendering.
- Privacy improves too — no cookies or tracking scripts load until the visitor explicitly chooses to play.
What you get:
- One block, one job — lazy-load YouTube video embeds with zero configuration required.
- Custom poster image — upload any image from the Media Library or use the automatic YouTube thumbnail.
- Aspect ratio control — 16:9, 4:3, 1:1, 9:16 (vertical/Shorts), or 21:9 cinematic.
- Start time — set a starting timecode, or paste a YouTube URL with ?t=… and it fills automatically.
- Above-the-fold mode — disables lazy-load on the preview image for hero videos, improving LCP.
- Hover prefetch — opens connections to YouTube the instant the cursor lands on the block, so the iframe loads noticeably faster on click. No extra config.
- Play button styling — control size, button shape (circle, rounded, square), triangle corner roundness, background color, icon color, and hover states using the native WordPress color picker with full theme palette support.
- Block style variations — Minimal, Bold, and Glass presets in one click.
- Pulse animation — optional hover effect to draw attention to the Play button.
- Thumbnail quality — choose between standard and maximum resolution thumbnails.
- Accessible by default — full keyboard navigation, ARIA attributes, optional descriptive title for screen readers, visible focus indicators, RTL support, and prefers-reduced-motion support.
- Noscript fallback — visitors without JavaScript get a direct link to the YouTube video (with timecode preserved).
- Responsive — chosen aspect ratio adapts to any container width.
- Clean uninstall — removing the plugin leaves no options, transients, or database entries behind.
For developers:
Space Lightplay uses register_block_type_from_metadata() with a standard block.json manifest. All assets are declared in block.json and enqueued automatically by WordPress. The plugin adds zero global hooks, filters, admin pages, or database entries. Output is a server-rendered block via render.php.
