Skip to main content

Create a player

createPlayer returns a Result<BlindcastPlayer, PlayerError>. The video element must be in the DOM before you call it.
keyServerUrl must include the /keys path — e.g., https://your-worker.workers.dev/keys, not just the base URL. The player appends /:contentId to this path when fetching keys.

Load a manifest

The player fetches the manifest, reads EXT-X-KEY tags to discover the key server URL, fetches the content key, then decrypts each segment as it downloads.

Events

Subscribe to events with player.on(). It returns an unsubscribe function.

Metrics

Call getMetrics() at any time for a snapshot of cumulative stats since load().
Useful for dashboards, debugging, and monitoring. See Monitoring for production recommendations.

Destroy

Always call destroy() when the component unmounts or the user navigates away.

React example