From 38fd7abec701d8a4750f9e95eaeb40fb67e9f0e6 Mon Sep 17 00:00:00 2001 From: Fatih Kaya Date: Thu, 27 Apr 2023 09:44:30 +0300 Subject: [PATCH] Update admaticBidAdapter.js --- modules/admaticBidAdapter.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/admaticBidAdapter.js b/modules/admaticBidAdapter.js index 85b441b3db9..4905c19be40 100644 --- a/modules/admaticBidAdapter.js +++ b/modules/admaticBidAdapter.js @@ -113,7 +113,10 @@ export const spec = { ttl: 360 }; - if (resbid.mediaType === "video") { + if (resbid.mediaType === "video" && isUrl(bid.party_tag)) { + resbid.vastUrl = bid.party_tag; + resbid.vastImpUrl = bid.iurl; + } else if (resbid.mediaType === "video") { resbid.vastXml = bid.party_tag; resbid.vastImpUrl = bid.iurl; } else if (resbid.mediaType === "banner") { @@ -127,6 +130,15 @@ export const spec = { } }; +function isUrl(str) { + try { + new URL(str); + return true; + } catch (error) { + return false; + } +}; + function enrichSlotWithFloors(slot, bidRequest) { try { const slotFloors = {};