Skip to main content
Beta@videojs/core is close to stable. Experimental adoption in real projects is welcome.
@videojs/core provides the foundational building blocks used by platform-specific implementations (DOM, HTML, React, React Native) to create consistent media player experiences. It contains feature definitions, feature state types, and core player logic that remains independent of any rendering environment. In the dependency hierarchy, @videojs/core sits above @videojs/utils and @videojs/store, and below the platform packages @videojs/html and @videojs/react.
utils ← store ← core ← html / react / react-native

Installation

npm install @videojs/core

Exports

Entry pointDescription
.Main entry — runtime-agnostic core logic, feature definitions, and state types
./domDOM bindings — connects core features to the browser environment
./dom/media/*Media-specific DOM modules (e.g. HLS, DASH playback adapters)

Main entry (.)

The default import provides runtime-agnostic player logic and feature primitives that work in any JavaScript environment.
import { createFeature } from '@videojs/core';

const myFeature = createFeature({
  id: 'my-feature',
  // feature definition
});

DOM bindings (./dom)

The ./dom subpath exports bindings that connect core player state to the browser DOM. Import this in browser environments when you need to wire up DOM elements to player features.
import '@videojs/core/dom';

Media DOM modules (./dom/media/*)

Media-specific modules provide DOM-level adapters for specific playback formats. These are used internally by @videojs/html and @videojs/react.
import '@videojs/core/dom/media/hls';
import '@videojs/core/dom/media/dash';

Dependencies

PackageRole
@videojs/spfStream Processing Framework — unified HLS/DASH interface
@videojs/storeReactive state management
@videojs/utilsShared utility functions
dashjsMPEG-DASH playback engine
hls.jsHLS playback engine

@videojs/html

Web Components implementation built on top of core.

@videojs/react

React components and hooks built on top of core.

@videojs/store

Reactive state management used by core.

@videojs/spf

Stream Processing Framework used by core.

Build docs developers (and LLMs) love