Video Player Configuration Examples

Learn how to customize the video player for different use cases. Each example shows a different configuration preset and the corresponding code.

Default Style

Full-featured player with the standard control set

0:00 / 0:00

Custom Configuration

Custom behavior and specific controls

0:00 / 0:00

How to Use Configuration

Step-by-step guide to implement configurable video players in your Next.js app

1. Wrap your app with PlayerConfigProvider

// app/layout.tsx or your root component
import { PlayerConfigProvider, PlayerPresets } from '@madraka/nextjs-videoplayer';

export default function RootLayout({ children }) {
  return (
    <PlayerConfigProvider
      defaultConfig={PlayerPresets.default}
      storageKey="nextjs-videoplayer-showcase-config-v2"
    >
      {children}
    </PlayerConfigProvider>
  );
}

2. Use ConfigurableVideoPlayer component

// In your component
import { ConfigurableVideoPlayer } from '@madraka/nextjs-videoplayer';

function MyVideoComponent() {
  return (
    <ConfigurableVideoPlayer
      src="https://example.com/video.mp4"
      poster="https://example.com/poster.jpg"
      // Optional: Override global config for this instance
      configOverride={{
        controls: {
          visibility: {
            playbackRate: false, // Hide playback rate for this video
          },
        },
      }}
    />
  );
}

3. Available Configuration Options

Control visibility (show/hide any button)
Custom themes and colors
Keyboard shortcuts configuration
Touch gesture settings
Auto-behaviors (autoplay, auto-hide)
Responsive breakpoints
Performance settings
Analytics tracking
Advanced features toggle