Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for publisher-defined outstream renderers #1357

Merged
merged 1 commit into from
Jul 17, 2017

Conversation

matthewlane
Copy link
Collaborator

Type of change

  • Feature

Description of change

This change adds the ability to specify a renderer to use for outstream bids. Currently, an outstream bid response is accompanied by a renderer in the form of a url that points to a script containing the renderer software. This supplied renderer is used by Prebid to load and play the winning outstream bid.

If a publisher specifies a renderer on an outstream ad unit, this renderer will be used to load and play the outstream bid, instead of the renderer that is supplied with the bid. If both an ad unit renderer and a bid renderer are present, the ad unit renderer will be used.

In addition to a url pointing to the render script, a function that invokes the renderer is required to tell Prebid how to use the script to render the bid. A publisher can define these pieces with the renderer property in an outstream ad unit. The renderer property is an object with a url that points to the render script, and a render function that receives a bid parameter.

pbjs.addAdUnit({
  code: 'video1',
  sizes: [ 640, 480 ],
  mediaType: 'video-outstream',
  renderer: {
    url: 'http://cdn.adnxs.com/renderer/video/ANOutstreamVideo.js',
    render: function(bid) {
      ANOutstreamVideo.renderAd({
        targetId: bid.adUnitCode,
        adResponse: bid.adResponse,
      });
    }
  },
  bids: [
    {
      bidder: 'appnexusAst',
      params: {
        placementId: '5768085',
        video: {
          skippable: true,
          playback_method: [ 'auto_play_sound_off' ]
        }
      }
    }
  ]
});

mkendall07
mkendall07 previously approved these changes Jul 11, 2017
mkendall07
mkendall07 previously approved these changes Jul 12, 2017
@mkendall07
Copy link
Member

@matthewlane You'll need to rebase this.

@dbemiller dbemiller merged commit 55ae941 into master Jul 17, 2017
@matthewlane matthewlane deleted the feature/pub-defined-renderer branch July 17, 2017 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants