diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js
index 916e5c42ee95..af981a226c08 100644
--- a/modules/ixBidAdapter.js
+++ b/modules/ixBidAdapter.js
@@ -84,6 +84,14 @@ const LOCAL_STORAGE_KEY = 'ixdiag';
let hasRegisteredHandler = false;
export const storage = getStorageManager(GLOBAL_VENDOR_ID, BIDDER_CODE);
+// Possible values for bidResponse.seatBid[].bid[].mtype which indicates the type of the creative markup so that it can properly be associated with the right sub-object of the BidRequest.Imp.
+const MEDIA_TYPES = {
+ Banner: 1,
+ Video: 2,
+ Audio: 3,
+ Native: 4
+}
+
/**
* Transform valid bid request config object to banner impression object that will be sent to ad server.
*
@@ -275,9 +283,14 @@ function parseBid(rawBid, currency, bidRequest) {
bid.currency = currency;
bid.creativeId = rawBid.hasOwnProperty('crid') ? rawBid.crid : '-';
- // in the event of a video
- if (deepAccess(rawBid, 'ext.vasturl')) {
+ if (rawBid.mtype == MEDIA_TYPES.Video) {
+ bid.vastXml = rawBid.adm
+ } else if (rawBid.ext && rawBid.ext.vasturl) {
bid.vastUrl = rawBid.ext.vasturl
+ }
+
+ // in the event of a video
+ if ((rawBid.ext && rawBid.ext.vasturl) || rawBid.mtype == MEDIA_TYPES.Video) {
bid.width = bidRequest.video.w;
bid.height = bidRequest.video.h;
bid.mediaType = VIDEO;
@@ -1066,7 +1079,13 @@ function outstreamRenderer(bid) {
timeout: 3000
};
- window.IXOutstreamPlayer(bid.vastUrl, bid.adUnitCode, config);
+ // IXOutstreamPlayer supports both vastUrl and vastXml, so we can pass either.
+ // Since vastUrl is going to be deprecated from exchange response, vastXml takes priority.
+ if (bid.vastXml) {
+ window.IXOutstreamPlayer(bid.vastXml, bid.adUnitCode, config);
+ } else {
+ window.IXOutstreamPlayer(bid.vastUrl, bid.adUnitCode, config);
+ }
});
}
diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js
index 4345aae83548..32ce40f25cb9 100644
--- a/test/spec/modules/ixBidAdapter_spec.js
+++ b/test/spec/modules/ixBidAdapter_spec.js
@@ -353,6 +353,37 @@ describe('IndexexchangeAdapter', function () {
]
};
+ const DEFAULT_VIDEO_BID_RESPONSE_WITH_MTYPE_SET = {
+ cur: 'USD',
+ id: '1aa2bb3cc4de',
+ seatbid: [
+ {
+ bid: [
+ {
+ crid: '12346',
+ adomain: ['www.abcd.com'],
+ adid: '14851456',
+ impid: '1a2b3c4e',
+ cid: '3051267',
+ price: 110,
+ id: '2',
+ mtype: 2,
+ adm: ' Test In-Stream Video Test In-Stream Video