Skip to content

Commit

Permalink
Update admaticBidAdapter.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkaya84 committed Apr 27, 2023
1 parent a5316e7 commit 38fd7ab
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion modules/admaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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 = {};
Expand Down

0 comments on commit 38fd7ab

Please sign in to comment.