Skip to content

Commit

Permalink
Brightcom Bid Adapter: use getFloor function (#6918)
Browse files Browse the repository at this point in the history
  • Loading branch information
prBigBrother authored Jun 2, 2021
1 parent f957aa7 commit 7e67b4e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion modules/brightcomBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function buildRequests(bidReqs, bidderRequest) {
},
tagid: String(bid.adUnitCode)
};
const bidFloor = utils.getBidIdParameter('bidFloor', bid.params);
const bidFloor = _getBidFloor(bid);
if (bidFloor) {
imp.bidfloor = bidFloor;
}
Expand Down Expand Up @@ -251,4 +251,20 @@ function _getPercentInView(element, topWin, { w, h } = {}) {
return 0;
}

function _getBidFloor(bid) {
if (!utils.isFn(bid.getFloor)) {
return bid.params.bidFloor ? bid.params.bidFloor : null;
}

let floor = bid.getFloor({
currency: 'USD',
mediaType: '*',
size: '*'
});
if (utils.isPlainObject(floor) && !isNaN(floor.floor) && floor.currency === 'USD') {
return floor.floor;
}
return null;
}

registerBidder(spec);

0 comments on commit 7e67b4e

Please sign in to comment.