Motion Blocks

Showcase

Video Player

Custom video player with play/pause, a hover-expanding scrubber, mute, and Flip fullscreen expand animation.

  • lit Preview of https://lit.devLitSimple. Fast. Web Components.
  • gsap Preview of https://gsap.comGSAPAnimate anything. Silky-smooth performance.

Preview

Hover to reveal controls. Click the expand icon to fullscreen via GSAP Flip layout animation.

Installation

pnpm dlx motion-blocks add video-player

Usage

---import "@/components/motion-blocks/video-player-element.ts";--- <motion-video-player  src="https://example.com/video.mp4"  poster="https://example.com/poster.jpg"  class="aspect-video w-full max-w-2xl rounded-xl overflow-hidden"></motion-video-player>

API Reference

Attribute Type Default
src URL of the video file to play. string ""
poster URL of the poster image to display before playback. string ""
autoplay Whether to start playing automatically. boolean false
muted Whether the video starts muted. boolean true
loop Whether to loop the video when it ends. boolean false
hide-controls Whether to hide all controls (play/pause, scrubber, etc.). boolean false