Motion Kit

Showcase

Video Player

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

  • lit
  • gsap

Preview

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

Installation

pnpm dlx shadcn@latest add https://motion-kit-astro.vercel.app/r/video-player.json

Usage

---
import "@/components/motion-kit/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