Getting Started with Long-Form Video

If you’re new to header bidding and Prebid review the following to get a general understanding of Prebid.js.

See Prebid.js Video Overview for a general description and high-level overview of working with video demand in Prebid.js.

Ad Server Setup

Prebid uses FreeWheel for the distrubtion of Creatives. Refer to Setting Up Prebid video in FreeWheel for an Ad Ops getting started guide.


Download Prebid.js

To implement header bidding for long-form video start by downloading Prebid.js.

Before downloading, select the adapters you want to include. (You can add more adapters later.)

  • Include at least one video adapter. Find a list of available video adapters here.
  • Include the FreeWheel Ad Server module.
  • Include the Category Translation module.
  • If you’ll be integrating with Prebid Server, be sure to include “Prebid Server” in the list of adapters.

Ensuring Competitve Separation

You will need to configure Prebid to ensure competitive separation, the process of preventing two ads from the same industry appearing within an ad pod. After you have instantiated a Prebid instance call the setConfig method and add the following key-values.

  'adpod': {
    'brandCategoryExclusion': true

Define Prebid Ad Units

As with instream and outstream videos, you must set the video context for long-form ad units. The context setting for long-form video is adpod . There are also some addtional required and optional parameters (see list below).

As with all ad unit types you must include a list of bidders. The parameters differ depending on which bidder you’re including. For a list of parameters for each bidder, see Bidders’ Params.

var longFormatAdUnit = {
    video: {
       // required params
       context: 'adpod',
       playerSize: [640, 480],
       adPodDurationSec: 300,
       durationRangeSec: [15, 30],

       // optional params
       requireExactDuration: true,
       tvSeriesName: 'TvName',
       tvEpisodeName: 'episodeName',
       tvSeasonNumber: 3,
       tvEpisodeNumber: 6,
       contentLength: 300, // time in seconds,
       contentMode: 'on-demand'

    bids: [{
            bidder: 'appnexus',
            params: {
                placementId: 123456789,

Required Parameters

video.context A string indicating the ad unit type.

An array of numbers indicating the height and width of the video player size that will be passed to the demand partners.

A number indicating how long the ad pod should run.

A number indicating how long the creatives of an ad pod should run.

Optional Parameters

A boolean indicating if the returned creatives running time must match the value of adPodDurationSec

A string representing the name of the television series the adpod will appear in.

A string representing the episode name of the television series the adpod will appear in.

A number representing the season number of the television series the adpod will appear in.

A number representing the episode number of the television series the adpod will appear in.

A number representing the length of the content the adpod will appear in.

A string indicating the type of content being displayed in the video player. There are two options, live and on-demand.

Prebid Server

If you’re using Prebid Server, you must also include the field, as this is required by OpenRTB.

        mediaTypes: {
            video: {
                context: 'apod', // or 'instream', 'outstream'
                playerSize: [640, 480],
                mimes: ['video/mp4'],

For more on Prebid Server ad unit requirements, see Getting Started with Prebid Server – Video.


After you’ve defined your ad units, you can continue with the rest of your configuration.


See Prebid Video Examples for examples of long-form video ads.