Contact support

Video plugin: integration tutorial

Overview

This integration tutorial explains a simple integration from importing the Video plugin library until its registration.

Video tags

For most devices, the HTML5 Video plugin will create its own player on the page, adding a new <video> tag to the page as an overlay. This allows for the display of custom controls for ads, such as skip, time to skip, time to content, or fullscreen. This is the main approach used for desktop devices, tablets and all smartphones except the iPhone.

A single <video> tag approach is used on iPhones. Here, video content opens on the native player, QuickTime, which takes over the entire experience. The Video plugin uses the <video> tag from the content player and switches resources for either ads or content.

Step 1: Import Video plugin library

The Video plugin library contains all the logic of the video solution. It makes the requests to the ad server, parses the responses, manages ad breaks and all the tracking for reporting. Each Equativ customer has a dedicated version of the library.
To include the Video plugin library in your web page, add the following to your page’s <head> section:

<script type="text/javascript" src="http://[your_domain]/video/config.js?nwid=<your_network_id>"></script>
<script type="text/javascript" src="http://[your_domain]/video/controller.js?nwid=<your_network_id>"></script>

Your account manager will provide you with the appropriate values for [your_domain] and [your_network_id].

Step 2: Define video placements and targeting criteria

To instruct the Video plugin what to request, define the video placements (site, page, format) and targeting criteria (keywords) in a sasVideoData object (adData property). You can define different values for each player instance.

The adData object contains the following keys: 

Parameter Description
sas_format_linears The ID of the linear video format, as defined in the Equativ Monetization Platform. Use the same format ID for pre-roll, mid-roll, and post-roll video ads.
sas_format_overlays The ID of the non-linear (overlay) video format, as defined in the Equativ Monetization Platform.
sas_pageid The ID of a page on the website, as defined in the Equativ Monetization Platform. For more information, see Create placements.
sas_pagename The name of a page on the website, as defined in the Equativ Monetization Platform. For more information, see Create placements.
sas_siteid The ID of the website, as defined in the Equativ Monetization Platform. For more information, see Create placements.
sas_target

The keywords used for targeting, formatted as follows:

  • Keyword only: "my_keyword"
  • Key-value pair: "my_keyword=my_value"
  • Multiple values: "key1=value1;key2=value2"
sas_target_mid The keywords for targeting, specific to mid-roll ads. If you populate this parameter, the system ignores sas_target for mid-rolls.
sas_target_overlays The keywords for targeting, specific to overlay ads. If you populate this parameter, the system ignores sas_target for overlays.
sas_target_post The keywords for targeting, specific to post-roll ads. If you populate this parameter, the system ignores sas_target for post-rolls.
sas_target_pre The keywords for targeting, specific to pre-roll ads. If you populate this parameter, the system ignores sas_target for pre-rolls.

The following example shows the adData object with example values populated for each field.

// Equativ variables
var sasVideoData= {
	id: "playerId",
	adData: {
		sas_siteid: '44928',
		sas_pageid: '322652',
		sas_pagename: 'linear',
		sas_target: '',
		sas_format_linears: '20180',
		sas_format_overlays: '19582'
	}
};

The Video plugin is capable of requesting banner ads when pausing the main video content. The corresponding configuration keys must be set in the dedicated banner object of sasVideoData. For more information, see “Configure banner ads” in Video plugin: configure and customize.

Step 3: Register Video plugin 

Call this method to register all players that will display ads:

sas.video.register(sasVideoData);

sasVideoData is an object with defined Equativ data and plugin settings. Calling this method instantiates a new “javascript controller” which is responsible for loading, parsing and displaying the ads.

Preferably, register the player when it has already been created. Otherwise, the javascript library will be looping until the DOM element is found to start processing.

 

The following code block demonstrates a standard integration with example values populated for each field.

var sasVideoData= {
	id: 'myContainer',
	adData: {
		sas_siteid: '44928',
		sas_pageid: '322652',
		sas_pagename: 'linear',
		sas_target: '',
		sas_format_linears: '20180,20316,20317',
		sas_format_overlays: '19582
	}
};
sas.video.register(sasVideoData);

Registration object 

Name Description
adData The adData object. For more information, see section “Step 2: Define video placements and targeting criteria”, earlier in this document.
adRules The ad rules which determine the frequency and the size of ad breaks for different sets of content durations. For more information, see Video plugin: manage ad rules.
callbacks

The javascript functions to be executed a specific time.

For more information, see Use callback functions and Video plugin: API reference.

configuration The configuration object to customize the Video plugin. For more information, see Video plugin: configure and customize
contentData The content data, describing the video content where the in-stream video ads are inserted, used for reporting and targeting purposes. For more information, see Video plugin: send content metadata.
contentPlayer The object to grant access to the custom API of your content player, using the property api (content player API). The Video plugin uses this API for integration purposes. This is mostly used in the context of the Flowplayer. For more information, see “Flowplayer samples” in Video plugin: samples.
id The DOM object id used as the parent tag of the video element.
language The language used by the plugin. For more information, see "Customize languages" in Video plugin: configure and customize.
user The gdpr_consent user property, containing the IAB Transparency and Consent Framework (TCF) consent string. 
If this parameter isn't passed "manually" by the publisher, the Video plugin searches for an appropriate CMP function and retrieves the consent string automatically.