Skip to content

Commit 38fd7ab

Browse files
committed
Update admaticBidAdapter.js
1 parent a5316e7 commit 38fd7ab

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

modules/admaticBidAdapter.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ export const spec = {
113113
ttl: 360
114114
};
115115

116-
if (resbid.mediaType === "video") {
116+
if (resbid.mediaType === "video" && isUrl(bid.party_tag)) {
117+
resbid.vastUrl = bid.party_tag;
118+
resbid.vastImpUrl = bid.iurl;
119+
} else if (resbid.mediaType === "video") {
117120
resbid.vastXml = bid.party_tag;
118121
resbid.vastImpUrl = bid.iurl;
119122
} else if (resbid.mediaType === "banner") {
@@ -127,6 +130,15 @@ export const spec = {
127130
}
128131
};
129132

133+
function isUrl(str) {
134+
try {
135+
new URL(str);
136+
return true;
137+
} catch (error) {
138+
return false;
139+
}
140+
};
141+
130142
function enrichSlotWithFloors(slot, bidRequest) {
131143
try {
132144
const slotFloors = {};

0 commit comments

Comments
 (0)