Skip to content

Commit

Permalink
Update show-outstream-video-ads.md for backupOnly renderers (prebid#2259
Browse files Browse the repository at this point in the history
)

* Update show-outstream-video-ads.md

* Update show-outstream-video-ads.md

* Update show-outstream-video-ads.md
  • Loading branch information
patmmccann authored Aug 26, 2020
1 parent 22f7e7e commit 7c48e69
Showing 1 changed file with 21 additions and 8 deletions.
29 changes: 21 additions & 8 deletions dev-docs/show-outstream-video-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,17 @@ To display an outstream video, two things are needed:

Prebid.js will select the `renderer` used to display the outstream video in the following way:

1. If a `renderer` is associated with the Prebid adUnit, it will be used to display any outstream demand associated with that adUnit. Below, we will provide an example of an adUnit with an associated `renderer`.
1. If a `renderer` is associated with the Prebid adUnit, it will be used to display any outstream demand associated with that adUnit. Below, we will provide an example of an adUnit with an associated `renderer`. If that renderer is specified as backup only, it will only be used when no other renderer is found.
2. If no `renderer` is specified on the Prebid adUnit, Prebid will invoke the renderer associated with the winning (or selected) demand partner video bid.

{: .alert.alert-warning :}
At this time, since not all demand partners return a renderer with their video bid responses, we recommend that publishers associate a `renderer` with their Prebid video adUnits, if possible. By doing so, any Prebid adapter that supports video will be able to provide demand for a given outstream slot.
At this time, since not all demand partners return a renderer with their video bid responses, we recommend that publishers associate a `renderer` with their Prebid video adUnits, if possible. By doing so, any Prebid adapter that supports video will be able to provide demand for a given outstream slot. Choosing a backup only renderer allows publishers to access demand with or without an attached renderer.

Renderers are associated with adUnits through the `adUnit.renderer` object. This object contains two fields:
Renderers are associated with adUnits through the `adUnit.renderer` object. This object contains three fields:

1. `url` -- Points to a file containing the renderer script.
2. `render` -- A function that tells Prebid.js how to invoke the renderer script.
3. `backupOnly` -- Optional field, if set to 'true', buyer or adapter renderer will be preferred

{% highlight js %}

Expand All @@ -90,14 +91,26 @@ pbjs.addAdUnit({
},
renderer: {
url: 'https://acdn.adnxs.com/video/outstream/ANOutstreamVideo.js',
backupOnly: 'true', // prefer demand renderer
render: function (bid) {
ANOutstreamVideo.renderAd({
targetId: bid.adUnitCode,
adResponse: bid.adResponse,
adResponse = {
ad: {
video: {
content: bid.vastXml,
player_height: bid.playerHeight,
player_width: bid.playerWidth
}
}
}
// push to render queue because ANOutstreamVideo may not be loaded yet.
bid.renderer.push(() => {
ANOutstreamVideo.renderAd({
targetId: bid.adUnitCode, // target div id to render video.
adResponse: adResponse
});
});
}
},
...
}
});

{% endhighlight %}
Expand Down

0 comments on commit 7c48e69

Please sign in to comment.