FrameworkStyle

Presets

Feature collections that configure your player for specific use cases

Presets are collections of features that configure your player for a specific use case. Pick a preset, and you get the right features without wrangling configuration.

In React, presets are configuration passed to createPlayer(). This gives you the same feature set while following React’s composition patterns.

Using a Preset

import { createPlayer, presets, FrostedSkin, Video } from '@videojs/react';
import '@videojs/react/skins/frosted.css';

// Create a player with the website preset
const { Provider } = createPlayer(presets.website());

<Provider>
  <FrostedSkin>
    <Video src="video.mp4" />
  </FrostedSkin>
</Provider>

The website preset is the most common—a complete set of features for simple video playback on your site.

Available Presets

Preset Use Case Features
presets.website() Default website player playback, volume, time, fullscreen, keyboard, idle
presets.background() Background/hero video playback (autoplay, loop)
presets.news() Article embeds website + ads, playlist
presets.creator() Creator platforms website + quality, chapters
presets.swipe() Short-form video playback, gestures
presets.streamingApp() Streaming apps website + quality, chapters, preferences
presets.interactiveLive() Interactive live website + live, chat integration

Features

Features are the building blocks of presets. Each feature bundles related state and requests —similar to slices in Redux or Zustand.

Feature State Requests
playback paused, ended play(), pause(), togglePlay()
volume volume, muted setVolume(), toggleMute()
time currentTime, duration, seeking seek()
fullscreen isFullscreen enterFullscreen(), exitFullscreen(), toggleFullscreen()
keyboard Keyboard shortcuts (Space → play/pause, arrows → seek)
idle isIdle Tracks user activity for auto-hide UI
gestures Touch gestures (double-tap seek, swipe volume)

Extending a Preset

Add features to an existing preset:

import { createPlayer, presets, features } from '@videojs/react';

const { Provider, usePlayer } = createPlayer([
  ...presets.website(),
  features.gestures,
]);

Custom Features

For advanced use cases, you can create your own features:

import { createPlayer, createFeature, presets } from '@videojs/react';

const analytics = createFeature({
  initialState: { events: [] },

  subscribe: ({ target, update, signal }) => {
    // Track play/pause events
    target.media.element.addEventListener('play', () => {
      console.log('Video started');
      update();
    }, { signal });
  },

  request: {
    trackEvent: (eventName, { target }) => {
      console.log('Custom event:', eventName);
    },
  },
});

const { Provider, usePlayer } = createPlayer([
  ...presets.website(),
  analytics,
]);

Presets and Skins

Presets define what features are available . Skins define what UI exists . They’re designed to work together:

  • The presets.website() preset pairs with <FrostedSkin> and <MinimalSkin>
  • The presets.streamingApp() preset pairs with <StreamingSkin> (planned)
  • Using a skin with a preset it wasn’t designed for won’t show new UI—the skin only includes components for its intended features
Learn more about skins →

See Also

VideoJS