Skip to content
SanyamPuniaPublic

About

Drop-in video and audio players for React, installed as source with the shadcn CLI.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

131 Commits

Folders and files

Repository files navigation

bobine

Drop-in video and audio players for React.
Swap <video> for <VideoPlayer> and keep every native prop.

npm version npm downloads MIT license shadcn registry Documentation

Docs | Examples | Reference | npm


VideoPlayer paused on a flower, with an English caption above the control bar

Features

  • Native props. Every attribute you put on a video or audio element works unchanged.
  • Source you own. The shadcn CLI copies the components into your repo. Edit any line.
  • Keyboard first. Space, J, K, L, arrows and more, scoped to the focused player.
  • Adaptive streams. Add the HLS loader. hls.js loads only when an .m3u8 source appears.
  • Your theme. Styled with your tokens, so it matches your app in light and dark.
  • Composable. Unstyled parts and a selector hook for when the defaults do not fit.

Install

Copy the source into your project with the shadcn CLI:

npx shadcn@latest add https://bobine.fyi/r/video-player.json
Item What you get
video-player <VideoPlayer> with auto-hiding controls, captions and a settings menu
audio-player <AudioPlayer> that follows your theme tokens
media The store and unstyled parts, to compose your own player
media-hls The HLS loader. hls.js loads on demand, only when an .m3u8 source appears

Or install the package. It needs React 19, Tailwind CSS v4 and shadcn theme tokens.

pnpm add bobinejs

Setup for the package is in packages/bobine.

Use

Change the element name and drop controls. Sources, posters and caption tracks stay as they are.

import { VideoPlayer } from "@/components/ui/video-player"

<VideoPlayer
  src="/clip.mp4"
  poster="/clip.jpg"
  tracks={[{ src: "/clip.en.vtt", label: "English", srcLang: "en", default: true }]}
/>

Captions and playback speed share one settings menu:

VideoPlayer with the settings menu open, showing speed options and caption tracks

The audio player uses the same parts:

import { AudioPlayer } from "@/components/ui/audio-player"

<AudioPlayer src="/episode.mp3" title="Morning Drift" description="Demo track" showSpeed />

AudioPlayer with a title, a seek bar, a speed toggle and a mute button

Composition, streaming, every part and every keyboard shortcut are in the docs.

For agents

Install the skill so your coding agent knows the components, props and common mistakes:

npx skills add SanyamPunia/bobine

The skill lives in skills/bobine. The site also serves:

Develop

pnpm install
pnpm dev     # site on localhost:3000
pnpm check   # typecheck, lint, test and build: run before every push
pnpm package:build   # the npm package

License

MIT

About

Drop-in video and audio players for React, installed as source with the shadcn CLI.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages