🚧 The Shelby Explorer is currently in beta and is under active development

Shelby SymbolMedia Kit

Media Player

ShakaVideo

Core video component that wraps shaka-video-element


ShakaVideo

The core video component that wraps shaka-video-element and integrates with the player context.

Usage

import {
  MediaProvider,
  PlayerProvider,
  PlayerContainer,
  ShakaVideo,
  DefaultControls
} from '@shelby-protocol/player'

function MyPlayer() {
  return (
    <MediaProvider>
      <PlayerProvider>
        <PlayerContainer>
          <ShakaVideo
            src="https://example.com/video.m3u8"
            poster="https://example.com/poster.jpg"
            config={{
              abr: { enabled: true }
            }}
            className="w-full"
          />
          <DefaultControls title="My Video" />
        </PlayerContainer>
      </PlayerProvider>
    </MediaProvider>
  )
}

Props

PropTypeDescription
srcstringThe URL of the video source (HLS/DASH manifest)
posterstringURL of the poster image
configshaka.PlayerConfigurationShaka Player configuration object
classNamestringAdditional CSS classes
autoplaybooleanEnable autoplay (will be muted)
onPlay() => voidCallback when playback starts
onPause() => voidCallback when playback pauses
onTimeUpdate(e: Event) => voidCallback when time updates
onDurationChange(e: Event) => voidCallback when duration changes

On this page