Skip to content

Commit

Permalink
aniviewBidAdapter - update renderer config (#5636)
Browse files Browse the repository at this point in the history
* Support new aniview bid adapter

* Support new aniview bid adapter

* Support new aniview bid adapter

* Support new aniview bid adapter

* Fix Consent parameters

* Update aniviewBidAdapter.js

V3 support

* Update aniviewBidAdapter.js

* Update aniviewBidAdapter.js

Update refererInfo

* Update aniviewBidAdapter.js

Fix tabs and spaces

* Update aniviewBidAdapter.js

fixes

* Update aniviewBidAdapter.js

* Update aniviewBidAdapter.js

Add ccpa support

* Update aniviewBidAdapter.js

Typo

* Update aniviewBidAdapter.js

* Update aniviewBidAdapter.js

* Fix size and sample

Fixed sizes from playerSize
Updated md sample

* Fix tabs

* Fix sizes

* Recheck

* Add tgt parameter

* Update sample

* Add support for cookie sync + tests

* Add support for cookie sync + tests

* Add support for cookie sync + tests

* Support aliases

Support aliases

* Update

Update

* Fix lint

Fix lint

* Update spec

Update spec

* Aniview Bid Adapter: Added the new alias

* Aniview Bid Adapter: Added the new configs for the renderer

* Aniview Bid Adapter: Added unit tests for the renderer

* Aniview Bid Adapter: Have added gvlid

Co-authored-by: Roman Shevchenko <[email protected]>
  • Loading branch information
itaynave and roshecode authored Aug 26, 2020
1 parent eb1aea4 commit 347be07
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
24 changes: 22 additions & 2 deletions modules/aniviewBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { registerBidder } from '../src/adapters/bidderFactory.js';
import { Renderer } from '../src/Renderer.js';

const BIDDER_CODE = 'aniview';
const GVLID = 780;
const TTL = 600;

function avRenderer(bid) {
Expand All @@ -24,10 +25,28 @@ function avRenderer(bid) {
}

function newRenderer(bidRequest) {
let playerDomain = bidRequest && bidRequest.bidRequest && bidRequest.bidRequest.params && bidRequest.bidRequest.params.playerDomain ? bidRequest.bidRequest.params.playerDomain : 'player.aniview.com';
let playerDomain = 'player.aniview.com';
const config = {};

if (bidRequest && bidRequest.bidRequest && bidRequest.bidRequest.params) {
const params = bidRequest.bidRequest.params

if (params.playerDomain) {
playerDomain = params.playerDomain;
}

if (params.AV_PUBLISHERID) {
config.AV_PUBLISHERID = params.AV_PUBLISHERID;
}

if (params.AV_CHANNELID) {
config.AV_CHANNELID = params.AV_CHANNELID;
}
}

const renderer = Renderer.install({
url: 'https://' + playerDomain + '/script/6.1/prebidRenderer.js',
config: {},
config: config,
loaded: false,
});

Expand Down Expand Up @@ -252,6 +271,7 @@ function getUserSyncs(syncOptions, serverResponses) {

export const spec = {
code: BIDDER_CODE,
gvlid: GVLID,
aliases: ['avantisvideo', 'selectmediavideo'],
supportedMediaTypes: [VIDEO],
isBidRequestValid,
Expand Down
27 changes: 27 additions & 0 deletions test/spec/modules/aniviewBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,33 @@ describe('ANIVIEW Bid Adapter Test', function () {
let result = spec.interpretResponse(nobidResponse, bidRequest);
expect(result.length).to.equal(0);
});

it('should add renderer if outstream context', function () {
const bidRequest = spec.buildRequests([
{
bidId: '253dcb69fb2577',
params: {
playerDomain: 'example.com',
AV_PUBLISHERID: '55b78633181f4603178b4568',
AV_CHANNELID: '55b7904d181f46410f8b4568'
},
mediaTypes: {
video: {
playerSize: [[640, 480]],
context: 'outstream'
}
}
}
])[0]
const bidResponse = spec.interpretResponse(serverResponse, bidRequest)[0]

expect(bidResponse.renderer.url).to.equal('https://example.com/script/6.1/prebidRenderer.js')
expect(bidResponse.renderer.config.AV_PUBLISHERID).to.equal('55b78633181f4603178b4568')
expect(bidResponse.renderer.config.AV_CHANNELID).to.equal('55b7904d181f46410f8b4568')
expect(bidResponse.renderer.loaded).to.equal(false)
expect(bidResponse.width).to.equal(640)
expect(bidResponse.height).to.equal(480)
})
});

describe('getUserSyncs', function () {
Expand Down

0 comments on commit 347be07

Please sign in to comment.