prebid.js 7.22.0 → 7.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/33acrossBidAdapter.js +1 -1
  2. package/dist/aaxBlockmeterRtdProvider.js +1 -0
  3. package/dist/adagioBidAdapter.js +1 -1
  4. package/dist/adbookpspBidAdapter.js +1 -1
  5. package/dist/adgenerationBidAdapter.js +1 -1
  6. package/dist/admaticBidAdapter.js +1 -0
  7. package/dist/adrelevantisBidAdapter.js +1 -1
  8. package/dist/adtrgtmeBidAdapter.js +1 -1
  9. package/dist/adxcgBidAdapter.js +1 -1
  10. package/dist/adyoulikeBidAdapter.js +1 -1
  11. package/dist/ajaBidAdapter.js +1 -1
  12. package/dist/amxBidAdapter.js +1 -1
  13. package/dist/amxIdSystem.js +1 -1
  14. package/dist/analyticsAdapter.js +1 -1
  15. package/dist/appierAnalyticsAdapter.js +1 -1
  16. package/dist/appnexusBidAdapter.js +1 -1
  17. package/dist/asoBidAdapter.js +1 -1
  18. package/dist/audiencerunBidAdapter.js +1 -1
  19. package/dist/axonixBidAdapter.js +1 -1
  20. package/dist/bidViewability.js +1 -1
  21. package/dist/bidViewabilityIO.js +1 -1
  22. package/dist/bidglassBidAdapter.js +1 -1
  23. package/dist/big-richmediaBidAdapter.js +1 -1
  24. package/dist/bluebillywigBidAdapter.js +1 -1
  25. package/dist/bridgewellBidAdapter.js +1 -1
  26. package/dist/brightMountainMediaBidAdapter.js +1 -1
  27. package/dist/browsiRtdProvider.js +1 -1
  28. package/dist/carodaBidAdapter.js +1 -1
  29. package/dist/chtnwBidAdapter.js +1 -0
  30. package/dist/cleanioRtdProvider.js +1 -1
  31. package/dist/concertBidAdapter.js +1 -1
  32. package/dist/connectIdSystem.js +1 -1
  33. package/dist/connectadBidAdapter.js +1 -1
  34. package/dist/consentManagement.js +1 -1
  35. package/dist/consentManagementUsp.js +1 -1
  36. package/dist/consumableBidAdapter.js +1 -1
  37. package/dist/conversantBidAdapter.js +1 -1
  38. package/dist/craftBidAdapter.js +1 -1
  39. package/dist/criteoBidAdapter.js +1 -1
  40. package/dist/currency.js +1 -1
  41. package/dist/dependencies.json +19 -0
  42. package/dist/dfpAdServerVideo.js +1 -1
  43. package/dist/dgkeywordRtdProvider.js +1 -1
  44. package/dist/dspxBidAdapter.js +1 -1
  45. package/dist/eplanningBidAdapter.js +1 -1
  46. package/dist/finativeBidAdapter.js +1 -1
  47. package/dist/gdprEnforcement.js +1 -1
  48. package/dist/glimpseBidAdapter.js +1 -1
  49. package/dist/gmosspBidAdapter.js +1 -1
  50. package/dist/goldbachBidAdapter.js +1 -1
  51. package/dist/googleAnalyticsAdapter.js +1 -1
  52. package/dist/gridBidAdapter.js +1 -1
  53. package/dist/gridNMBidAdapter.js +1 -1
  54. package/dist/growthCodeIdSystem.js +1 -1
  55. package/dist/gumgumBidAdapter.js +1 -1
  56. package/dist/h12mediaBidAdapter.js +1 -1
  57. package/dist/id5AnalyticsAdapter.js +1 -1
  58. package/dist/id5IdSystem.js +1 -1
  59. package/dist/impactifyBidAdapter.js +1 -1
  60. package/dist/improvedigitalBidAdapter.js +1 -1
  61. package/dist/inmarBidAdapter.js +1 -1
  62. package/dist/insticatorBidAdapter.js +1 -1
  63. package/dist/instreamTracking.js +1 -1
  64. package/dist/ixBidAdapter.js +1 -1
  65. package/dist/jixieBidAdapter.js +1 -1
  66. package/dist/justpremiumBidAdapter.js +1 -1
  67. package/dist/jwplayerVideoProvider.js +1 -0
  68. package/dist/kargoBidAdapter.js +1 -1
  69. package/dist/konduitAnalyticsAdapter.js +1 -1
  70. package/dist/kueezBidAdapter.js +1 -1
  71. package/dist/kueezRtbBidAdapter.js +1 -0
  72. package/dist/lassoBidAdapter.js +1 -1
  73. package/dist/lifestreetBidAdapter.js +1 -1
  74. package/dist/liveyieldAnalyticsAdapter.js +1 -1
  75. package/dist/logicadBidAdapter.js +1 -1
  76. package/dist/loglyliftBidAdapter.js +1 -1
  77. package/dist/magniteAnalyticsAdapter.js +1 -1
  78. package/dist/malltvAnalyticsAdapter.js +1 -1
  79. package/dist/marsmediaBidAdapter.js +1 -1
  80. package/dist/mediafuseBidAdapter.js +1 -1
  81. package/dist/mediakeysBidAdapter.js +1 -1
  82. package/dist/mediasquareBidAdapter.js +1 -1
  83. package/dist/mgidBidAdapter.js +1 -1
  84. package/dist/mgidRtdProvider.js +1 -0
  85. package/dist/minutemediaBidAdapter.js +1 -1
  86. package/dist/multibid.js +1 -1
  87. package/dist/not-for-prod/prebid.js +153 -141
  88. package/dist/oguryBidAdapter.js +1 -1
  89. package/dist/onetagBidAdapter.js +1 -1
  90. package/dist/ooloAnalyticsAdapter.js +1 -1
  91. package/dist/openxOrtbBidAdapter.js +1 -1
  92. package/dist/ortbConverter.js +1 -0
  93. package/dist/outbrainBidAdapter.js +1 -1
  94. package/dist/oxxionRtdProvider.js +1 -0
  95. package/dist/parrableIdSystem.js +1 -1
  96. package/dist/pbsExtensions.js +1 -0
  97. package/dist/permutiveRtdProvider.js +1 -1
  98. package/dist/pixfutureBidAdapter.js +1 -1
  99. package/dist/prebid-core.js +1 -1
  100. package/dist/prebidServerBidAdapter.js +1 -1
  101. package/dist/priceFloors.js +1 -1
  102. package/dist/pubCommonId.js +1 -1
  103. package/dist/publinkIdSystem.js +1 -1
  104. package/dist/pubmaticBidAdapter.js +1 -1
  105. package/dist/pubwiseAnalyticsAdapter.js +1 -1
  106. package/dist/pxyzBidAdapter.js +1 -1
  107. package/dist/quantcastBidAdapter.js +1 -1
  108. package/dist/readpeakBidAdapter.js +1 -1
  109. package/dist/relaidoBidAdapter.js +1 -1
  110. package/dist/rhythmoneBidAdapter.js +1 -1
  111. package/dist/riseBidAdapter.js +1 -1
  112. package/dist/rtdModule.js +1 -1
  113. package/dist/rubiconAnalyticsAdapter.js +1 -1
  114. package/dist/rubiconBidAdapter.js +1 -1
  115. package/dist/schain.js +1 -1
  116. package/dist/seedingAllianceBidAdapter.js +1 -1
  117. package/dist/seedtagBidAdapter.js +1 -1
  118. package/dist/sharethroughAnalyticsAdapter.js +1 -1
  119. package/dist/sharethroughBidAdapter.js +1 -1
  120. package/dist/shinezBidAdapter.js +1 -1
  121. package/dist/smaatoBidAdapter.js +1 -1
  122. package/dist/smartadserverBidAdapter.js +1 -1
  123. package/dist/smartxBidAdapter.js +1 -1
  124. package/dist/smilewantedBidAdapter.js +1 -1
  125. package/dist/sonobiBidAdapter.js +1 -1
  126. package/dist/sovrnAnalyticsAdapter.js +1 -1
  127. package/dist/sovrnBidAdapter.js +1 -1
  128. package/dist/spotxBidAdapter.js +1 -1
  129. package/dist/sspBCBidAdapter.js +1 -1
  130. package/dist/sublimeBidAdapter.js +1 -1
  131. package/dist/synacormediaBidAdapter.js +1 -1
  132. package/dist/targetVideoBidAdapter.js +1 -1
  133. package/dist/teadsBidAdapter.js +1 -1
  134. package/dist/teadsIdSystem.js +1 -1
  135. package/dist/trionBidAdapter.js +1 -1
  136. package/dist/tripleliftBidAdapter.js +1 -1
  137. package/dist/ttdBidAdapter.js +1 -1
  138. package/dist/ucfunnelAnalyticsAdapter.js +1 -1
  139. package/dist/underdogmediaBidAdapter.js +1 -1
  140. package/dist/undertoneBidAdapter.js +1 -1
  141. package/dist/userId.js +1 -1
  142. package/dist/vidazooBidAdapter.js +1 -1
  143. package/dist/video.js +1 -0
  144. package/dist/videoModule.js +1 -0
  145. package/dist/videobyteBidAdapter.js +1 -1
  146. package/dist/videojsVideoProvider.js +1 -0
  147. package/dist/visxBidAdapter.js +1 -1
  148. package/dist/vuukleBidAdapter.js +1 -1
  149. package/dist/widespaceBidAdapter.js +1 -1
  150. package/dist/winrBidAdapter.js +1 -1
  151. package/dist/yahoosspBidAdapter.js +1 -1
  152. package/dist/yieldmoBidAdapter.js +1 -1
  153. package/dist/yieldoneAnalyticsAdapter.js +1 -1
  154. package/integrationExamples/gpt/mgidRtdProvider_example.html +143 -0
  155. package/integrationExamples/videoModule/jwplayer/bidMarkedAsUsed.html +98 -0
  156. package/integrationExamples/videoModule/jwplayer/bidRequestScheduling.html +89 -0
  157. package/integrationExamples/videoModule/jwplayer/eventListeners.html +244 -0
  158. package/integrationExamples/videoModule/jwplayer/gamAdServerMediation.html +122 -0
  159. package/integrationExamples/videoModule/jwplayer/mediaMetadata.html +80 -0
  160. package/integrationExamples/videoModule/jwplayer/playlist.html +122 -0
  161. package/integrationExamples/videoModule/videojs/bidMarkedAsUsed.html +126 -0
  162. package/integrationExamples/videoModule/videojs/bidRequestScheduling.html +132 -0
  163. package/integrationExamples/videoModule/videojs/eventListeners.html +238 -0
  164. package/integrationExamples/videoModule/videojs/gamAdServerMediation.html +138 -0
  165. package/integrationExamples/videoModule/videojs/mediaMetadata.html +103 -0
  166. package/integrationExamples/videoModule/videojs/playlist.html +151 -0
  167. package/libraries/ortbConverter/README.md +378 -0
  168. package/libraries/ortbConverter/converter.js +135 -0
  169. package/libraries/ortbConverter/lib/composer.js +43 -0
  170. package/libraries/ortbConverter/lib/mergeProcessors.js +9 -0
  171. package/libraries/ortbConverter/lib/sizes.js +14 -0
  172. package/libraries/ortbConverter/processors/banner.js +40 -0
  173. package/libraries/ortbConverter/processors/default.js +167 -0
  174. package/libraries/ortbConverter/processors/mediaType.js +21 -0
  175. package/libraries/ortbConverter/processors/native.js +37 -0
  176. package/libraries/ortbConverter/processors/video.js +66 -0
  177. package/libraries/pbsExtensions/pbsExtensions.js +12 -0
  178. package/libraries/pbsExtensions/processors/aliases.js +17 -0
  179. package/libraries/pbsExtensions/processors/mediaType.js +23 -0
  180. package/libraries/pbsExtensions/processors/params.js +22 -0
  181. package/libraries/pbsExtensions/processors/pbs.js +99 -0
  182. package/libraries/pbsExtensions/processors/requestExtPrebid.js +30 -0
  183. package/libraries/pbsExtensions/processors/video.js +23 -0
  184. package/libraries/video/constants/enums.js +5 -0
  185. package/libraries/video/constants/events.js +97 -0
  186. package/libraries/video/constants/ortb.js +169 -0
  187. package/libraries/video/constants/vendorCodes.js +6 -0
  188. package/libraries/video/shared/eventHandler.js +18 -0
  189. package/libraries/video/shared/parentModule.js +82 -0
  190. package/libraries/video/shared/state.js +47 -0
  191. package/libraries/video/shared/vastXmlBuilder.js +77 -0
  192. package/libraries/video/shared/vastXmlEditor.js +115 -0
  193. package/modules/.submodules.json +7 -1
  194. package/modules/aaxBlockmeterRtdProvider.js +59 -0
  195. package/modules/aaxBlockmeterRtdProvider.md +48 -0
  196. package/modules/admaticBidAdapter.js +147 -0
  197. package/modules/admaticBidAdapter.md +48 -0
  198. package/modules/amxBidAdapter.js +1 -0
  199. package/modules/appnexusBidAdapter.js +38 -1
  200. package/modules/chtnwBidAdapter.js +110 -0
  201. package/modules/chtnwBidAdapter.md +31 -0
  202. package/modules/concertBidAdapter.js +44 -2
  203. package/modules/connectIdSystem.js +36 -23
  204. package/modules/connectIdSystem.md +3 -2
  205. package/modules/consentManagement.js +22 -1
  206. package/modules/consentManagementUsp.js +29 -7
  207. package/modules/criteoBidAdapter.js +25 -5
  208. package/modules/currency.js +9 -0
  209. package/modules/dgkeywordRtdProvider.js +3 -3
  210. package/modules/gridNMBidAdapter.js +10 -14
  211. package/modules/growthCodeIdSystem.js +9 -5
  212. package/modules/gumgumBidAdapter.js +4 -0
  213. package/modules/improvedigitalBidAdapter.js +191 -470
  214. package/modules/ixBidAdapter.js +54 -71
  215. package/modules/jwplayerVideoProvider.js +929 -0
  216. package/modules/jwplayerVideoProvider.md +25 -0
  217. package/modules/kargoBidAdapter.js +1 -1
  218. package/modules/kueezRtbBidAdapter.js +278 -0
  219. package/modules/kueezRtbBidAdapter.md +35 -0
  220. package/modules/magniteAnalyticsAdapter.js +6 -1
  221. package/modules/mgidRtdProvider.js +190 -0
  222. package/modules/mgidRtdProvider.md +51 -0
  223. package/modules/multibid/index.js +12 -0
  224. package/modules/openxOrtbBidAdapter.js +120 -275
  225. package/modules/oxxionRtdProvider.js +119 -0
  226. package/modules/oxxionRtdProvider.md +48 -0
  227. package/modules/permutiveRtdProvider.js +2 -1
  228. package/modules/permutiveRtdProvider.md +36 -1
  229. package/modules/prebidServerBidAdapter/index.js +19 -716
  230. package/modules/prebidServerBidAdapter/ortbConverter.js +274 -0
  231. package/modules/priceFloors.js +73 -1
  232. package/modules/pubmaticBidAdapter.js +21 -29
  233. package/modules/rtdModule/index.js +22 -1
  234. package/modules/schain.js +24 -1
  235. package/modules/spotxBidAdapter.js +16 -15
  236. package/modules/synacormediaBidAdapter.js +1 -1
  237. package/modules/teadsIdSystem.js +5 -0
  238. package/modules/tripleliftBidAdapter.js +1 -1
  239. package/modules/userId/eids.js +3 -10
  240. package/modules/userId/index.js +64 -6
  241. package/modules/videoModule/addingSubmodule.md +521 -0
  242. package/modules/videoModule/coreVideo.js +234 -0
  243. package/modules/videoModule/gamAdServerSubmodule.js +27 -0
  244. package/modules/videoModule/index.js +244 -0
  245. package/modules/videoModule/videoImpressionVerifier.js +206 -0
  246. package/modules/videojsVideoProvider.js +854 -0
  247. package/modules/videojsVideoProvider.md +17 -0
  248. package/package.json +12 -8
  249. package/src/adRendering.js +1 -1
  250. package/src/adapterManager.js +56 -7
  251. package/src/adloader.js +3 -1
  252. package/src/auction.js +6 -1
  253. package/src/events.js +5 -1
  254. package/src/pbjsORTB.js +35 -0
  255. package/src/prebid.js +137 -112
  256. package/src/targeting.js +10 -2
  257. package/src/utils/currency.js +16 -0
  258. package/src/utils.js +21 -0
  259. package/test/spec/auctionmanager_spec.js +15 -0
  260. package/test/spec/modules/aaxBlockmeter_spec.js +58 -0
  261. package/test/spec/modules/admaticBidAdapter_spec.js +46 -0
  262. package/test/spec/modules/chtnwBidAdapter_spec.js +105 -0
  263. package/test/spec/modules/concertBidAdapter_spec.js +56 -0
  264. package/test/spec/modules/connectIdSystem_spec.js +175 -5
  265. package/test/spec/modules/consentManagementUsp_spec.js +64 -18
  266. package/test/spec/modules/criteoBidAdapter_spec.js +28 -0
  267. package/test/spec/modules/dgkeywordRtdProvider_spec.js +3 -3
  268. package/test/spec/modules/eids_spec.js +10 -7
  269. package/test/spec/modules/ftrackIdSystem_spec.js +34 -22
  270. package/test/spec/modules/gumgumBidAdapter_spec.js +15 -0
  271. package/test/spec/modules/improvedigitalBidAdapter_spec.js +231 -211
  272. package/test/spec/modules/ixBidAdapter_spec.js +412 -350
  273. package/test/spec/modules/kueezRtbBidAdapter_spec.js +396 -0
  274. package/test/spec/modules/magniteAnalyticsAdapter_spec.js +26 -0
  275. package/test/spec/modules/mgidRtdProvider_spec.js +366 -0
  276. package/test/spec/modules/openxOrtbBidAdapter_spec.js +77 -49
  277. package/test/spec/modules/oxxionRtdProvider_spec.js +142 -0
  278. package/test/spec/modules/permutiveRtdProvider_spec.js +64 -5
  279. package/test/spec/modules/prebidServerBidAdapter_spec.js +139 -137
  280. package/test/spec/modules/realTimeDataModule_spec.js +65 -0
  281. package/test/spec/modules/tripleliftBidAdapter_spec.js +14 -0
  282. package/test/spec/modules/userId_spec.js +67 -1
  283. package/test/spec/modules/videoModule/coreVideo_spec.js +98 -0
  284. package/test/spec/modules/videoModule/pbVideo_spec.js +362 -0
  285. package/test/spec/modules/videoModule/shared/parentModule_spec.js +73 -0
  286. package/test/spec/modules/videoModule/shared/state_spec.js +26 -0
  287. package/test/spec/modules/videoModule/shared/vastXmlBuilder_spec.js +103 -0
  288. package/test/spec/modules/videoModule/shared/vastXmlEditor_spec.js +209 -0
  289. package/test/spec/modules/videoModule/submodules/jwplayerVideoProvider_spec.js +846 -0
  290. package/test/spec/modules/videoModule/submodules/videojsVideoProvider_spec.js +391 -0
  291. package/test/spec/modules/videoModule/videoImpressionVerifier_spec.js +112 -0
  292. package/test/spec/ortbConverter/banner_spec.js +203 -0
  293. package/test/spec/ortbConverter/composer_spec.js +69 -0
  294. package/test/spec/ortbConverter/converter_spec.js +283 -0
  295. package/test/spec/ortbConverter/currency_spec.js +40 -0
  296. package/test/spec/ortbConverter/default_processors_spec.js +61 -0
  297. package/test/spec/ortbConverter/gdpr_spec.js +38 -0
  298. package/test/spec/ortbConverter/mediaTypes_spec.js +67 -0
  299. package/test/spec/ortbConverter/mergeProcessors_spec.js +59 -0
  300. package/test/spec/ortbConverter/multibid_spec.js +35 -0
  301. package/test/spec/ortbConverter/native_spec.js +95 -0
  302. package/test/spec/ortbConverter/pbjsORTB_spec.js +67 -0
  303. package/test/spec/ortbConverter/pbsExtensions/aliases_spec.js +57 -0
  304. package/test/spec/ortbConverter/pbsExtensions/params_spec.js +96 -0
  305. package/test/spec/ortbConverter/pbsExtensions/video_spec.js +52 -0
  306. package/test/spec/ortbConverter/priceFloors_spec.js +143 -0
  307. package/test/spec/ortbConverter/schain_spec.js +33 -0
  308. package/test/spec/ortbConverter/userId_spec.js +21 -0
  309. package/test/spec/ortbConverter/usp_spec.js +15 -0
  310. package/test/spec/ortbConverter/video_spec.js +189 -0
  311. package/test/spec/unit/core/adapterManager_spec.js +102 -0
  312. package/test/spec/unit/core/targeting_spec.js +34 -0
  313. package/test/spec/unit/pbjs_api_spec.js +124 -45
  314. package/test/spec/utils_spec.js +45 -1
@@ -0,0 +1,97 @@
1
+ // Life Cycle
2
+ export const SETUP_COMPLETE = 'setupComplete';
3
+ export const SETUP_FAILED = 'setupFailed';
4
+ export const DESTROYED = 'destroyed';
5
+
6
+ // Ads
7
+ export const AD_REQUEST = 'adRequest';
8
+ export const AD_BREAK_START = 'adBreakStart';
9
+ export const AD_LOADED = 'adLoaded';
10
+ export const AD_STARTED = 'adStarted';
11
+ export const AD_IMPRESSION = 'adImpression';
12
+ export const AD_PLAY = 'adPlay';
13
+ export const AD_TIME = 'adTime';
14
+ export const AD_PAUSE = 'adPause';
15
+ export const AD_CLICK = 'adClick';
16
+ export const AD_SKIPPED = 'adSkipped';
17
+ export const AD_ERROR = 'adError';
18
+ export const AD_COMPLETE = 'adComplete';
19
+ export const AD_BREAK_END = 'adBreakEnd';
20
+
21
+ // Media
22
+ export const PLAYLIST = 'playlist';
23
+ export const PLAYBACK_REQUEST = 'playbackRequest';
24
+ export const AUTOSTART_BLOCKED = 'autostartBlocked';
25
+ export const PLAY_ATTEMPT_FAILED = 'playAttemptFailed';
26
+ export const CONTENT_LOADED = 'contentLoaded';
27
+ export const PLAY = 'play';
28
+ export const PAUSE = 'pause';
29
+ export const BUFFER = 'buffer';
30
+ export const TIME = 'time';
31
+ export const SEEK_START = 'seekStart';
32
+ export const SEEK_END = 'seekEnd';
33
+ export const MUTE = 'mute';
34
+ export const VOLUME = 'volume';
35
+ export const RENDITION_UPDATE = 'renditionUpdate';
36
+ export const ERROR = 'error';
37
+ export const COMPLETE = 'complete';
38
+ export const PLAYLIST_COMPLETE = 'playlistComplete';
39
+
40
+ // Layout
41
+ export const FULLSCREEN = 'fullscreen';
42
+ export const PLAYER_RESIZE = 'playerResize';
43
+ export const VIEWABLE = 'viewable';
44
+ export const CAST = 'cast';
45
+
46
+ export const allVideoEvents = [
47
+ SETUP_COMPLETE, SETUP_FAILED, DESTROYED, AD_REQUEST, AD_BREAK_START, AD_LOADED, AD_STARTED,
48
+ AD_IMPRESSION, AD_PLAY, AD_TIME, AD_PAUSE, AD_CLICK, AD_SKIPPED, AD_ERROR, AD_COMPLETE, AD_BREAK_END, PLAYLIST,
49
+ PLAYBACK_REQUEST, AUTOSTART_BLOCKED, PLAY_ATTEMPT_FAILED, CONTENT_LOADED, PLAY, PAUSE, BUFFER, TIME, SEEK_START,
50
+ SEEK_END, MUTE, VOLUME, RENDITION_UPDATE, ERROR, COMPLETE, PLAYLIST_COMPLETE, FULLSCREEN, PLAYER_RESIZE, VIEWABLE,
51
+ CAST
52
+ ];
53
+
54
+ export const AUCTION_AD_LOAD_ATTEMPT = 'auctionAdLoadAttempt';
55
+ export const AUCTION_AD_LOAD_ABORT = 'auctionAdLoadAbort';
56
+ export const BID_IMPRESSION = 'bidImpression';
57
+ export const BID_ERROR = 'bidError';
58
+
59
+ export const videoEvents = {
60
+ SETUP_COMPLETE,
61
+ SETUP_FAILED,
62
+ DESTROYED,
63
+ AD_REQUEST,
64
+ AD_BREAK_START,
65
+ AD_LOADED,
66
+ AD_STARTED,
67
+ AD_IMPRESSION,
68
+ AD_PLAY,
69
+ AD_TIME,
70
+ AD_PAUSE,
71
+ AD_CLICK,
72
+ AD_SKIPPED,
73
+ AD_ERROR,
74
+ AD_COMPLETE,
75
+ AD_BREAK_END,
76
+ PLAYLIST,
77
+ PLAYBACK_REQUEST,
78
+ AUTOSTART_BLOCKED,
79
+ PLAY_ATTEMPT_FAILED,
80
+ CONTENT_LOADED,
81
+ PLAY,
82
+ PAUSE,
83
+ BUFFER,
84
+ TIME,
85
+ SEEK_START,
86
+ SEEK_END,
87
+ MUTE,
88
+ VOLUME,
89
+ RENDITION_UPDATE,
90
+ ERROR,
91
+ COMPLETE,
92
+ PLAYLIST_COMPLETE,
93
+ FULLSCREEN,
94
+ PLAYER_RESIZE,
95
+ VIEWABLE,
96
+ CAST,
97
+ };
@@ -0,0 +1,169 @@
1
+ /**
2
+ * @typedef {Object} OrtbParams
3
+ * @property {OrtbVideoParamst} video
4
+ * @property {OrtbContentParams} content
5
+ */
6
+
7
+ /**
8
+ * @typedef OrtbVideoParams
9
+ * @property {[string]} mimes - Content MIME types supported (e.g., “video/x-ms-wmv”, “video/mp4”).
10
+ * @property {number|undefined} minduration - Minimum video ad duration in seconds.
11
+ * @property {number|undefined} maxduration - Maximum video ad duration in seconds.
12
+ * @property {[number]} protocols - Supported video protocols. At least one supported protocol must be specified.
13
+ * @property {number} w - Width of the video player in device independent pixels (DIPS).
14
+ * @property {number} h - Height of the video player in device independent pixels (DIPS).
15
+ * @property {number|undefined} startdelay - Indicates the offset of the ad placement.
16
+ * @property {number|undefined} placement - Placement type for the impression.
17
+ * @property {number|undefined} linearity - Indicates if the impression must be linear, nonlinear, etc. If omitted, assume all are allowed.
18
+ * @property {number} skip - Indicates if the player can allow the video to be skipped, where 0 is no, 1 is yes.
19
+ * @property {number|undefined} skipmin - Only ad creatives with a duration greater than this value can be skippable; only applicable if the ad is skippable.
20
+ * @property {number|undefined} skipafter - Number of seconds a video must play before skipping is enabled; only applicable if the ad is skippable.
21
+ * @property {number|undefined} sequence - If multiple ad impressions are offered in the same bid request, the sequence number will allow for the coordinated delivery of multiple creatives.
22
+ * @property {[number]|undefined} battr - Blocked creative attributes. Use this to indicate which creatives the player does not support.
23
+ * @property {number|undefined} maxextended - Maximum extended ad duration if extension is allowed.
24
+ * @property {number|undefined} minbitrate - Minimum bit rate in Kbps supported by the player.
25
+ * @property {number|undefined} maxbitrate - Maximum bit rate in Kbps supported by the player.
26
+ * @property {number|undefined} boxingallowed - Indicates if letter-boxing of 4:3 content into a 16:9 window is allowed. 0 is no, 1 is yes.
27
+ * @property {[number]|undefined} playbackmethod - Playback methods that may be in use.
28
+ * @property {number|undefined} playbackend - The scenario that causes playback to end.
29
+ * @property {[number]|undefined} delivery - Supported delivery methods (e.g., streaming, progressive).
30
+ * @property {number|undefined} pos - Ad position on screen.
31
+ * @property {[Object]|undefined} companionad - list of companion ads. Refer to Section 3.2.6 of the oRTB v2.5 spec for the interface of the companion ad object.
32
+ * @property {[number]|undefined} api - List of supported API frameworks for this impression.
33
+ * @property {[number]|undefined} companiontype - Supported VAST companion ad types. Refer to List 5.14 of the oRTB v2.5 spec for the interface.
34
+ * @property {Object|undefined} ext - Placeholder for exchange-specific extensions to OpenRTB.
35
+ */
36
+
37
+ /**
38
+ * @typedef OrtbContentParams
39
+ * @property {string} id - ID uniquely identifying the content.
40
+ * @property {string} url - URL of the content, for buy-side contextualization or review.
41
+ * @property {number|undefined} episode - Episode number.
42
+ * @property {string|undefined} title - Content title.
43
+ * @property {string|undefined} series - Content series i.e. “The Office” (television), “Star Wars” (movie).
44
+ * @property {string|undefined} season - Content season (e.g., “Season 3”).
45
+ * @property {string|undefined} artist - Artist credited with the content.
46
+ * @property {string|undefined} genre - Genre that best describes the content (e.g., rock, pop, etc).
47
+ * @property {string|undefined} album - Album to which the content belongs. Typically for audio.
48
+ * @property {string|undefined} isrc - International Standard Recording Code conforming to ISO3901.
49
+ * @property {Object|undefined} producer - Details about the content Producer. For Producer interface visit Section 3.2.17 of the oRTB v2.5 spec.
50
+ * @property {[string]|undefined} cat - List of IAB content categories that describe the content. Refer to List 5.1. of the oRTB v2.5 spec for the complete list.
51
+ * @property {number|undefined} prodq - Production quality. Refer to List 5.13 of the oRTB v2.5 spec.
52
+ * @property {number|undefined} context - Type of content (game, video, text, etc.). Refer to List 5.18 of the oRTB v2.5 spec.
53
+ * @property {string|undefined} contentrating - Content rating (e.g., MPAA).
54
+ * @property {string|undefined} userrating - User rating of the content (e.g., number of stars, likes, etc.).
55
+ * @property {number|undefined} qagmediarating - Media rating per IQG guidelines. Refer to List 5.19 of the oRTB v2.5 spec.
56
+ * @property {string|undefined} keywords - Comma separated list of keywords describing the content.
57
+ * @property {number|undefined} livestream - Whether the stream is live or not. 0 means not live (VOD), 1 means content is live streaming.
58
+ * @property {number|undefined} sourcerelationship - 0 means indirect, 1 means direct.
59
+ * @property {number} len - Duration of content in seconds.
60
+ * @property {string|undefined} language - Content language using ISO-639-1-alpha-2.
61
+ * @property {number|undefined} embeddable - Indicator of whether or not the content is embeddable (e.g., an embeddable video player). 0 means no, 1 means yes.
62
+ * @property {[Object]|undefined} data - Additional content data. Each Data object represents a different data source. See Section 3.2.21 of the oRTB v2.5 spec.
63
+ * @property {Object|undefined} ext - Placeholder for exchange-specific extensions to OpenRTB.
64
+ */
65
+
66
+ const VIDEO_PREFIX = 'video/';
67
+ const APPLICATION_PREFIX = 'application/';
68
+
69
+ /**
70
+ * ORTB 2.5 section 3.2.7 - Video.mimes
71
+ * @enum OrtbVideoParams.mimes
72
+ */
73
+ export const VIDEO_MIME_TYPE = {
74
+ MP4: VIDEO_PREFIX + 'mp4',
75
+ MPEG: VIDEO_PREFIX + 'mpeg',
76
+ OGG: VIDEO_PREFIX + 'ogg',
77
+ WEBM: VIDEO_PREFIX + 'webm',
78
+ AAC: VIDEO_PREFIX + 'aac',
79
+ HLS: APPLICATION_PREFIX + 'vnd.apple.mpegurl'
80
+ };
81
+
82
+ export const JS_APP_MIME_TYPE = APPLICATION_PREFIX + 'javascript';
83
+ export const VPAID_MIME_TYPE = JS_APP_MIME_TYPE;
84
+
85
+ /**
86
+ * ORTB 2.5 section 5.9 - Video Placement Types
87
+ * @enum OrtbVideoParams.placement
88
+ */
89
+ export const PLACEMENT = {
90
+ INSTREAM: 1,
91
+ BANNER: 2,
92
+ ARTICLE: 3,
93
+ FEED: 4,
94
+ INTERSTITIAL: 5,
95
+ SLIDER: 5,
96
+ FLOATING: 5,
97
+ INTERSTITIAL_SLIDER_FLOATING: 5
98
+ };
99
+
100
+ /**
101
+ * ORTB 2.5 section 5.4 - Ad Position
102
+ * @enum OrtbVideoParams.pos
103
+ */
104
+ export const AD_POSITION = {
105
+ UNKNOWN: 0,
106
+ ABOVE_THE_FOLD: 1,
107
+ BELOW_THE_FOLD: 3,
108
+ HEADER: 4,
109
+ FOOTER: 5,
110
+ SIDEBAR: 6,
111
+ FULL_SCREEN: 7
112
+ }
113
+
114
+ /**
115
+ * ORTB 2.5 section 5.11 - Playback Cessation Modes
116
+ * @enum OrtbVideoParams.playbackend
117
+ */
118
+ export const PLAYBACK_END = {
119
+ VIDEO_COMPLETION: 1,
120
+ VIEWPORT_LEAVE: 2,
121
+ FLOATING: 3
122
+ }
123
+
124
+ /**
125
+ * ORTB 2.5 section 5.10 - Playback Methods
126
+ * @enum OrtbVideoParams.playbackmethod
127
+ */
128
+ export const PLAYBACK_METHODS = {
129
+ AUTOPLAY: 1,
130
+ AUTOPLAY_MUTED: 2,
131
+ CLICK_TO_PLAY: 3,
132
+ CLICK_TO_PLAY_MUTED: 4,
133
+ VIEWABLE: 5,
134
+ VIEWABLE_MUTED: 6
135
+ };
136
+
137
+ /**
138
+ * ORTB 2.5 section 5.8 - Protocols
139
+ * @enum OrtbVideoParams.protocols
140
+ */
141
+ export const PROTOCOLS = {
142
+ // VAST_1_0: 1,
143
+ VAST_2_0: 2,
144
+ VAST_3_0: 3,
145
+ // VAST_1_O_WRAPPER: 4,
146
+ VAST_2_0_WRAPPER: 5,
147
+ VAST_3_0_WRAPPER: 6,
148
+ VAST_4_0: 7,
149
+ VAST_4_0_WRAPPER: 8
150
+ };
151
+
152
+ /**
153
+ * ORTB 2.5 section 5.6 - API Frameworks
154
+ * @enum OrtbVideoParams.api
155
+ */
156
+ export const API_FRAMEWORKS = {
157
+ VPAID_1_0: 1,
158
+ VPAID_2_0: 2,
159
+ OMID_1_0: 7
160
+ };
161
+
162
+ /**
163
+ * ORTB 2.5 section 5.18 - Content Context
164
+ * @enum OrtbContentParams.context
165
+ */
166
+ export const CONTEXT = {
167
+ VIDEO: 1,
168
+ AUDIO: 3
169
+ };
@@ -0,0 +1,6 @@
1
+ // Video Vendors
2
+ export const JWPLAYER_VENDOR = 1;
3
+ export const VIDEO_JS_VENDOR = 2;
4
+
5
+ // Ad Server Vendors
6
+ export const GAM_VENDOR = 'gam';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Builds a standard event handler
3
+ * @param {String} type Event name
4
+ * @param {(function(String, Object): Object)} callback Callback defined by publisher to be executed when the event occurs
5
+ * @param {Object} payload Base payload defined when the event is registered
6
+ * @param {(function(*): Object)|null|undefined} getExtraPayload Parses the player's event payload to return a normalized payload
7
+ * @returns {(function(*): void)|*} event handler
8
+ */
9
+ export function getEventHandler(type, callback, payload, getExtraPayload) {
10
+ return event => {
11
+ if (getExtraPayload) {
12
+ const extraPayload = getExtraPayload(event);
13
+ Object.assign(payload, extraPayload);
14
+ }
15
+
16
+ callback(type, payload);
17
+ };
18
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * @typedef {Object} ParentModule
3
+ * @summary abstraction for any module to store and reference its submodules
4
+ * @param {SubmoduleBuilder} submoduleBuilder_
5
+ * @returns {ParentModule}
6
+ * @constructor
7
+ */
8
+ export function ParentModule(submoduleBuilder_) {
9
+ const submoduleBuilder = submoduleBuilder_;
10
+ const submodules = {};
11
+
12
+ /**
13
+ * @function ParentModule#registerSubmodule
14
+ * @summary Stores a submodule
15
+ * @param {String} id - unique identifier of the submodule instance
16
+ * @param {String} vendorCode - identifier to the submodule type that must be built
17
+ * @param {Object} config - additional information necessary to instantiate the submodule
18
+ */
19
+ function registerSubmodule(id, vendorCode, config) {
20
+ if (submodules[id]) {
21
+ return;
22
+ }
23
+
24
+ let submodule;
25
+ try {
26
+ submodule = submoduleBuilder.build(vendorCode, config);
27
+ } catch (e) {
28
+ throw e;
29
+ }
30
+ submodules[id] = submodule;
31
+ }
32
+
33
+ /**
34
+ * @function ParentModule#getSubmodule
35
+ * @summary Stores a submodule
36
+ * @param {String} id - unique identifier of the submodule instance
37
+ * @returns {Object} - a submodule instance
38
+ */
39
+ function getSubmodule(id) {
40
+ return submodules[id];
41
+ }
42
+
43
+ return {
44
+ registerSubmodule,
45
+ getSubmodule
46
+ }
47
+ }
48
+
49
+ /**
50
+ * @typedef {Object} SubmoduleBuilder
51
+ * @summary Instantiates submodules
52
+ * @param {vendorSubmoduleDirectory} submoduleDirectory_
53
+ * @param {Object|null|undefined} sharedUtils_
54
+ * @returns {SubmoduleBuilder}
55
+ * @constructor
56
+ */
57
+ export function SubmoduleBuilder(submoduleDirectory_, sharedUtils_) {
58
+ const submoduleDirectory = submoduleDirectory_;
59
+ const sharedUtils = sharedUtils_;
60
+
61
+ /**
62
+ * @function SubmoduleBuilder#build
63
+ * @param vendorCode - identifier to the submodule type that must be instantiated
64
+ * @param config - additional information necessary to instantiate the submodule
65
+ * @throws
66
+ * @returns {{init}|*} - a submodule instance
67
+ */
68
+ function build(vendorCode, config) {
69
+ const submoduleFactory = submoduleDirectory[vendorCode];
70
+ if (!submoduleFactory) {
71
+ throw new Error('Unrecognized submodule vendor code: ' + vendorCode);
72
+ }
73
+
74
+ const submodule = submoduleFactory(config, sharedUtils);
75
+ submodule && submodule.init && submodule.init();
76
+ return submodule;
77
+ }
78
+
79
+ return {
80
+ build
81
+ };
82
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @typedef {Object} State
3
+ * @summary simple state object. Can be subclassed
4
+ * @function updateState
5
+ * @function getState
6
+ * @function clearState
7
+ */
8
+
9
+ /**
10
+ * @summary factory to create a simple state object
11
+ * @returns {State}
12
+ */
13
+ export default function stateFactory() {
14
+ let state = {};
15
+
16
+ /**
17
+ * @function State#updateState
18
+ * @summary updates the state
19
+ * @param {Object} stateUpdate
20
+ */
21
+ function updateState(stateUpdate) {
22
+ Object.assign(state, stateUpdate);
23
+ }
24
+
25
+ /**
26
+ * @function State#getState
27
+ * @summary provides the current state
28
+ * @returns {Object} the current state
29
+ */
30
+ function getState() {
31
+ return state;
32
+ }
33
+
34
+ /**
35
+ * @function State#clearState
36
+ * @summary erases the current state
37
+ */
38
+ function clearState() {
39
+ state = {};
40
+ }
41
+
42
+ return {
43
+ updateState,
44
+ getState,
45
+ clearState
46
+ };
47
+ }
@@ -0,0 +1,77 @@
1
+ import { getGlobal } from '../../../src/prebidGlobal.js';
2
+
3
+ export function buildVastWrapper(adId, adTagUrl, impressionUrl, impressionId, errorUrl) {
4
+ let wrapperBody = getAdSystemNode('Prebid org', getGlobal().version);
5
+
6
+ if (adTagUrl) {
7
+ wrapperBody += getAdTagUriNode(adTagUrl);
8
+ }
9
+
10
+ if (impressionUrl) {
11
+ wrapperBody += getImpressionNode(impressionUrl, impressionId);
12
+ }
13
+
14
+ if (errorUrl) {
15
+ wrapperBody += getErrorNode(errorUrl);
16
+ }
17
+
18
+ return getVastNode(getAdNode(getWrapperNode(wrapperBody), adId), '4.2');
19
+ }
20
+
21
+ export function getVastNode(body, vastVersion) {
22
+ return getNode('VAST', body, { version: vastVersion });
23
+ }
24
+
25
+ export function getAdNode(body, adId) {
26
+ return getNode('Ad', body, { id: adId });
27
+ }
28
+
29
+ export function getWrapperNode(body) {
30
+ return getNode('Wrapper', body);
31
+ }
32
+
33
+ export function getAdSystemNode(system, version) {
34
+ return getNode('AdSystem', system, { version });
35
+ }
36
+
37
+ export function getAdTagUriNode(adTagUrl) {
38
+ return getUrlNode('VASTAdTagURI', adTagUrl);
39
+ }
40
+
41
+ export function getImpressionNode(pingUrl, id) {
42
+ return getUrlNode('Impression', pingUrl, { id });
43
+ }
44
+
45
+ export function getErrorNode(pingUrl) {
46
+ return getUrlNode('Error', pingUrl);
47
+ }
48
+
49
+ // Helpers
50
+
51
+ function getUrlNode(labelName, url, attributes) {
52
+ const body = `<![CDATA[${url}]]>`;
53
+ return getNode(labelName, body, attributes);
54
+ }
55
+
56
+ function getNode(labelName, body, attributes) {
57
+ const openingLabel = getOpeningLabel(labelName, attributes);
58
+ return `<${openingLabel}>${body}</${labelName}>`;
59
+ }
60
+
61
+ /*
62
+ attributes is a KVP Object.
63
+ */
64
+ function getOpeningLabel(name, attributes) {
65
+ if (!attributes) {
66
+ return name;
67
+ }
68
+
69
+ return Object.keys(attributes).reduce((label, key) => {
70
+ const value = attributes[key];
71
+ if (!value) {
72
+ return label;
73
+ }
74
+
75
+ return label + ` ${key}="${value}"`;
76
+ }, name);
77
+ }
@@ -0,0 +1,115 @@
1
+ import { getErrorNode, getImpressionNode, buildVastWrapper } from './vastXmlBuilder.js';
2
+
3
+ export const XML_MIME_TYPE = 'application/xml';
4
+
5
+ export function VastXmlEditor(xmlUtil_) {
6
+ const xmlUtil = xmlUtil_;
7
+
8
+ function getVastXmlWithTracking(vastXml, adId, impressionUrl, impressionId, errorUrl) {
9
+ const impressionDoc = getImpressionDoc(impressionUrl, impressionId);
10
+ const errorDoc = getErrorDoc(errorUrl);
11
+ if (!adId && !impressionDoc && !errorDoc) {
12
+ return vastXml;
13
+ }
14
+
15
+ const vastXmlDoc = xmlUtil.parse(vastXml);
16
+ appendTrackingNodes(vastXmlDoc, impressionDoc, errorDoc);
17
+ replaceAdId(vastXmlDoc, adId);
18
+ return xmlUtil.serialize(vastXmlDoc);
19
+ }
20
+
21
+ function appendTrackingNodes(vastXmlDoc, impressionDoc, errorDoc) {
22
+ const nodes = vastXmlDoc.querySelectorAll('InLine,Wrapper');
23
+ const nodeCount = nodes.length;
24
+ for (let i = 0; i < nodeCount; i++) {
25
+ const node = nodes[i];
26
+ // A copy of the child is required until we reach the last node.
27
+ const requiresCopy = i < nodeCount - 1;
28
+ appendChild(node, impressionDoc, requiresCopy);
29
+ appendChild(node, errorDoc, requiresCopy);
30
+ }
31
+ }
32
+
33
+ function replaceAdId(vastXmlDoc, adId) {
34
+ if (!adId) {
35
+ return;
36
+ }
37
+
38
+ const adNode = vastXmlDoc.querySelector('Ad');
39
+ if (!adNode) {
40
+ return;
41
+ }
42
+
43
+ adNode.id = adId;
44
+ }
45
+
46
+ return {
47
+ getVastXmlWithTracking,
48
+ buildVastWrapper
49
+ }
50
+
51
+ function getImpressionDoc(impressionUrl, impressionId) {
52
+ if (!impressionUrl) {
53
+ return;
54
+ }
55
+
56
+ const impressionNode = getImpressionNode(impressionUrl, impressionId);
57
+ return xmlUtil.parse(impressionNode);
58
+ }
59
+
60
+ function getErrorDoc(errorUrl) {
61
+ if (!errorUrl) {
62
+ return;
63
+ }
64
+
65
+ const errorNode = getErrorNode(errorUrl);
66
+ return xmlUtil.parse(errorNode);
67
+ }
68
+
69
+ function appendChild(node, child, copy) {
70
+ if (!child) {
71
+ return;
72
+ }
73
+
74
+ const doc = copy ? child.cloneNode(true) : child;
75
+ node.appendChild(doc.documentElement);
76
+ }
77
+ }
78
+
79
+ function XMLUtil() {
80
+ let parser;
81
+ let serializer;
82
+
83
+ function getParser() {
84
+ if (!parser) {
85
+ // DOMParser instantiation is costly; instantiate only once throughout Prebid lifecycle.
86
+ parser = new DOMParser();
87
+ }
88
+ return parser;
89
+ }
90
+
91
+ function getSerializer() {
92
+ if (!serializer) {
93
+ // XMLSerializer instantiation is costly; instantiate only once throughout Prebid lifecycle.
94
+ serializer = new XMLSerializer();
95
+ }
96
+ return serializer;
97
+ }
98
+
99
+ function parse(xmlString) {
100
+ return getParser().parseFromString(xmlString, XML_MIME_TYPE);
101
+ }
102
+
103
+ function serialize(xmlDoc) {
104
+ return getSerializer().serializeToString(xmlDoc);
105
+ }
106
+
107
+ return {
108
+ parse,
109
+ serialize
110
+ };
111
+ }
112
+
113
+ export function vastXmlEditorFactory() {
114
+ return VastXmlEditor(XMLUtil());
115
+ }
@@ -52,6 +52,7 @@
52
52
  ],
53
53
  "rtdModule": [
54
54
  "1plusXRtdProvider",
55
+ "aaxBlockmeterRtdProvider",
55
56
  "airgridRtdProvider",
56
57
  "akamaiDapRtdProvider",
57
58
  "blueconicRtdProvider",
@@ -63,6 +64,7 @@
63
64
  "iasRtdProvider",
64
65
  "jwplayerRtdProvider",
65
66
  "medianetRtdProvider",
67
+ "mgidRtdProvider",
66
68
  "oneKeyRtdProvider",
67
69
  "optimeraRtdProvider",
68
70
  "permutiveRtdProvider",
@@ -75,6 +77,10 @@
75
77
  "enrichmentFpdModule",
76
78
  "validationFpdModule",
77
79
  "topicsFpdModule"
80
+ ],
81
+ "videoModule": [
82
+ "jwplayerVideoProvider",
83
+ "videojsVideoProvider"
78
84
  ]
79
85
  }
80
- }
86
+ }
@@ -0,0 +1,59 @@
1
+ import {isEmptyStr, isStr, logError, isFn, logWarn} from '../src/utils.js';
2
+ import {submodule} from '../src/hook.js';
3
+ import { loadExternalScript } from '../src/adloader.js';
4
+
5
+ export const _config = {
6
+ MODULE: 'aaxBlockmeter',
7
+ ADSERVER_TARGETING_KEY: 'atk',
8
+ BLOCKMETER_URL: 'c.aaxads.com/aax.js',
9
+ VERSION: '1.2'
10
+ };
11
+
12
+ window.aax = window.aax || {};
13
+
14
+ function loadBlockmeter(_rtdConfig) {
15
+ if (!(_rtdConfig.params && _rtdConfig.params.pub) || !isStr(_rtdConfig.params && _rtdConfig.params.pub) || isEmptyStr(_rtdConfig.params && _rtdConfig.params.pub)) {
16
+ logError(`${_config.MODULE}: params.pub should be a string`);
17
+ return false;
18
+ }
19
+
20
+ const params = [];
21
+ params.push(`pub=${_rtdConfig.params.pub}`);
22
+ params.push(`dn=${window.location.hostname}`);
23
+
24
+ let url = _rtdConfig.params.url;
25
+ if (!url || isEmptyStr(url)) {
26
+ logWarn(`${_config.MODULE}: params.url is missing, using default url.`);
27
+ url = `${_config.BLOCKMETER_URL}?ver=${_config.VERSION}`;
28
+ }
29
+
30
+ const scriptUrl = `https://${url}&${params.join('&')}`;
31
+ loadExternalScript(scriptUrl, _config.MODULE);
32
+ return true;
33
+ }
34
+
35
+ function markAdBlockInventory(codes, _rtdConfig, _userConsent) {
36
+ return codes.reduce((targets, code) => {
37
+ targets[code] = targets[code] || {};
38
+ const getAaxTargets = () => isFn(window.aax.getTargetingData)
39
+ ? window.aax.getTargetingData(code, _rtdConfig, _userConsent)
40
+ : {};
41
+ targets[code] = {
42
+ [_config.ADSERVER_TARGETING_KEY]: code,
43
+ ...getAaxTargets()
44
+ };
45
+ return targets;
46
+ }, {});
47
+ }
48
+
49
+ export const aaxBlockmeterRtdModule = {
50
+ name: _config.MODULE,
51
+ init: loadBlockmeter,
52
+ getTargetingData: markAdBlockInventory,
53
+ };
54
+
55
+ function registerSubModule() {
56
+ submodule('realTimeData', aaxBlockmeterRtdModule);
57
+ }
58
+
59
+ registerSubModule();