Video Player
React video player for Shelby
@shelby-protocol/player is a React video player built for streaming from Shelby's decentralized storage. Powered by Shaka Player, it supports HLS streaming with adaptive bitrate out of the box.
Demo Video
0:00 / 0:00
Installation
npm install @shelby-protocol/playerQuick Start
import { VideoPlayer } from "@shelby-protocol/player";
function App() {
return (
<VideoPlayer
src="https://example.com/video.m3u8"
poster="https://example.com/poster.jpg"
title="My Video"
/>
);
}Props
| Prop | Type | Description |
|---|---|---|
src | string | Video URL (HLS, DASH, or direct) |
poster | string | Poster image URL |
title | string | Video title for controls |
autoplay | boolean | Auto-play on load |
muted | boolean | Start muted |
loop | boolean | Loop playback |
Composable Components
The player is fully composable. Use individual components to build custom layouts:
PlayerProvider
Context provider for player state
PlayerContainer
Wrapper with aspect ratio handling
ShakaVideo
Video element with Shaka Player integration
PlayButton
Play/pause toggle button
TimeSlider
Seek bar for video navigation
VolumeButton
Mute toggle button
FullscreenButton
Fullscreen toggle button