Options

Options can be passed as an object to the constructor, see example below.

Available Options

Text

type

Default

Description

autoPlay

boolean

false

Start playback immediately on load. Note that in most browsers this will only work in conjunction with the muted option set to true.

boolean

true

If set to false, the videos will be shown under the video instead of as a dialog. Only for JavaScript embeds.

boolean

false

If set to true, the next video will start playing immediately after the current video has ended.

defaultLanguage

string

-

Sets the default language of the video. Accepts a 2 letter language code.

defaultSubtitle

object

-

This will set and enable a subtitle or caption text track. Example: defaultSubtitle: {'lang': 'en', 'kind': 'captions'} Lang is always a 2 letter language code and kind can be either “subtitles” or “captions”. The object can also be sent without kind, it will then default to “subtitles”.

disableContextMenu

boolean

false

Prevents right-clicking on the video element.

displayLanguage

string

browser

Sets the UI language for the player. When omitted, the player will look for the user’s browser/system language first and if translations are missing it will default to English. Currently supported language codes: en, sv

hideControls

boolean

true

Player controls will never be hidden if set to false.

hideOverlaidPlayButton

boolean

false

Hide the overlaid play button.

muted

boolean

false

Start playback in a muted state.

showShare

boolean

false

Shows a share button in the top right corner.

showTitle

boolean

false

Shows the video title in the top left corner.

string

-

Accepts a player theme ID.

volume

number

1

Set the video volume. A number between 0 and 1.

Example: Setting Options

Setting the player options for a regular video embed looks like this:

const playerOptions = {
  displayLanguage: 'en',
  showTitle: true
};
const player = new MFPlaylist('#player1', '4Pr3oclLkltnB6Ji5rv6gh', playerOptions);

Example: Setting Playlist Options

For , the options object looks a little bit different. See example below:

const playerOptions = {
  continuousPlay: true,
  contained: false,
  playerOptions: {
    displayLanguage: 'en',
    showTitle: true
  }
};
const player = new MFPlaylist('#player1', 'dNr4ocPZ973YQYJi8rv6tp', playerOptions);

Last updated