Getting Started with Clappr

August 5, 2026 · View on GitHub

This guide will walk you through setting up Clappr, configuring the Player and Playbacks, installing it in your project, and running it locally for development.

Installation

In your project's HTML, import Clappr's latest version by adding the following script:

<head>
  <script type="text/javascript" src="http://cdn.clappr.io/latest/clappr.min.js"></script>
</head>

Now, create an element for Clappr's Player and instantiate it:

<body>
  <div id="player"></div>
  <script>
    const player = new Clappr.Player({
      source: 'http://your.video/here.mp4',
      parentId: '#player' 
    })
  </script>
</body>

Development

Ensure you have Yarn installed.

Local Development

Clone the project:

git clone git@github.com:clappr/clappr.git
cd clappr
yarn install

Start the development server:

yarn start

Visit http://localhost:8080. Changes are reflected live without restarting the server.

Build

Run tests:

yarn test

Build a custom version:

yarn build

The newly built Player will be in the dist/ directory.

Configuration

Player Config

When instantiating Clappr in your web application, there are a variety of options you can use to configure the Player.

NameTypeDefaultDescription
parentStringSpecify where the player should be attached using the DOM element.
parentIdStringSpecify where the player should be attached using the ID of a DOM element.
sourceStringSets the media source URL to play.
sourcesArrayAn array of sources. If a media is invalid, the next source is played.
mimeTypeStringSet the media source format when using a URL without an extension.
eventsObjectAdd callback functions for mapped events. See Events.
pluginsObjectConfigure external plugin instances. See [Plugins].
plugins.loadExternalPluginsFirstBooleantrueLoad external plugins before default Clappr plugins.
plugins.loadExternalPlaybacksFirstBooleantrueLoad external playbacks before default Clappr playbacks.
mediacontrolObjectCustomize control bar colors. Example: { seekbar: '#E113D3', buttons: '#66B2FF' }
hideMediaControlBooleantrueDisable Media Control auto-hide.
heightString360pxSet player height (px or %).
widthString640pxSet player width (px or %).
autoPlayBooleanfalsePlay media automatically when ready.
autoPlayVisibleStringpartial or full for automatic play based on visibility.
muteBooleanfalseSet volume to zero using <video> muted attribute.
hideVolumeBarBooleanfalseHide the volume bar.
loopBooleanfalseLoop the video.
languageStringen-USSet supported language. See Strings plugin.
persistConfigBooleantruePersist Player volume across multiple videos using localStorage.
playbackNotSupportedMessageStringplayback_not_supportedCustom message when playback isn't supported.
useCodePrefixBooleantruePrefix error codes with the component name.
autoSeekFromUrlBooleantrueSeek to timestamp if present in URL. Example: example.com?t=100.
includeResetStyleBooleantrueEnable/disable Clappr's _resets.scss style reset.

Playback Config

Options specific to Playbacks (compatible with HTML5Playback and derived playbacks):

NameTypeDefaultDescription
preloadStringmetadataDefine how the video is preloaded. More info.
disableContextMenuBooleanfalseDisable context menu activation.
controlsBooleantrueEnable/disable HTML5 video tag controls.
crossOriginStringuse-credentialsSet <video> tag's crossOrigin attribute.
playInlineBooleantrueEnable <video> playInline attribute.
minimumDvrSizeIntegerMinimum value to activate DVR for live media.
externalTracksArrayArray of track objects with src, lang, label (optional kind).
hlsjsConfigObjectSettings for hls.js.
shakaConfigurationObjectSettings for shaka-player.

Playground

You can test Clappr directly in your browser via Clappr Playground.

Clappr Playground Interface

Features

  • Shareable: Generate a shareable link for your current configuration using the Run button.
  • External Plugins: Test external plugins by adding their JavaScript file links alongside Clappr.