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
@@ -129,7 +129,7 @@ import {find, includes} from '../../src/polyfill.js';
129
129
  import {config} from '../../src/config.js';
130
130
  import * as events from '../../src/events.js';
131
131
  import {getGlobal} from '../../src/prebidGlobal.js';
132
- import {gdprDataHandler} from '../../src/adapterManager.js';
132
+ import adapterManager, {gdprDataHandler} from '../../src/adapterManager.js';
133
133
  import CONSTANTS from '../../src/constants.json';
134
134
  import {hook, module, ready as hooksReady} from '../../src/hook.js';
135
135
  import {buildEidPermissions, createEidsArray, USER_IDS_CONFIG} from './eids.js';
@@ -149,11 +149,12 @@ import {
149
149
  logInfo,
150
150
  logWarn,
151
151
  timestamp,
152
- isEmpty
152
+ isEmpty, deepSetValue
153
153
  } from '../../src/utils.js';
154
154
  import {getPPID as coreGetPPID} from '../../src/adserver.js';
155
155
  import {defer, GreedyPromise} from '../../src/utils/promise.js';
156
156
  import {hasPurpose1Consent} from '../../src/utils/gpdr.js';
157
+ import {registerOrtbProcessor, REQUEST} from '../../src/pbjsORTB.js';
157
158
  import {newMetrics, timedAuctionHook, useMetrics} from '../../src/utils/perfMetrics.js';
158
159
 
159
160
  const MODULE_NAME = 'User ID';
@@ -216,6 +217,14 @@ export function setSubmoduleRegistry(submodules) {
216
217
  submoduleRegistry = submodules;
217
218
  }
218
219
 
220
+ function cookieSetter(submodule) {
221
+ const domainOverride = (typeof submodule.submodule.domainOverride === 'function') ? submodule.submodule.domainOverride() : null;
222
+ const name = submodule.config.storage.name;
223
+ return function setCookie(suffix, value, expiration) {
224
+ coreStorage.setCookie(name + (suffix || ''), value, expiration, 'Lax', domainOverride);
225
+ }
226
+ }
227
+
219
228
  /**
220
229
  * @param {SubmoduleContainer} submodule
221
230
  * @param {(Object|string)} value
@@ -225,15 +234,15 @@ export function setStoredValue(submodule, value) {
225
234
  * @type {SubmoduleStorage}
226
235
  */
227
236
  const storage = submodule.config.storage;
228
- const domainOverride = (typeof submodule.submodule.domainOverride === 'function') ? submodule.submodule.domainOverride() : null;
229
237
 
230
238
  try {
231
- const valueStr = isPlainObject(value) ? JSON.stringify(value) : value;
232
239
  const expiresStr = (new Date(Date.now() + (storage.expires * (60 * 60 * 24 * 1000)))).toUTCString();
240
+ const valueStr = isPlainObject(value) ? JSON.stringify(value) : value;
233
241
  if (storage.type === COOKIE) {
234
- coreStorage.setCookie(storage.name, valueStr, expiresStr, 'Lax', domainOverride);
242
+ const setCookie = cookieSetter(submodule);
243
+ setCookie(null, value, expiresStr);
235
244
  if (typeof storage.refreshInSeconds === 'number') {
236
- coreStorage.setCookie(`${storage.name}_last`, new Date().toUTCString(), expiresStr, 'Lax', domainOverride);
245
+ setCookie('_last', new Date().toUTCString(), expiresStr);
237
246
  }
238
247
  } else if (storage.type === LOCAL_STORAGE) {
239
248
  coreStorage.setDataInLocalStorage(`${storage.name}_exp`, expiresStr);
@@ -247,6 +256,31 @@ export function setStoredValue(submodule, value) {
247
256
  }
248
257
  }
249
258
 
259
+ export function deleteStoredValue(submodule) {
260
+ let deleter, suffixes;
261
+ switch (submodule.config?.storage?.type) {
262
+ case COOKIE:
263
+ const setCookie = cookieSetter(submodule);
264
+ const expiry = (new Date(Date.now() - 1000 * 60 * 60 * 24)).toUTCString();
265
+ deleter = (suffix) => setCookie(suffix, '', expiry)
266
+ suffixes = ['', '_last'];
267
+ break;
268
+ case LOCAL_STORAGE:
269
+ deleter = (suffix) => coreStorage.removeDataFromLocalStorage(submodule.config.storage.name + suffix)
270
+ suffixes = ['', '_last', '_exp'];
271
+ break;
272
+ }
273
+ if (deleter) {
274
+ suffixes.forEach(suffix => {
275
+ try {
276
+ deleter(suffix)
277
+ } catch (e) {
278
+ logError(e);
279
+ }
280
+ });
281
+ }
282
+ }
283
+
250
284
  function setPrebidServerEidPermissions(initializedSubmodules) {
251
285
  let setEidPermissions = getPrebidInternal().setEidPermissions;
252
286
  if (typeof setEidPermissions === 'function' && isArray(initializedSubmodules)) {
@@ -1009,12 +1043,28 @@ function updateSubmodules() {
1009
1043
  if (!addedUserIdHook && submodules.length) {
1010
1044
  // priority value 40 will load after consentManagement with a priority of 50
1011
1045
  getGlobal().requestBids.before(requestBidsHook, 40);
1046
+ adapterManager.callDataDeletionRequest.before(requestDataDeletion);
1012
1047
  coreGetPPID.after((next) => next(getPPID()));
1013
1048
  logInfo(`${MODULE_NAME} - usersync config updated for ${submodules.length} submodules: `, submodules.map(a => a.submodule.name));
1014
1049
  addedUserIdHook = true;
1015
1050
  }
1016
1051
  }
1017
1052
 
1053
+ export function requestDataDeletion(next, ...args) {
1054
+ logInfo('UserID: received data deletion request; deleting all stored IDs...')
1055
+ submodules.forEach(submodule => {
1056
+ if (typeof submodule.submodule.onDataDeletionRequest === 'function') {
1057
+ try {
1058
+ submodule.submodule.onDataDeletionRequest(submodule.config, submodule.idObj, ...args);
1059
+ } catch (e) {
1060
+ logError(`Error calling onDataDeletionRequest for ID submodule ${submodule.submodule.name}`, e);
1061
+ }
1062
+ }
1063
+ deleteStoredValue(submodule);
1064
+ })
1065
+ next.apply(this, args);
1066
+ }
1067
+
1018
1068
  /**
1019
1069
  * enable submodule in User ID
1020
1070
  * @param {Submodule} submodule
@@ -1082,3 +1132,11 @@ export function init(config, {delay = GreedyPromise.timeout} = {}) {
1082
1132
  init(config);
1083
1133
 
1084
1134
  module('userId', attachIdSystem);
1135
+
1136
+ export function setOrtbUserExtEids(ortbRequest, bidderRequest, context) {
1137
+ const eids = deepAccess(context, 'bidRequests.0.userIdAsEids');
1138
+ if (eids) {
1139
+ deepSetValue(ortbRequest, 'user.ext.eids', eids);
1140
+ }
1141
+ }
1142
+ registerOrtbProcessor({type: REQUEST, name: 'userExtEids', fn: setOrtbUserExtEids});
@@ -0,0 +1,521 @@
1
+ # How to Add a Video Submodule
2
+
3
+ Video submodules interact with the Video Module to integrate Prebid with Video Players, allowing Prebid to automatically:
4
+ - render bids in the desired video player
5
+ - mark used bids as won
6
+ - trigger player and media events
7
+ - populate the oRTB Video Impression and Content params in the bid request
8
+
9
+ ## Overview
10
+
11
+ The Prebid Video Module simplifies the way Prebid integrates with video players by acting as a single point of contact for everything video.
12
+ In order for the Video Module to connect to a video player, a submodule must be implemented. The submodule acts as a bridge between the Video Module and the video player.
13
+ The Video Module will route commands and tasks to the appropriate submodule instance.
14
+ A submodule is expected to work for a specific video player. i.e. the JW Player submodule is used to integrate Prebid with JW Player. The video.js submdule connects to video.js.
15
+ Publishers who use players from different vendors on the same page can use multiple video submodules.
16
+
17
+ ## Requirements
18
+
19
+ The Video Module only supports integration with Video Players that meet the following requirements:
20
+ - Must support parsing and reproduction of VAST ads
21
+ - Input can be an ad tag URL or the actual Vast XML.
22
+ - Must expose an API that allows the procurement of [Open RTB params](https://www.iab.com/wp-content/uploads/2016/03/OpenRTB-API-Specification-Version-2-5-FINAL.pdf) for Video (section 3.2.7) and Content (section 3.2.16).
23
+ - Must emit javascript events for Ads and Media
24
+ - see [Event Registration](#event-registration)
25
+
26
+ ## Creating a Submodule
27
+
28
+ ### Step 1: Add a markdown file describing the submodule
29
+
30
+ Create a markdown file under `modules` with the name of the module suffixed with 'VideoProvider', i.e. `exampleVideoProvider.md`.
31
+
32
+ Example markdown file:
33
+ ```markdown
34
+ # Overview
35
+
36
+ Module Name: Example Video Provider
37
+ Module Type: Video Submodule
38
+ Video Player: Example player
39
+ Player website: example-player.com
40
+ Maintainer: someone@example.com
41
+
42
+ # Description
43
+
44
+ Video provider for Example Player. Contact someone@example.com for information.
45
+
46
+ # Requirements
47
+
48
+ Your page must link the Example Player build from our CDN. Alternatively yu can use npm to load the build.
49
+ ```
50
+
51
+ ### Step 2: Add a Vendor Code
52
+
53
+ Vendor codes are required to indicate which submodule type to instantiate. Add your vendor code constant to an export const in `vendorCodes.js` in Prebid.js under `libraries/video/constants/vendorCodes.js`.
54
+ i.e. in `vendorCodes.js`:
55
+
56
+ ```javascript
57
+ export const EXAMPLE_PLAYER_VENDOR = 3;
58
+ ```
59
+
60
+ ### Step 2: Build the Module
61
+
62
+ Now create a javascript file under `modules` with the name of the module suffixed with 'VideoProvider', e.g., `exampleVideoProvider.js`.
63
+
64
+ #### The Submodule factory
65
+
66
+ The Video Module will need a submodule instance for every player instance registered with Prebid. You will therefore need to implement a submodule factory which is called with a `videoProviderConfig` argument and returns a Video Provider instance.
67
+ Your submodule should import your vendor code constant and set it to a `vendorCode` property on your submodule factory.
68
+ Your submodule should also import the `submodule` function from `src/hook.js` and should use it to register as a submodule of `'video'`.
69
+
70
+ **Code Example**
71
+
72
+ ```javascript
73
+ import { submodule } from '../src/hook.js';
74
+
75
+ function exampleSubmoduleFactory(videoProviderConfig) {
76
+ const videoProvider = {
77
+ // implementation
78
+ };
79
+
80
+ return videoProvider;
81
+ }
82
+
83
+ exampleSubmoduleFactory.vendorCode = EXAMPLE_VENDOR;
84
+ submodule('video', exampleSubmoduleFactory);
85
+ ```
86
+
87
+ #### The Submodule object
88
+
89
+ The submodule object must adhere to the `VideoProvider` interface defined in the `coreVideo.js` inline documentation.
90
+
91
+ #### Event registration
92
+
93
+ Submodules must support attaching and detaching event listeners on the video player. The list of events are defined in the Events file in the Video Library: `libraries/video/constants/events.js`.
94
+ All events and their params must be supported.
95
+
96
+ ##### Event params
97
+
98
+ All Video Module events include a `divId` and `type` param in the payload by default.
99
+ The `divId` is the div id string of the player emitting the event; it can be used as an identifier. The `type` is the string name of the event.
100
+ The remaining Payload params are listed in the following:
101
+
102
+ ###### SETUP_COMPLETE
103
+
104
+ | argument name | type | description |
105
+ | ------------- | ---- | ----------- |
106
+ | playerVersion | string | The version of the player on the page |
107
+ | viewable | boolean | Is the player currently viewable? |
108
+ | viewabilityPercentage | number | The percentage of the video that is currently viewable on the user's screen. |
109
+ | mute | boolean | Whether or not the player is currently muted. |
110
+ | volumePercentage | number | The volume of the player, as a percentage |
111
+
112
+ ###### SETUP_FAILED
113
+
114
+ | argument name | type | description |
115
+ | ------------- | ---- | ----------- |
116
+ | playerVersion | string | The version of the player on the page |
117
+ | errorCode | number | The identifier of the error preventing the media from rendering |
118
+ | errorMessage | string | Developer friendly description of the reason the error occurred. |
119
+ | sourceError | object | The underlying root Error which prevented the playback. |
120
+
121
+ ###### DESTROYED
122
+ No additional params.
123
+
124
+ ###### AD_REQUEST
125
+
126
+ | argument name | type | description |
127
+ | ------------- | ---- | ----------- |
128
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
129
+
130
+ ###### AD_BREAK_START
131
+
132
+ | argument name | type | description |
133
+ | ------------- | ---- | ----------- |
134
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
135
+
136
+ ###### AD_LOADED
137
+
138
+ | argument name | type | description |
139
+ | ------------- | ---- | ----------- |
140
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
141
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
142
+ | loadTime | number | Time the ad took to load in milliseconds |
143
+ | vastAdId | string | The ID given to the ad within the ad tag's XML. Nullable when absent from the VAST xml. |
144
+ | adDescription | string | Description of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
145
+ | adServer | string | Ad server used (e.g. dart or mediamind) from the vast tag. Nullable when absent from the VAST xml. |
146
+ | adTitle | string | Title of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
147
+ | advertiserId | string | Optional identifier for the advertiser, provided by the ad server. Nullable when absent from the VAST xml. |
148
+ | advertiserName | string | Name of the advertiser as defined by the ad serving party, from the vast XML. Nullable when absent from the VAST xml. |
149
+ | dealId | string | The ID of the Ads deal. Generally relates to Direct Sold Ad Campaigns. Nullable when absent from the VAST xml. |
150
+ | linear | boolean | Is the ad linear or not? |
151
+ | vastVersion | string | Version of VAST being reported from the tag |
152
+ | creativeUrl | string | The URL representing the VPAID or MP4 ad that is run |
153
+ | adId | string | Unique Ad ID - refers to the 'attribute' of the <Ad> node within the VAST. Nullable when absent from the VAST xml. |
154
+ | universalAdId | string | Unique identifier for an ad in VAST4. Nullable when absent from the VAST xml. |
155
+ | creativeId | string | Ad server's unique ID for the creative pulled from the ad tag's XML. Should be used to specify the ad server’s unique identifier as opposed to the Universal Ad Id which is used for maintaining a creative id for the ad across multiple systems. Nullable when absent from the VAST xml. |
156
+ | creativeType | string | The MIME type of the ad creative currently being displayed |
157
+ | redirectUrl | string | the url to which the viewer is being redirected after clicking the ad. Nullable when absent from the VAST xml. |
158
+ | adPlacementType | number | The video placements per IAB guidelines. Enum list: In-Stream: 1, In-Banner: 2, In-Article: 3, In-Feed: 4, Interstitial/Slider/Floating: 5 |
159
+ | waterfallIndex | number | Index of the current item in the ad waterfall |
160
+ | waterfallCount | number | The count of items in a given ad waterfall |
161
+ | adPodCount | number | the total number of ads in the pod |
162
+ | adPodIndex | number | The index of the currently playing ad within an ad pod |
163
+ | wrapperAdIds | array[string] | Ad IDs of the VAST Wrappers that were loaded while loading the Ad tag. The list returned starts at the inline ad (innermost) and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads. |
164
+
165
+ ###### AD_STARTED
166
+
167
+ | argument name | type | description |
168
+ | ------------- | ---- | ----------- |
169
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
170
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
171
+ | loadTime | number | Time the ad took to load in milliseconds |
172
+ | vastAdId | string | The ID given to the ad within the ad tag's XML. Nullable when absent from the VAST xml. |
173
+ | adDescription | string | Description of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
174
+ | adServer | string | Ad server used (e.g. dart or mediamind) from the vast tag. Nullable when absent from the VAST xml. |
175
+ | adTitle | string | Title of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
176
+ | advertiserId | string | Optional identifier for the advertiser, provided by the ad server. Nullable when absent from the VAST xml. |
177
+ | advertiserName | string | Name of the advertiser as defined by the ad serving party, from the vast XML. Nullable when absent from the VAST xml. |
178
+ | dealId | string | The ID of the Ads deal. Generally relates to Direct Sold Ad Campaigns. Nullable when absent from the VAST xml. |
179
+ | linear | boolean | Is the ad linear or not? |
180
+ | vastVersion | string | Version of VAST being reported from the tag |
181
+ | creativeUrl | string | The URL representing the VPAID or MP4 ad that is run |
182
+ | adId | string | Unique Ad ID - refers to the 'attribute' of the <Ad> node within the VAST. Nullable when absent from the VAST xml. |
183
+ | universalAdId | string | Unique identifier for an ad in VAST4. Nullable when absent from the VAST xml. |
184
+ | creativeId | string | Ad server's unique ID for the creative pulled from the ad tag's XML. Should be used to specify the ad server’s unique identifier as opposed to the Universal Ad Id which is used for maintaining a creative id for the ad across multiple systems. Nullable when absent from the VAST xml. |
185
+ | creativeType | string | The MIME type of the ad creative currently being displayed |
186
+ | redirectUrl | string | the url to which the viewer is being redirected after clicking the ad. Nullable when absent from the VAST xml. |
187
+ | adPlacementType | number | The video placements per IAB guidelines. Enum list: In-Stream: 1, In-Banner: 2, In-Article: 3, In-Feed: 4, Interstitial/Slider/Floating: 5 |
188
+ | waterfallIndex | number | Index of the current item in the ad waterfall |
189
+ | waterfallCount | number | The count of items in a given ad waterfall |
190
+ | adPodCount | number | the total number of ads in the pod |
191
+ | adPodIndex | number | The index of the currently playing ad within an ad pod |
192
+ | wrapperAdIds | array[string] | Ad IDs of the VAST Wrappers that were loaded while loading the Ad tag. The list returned starts at the inline ad (innermost) and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads. |
193
+
194
+ <a name="ad-impression-params" />
195
+
196
+ ###### AD_IMPRESSION
197
+
198
+ | argument name | type | description |
199
+ | ------------- | ---- | ----------- |
200
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
201
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
202
+ | loadTime | number | Time the ad took to load in milliseconds |
203
+ | vastAdId | string | The ID given to the ad within the ad tag's XML. Nullable when absent from the VAST xml. |
204
+ | adDescription | string | Description of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
205
+ | adServer | string | Ad server used (e.g. dart or mediamind) from the vast tag. Nullable when absent from the VAST xml. |
206
+ | adTitle | string | Title of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
207
+ | advertiserId | string | Optional identifier for the advertiser, provided by the ad server. Nullable when absent from the VAST xml. |
208
+ | advertiserName | string | Name of the advertiser as defined by the ad serving party, from the vast XML. Nullable when absent from the VAST xml. |
209
+ | dealId | string | The ID of the Ads deal. Generally relates to Direct Sold Ad Campaigns. Nullable when absent from the VAST xml. |
210
+ | linear | boolean | Is the ad linear or not? |
211
+ | vastVersion | string | Version of VAST being reported from the tag |
212
+ | creativeUrl | string | The URL representing the VPAID or MP4 ad that is run |
213
+ | adId | string | Unique Ad ID - refers to the 'attribute' of the <Ad> node within the VAST. Nullable when absent from the VAST xml. |
214
+ | universalAdId | string | Unique identifier for an ad in VAST4. Nullable when absent from the VAST xml. |
215
+ | creativeId | string | Ad server's unique ID for the creative pulled from the ad tag's XML. Should be used to specify the ad server’s unique identifier as opposed to the Universal Ad Id which is used for maintaining a creative id for the ad across multiple systems. Nullable when absent from the VAST xml. |
216
+ | creativeType | string | The MIME type of the ad creative currently being displayed |
217
+ | redirectUrl | string | the url to which the viewer is being redirected after clicking the ad. Nullable when absent from the VAST xml. |
218
+ | adPlacementType | number | The video placements per IAB guidelines. Enum list: In-Stream: 1, In-Banner: 2, In-Article: 3, In-Feed: 4, Interstitial/Slider/Floating: 5 |
219
+ | waterfallIndex | number | Index of the current item in the ad waterfall |
220
+ | waterfallCount | number | The count of items in a given ad waterfall |
221
+ | adPodCount | number | the total number of ads in the pod |
222
+ | adPodIndex | number | The index of the currently playing ad within an ad pod |
223
+ | wrapperAdIds | array[string] | Ad IDs of the VAST Wrappers that were loaded while loading the Ad tag. The list returned starts at the inline ad (innermost) and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads. |
224
+ | time | number | The playback time in the ad when the event occurs, in seconds. |
225
+ | duration | number | Total duration of an ad in seconds |
226
+
227
+ ###### AD_PLAY
228
+
229
+ | argument name | type | description |
230
+ | ------------- | ---- | ----------- |
231
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
232
+
233
+ ###### AD_TIME
234
+
235
+ | argument name | type | description |
236
+ | ------------- | ---- | ----------- |
237
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
238
+ | time | number | The current poisition in the ad timeline |
239
+ | duration | number | Total duration of an ad in seconds |
240
+
241
+ ###### AD_PAUSE
242
+
243
+ | argument name | type | description |
244
+ | ------------- | ---- | ----------- |
245
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
246
+
247
+ ###### AD_CLICK
248
+
249
+ | argument name | type | description |
250
+ | ------------- | ---- | ----------- |
251
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
252
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
253
+ | loadTime | number | Time the ad took to load in milliseconds |
254
+ | vastAdId | string | The ID given to the ad within the ad tag's XML. Nullable when absent from the VAST xml. |
255
+ | adDescription | string | Description of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
256
+ | adServer | string | Ad server used (e.g. dart or mediamind) from the vast tag. Nullable when absent from the VAST xml. |
257
+ | adTitle | string | Title of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
258
+ | advertiserId | string | Optional identifier for the advertiser, provided by the ad server. Nullable when absent from the VAST xml. |
259
+ | advertiserName | string | Name of the advertiser as defined by the ad serving party, from the vast XML. Nullable when absent from the VAST xml. |
260
+ | dealId | string | The ID of the Ads deal. Generally relates to Direct Sold Ad Campaigns. Nullable when absent from the VAST xml. |
261
+ | linear | boolean | Is the ad linear or not? |
262
+ | vastVersion | string | Version of VAST being reported from the tag |
263
+ | creativeUrl | string | The URL representing the VPAID or MP4 ad that is run |
264
+ | adId | string | Unique Ad ID - refers to the 'attribute' of the <Ad> node within the VAST. Nullable when absent from the VAST xml. |
265
+ | universalAdId | string | Unique identifier for an ad in VAST4. Nullable when absent from the VAST xml. |
266
+ | creativeId | string | Ad server's unique ID for the creative pulled from the ad tag's XML. Should be used to specify the ad server’s unique identifier as opposed to the Universal Ad Id which is used for maintaining a creative id for the ad across multiple systems. Nullable when absent from the VAST xml. |
267
+ | creativeType | string | The MIME type of the ad creative currently being displayed |
268
+ | redirectUrl | string | the url to which the viewer is being redirected after clicking the ad. Nullable when absent from the VAST xml. |
269
+ | adPlacementType | number | The video placements per IAB guidelines. Enum list: In-Stream: 1, In-Banner: 2, In-Article: 3, In-Feed: 4, Interstitial/Slider/Floating: 5 |
270
+ | waterfallIndex | number | Index of the current item in the ad waterfall |
271
+ | waterfallCount | number | The count of items in a given ad waterfall |
272
+ | adPodCount | number | the total number of ads in the pod |
273
+ | adPodIndex | number | The index of the currently playing ad within an ad pod |
274
+ | wrapperAdIds | array[string] | Ad IDs of the VAST Wrappers that were loaded while loading the Ad tag. The list returned starts at the inline ad (innermost) and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads. |
275
+ | time | number | The playback time in the ad when the event occurs, in seconds. |
276
+ | duration | number | Total duration of an ad in seconds |
277
+
278
+ ###### AD_SKIPPED
279
+
280
+ | argument name | type | description |
281
+ | ------------- | ---- | ----------- |
282
+ | time | number | The playback time in the ad when the event occurs, in seconds. |
283
+ | duration | number | Total duration of an ad in seconds |
284
+
285
+ <a name="ad-error-params" />
286
+
287
+ ###### AD_ERROR
288
+
289
+ | argument name | type | description |
290
+ | ------------- | ---- | ----------- |
291
+ | playerErrorCode | number | The ad error code from the Player’s internal spec. |
292
+ | vastErrorCode | number | The error code for the VAST response that is returned from the request, as defined in the VAST spec. |
293
+ | errorMessage | string | Developer friendly description of the reason the error occurred. |
294
+ | sourceError | object | The underlying root Error which prevented the playback. |
295
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
296
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
297
+ | loadTime | number | Time the ad took to load in milliseconds |
298
+ | vastAdId | string | The ID given to the ad within the ad tag's XML. Nullable when absent from the VAST xml. |
299
+ | adDescription | string | Description of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
300
+ | adServer | string | Ad server used (e.g. dart or mediamind) from the vast tag. Nullable when absent from the VAST xml. |
301
+ | adTitle | string | Title of the ad pulled from the ad tag's XML. Nullable when absent from the VAST xml. |
302
+ | advertiserId | string | Optional identifier for the advertiser, provided by the ad server. Nullable when absent from the VAST xml. |
303
+ | advertiserName | string | Name of the advertiser as defined by the ad serving party, from the vast XML. Nullable when absent from the VAST xml. |
304
+ | dealId | string | The ID of the Ads deal. Generally relates to Direct Sold Ad Campaigns. Nullable when absent from the VAST xml. |
305
+ | linear | boolean | Is the ad linear or not? |
306
+ | vastVersion | string | Version of VAST being reported from the tag |
307
+ | creativeUrl | string | The URL representing the VPAID or MP4 ad that is run |
308
+ | adId | string | Unique Ad ID - refers to the 'attribute' of the <Ad> node within the VAST. Nullable when absent from the VAST xml. |
309
+ | universalAdId | string | Unique identifier for an ad in VAST4. Nullable when absent from the VAST xml. |
310
+ | creativeId | string | Ad server's unique ID for the creative pulled from the ad tag's XML. Should be used to specify the ad server’s unique identifier as opposed to the Universal Ad Id which is used for maintaining a creative id for the ad across multiple systems. Nullable when absent from the VAST xml. |
311
+ | creativeType | string | The MIME type of the ad creative currently being displayed |
312
+ | redirectUrl | string | the url to which the viewer is being redirected after clicking the ad. Nullable when absent from the VAST xml. |
313
+ | adPlacementType | number | The video placements per IAB guidelines. Enum list: In-Stream: 1, In-Banner: 2, In-Article: 3, In-Feed: 4, Interstitial/Slider/Floating: 5 |
314
+ | waterfallIndex | number | Index of the current item in the ad waterfall |
315
+ | waterfallCount | number | The count of items in a given ad waterfall |
316
+ | adPodCount | number | the total number of ads in the pod |
317
+ | adPodIndex | number | The index of the currently playing ad within an ad pod |
318
+ | wrapperAdIds | array[string] | Ad IDs of the VAST Wrappers that were loaded while loading the Ad tag. The list returned starts at the inline ad (innermost) and traverses to the outermost wrapper ad. An empty array is returned if there are no wrapper ads. |
319
+ | time | number | The playback time in the ad when the event occurs, in seconds. |
320
+ | duration | number | Total duration of an ad in seconds |
321
+
322
+ ###### AD_COMPLETE
323
+
324
+ | argument name | type | description |
325
+ | ------------- | ---- | ----------- |
326
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
327
+
328
+ ###### AD_BREAK_END
329
+
330
+ | argument name | type | description |
331
+ | ------------- | ---- | ----------- |
332
+ | offset | string | Scheduled position in the video for the ad to play. For mid-rolls, will be the position in seconds as string. Other options: 'pre' (pre-roll), 'post' (post-roll), 'api' (ad was not scheduled) |
333
+
334
+ ###### PLAYLIST
335
+
336
+ | argument name | type | description |
337
+ | ------------- | ---- | ----------- |
338
+ | playlistItemCount | number | The number of items in the current playlist |
339
+ | autostart | boolean | Whether or not the player is set to begin playing automatically. |
340
+
341
+ ###### PLAYBACK_REQUEST
342
+
343
+ | argument name | type | description |
344
+ | ------------- | ---- | ----------- |
345
+ | playReason | string | wWy the play attempt originated. Options: ‘Unknown’ (Unknown reason:we cannot tell), ‘Interaction’ (A viewer interacts with the UI), ‘Auto’ (Autoplay based on the configuration of the player - autoStart), ‘autoOnViewable’ (autoStart when viewable), ‘autoRepeat’ (media automatically restarted after completion, without any user interaction), ‘Api’ (caused by a call on the player’s API), ‘Internal’ (started because of an internal mechanism i.e. playlist progressed to a recommended item) |
346
+
347
+ ###### AUTOSTART_BLOCKED
348
+
349
+ | argument name | type | description |
350
+ | ------------- | ---- | ----------- |
351
+ | errorCode | number | The identifier of error preventing the media from rendering |
352
+ | errorMessage | string | Developer friendly description of the reason the error occurred. |
353
+ | sourceError | object | The underlying root Error which prevented the playback. |
354
+
355
+ ###### PLAY_ATTEMPT_FAILED
356
+
357
+ | argument name | type | description |
358
+ | ------------- | ---- | ----------- |
359
+ | playReason | string | Why the play attempt originated. Options: ‘Unknown’ (Unknown reason:we cannot tell), ‘Interaction’ (A viewer interacts with the UI), ‘Auto’ (Autoplay based on the configuration of the player - autoStart), ‘autoOnViewable’ (autoStart when viewable), ‘autoRepeat’ (media automatically restarted after completion, without any user interaction), ‘Api’ (caused by a call on the player’s API), ‘Internal’ (started because of an internal mechanism i.e. playlist progressed to a recommended item) |
360
+ | errorCode | number | The identifier of error preventing the media from rendering |
361
+ | errorMessage | string | Developer friendly description of the reason the error occurred. |
362
+ | sourceError | object | The underlying root Error which prevented the playback. |
363
+
364
+ ###### CONTENT_LOADED
365
+
366
+ | argument name | type | description |
367
+ | ------------- | ---- | ----------- |
368
+ | contentId | string | The unique identifier of the media item being rendered by the video player. Nullable when not provided by Publisher, or unknown. |
369
+ | contentUrl | string | The URL of the media source of the playlist item |
370
+ | title | string | The title of the content; not meant to be used as a unique identifier. Nullable when not provided by Publisher, or unknown. |
371
+ | description | string | The description of the content. Nullable when not provided by Publisher, or unknown. |
372
+ | playlistIndex | number | The currently playing media item's index in the playlist. |
373
+ | contentTags | array[string] | Customer media level tags describing the content. Nullable when not provided by Publisher, or unknown. |
374
+
375
+ ###### PLAY
376
+
377
+ No additional params.
378
+
379
+ ###### PAUSE
380
+
381
+ No additional params.
382
+
383
+ ###### BUFFER
384
+
385
+ | argument name | type | description |
386
+ | ------------- | ---- | ----------- |
387
+ | time | number | Playback position of the media in seconds |
388
+ | duration | number | Current media’s length in seconds |
389
+ | playbackMode | number | The current playback mode used by a given player. Enum list: vod: 0, live: 1, dvr: 2 |
390
+
391
+ ###### TIME
392
+
393
+ | argument name | type | description |
394
+ | ------------- | ---- | ----------- |
395
+ | position | number | Playback position of the media in seconds |
396
+ | duration | number | Current media’s length in seconds |
397
+
398
+ ###### SEEK_START
399
+
400
+ | argument name | type | description |
401
+ | ------------- | ---- | ----------- |
402
+ | position | number | Playback position of the media in seconds, when the seek begins |
403
+ | destination | number | Desired playback position of a seek action, in seconds |
404
+ | duration | number | Current media’s length in seconds |
405
+
406
+ ###### SEEK_END
407
+
408
+ | argument name | type | description |
409
+ | ------------- | ---- | ----------- |
410
+ | position | number | Playback position of the media in seconds, when the seek has ended |
411
+ | duration | number | Current media’s length in seconds |
412
+
413
+ ###### MUTE
414
+
415
+ | argument name | type | description |
416
+ | ------------- | ---- | ----------- |
417
+ | mute | boolean | Whether or not the player is currently muted. |
418
+
419
+ ###### VOLUME
420
+
421
+ | argument name | type | description |
422
+ | ------------- | ---- | ----------- |
423
+ | volumePercentage | number | The volume of the player, as a percentage |
424
+
425
+ ###### RENDITION_UPDATE
426
+
427
+ | argument name | type | description |
428
+ | ------------- | ---- | ----------- |
429
+ | videoReportedBitrate | number | The bitrate of the currently playing video in kbps as reported by the Adaptive Manifest. |
430
+ | audioReportedBitrate | number | The bitrate of the currently playing audio in kbps as reported by the Adaptive Manifest. |
431
+ | encodedVideoWidth | number | The encoded width in pixels of the currently playing video rendition. |
432
+ | encodedVideoHeight | number | The encoded height in pixels of the currently playing video rendition. |
433
+ | videoFramerate | number | The current rate of playback. For a video that is playing twice as fast as the default playback, the playbackRate value should be 2.00 |
434
+
435
+ ###### ERROR
436
+
437
+ | argument name | type | description |
438
+ | ------------- | ---- | ----------- |
439
+ | errorCode | number | The identifier of the error preventing the media from rendering |
440
+ | errorMessage | string | Developer friendly description of the reason the error occurred. |
441
+ | sourceError | object | The underlying root Error which prevented the playback. |
442
+
443
+ ###### COMPLETE
444
+
445
+ No additional params.
446
+
447
+ ###### PLAYLIST_COMPLETE
448
+
449
+ No additional params.
450
+
451
+ ###### FULLSCREEN
452
+
453
+ | argument name | type | description |
454
+ | ------------- | ---- | ----------- |
455
+ | fullscreen | boolean | Whether or not the player is currently in fullscreen |
456
+
457
+ ###### PLAYER_RESIZE
458
+
459
+ | argument name | type | description |
460
+ | ------------- | ---- | ----------- |
461
+ | height | number | The height of the player in pixels |
462
+ | width | number | The width of the player in pixels |
463
+
464
+ ###### VIEWABLE
465
+
466
+ | argument name | type | description |
467
+ | ------------- | ---- | ----------- |
468
+ | viewable | boolean | Is the player currently viewable? |
469
+ | viewabilityPercentage | number | The percentage of the video that is currently viewable on the user's screen. |
470
+
471
+ ###### CAST
472
+
473
+ | argument name | type | description |
474
+ | ------------- | ---- | ----------- |
475
+ | casting | boolean | Whether or not the current user is casting to a device |
476
+
477
+ ###### AUCTION_AD_LOAD_ATTEMPT
478
+
479
+ | argument name | type | description |
480
+ | ------------- | ---- | ----------- |
481
+ | adTagUrl | string | The URL for the ad tag associated with the given ad event |
482
+ | adUnitCode | string | Unique identifier that was used when creating the ad unit. |
483
+
484
+ ###### AUCTION_AD_LOAD_ABORT
485
+
486
+ | argument name | type | description |
487
+ | ------------- | ---- | ----------- |
488
+ | adUnitCode | string | Unique identifier that was used when creating the ad unit. |
489
+
490
+ ###### BID_IMPRESSION
491
+
492
+ | argument name | type | description |
493
+ | ------------- | ---- | ----------- |
494
+ | bid | object | Information about the Bid which resulted in the Ad Impression |
495
+ | adEvent | object | Event payload from the [Ad Impression](#ad-impression-params) |
496
+
497
+ ###### BID_ERROR
498
+
499
+ | argument name | type | description |
500
+ | ------------- | ---- | ----------- |
501
+ | bid | object | Information about the Bid which resulted in the Ad Error |
502
+ | adEvent | object | Event payload from the [Ad Error](#ad-error-params) |
503
+
504
+ #### Update .submodules.json
505
+
506
+ In prebid.js, add your new submodule to `.submodules.json` under the `videoModule` as such:
507
+ {% highlight text %}
508
+ ```
509
+ {
510
+ "parentModules": {
511
+ "videoModule": [
512
+ "exampleVideoProvider"
513
+ ]
514
+ }
515
+ }
516
+ ```
517
+
518
+ ### Shared resources for developers
519
+
520
+ A video library containing reusable code and constants has been added to Prebid.js for your convenience. We encourage you to import from this library.
521
+ Constants such as event names can be found in the `libraries/video/constants/` folder.