Documentation

Configuration

Understand Sopplayer options, defaults, aspect ratios, playback rates and keyboard behavior.

Options

OptionDefaultDescription
themedefaultOne of the eight built-in theme names.
autoplayfalseRequests autoplay through the browser.
mutedfalseStarts the player muted.
controlstrueShows interactive controls.
loopfalseLoops playback.
preloadmetadataNative video preload mode.
volume1Initial volume from 0 to 1.
playbackRate1Initial playback speed.
aspectRatio16:9Applies a player aspect-ratio class.
shortcutstrueEnables keyboard interactions.
hideControlsDelay3000Inactivity delay in milliseconds.

Example

const player = new Sopplayer('#player', {
  theme: 'duolingo',
  volume: 0.8,
  playbackRate: 1,
  aspectRatio: '16:9',
  shortcuts: true
});