Skip to content

Commit

Permalink
Support min &max duration for onevideo (#5079)
Browse files Browse the repository at this point in the history
* outstream changes

* removing global filtet

* reverting page

* message

* adapter change

* remove space

* testcases

* testpage

* spaces for test page

* renderer exist case

* reverting package-lock.json

* adding schain object

* adding tagid

* syntaxx error fix

* video.html

* space trailing

* space

* tagid

* inventoryId and placement

* rewarded video

* added unit test case

* comment

* changes

* min max dduration

* .md file

* min max

* md change

* version

* tests fix

Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
Co-authored-by: Deepthi Neeladri Sravana <[email protected]>
  • Loading branch information
12 people authored Apr 8, 2020
1 parent 78602ff commit 75f13a0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
11 changes: 9 additions & 2 deletions modules/oneVideoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'oneVideo';
export const spec = {
code: 'oneVideo',
gvlid: 25,
VERSION: '3.0.0',
VERSION: '3.0.1',
ENDPOINT: 'https://ads.adaptv.advertising.com/rtb/openrtb?ext_id=',
SYNC_ENDPOINT1: 'https://cm.g.doubleclick.net/pixel?google_nid=adaptv_dbm&google_cm&google_sc',
SYNC_ENDPOINT2: 'https://pr-bh.ybp.yahoo.com/sync/adaptv_ortb/{combo_uid}',
Expand Down Expand Up @@ -215,6 +214,14 @@ function getRequestData(bid, consentData, bidRequest) {
if (bid.params.video.placement) {
bidData.imp[0].banner.placement = bid.params.video.placement
}
if (bid.params.video.maxduration) {
bidData.imp[0].banner.ext = bidData.imp[0].banner.ext || {}
bidData.imp[0].banner.ext.maxduration = bid.params.video.maxduration
}
if (bid.params.video.minduration) {
bidData.imp[0].banner.ext = bidData.imp[0].banner.ext || {}
bidData.imp[0].banner.ext.minduration = bid.params.video.minduration
}
}
if (bid.params.video.inventoryid) {
bidData.imp[0].ext.inventoryid = bid.params.video.inventoryid
Expand Down
4 changes: 3 additions & 1 deletion modules/oneVideoBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ Connects to One Video demand source to fetch bids.
sid: <scpid>,
rewarded: 1,
placement: 1,
inventoryid: 123
inventoryid: 123,
minduration: 10,
maxduration: 30,
},
site: {
id: 1,
Expand Down
14 changes: 11 additions & 3 deletions test/spec/modules/oneVideoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('OneVideoBidAdapter', function () {
const placement = bidRequest.params.video.placement;
const rewarded = bidRequest.params.video.rewarded;
const inventoryid = bidRequest.params.video.inventoryid;
const VERSION = '3.0.0';
const VERSION = '3.0.1';
expect(data.imp[0].video.w).to.equal(width);
expect(data.imp[0].video.h).to.equal(height);
expect(data.imp[0].bidfloor).to.equal(bidRequest.params.bidfloor);
Expand Down Expand Up @@ -292,7 +292,9 @@ describe('OneVideoBidAdapter', function () {
placement: 1,
inventoryid: 123,
sid: 134,
display: 1
display: 1,
minduration: 10,
maxduration: 30
},
site: {
id: 1,
Expand All @@ -314,6 +316,8 @@ describe('OneVideoBidAdapter', function () {
expect(data.imp[0].ext.inventoryid).to.equal(bidRequest.params.video.inventoryid);
expect(data.imp[0].banner.mimes).to.equal(bidRequest.params.video.mimes);
expect(data.imp[0].banner.placement).to.equal(bidRequest.params.video.placement);
expect(data.imp[0].banner.ext.minduration).to.equal(bidRequest.params.video.minduration);
expect(data.imp[0].banner.ext.maxduration).to.equal(bidRequest.params.video.maxduration);
expect(data.site.id).to.equal(bidRequest.params.site.id);
});
it('should send video object when display is other than 1', function () {
Expand Down Expand Up @@ -384,7 +388,9 @@ describe('OneVideoBidAdapter', function () {
delivery: [2],
playbackmethod: [1, 5],
placement: 123,
sid: 134
sid: 134,
minduration: 10,
maxduration: 30
},
site: {
id: 1,
Expand All @@ -406,6 +412,8 @@ describe('OneVideoBidAdapter', function () {
expect(data.imp[0].video.mimes).to.equal(bidRequest.params.video.mimes);
expect(data.imp[0].video.protocols).to.equal(bidRequest.params.video.protocols);
expect(data.imp[0].video.linearity).to.equal(1);
expect(data.imp[0].video.maxduration).to.equal(bidRequest.params.video.maxduration);
expect(data.imp[0].video.minduration).to.equal(bidRequest.params.video.minduration);
});
describe('getUserSyncs', function () {
const GDPR_CONSENT_STRING = 'GDPR_CONSENT_STRING';
Expand Down

0 comments on commit 75f13a0

Please sign in to comment.