-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 in-renderer integration example #5859
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
adb4612
Add in-renderer integration example
hogekai 89b4480
Fix markdown linting issue in in-renderer integration example
hogekai 5a5c11c
Remove markdown linting directive from in-renderer integration example
hogekai 0566df4
Update link format in in-renderer integration documentation
hogekai 3081886
Fix URL formatting in in-renderer integration example
hogekai d5671dd
Update InRenderer.js documentation link to use HTML anchor tag
hogekai 14e6a72
Update multi-format example
hogekai e0adbe7
Fix example html title in multi format example
hogekai 7e1d15c
Enhance outstream example
hogekai dfccb72
Update dev-docs/examples/multi-format-example.md
hogekai b14ad0e
Update examples/video/outstream/pb-ve-outstream-no-server.html
hogekai d9f2004
Fix broken tab layout in outstream no ad server example
hogekai 0f48b17
Remove deprecated Prebid.js script from multi-format and in-renderer …
hogekai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
layout: example | ||
title: in-renderer Integration Example | ||
description: in-renderer Integration (formerly known as “outstream”) Example | ||
|
||
sidebarType: 1 | ||
|
||
about: | ||
- in-renderer Integration is one of the integration methods for Prebid Video | ||
- In this example, to keep it simple, ad rendering is performed using `pbjs.renderAd` | ||
- InRenderer.js, an open-source renderer optimized for in-renderer integration, is used as the renderer for in-renderer integration. For more information, see <a href="https://github.com/hogekai/in-renderer-js" target="_blank">InRenderer.js documentation</a> | ||
--- | ||
|
||
## Example | ||
|
||
{% capture htmlCodePrebid %} | ||
<h1>in-renderer Integration Example</h1> | ||
|
||
<div id="ad-unit-1"></div> | ||
{% endcapture %} | ||
|
||
{% capture jsCode %}var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
var adUnit = { | ||
code: "ad-unit-1", | ||
mediaTypes: { | ||
video: { | ||
context: "outstream", | ||
playerSize: [640, 360], | ||
mimes: ["video/mp4", "video/webm", "video/ogg"], | ||
protocols: [2, 3, 5, 6, 7, 8], | ||
api: [2], | ||
} | ||
}, | ||
bids: [ | ||
{ | ||
bidder: "michao", | ||
params: { | ||
placement: "inbanner", | ||
site: 1, | ||
test: true | ||
muuki88 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}, | ||
}, | ||
], | ||
renderer: { | ||
url: `https://cdn.jsdelivr.net/npm/in-renderer-js@1/dist/in-renderer.umd.min.js`, | ||
render: (bid) => { | ||
var inRenderer = new window.InRenderer(); | ||
inRenderer.render("ad-unit-1", bid); | ||
}, | ||
}, | ||
}; | ||
|
||
pbjs.que.push(function() { | ||
pbjs.addAdUnits(adUnit); | ||
pbjs.requestBids({ | ||
timeout: 5000, | ||
bidsBackHandler: function () { | ||
const highestCpmBids = pbjs.getHighestCpmBids("ad-unit-1"); | ||
pbjs.renderAd('ad-unit-1', highestCpmBids[0].adId); | ||
}, | ||
}); | ||
}) | ||
{% endcapture %} | ||
|
||
{% include code/web-example.html id="basic-prebid-example" html=htmlCodePrebid js=jsCode %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works! Amazing 🥳