Space Lightplay

Description

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.
  • Play button styling — control size, shape (circle, rounded, square), background color, icon color, and hover states using the native WordPress color picker with full theme palette support.
  • 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, visible focus indicators, and prefers-reduced-motion support.
  • Noscript fallback — visitors without JavaScript get a direct link to the YouTube video.
  • Responsive — 16:9 aspect ratio that 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.

Screenshots

Blocks

This plugin provides 1 block.

  • Space Lightplay Lightweight video embed with custom preview and configurable Play button. Loads iframe only on click.

Installation

  1. Upload the space-lightplay folder to /wp-content/plugins/.
  2. Activate the plugin through the “Plugins” menu in WordPress.
  3. In the block editor, search for “Space Lightplay” and add it to your post or page.
  4. Paste a YouTube video URL or ID — done. Optionally tweak the Play button in the sidebar.

FAQ

Does Space Lightplay load any scripts before the visitor clicks Play?

No. Before the click, only a static preview image and a small CSS file are loaded. The iframe, along with all associated scripts from YouTube, is injected only after the visitor presses Play.

Can I use my own preview image instead of the automatic thumbnail?

Yes. In the block sidebar under “Video”, click “Upload preview image” and select any image from your Media Library. To revert to the automatic thumbnail, click “Remove”.

Does the block work with the Full Site Editor?

Yes. Space Lightplay is a standard Gutenberg block and works in the post editor, the site editor, and any context that supports WordPress blocks.

Will removing Space Lightplay leave anything in my database?

No. Space Lightplay does not create any options, custom tables, or transients. Deactivating and deleting the plugin leaves your database clean.

Why does the Play button look oval on my theme?

This was a known issue in earlier development. The current version uses aspect-ratio: 1 and flex-shrink: 0 to guarantee a perfect circle regardless of your theme’s CSS.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Space Lightplay” is open source software. The following people have contributed to this plugin.

Contributors

Translate “Space Lightplay” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.0.0

  • Initial release.