Skip to content

Commit

Permalink
Unruly: bid.dur support
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Haines committed Apr 19, 2024
1 parent 7635519 commit 5a324b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 8 additions & 2 deletions adapters/unruly/unruly.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,16 @@ func (a *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest
if err != nil {
errs = append(errs, err...)
} else {
bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
bid := adapters.TypedBid{
Bid: &sb.Bid[i],
BidType: bidType,
})
}
if bidType == openrtb_ext.BidTypeVideo && sb.Bid[i].Dur > 0 {
bid.BidVideo = &openrtb_ext.ExtBidPrebidVideo{
Duration: int(sb.Bid[i].Dur),
}
}
bidResponse.Bids = append(bidResponse.Bids, &bid)
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions adapters/unruly/unrulytest/exemplary/simple-video.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"video/mp4"
],
"minduration": 1,
"maxduration": 2,
"maxduration": 60,
"protocols": [1,3,5],
"w": 1020,
"h": 780,
Expand Down Expand Up @@ -41,7 +41,7 @@
"video/mp4"
],
"minduration": 1,
"maxduration": 2,
"maxduration": 60,
"protocols": [1,3,5],
"w": 1020,
"h": 780,
Expand Down Expand Up @@ -78,7 +78,8 @@
"adm": "some-test-ad",
"crid": "crid_10",
"w": 1024,
"h": 576
"h": 576,
"dur": 30
}
]
}
Expand All @@ -97,7 +98,8 @@
"adm": "some-test-ad",
"crid": "crid_10",
"w": 1024,
"h": 576
"h": 576,
"dur": 30
},
"type": "video"
}]
Expand Down

0 comments on commit 5a324b3

Please sign in to comment.