File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,14 @@ export const spec = {
161
161
spotxReq . video . startdelay = 0 + Boolean ( utils . getBidIdParameter ( 'start_delay' , bid . params ) ) ;
162
162
}
163
163
164
+ if ( utils . getBidIdParameter ( 'min_duration' , bid . params ) != '' ) {
165
+ spotxReq . video . minduration = utils . getBidIdParameter ( 'min_duration' , bid . params ) ;
166
+ }
167
+
168
+ if ( utils . getBidIdParameter ( 'max_duration' , bid . params ) != '' ) {
169
+ spotxReq . video . maxduration = utils . getBidIdParameter ( 'max_duration' , bid . params ) ;
170
+ }
171
+
164
172
if ( bid . crumbs && bid . crumbs . pubcid ) {
165
173
pubcid = bid . crumbs . pubcid ;
166
174
}
Original file line number Diff line number Diff line change @@ -144,7 +144,9 @@ describe('the spotx adapter', function () {
144
144
price_floor : 123 ,
145
145
start_delay : true ,
146
146
number_of_ads : 2 ,
147
- spotx_all_google_consent : 1
147
+ spotx_all_google_consent : 1 ,
148
+ min_duration : 5 ,
149
+ max_duration : 10
148
150
} ;
149
151
150
152
bid . userId = {
@@ -169,6 +171,10 @@ describe('the spotx adapter', function () {
169
171
170
172
request = spec . buildRequests ( [ bid ] , bidRequestObj ) [ 0 ] ;
171
173
expect ( request . data . id ) . to . equal ( 54321 ) ;
174
+ expect ( request . data . imp . video ) . to . contain ( {
175
+ minduration : 5 ,
176
+ maxduration : 10
177
+ } )
172
178
expect ( request . data . imp . video . ext ) . to . deep . equal ( {
173
179
ad_volume : 1 ,
174
180
hide_skin : 1 ,
@@ -297,6 +303,18 @@ describe('the spotx adapter', function () {
297
303
expect ( request . data . user . ext . consent ) . to . equal ( 'consent123' ) ;
298
304
expect ( request . data . regs . ext . us_privacy ) . to . equal ( '1YYY' ) ;
299
305
} ) ;
306
+
307
+ it ( 'should pass min and max duration params' , function ( ) {
308
+ var request ;
309
+
310
+ bid . params . min_duration = 3
311
+ bid . params . max_duration = 15
312
+
313
+ request = spec . buildRequests ( [ bid ] , bidRequestObj ) [ 0 ] ;
314
+
315
+ expect ( request . data . imp . video . minduration ) . to . equal ( 3 ) ;
316
+ expect ( request . data . imp . video . maxduration ) . to . equal ( 15 ) ;
317
+ } ) ;
300
318
} ) ;
301
319
302
320
describe ( 'interpretResponse' , function ( ) {
You can’t perform that action at this time.
0 commit comments