Beta —
@videojs/spf is close to stable. Experimental adoption in real projects is welcome.@videojs/spf is the Stream Processing Framework powering adaptive bitrate (ABR) playback in Video.js 10. It provides a unified interface that abstracts hls.js and dash.js behind a common playback engine API, so the rest of the stack does not need to handle streaming library specifics.
This package is used internally by @videojs/core. You do not need to install it directly unless you are building a custom integration.
Installation
Exports
| Entry point | Description |
|---|---|
. | Core SPF — runtime-agnostic stream processing logic |
./dom | DOM-specific SPF — attaches the playback engine to a media element |
./playback-engine | Playback engine abstraction — unified interface over hls.js and dash.js |
Architecture
SPF separates stream processing into two layers:<video> or <audio> element.
Usage
In most cases you will use SPF indirectly through@videojs/core. For custom integrations, the playback engine abstraction provides a stable API:
DOM attachment
Bundle size
SPF ships a bundle size measurement script. Run from the monorepo root:Dependencies
| Package | Role |
|---|---|
@videojs/utils | Shared utility functions |
hls.js or dash.js directly — those are provided by @videojs/core as dependencies so they are deduplicated across the stack.
Related packages
@videojs/core
Core package that consumes SPF for stream handling.
@videojs/utils
Shared utilities used by SPF.
@videojs/html
HTML player that uses SPF via core.
@videojs/react
React player that uses SPF via core.