Sample Brightcove Player Prebid Plugin Integration - Prebid After Player is Loaded


The simplest method for using the Brightcove Prebid Plugin is to invoke prebid and render the ad after the Brightcove Player has been loaded.


  • Simpler publisher integration - the integration code only needs to occur in the body of the document where the Brightcove Player is loaded.
  • Publisher may register the plugin in Brightcove Studio or on page, according to their preference.
  • Because all of the code will run in the same document where the Brightcove Player is located, there are no cross-domain issues (with potentially one exception, noted in the “Caveats” section below).


  • Potentially longer latency in rendering the selected ad; the observed latency is directly related to how long the prebid process is allowed to run.


  • If the Brightcove Player is being embedded in a cross-domain (unfriendly) iFrame and the publisher is using a preferred ad server to determine the selected ad, then the publisher’s code to select the winning ad must run within the same iFrame where the Brightcove Player is located.

Sample Code

The following is a sample Brightcove Player Prebid Plugin integration that invokes prebid after the Brightcove Player has been loaded.

<!doctype html>
    <meta charset="utf-8">
    <title>Brightcove Player Prebid Plugin - Prebid in Body</title>

    <link href="" rel="stylesheet">
    <link href="" rel="stylesheet">

<body >
<div style="background: #ff8800; color: #ffffff; overflow:scroll; width:1000px; height:800px;">

    <div id="parentContainer1" style="width:640px; position:absolute; top:100px; left:70px; z-index:1000;">
        <video id="player"
            class="video-js" controls width="600" height="337.5"></video>
        <script src="//"></script>

<script type="text/javascript" src=""></script>
    // register the plugin

    // define the options (both prebid and render options)
    var options = {};

    // set the prebid options
    // specify prebid parameters as the value of biddersSpec
    // the set of bidders here shows how to specify the AppNexus video bidder:  appnexus
    var params = {
         code : 'my-video-tag',
         sizes : [640, 480],
         mediaType: 'video',
         bids: [
                    bidder: 'appnexus',
                    params: {
                        placementId: 12334567,
                        video: {
                            skippable: true,
                            playback_method: ['auto_play_sound_off']
     options.biddersSpec = params;

     // set the Google Ad Manager Parameters
     // use this only if you want to use Google Ad Manager as your primary ad server
        var dfpParams = {
            params : {
                iu : '/1234456/prebid_cache_video_ad_unit_test',
                output : 'vast'

     options.dfpParameters = dfpParams;

    // add the render options
    // set timeOffset for a preroll
    options.timeOffset = 'start';

    // other publisher preferences can be passed in if needed
    options.skippable = {enabled: true, videoThreshold : 16, videoOffset : 5};

    // invoke doPrebid which will run prebid and then render the ad
    BCVideo_PrebidVastPlugin.renderAd(options, 'player');