Content Units

Content unit parameters

These are the settings of each content unit type. You set them in the CMS when you create or edit the unit, and for most types you can override them in the embed code. The names below are keys of the unit’s Widget object: Widget.settings holds the colour (for the OTT traffic driver, the site address) and Widget.options holds everything else.

Switches are stored as "1" (on) and "0" (off). Use the same strings when you override them: they work for every type, while true and 1 don’t work for all of them.

Overriding settings in the embed code

  • Playlist, Native, Mid-article and Simple: add a Widget object to the $bp() config. It replaces the unit’s CMS settings as a whole, so include settings and every option you want; anything you leave out is off or uses its default.

  • Standard lightbox and OTT traffic driver: add a Widget object to the $lb() or $td() config. It is merged with the CMS settings, so include only what you change.

  • Vertical lightbox: only options.showTitle and options.showDescription can be overridden.

  • Reels: settings can’t be overridden; they are set only in the CMS.

A Playlist unit with all its settings in the embed code:

<script type="text/javascript" src="https://player.target-video.com/player/build/targetvideo.min.js"></script>

<div id="TargetVideo_12345678"></div>
<script type="text/javascript">
    $bp("TargetVideo_12345678", {
        "id": "PLAYER_ID",
        "playlist": {"mode": "widget", "id": "CONTENT_UNIT_ID", "widget_type": "playlist_widget"},
        "Widget": {
            "settings": {
                "color": "#ffffff"
            },
            "options": {
                "forceDuration": "1",
                "forceTitle": "1",
                "forcePlayButton": "0",
                "numberOfThumbs": 4,
                "logo": {
                    "url": "https://your-domain.com/logo.png",
                    "width": 32,
                    "height": 32,
                    "position": "top-right",
                    "title": "Logo"
                }
            }
        }
    });
</script>

A standard lightbox that changes only how titles are shown:

<script type="text/javascript">
    $lb("TargetVideo_12345678", {
        "id": "PLAYER_ID",
        "Playlist": {"mode": "widget", "id": "CONTENT_UNIT_ID", "widget_type": "lightbox_widget"},
        "Widget": {"options": {"forceTitle": "1", "titleOptions": {"position": "outside"}}}
    });
</script>

Playlist

Parameter

Description

settings.color (string)

Background colour behind the player and its thumbnails, as a CSS colour. In the CMS: Background color.

options.forceDuration (switch)

Shows each video’s duration on its thumbnail. In the CMS: Video duration.

options.forceTitle (switch)

Shows each video’s title on its thumbnail, on desktop only. In the CMS: Video title.

options.forcePlayButton (switch)

Shows a play button on every thumbnail. In the CMS: Play button.

options.numberOfThumbs (number)

Number of thumbnails to show. Without it, the number fits the available width. Embed code only.

options.logo.url (string)

Logo image shown on every thumbnail. In the CMS: Upload Logo.

options.logo.width, options.logo.height (number)

Logo size in px. Default 32. In the CMS: Size (px).

options.logo.position (string)

Corner of the thumbnail: top-right (default), top-left, bottom-left or bottom-right. In the CMS: Position.

options.logo.title (string)

Text shown when a viewer hovers over the logo. Default “Logo”. In the CMS: Title.

Native

Parameter

Description

settings.color (string)

Background colour of the unit while the text panel is shown. In the CMS: Background color.

options.position (string)

Side of the text panel: right (default) or left. In the CMS: Position.

options.minWidth (number)

Below this width in px, the text panel is hidden. Default 400. In the CMS: Minimum width (px).

options.header.title (string)

Header text. The header is shown when a title or a “Powered by” value is set. In the CMS: Title.

options.header.poweredBy (string)

Shown as “Powered by: …” in the header; an image URL is shown as an image. In the CMS: Powered by.

options.header.poweredByUrl (string)

Link for the “Powered by” text or image. In the CMS: Powered by URL.

Mid-article

Parameter

Description

settings.color (string)

Background colour of the unit when it is at least 500 px wide. In the CMS: Background color.

options.position (string)

Side of the thumbnail column: right (default) or left. In the CMS: Position.

options.forceDuration (switch)

Shows each video’s duration on its thumbnail. In the CMS: Video duration.

options.forceTitle (switch)

Shows each video’s title on its thumbnail, on desktop only, unless the description box shows the title. In the CMS: Video title.

options.forcePlayButton (switch)

Shows a play button on every thumbnail. In the CMS: Play button.

options.forceThumbs (switch)

Keeps the thumbnails on screens narrower than 500 px instead of hiding them. In the CMS: Show thumbnails on small devices.

options.logo (object)

The same url, width, height, position and title as for the Playlist unit. In the CMS: the Logo section.

options.titleDescriptionAdditions.showTitle (switch)

Shows the video title in the description box. In the CMS: Display video title.

options.titleDescriptionAdditions.showDescription (switch)

Shows the video description in the description box. In the CMS: Display video description.

options.titleDescriptionAdditions.position (string)

Side of the description box: right (default) or left. In the CMS: Description box position.

options.header (object)

The same title, poweredBy and poweredByUrl as for the Native unit. In the CMS: the Header section.

Simple

Parameter

Description

settings.color (string)

Background colour of the description panel. In the CMS: Background color.

options.widget_mobile_position.position (string)

Screen edge the sticky player docks to: bottom (default) or top. In the CMS: Position, under Sticky.

options.widget_mobile_position.offset (string)

Distance from that edge in px, as a string, e.g. "10". Default 5. In the CMS: Bottom offset (px) or Top offset (px).

options.description_wrapper_position (string)

Side of the description panel: right (default) or left. In the CMS: Position, under Text Configuration.

options.text_color (string)

Colour of the description title, as a CSS colour. In the CMS: Text color.

Standard lightbox

Parameter

Description

settings.color (string)

Background colour of the popup player. In the CMS: Popup background color.

options.header.title (string)

Header text above the thumbnails. In the CMS: Title.

options.forceDuration (switch)

Shows each video’s duration on its thumbnail. In the CMS: Video duration.

options.forceTitle (switch)

Shows each video’s title on its thumbnail. In the CMS: Video title.

options.titleOptions.position (string)

Where the title is shown: inside (over the image, default) or outside (below it). In the CMS: Position.

options.titleOptions.color (string)

Title colour, as a CSS colour. Default white. In the CMS: Color.

options.forcePlayButton (switch)

Shows a play button on every thumbnail. In the CMS: Play button.

options.logo.url (string)

Logo image shown in the header. In the CMS: Upload Logo.

Vertical lightbox

Parameter

Description

options.showTitle (switch)

Shows the video titles on the cards. In the CMS: Display video title.

options.showDescription (switch)

Shows the video description in the player, with player skins that support it. In the CMS: Display video description.

The unit’s ad settings, Script ad tag and Frequency, are set in the CMS and can’t be overridden.

OTT traffic driver

Parameter

Description

settings.ott_url (string)

Address of your OTT site. Each thumbnail links to the video there and opens in a new tab. In the CMS: OTT Url.

options.header.title (string)

Header text. In the CMS: Title.

options.forceDuration (switch)

Shows each video’s duration on its thumbnail. Only "1" turns it on. In the CMS: Video duration.

options.forceTitle (switch)

Shows each video’s title on its thumbnail. Only "1" turns it on. In the CMS: Video title.

options.forcePlayButton (switch)

Shows a play button on every thumbnail. Only "1" turns it on. In the CMS: Play button.

Reels

Reels settings, such as the feed page address, background, logo, navigation, titles, ads and the thumbnail cards, are set only in the CMS. How each one works is described in the Help Center: https://helpdesk.target-video.com/reels-content-unit

Content unit parameters · TargetVideo Developer Docs