Skip to main content

Configuration

This section outlines the available configuration options for VP Vertical Player. The player is highly customizable, offering a variety of settings to tailor the playback experience.

Configuration Overview

To configure the player, you need to provide a configuration object with the desired settings.

const configuration = {
video:{
...
},
config:{
...
}
}
vpVerticalPlayer("div").setup(configuration);

Below is a breakdown of the available configuration options.

Player video Configurations

Basic Video Options

PROPERTYDESCRIPTION
video ObjectThis object contains in itself all of the properties shown below.
videoId stringUnique ID of the video.
file stringVideo source URL. Supports HLS (.m3u8) streams and standalone .mp4, .m4v, and .webm files.
mp4QualitiesUrl stringURL to a .gjp4 metadata document describing the MP4 renditions. When mp4QualityMode is on and this is set, the player fetches the qualities from it and ignores mp4Qualities and mp4DeriveQualities.
mp4Qualities arrayMP4 quality renditions that you provide. When mp4QualityMode is on and mp4QualitiesUrl is empty, the player switches quality using this list; the player does not generate it. See the element properties below.
title stringVideo title.
description stringVideo description.
author stringVideo author. Displayed when showAuthor is enabled.
publishDate stringPublish date. Displayed when showPublishDate is enabled.
thumbnail stringThumbnail image URL.
shareUrl stringURL for sharing.
live boolean Indicates if the video is a live stream.
duration intVideo duration in seconds. Populated automatically by the player.

mp4Qualities element

Provide mp4Qualities when your source is standalone MP4 files (not HLS) but you still want viewers to choose between multiple quality levels. The player treats the list like a simplified HLS playlist: it picks a starting quality from the viewer's estimated bandwidth and lets them switch quality from the settings menu. Each entry describes one rendition.

Each element in the mp4Qualities array has these properties:

PROPERTYDESCRIPTION
url stringMP4 file URL for this quality rendition.
height intRendition height in pixels. Used as the quality label (for example 720 shows as "720p").
bitrate intAverage bitrate in bits per second. Used to pick the starting quality from the estimated bandwidth.

Example:

"mp4Qualities": [{ "url": "https://cdn.vpplayer.tech/.../720p.mp4", "height": 720, "bitrate": 2500000 }]

Tracks (Subtitles)

PROPERTYDESCRIPTION
tracks arrayList of subtitle tracks.

Each element in the tracks array has these properties:

PROPERTYDESCRIPTION
file stringSubtitle file URL. Supports .vtt and .srt (SRT is converted automatically).
lang stringLanguage code, for example en.
label stringDisplay name shown in the subtitles menu, for example "English".

Example:

"tracks": [{"file": "https://cdn.vpplayer.tech/subtitles/en.srt", "lang": "en", "label": "English"}]

Playlist

Playlist mode turns the player into a sequence of videos the viewer moves through with the next and previous controls.

There are two ways to populate the playlist:

  • Hosted playlist - set playlistId to a playlist ID provided by VP, and the player fetches that playlist from our backend.
  • Manual list - provide your own videos array.

If both are set, the hosted playlistId takes precedence.

PROPERTYDESCRIPTION
state boolean Turns on playlist mode. The other playlist fields apply only when this is true.
playlistId stringPlaylist identifier. If it is an ID provided by VP, the player fetches that hosted playlist from our backend; otherwise it is treated as a unique ID for your playlist.
videos arrayA list of videos you supply, used when you are not loading a hosted playlist via playlistId.
playlistVideoIndex intZero-based index of the video to start on. Defaults to 0 (first video).

Each element in the videos array is a video object with the same properties as a single video (for example file, videoId, title, thumbnail).

Manual list:

"playlist": {
"state": true,
"playlistVideoIndex": 0,
"videos": [
{ "videoId": "abc", "file": "https://.../1.m3u8", "title": "First", "thumbnail": "https://.../1.jpg" },
{ "videoId": "def", "file": "https://.../2.m3u8", "title": "Second", "thumbnail": "https://.../2.jpg" }
]
}

Hosted playlist:

"playlist": { "state": true, "playlistId": "your-vp-playlist-id" }

Video Locking

Video locking gates the video after a set amount of playback. When the viewer reaches the lock point, playback stops and the player shows the locked (paywall) screen. Useful for previews and paywalled content.

PROPERTYDESCRIPTION
isEnabled boolean Turns on video locking.
type stringHow value is interpreted: seconds or percentage.
value intHow much of the video plays before it locks: a number of seconds (when type is seconds), or a percent of the duration (when type is percentage). Use 0 to lock immediately.

Example:

"videoLocking": { "isEnabled": true, "type": "seconds", "value": 30 }

Advertising

The player supports two kinds of ads: video ads (VAST) played through Google IMA between videos, and a display banner served through Google Publisher Tags (GPT). Set advertising to true to enable ads; the ads settings below apply only when it is on.

PROPERTYDESCRIPTION
advertising boolean Enables ads for the video.

Ads

The ads object holds all ad settings.

PROPERTYDESCRIPTION
frequency objectHow often video ads play. See below.
initialDelay objectWhen the first video ad becomes eligible. See below.
maxCap intMaximum number of ads per session. 0 means unlimited.
adBreaks arrayVAST ad breaks. Each break has an adTagUrl (an array of VAST tag URLs tried in order as a fallback). Multiple breaks are used in rotation across successive ads.
banner objectDisplay banner (GPT) settings. See below.

Each element in adBreaks has an adTagUrl property: an array of VAST ad tag URLs, tried in order as a fallback.

"adBreaks": [
{
"adTagUrl": [
"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
]
}
]

frequency

PROPERTYDESCRIPTION
type stringvideos - plays an ad every N videos.
value intNumber of videos between ads.

initialDelay

PROPERTYDESCRIPTION
type stringvideos - the first ad becomes eligible after N videos.
value intNumber of videos before the first ad.

The banner is a display ad served through Google Publisher Tags (GPT).

PROPERTYDESCRIPTION
adUnitPath stringGPT ad unit path for the banner.
sizes arrayAllowed banner sizes, for example [[300, 250], [728, 90]].

A complete ads object:

"ads": {
"frequency": { "type": "videos", "value": 3 },
"initialDelay": { "type": "videos", "value": 1 },
"maxCap": 5,
"adBreaks": [
{
"adTagUrl": [
"https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&correlator="
]
}
],
"banner": {
"adUnitPath": "/1234567/your-banner-unit",
"sizes": [[300, 250], [728, 90]]
}
}

Player config Configurations

Most settings below are individual config properties. When a section is marked grouped under an object (for example the size object), those properties are nested under that key, like config.size: { ... }.

General Settings

PROPERTYDESCRIPTION
muted boolean Starts the player muted.
autoplay boolean Starts next video playback automatically.
volume floatDefault volume (0.0 - 1.0).
pauseOtherVideos boolean Pauses other players on the page.
loop boolean Loops the video.
soundSubtitleInversion boolean Shows subtitles while the video is muted and hides them when it is unmuted. Turns off automatically once the viewer selects a subtitle manually.
autoHideOverlay boolean Hides the overlay (controls) during playback and shows it on interaction. The overlay is not hidden while the video is paused.
playlistLoop boolean Loops the playlist, returning to the first video after the last.
swipeToSkip boolean Lets the viewer swipe to skip an ad. Enabled by default.
focusOnAutostart boolean Scrolls to and focuses the player when it autostarts (first play only).
viewMode stringLayout mode: normal, external-actions, or page-fill. See below.

viewMode options (desktop only; mobile always uses normal):

  • normal (default) - standard vertical player layout.
  • external-actions - moves the side action buttons outside the player frame.
  • page-fill - the player fills its parent container and enables the ambient background effect.

Player Size

Grouped under the size object.

PROPERTYDESCRIPTION
sizeType stringSize mode: responsive (fills its container) or fixed (uses the height below). Defaults to responsive.
height intPlayer height in pixels. Applies only when sizeType is fixed.

Autostart Settings

Autostart and autopause are controlled by three independent config objects: autostartOnLoad, autostartOnViewable, and autopauseOnViewable.

autostartOnLoad

Starts playback as soon as the video loads (first video only).

PROPERTYDESCRIPTION
state boolean Enables autostart on load.
onMobile boolean Allows autostart on mobile devices.
percentageViewable floatRequired viewable percentage (0.0 - 1.0).

autostartOnViewable

Starts playback when the player becomes viewable in the viewport.

PROPERTYDESCRIPTION
state boolean Enables autostart when viewable.
onMobile boolean Allows viewable autostart on mobile devices.
percentageViewable floatViewable percentage (0.0 - 1.0) required to trigger autostart.
removeAfterPlay boolean Stops re-triggering autostart after the first play (for example when scrolling back to the player).

autopauseOnViewable

Pauses playback when the player is no longer sufficiently viewable.

PROPERTYDESCRIPTION
state boolean Enables autopause when not viewable.
onMobile boolean Allows viewable autopause on mobile devices.
percentageViewable floatViewable percentage (0.0 - 1.0) below which playback pauses.

Controls

Grouped under the controls object.

PROPERTYDESCRIPTION
fullscreen boolean Fullscreen button visibility.
share boolean Share button visibility.
text boolean Text display visibility.
seekbar boolean Seekbar visibility.
settings boolean Settings menu visibility.
time boolean Time display visibility.
arrows boolean Previous/next navigation arrows visibility.

Playback Rates

Supported playback speeds:

[0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]

Localization

Grouped under the lang object.

Language options for UI elements:

{
"locale": "en",
"controls": {
"play": "Play",
"pause": "Pause",
"more": "more",
"less": "less",
"previous": "Previous",
"next": "Next",
"volume": "Volume",
"mute": "Mute",
"unmute": "Unmute",
"settings": "Settings",
"fullscreen": "Fullscreen",
"minimize": "Exit Fullscreen",
"live": "Live"
},
"settings": {
"quality": "Quality",
"subtitles": "Subtitles",
"autoplay": "Autoplay",
"playbackRate": "Speed",
"auto": "Auto",
"off": "Off",
"normal": "Normal",
"share": "Share",
"copyLink": "Or copy link",
"copy": "Copy",
"close": "Close"
},
"ads": {
"adLabel": "Ad"
},
"hints": {
"swipeForMore": "Swipe for more"
},
"time": {
"minuteAgoSingular": "{{n}} minute ago",
"minuteAgoPlural": "{{n}} minutes ago",
"hourAgoSingular": "{{n}} hour ago",
"hourAgoPlural": "{{n}} hours ago",
"yesterday": "Yesterday"
}
}

The hints object localizes the swipe navigation hint shown to viewers. The time object localizes the relative publish date labels used when showRelativePublishDate is enabled; the {{n}} placeholder is replaced with the number of minutes or hours.

Skin Customization

Grouped under the skin object.

PROPERTYDESCRIPTION
background stringPlayer background color.
text stringText color.
buttons objectButton styles. See below.
seekbar objectSeekbar styles. See below.

buttons

PROPERTYDESCRIPTION
icon stringButtons icon color.
background stringButtons background color.

seekbar

PROPERTYDESCRIPTION
rail stringSeekbar rail color.
buffer stringSeekbar buffer color.
progress stringSeekbar progress color.
dragger stringSeekbar dragger color.

Content Display

PROPERTYDESCRIPTION
showAuthor boolean Displays the video author.
showPublishDate boolean Displays the video publish date.
showRelativePublishDate boolean Shows the publish date as relative time (for example "2 hours ago") instead of an absolute date.

Recommendations

PROPERTYDESCRIPTION
recommended boolean Enables recommended playlist mode.
recommendedId stringID of the recommended playlist to load.

MP4 Quality Mode

PROPERTYDESCRIPTION
mp4QualityMode boolean Enables MP4 quality selection between predefined renditions.
mp4DeriveQualities boolean Derives MP4 qualities from the .gjp4 metadata endpoint when video.mp4QualitiesUrl and video.mp4Qualities are both empty.

Social Sharing

PROPERTYDESCRIPTION
socialMedia arrayList of social platforms shown in the share menu.

Supported platforms: facebook, twitter (alias of x), x, reddit, pinterest, linkedin, tumblr, blogger, messenger, whatsapp, instagram, webshare.

"socialMedia": ["facebook", "x", "whatsapp", "linkedin"]

Note: instagram is shown on mobile devices only, and webshare requires the browser to support the Web Share API (it is added automatically when available).

Grouped under the logo object.

PROPERTYDESCRIPTION
state boolean Enables the custom logo overlay.
file stringLogo image URL.
onClickURL stringURL opened when the logo is clicked.

Font

Grouped under the font object.

PROPERTYDESCRIPTION
family stringFont family name.
url stringFont stylesheet URL (for example a Google Fonts URL).

Full Configuration Template:

{
"video": {
"videoId": "",
"file": "",
"mp4QualitiesUrl": "",
"mp4Qualities": [],
"title": "",
"description": "",
"author": "",
"publishDate": "",
"thumbnail": "",
"shareUrl": "",
"live": false,
"duration": 0,
"tracks": [],
"playlist": {
"state": false,
"playlistId": "",
"playlistVideoIndex": 0,
"videos": []
},
"videoLocking": {
"isEnabled": false,
"type": "seconds",
"value": 0
},
"advertising": false,
"ads": {
"frequency": {
"type": "",
"value": 0
},
"initialDelay": {
"type": "",
"value": 0
},
"maxCap": 0,
"adBreaks": [],
"banner": {
"adUnitPath": "",
"sizes": []
}
}
},
"config": {
"configId": "",
"muted": false,
"autoplay": false,
"volume": 0.6,
"pauseOtherVideos": true,
"loop": false,
"playlistLoop": false,
"soundSubtitleInversion": false,
"viewMode": "normal",
"recommended": false,
"recommendedId": "",
"swipeToSkip": true,
"showAuthor": false,
"showPublishDate": false,
"showRelativePublishDate": true,
"size": {
"sizeType": "responsive",
"height": 650
},
"autostartOnLoad": {
"state": false,
"onMobile": false,
"percentageViewable": 0.5
},
"autostartOnViewable": {
"state": false,
"onMobile": false,
"percentageViewable": 0.5,
"removeAfterPlay": false
},
"autopauseOnViewable": {
"state": false,
"onMobile": false,
"percentageViewable": 0.5
},
"focusOnAutostart": true,
"socialMedia": [],
"playbackRates": [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
"autoHideOverlay": true,
"mp4QualityMode": false,
"mp4DeriveQualities": false,
"controls": {
"fullscreen": false,
"share": true,
"text": true,
"seekbar": true,
"settings": true,
"time": true,
"arrows": true
},
"lang": {
"locale": "",
"controls": {
"play": "Play",
"pause": "Pause",
"more": "more",
"less": "less",
"previous": "Previous",
"next": "Next",
"volume": "Volume",
"mute": "Mute",
"unmute": "Unmute",
"settings": "Settings",
"fullscreen": "Fullscreen",
"minimize": "Exit Fullscreen",
"live": "Live"
},
"settings": {
"quality": "Quality",
"subtitles": "Subtitles",
"autoplay": "Autoplay",
"playbackRate": "Speed",
"auto": "Auto",
"off": "Off",
"normal": "Normal",
"share": "Share",
"copyLink": "Or copy link",
"copy": "Copy",
"close": "Close"
},
"ads": {
"adLabel": "Ad"
},
"hints": {
"swipeForMore": "Swipe for more"
},
"time": {
"minuteAgoSingular": "{{n}} minute ago",
"minuteAgoPlural": "{{n}} minutes ago",
"hourAgoSingular": "{{n}} hour ago",
"hourAgoPlural": "{{n}} hours ago",
"yesterday": "Yesterday"
}
},
"logo": {
"state": false,
"file": "",
"onClickURL": ""
},
"skin": {
"background": "#14161a",
"text": "#ffffff",
"buttons": {
"icon": "#ffffff",
"background": "rgba(0, 0, 0, 0.25)"
},
"seekbar": {
"rail": "rgba(255, 255, 255, 0)",
"buffer": "rgba(255, 255, 255, 0)",
"progress": "rgba(255, 255, 255, 0.50)",
"dragger": "#ffffff"
}
},
"font": {
"family": "Roboto",
"url": "https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600&display=swap"
}
}
}

With these configurations, you can fully customize the VP Vertical Player to meet your needs.