stormcloud-video-player 0.6.8 → 0.6.9

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.
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'react';
2
- import { S as StormcloudVideoPlayerConfig } from '../types-BYwfSJb5.cjs';
2
+ import { S as StormcloudVideoPlayerConfig } from '../types-DSKC4ySr.cjs';
3
3
 
4
4
  interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
5
5
  onMount?: (player: any) => void;
@@ -2229,24 +2229,30 @@ function getBrowserID(clientInfo) {
2229
2229
  });
2230
2230
  })();
2231
2231
  }
2232
- var TRACK_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track";
2232
+ var PLAYER_TRACKING_BASE_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking";
2233
+ var TRACK_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/metrics/ingest");
2234
+ var HEARTBEAT_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/heartbeat");
2235
+ var IMPRESSIONS_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/impressions/ingest");
2236
+ function buildHeaders(licenseKey) {
2237
+ var headers = {
2238
+ "Content-Type": "application/json"
2239
+ };
2240
+ if (licenseKey) {
2241
+ headers["Authorization"] = "Bearer ".concat(licenseKey);
2242
+ }
2243
+ return headers;
2244
+ }
2233
2245
  function sendTrackRequest(licenseKey, body) {
2234
2246
  return _async_to_generator(function() {
2235
- var headers, response;
2247
+ var response;
2236
2248
  return _ts_generator(this, function(_state) {
2237
2249
  switch(_state.label){
2238
2250
  case 0:
2239
- headers = {
2240
- "Content-Type": "application/json"
2241
- };
2242
- if (licenseKey) {
2243
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2244
- }
2245
2251
  return [
2246
2252
  4,
2247
2253
  fetch(TRACK_URL, {
2248
2254
  method: "POST",
2249
- headers: headers,
2255
+ headers: buildHeaders(licenseKey),
2250
2256
  body: JSON.stringify(body)
2251
2257
  })
2252
2258
  ];
@@ -2268,14 +2274,86 @@ function sendTrackRequest(licenseKey, body) {
2268
2274
  });
2269
2275
  })();
2270
2276
  }
2271
- function sendInitialTracking(licenseKey) {
2277
+ function postJson(url, licenseKey, body) {
2272
2278
  return _async_to_generator(function() {
2273
- var clientInfo, browserId, trackingData, headers, response, error;
2279
+ var response;
2280
+ return _ts_generator(this, function(_state) {
2281
+ switch(_state.label){
2282
+ case 0:
2283
+ return [
2284
+ 4,
2285
+ fetch(url, {
2286
+ method: "POST",
2287
+ headers: buildHeaders(licenseKey),
2288
+ body: JSON.stringify(body)
2289
+ })
2290
+ ];
2291
+ case 1:
2292
+ response = _state.sent();
2293
+ if (!response.ok) {
2294
+ throw new Error("HTTP error! status: ".concat(response.status));
2295
+ }
2296
+ return [
2297
+ 4,
2298
+ response.json()
2299
+ ];
2300
+ case 2:
2301
+ _state.sent();
2302
+ return [
2303
+ 2
2304
+ ];
2305
+ }
2306
+ });
2307
+ })();
2308
+ }
2309
+ function buildPlayerMetricEvent(_0) {
2310
+ return _async_to_generator(function(licenseKey) {
2311
+ var context, flags, _flags_captureAt, clientInfo, browserId, captureAt;
2312
+ var _arguments = arguments;
2313
+ return _ts_generator(this, function(_state) {
2314
+ switch(_state.label){
2315
+ case 0:
2316
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2317
+ clientInfo = getClientInfo();
2318
+ return [
2319
+ 4,
2320
+ getBrowserID(clientInfo)
2321
+ ];
2322
+ case 1:
2323
+ browserId = _state.sent();
2324
+ captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
2325
+ return [
2326
+ 2,
2327
+ {
2328
+ player_id: browserId,
2329
+ browserId: browserId,
2330
+ device_type: clientInfo.deviceType,
2331
+ deviceType: clientInfo.deviceType,
2332
+ input_stream_type: context.inputStreamType,
2333
+ os: clientInfo.os,
2334
+ ad_loaded: flags.adLoaded,
2335
+ ad_detect: flags.adDetect,
2336
+ license_key: licenseKey,
2337
+ capture_at: captureAt,
2338
+ timestamp: captureAt
2339
+ }
2340
+ ];
2341
+ }
2342
+ });
2343
+ }).apply(this, arguments);
2344
+ }
2345
+ function sendInitialTracking(_0) {
2346
+ return _async_to_generator(function(licenseKey) {
2347
+ var context, clientInfo, browserId, trackingData, error;
2348
+ var _arguments = arguments;
2274
2349
  return _ts_generator(this, function(_state) {
2275
2350
  switch(_state.label){
2276
2351
  case 0:
2352
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
2353
+ _state.label = 1;
2354
+ case 1:
2277
2355
  _state.trys.push([
2278
- 0,
2356
+ 1,
2279
2357
  4,
2280
2358
  ,
2281
2359
  5
@@ -2285,34 +2363,29 @@ function sendInitialTracking(licenseKey) {
2285
2363
  4,
2286
2364
  getBrowserID(clientInfo)
2287
2365
  ];
2288
- case 1:
2366
+ case 2:
2289
2367
  browserId = _state.sent();
2290
2368
  trackingData = _object_spread({
2291
2369
  browserId: browserId
2292
2370
  }, clientInfo);
2293
- headers = {
2294
- "Content-Type": "application/json"
2295
- };
2296
- if (licenseKey) {
2297
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2298
- }
2299
2371
  return [
2300
2372
  4,
2301
- fetch(TRACK_URL, {
2302
- method: "POST",
2303
- headers: headers,
2304
- body: JSON.stringify(trackingData)
2373
+ sendTrackRequest(licenseKey, {
2374
+ events: [
2375
+ {
2376
+ player_id: browserId,
2377
+ device_type: clientInfo.deviceType,
2378
+ input_stream_type: context.inputStreamType,
2379
+ os: clientInfo.os,
2380
+ ad_loaded: false,
2381
+ ad_detect: false,
2382
+ license_key: licenseKey,
2383
+ capture_at: /* @__PURE__ */ new Date().toISOString()
2384
+ }
2385
+ ],
2386
+ trackingData: trackingData
2305
2387
  })
2306
2388
  ];
2307
- case 2:
2308
- response = _state.sent();
2309
- if (!response.ok) {
2310
- throw new Error("HTTP error! status: ".concat(response.status));
2311
- }
2312
- return [
2313
- 4,
2314
- response.json()
2315
- ];
2316
2389
  case 3:
2317
2390
  _state.sent();
2318
2391
  return [
@@ -2332,36 +2405,30 @@ function sendInitialTracking(licenseKey) {
2332
2405
  ];
2333
2406
  }
2334
2407
  });
2335
- })();
2408
+ }).apply(this, arguments);
2336
2409
  }
2337
- function sendAdDetectTracking(licenseKey, adDetectInfo) {
2338
- return _async_to_generator(function() {
2339
- var clientInfo, browserId, trackingData, error;
2410
+ function sendAdDetectTracking(_0, _1) {
2411
+ return _async_to_generator(function(licenseKey, adDetectInfo) {
2412
+ var context, error;
2413
+ var _arguments = arguments;
2340
2414
  return _ts_generator(this, function(_state) {
2341
2415
  switch(_state.label){
2342
2416
  case 0:
2417
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2418
+ _state.label = 1;
2419
+ case 1:
2343
2420
  _state.trys.push([
2344
- 0,
2421
+ 1,
2345
2422
  3,
2346
2423
  ,
2347
2424
  4
2348
2425
  ]);
2349
- clientInfo = getClientInfo();
2350
- return [
2351
- 4,
2352
- getBrowserID(clientInfo)
2353
- ];
2354
- case 1:
2355
- browserId = _state.sent();
2356
- trackingData = _object_spread({
2357
- browserId: browserId
2358
- }, clientInfo);
2359
2426
  return [
2360
2427
  4,
2361
- sendTrackRequest(licenseKey, _object_spread_props(_object_spread({}, trackingData), {
2362
- licenseKey: licenseKey,
2363
- adDetectInfo: adDetectInfo
2364
- }))
2428
+ sendHeartbeat(licenseKey, context, {
2429
+ adDetect: true,
2430
+ captureAt: adDetectInfo.timestamp
2431
+ })
2365
2432
  ];
2366
2433
  case 2:
2367
2434
  _state.sent();
@@ -2382,36 +2449,30 @@ function sendAdDetectTracking(licenseKey, adDetectInfo) {
2382
2449
  ];
2383
2450
  }
2384
2451
  });
2385
- })();
2452
+ }).apply(this, arguments);
2386
2453
  }
2387
- function sendAdLoadedTracking(licenseKey, adLoadedInfo) {
2388
- return _async_to_generator(function() {
2389
- var clientInfo, browserId, trackingData, error;
2454
+ function sendAdLoadedTracking(_0, _1) {
2455
+ return _async_to_generator(function(licenseKey, adLoadedInfo) {
2456
+ var context, error;
2457
+ var _arguments = arguments;
2390
2458
  return _ts_generator(this, function(_state) {
2391
2459
  switch(_state.label){
2392
2460
  case 0:
2461
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2462
+ _state.label = 1;
2463
+ case 1:
2393
2464
  _state.trys.push([
2394
- 0,
2465
+ 1,
2395
2466
  3,
2396
2467
  ,
2397
2468
  4
2398
2469
  ]);
2399
- clientInfo = getClientInfo();
2400
- return [
2401
- 4,
2402
- getBrowserID(clientInfo)
2403
- ];
2404
- case 1:
2405
- browserId = _state.sent();
2406
- trackingData = _object_spread({
2407
- browserId: browserId
2408
- }, clientInfo);
2409
2470
  return [
2410
2471
  4,
2411
- sendTrackRequest(licenseKey, _object_spread_props(_object_spread({}, trackingData), {
2412
- licenseKey: licenseKey,
2413
- adLoadedInfo: adLoadedInfo
2414
- }))
2472
+ sendHeartbeat(licenseKey, context, {
2473
+ adLoaded: true,
2474
+ captureAt: adLoadedInfo.timestamp
2475
+ })
2415
2476
  ];
2416
2477
  case 2:
2417
2478
  _state.sent();
@@ -2432,103 +2493,95 @@ function sendAdLoadedTracking(licenseKey, adLoadedInfo) {
2432
2493
  ];
2433
2494
  }
2434
2495
  });
2435
- })();
2496
+ }).apply(this, arguments);
2436
2497
  }
2437
- function sendAdImpressionTracking(licenseKey, adImpressionInfo) {
2438
- return _async_to_generator(function() {
2439
- var clientInfo, browserId, trackingData, error;
2498
+ function sendAdImpressionTracking(_0, _1) {
2499
+ return _async_to_generator(function(licenseKey, adImpressionInfo) {
2500
+ var context, metricEvent, error;
2501
+ var _arguments = arguments;
2440
2502
  return _ts_generator(this, function(_state) {
2441
2503
  switch(_state.label){
2442
2504
  case 0:
2505
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2506
+ _state.label = 1;
2507
+ case 1:
2443
2508
  _state.trys.push([
2444
- 0,
2445
- 3,
2509
+ 1,
2510
+ 4,
2446
2511
  ,
2447
- 4
2512
+ 5
2448
2513
  ]);
2449
- clientInfo = getClientInfo();
2450
2514
  return [
2451
2515
  4,
2452
- getBrowserID(clientInfo)
2516
+ buildPlayerMetricEvent(licenseKey, context, {
2517
+ captureAt: adImpressionInfo.timestamp
2518
+ })
2453
2519
  ];
2454
- case 1:
2455
- browserId = _state.sent();
2456
- trackingData = _object_spread({
2457
- browserId: browserId
2458
- }, clientInfo);
2520
+ case 2:
2521
+ metricEvent = _state.sent();
2459
2522
  return [
2460
2523
  4,
2461
- sendTrackRequest(licenseKey, _object_spread_props(_object_spread({}, trackingData), {
2462
- licenseKey: licenseKey,
2463
- adImpressionInfo: adImpressionInfo
2464
- }))
2524
+ Promise.all([
2525
+ postJson(HEARTBEAT_URL, licenseKey, metricEvent),
2526
+ postJson(IMPRESSIONS_URL, licenseKey, {
2527
+ events: [
2528
+ {
2529
+ player_id: metricEvent.player_id,
2530
+ ad_played_count: 1,
2531
+ ad_url: adImpressionInfo.adUrl,
2532
+ license_key: licenseKey,
2533
+ capture_at: adImpressionInfo.timestamp
2534
+ }
2535
+ ]
2536
+ })
2537
+ ])
2465
2538
  ];
2466
- case 2:
2539
+ case 3:
2467
2540
  _state.sent();
2468
2541
  return [
2469
2542
  3,
2470
- 4
2543
+ 5
2471
2544
  ];
2472
- case 3:
2545
+ case 4:
2473
2546
  error = _state.sent();
2474
2547
  console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
2475
2548
  return [
2476
2549
  3,
2477
- 4
2550
+ 5
2478
2551
  ];
2479
- case 4:
2552
+ case 5:
2480
2553
  return [
2481
2554
  2
2482
2555
  ];
2483
2556
  }
2484
2557
  });
2485
- })();
2558
+ }).apply(this, arguments);
2486
2559
  }
2487
- function sendHeartbeat(licenseKey) {
2488
- return _async_to_generator(function() {
2489
- var clientInfo, browserId, heartbeatData, headers, response, error;
2560
+ function sendHeartbeat(_0) {
2561
+ return _async_to_generator(function(licenseKey) {
2562
+ var context, flags, heartbeatData, error;
2563
+ var _arguments = arguments;
2490
2564
  return _ts_generator(this, function(_state) {
2491
2565
  switch(_state.label){
2492
2566
  case 0:
2567
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2568
+ _state.label = 1;
2569
+ case 1:
2493
2570
  _state.trys.push([
2494
- 0,
2571
+ 1,
2495
2572
  4,
2496
2573
  ,
2497
2574
  5
2498
2575
  ]);
2499
- clientInfo = getClientInfo();
2500
2576
  return [
2501
2577
  4,
2502
- getBrowserID(clientInfo)
2503
- ];
2504
- case 1:
2505
- browserId = _state.sent();
2506
- heartbeatData = {
2507
- browserId: browserId,
2508
- timestamp: /* @__PURE__ */ new Date().toISOString()
2509
- };
2510
- headers = {
2511
- "Content-Type": "application/json"
2512
- };
2513
- if (licenseKey) {
2514
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2515
- }
2516
- return [
2517
- 4,
2518
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/heartbeat", {
2519
- method: "POST",
2520
- headers: headers,
2521
- body: JSON.stringify(heartbeatData)
2522
- })
2578
+ buildPlayerMetricEvent(licenseKey, context, flags)
2523
2579
  ];
2524
2580
  case 2:
2525
- response = _state.sent();
2526
- if (!response.ok) {
2527
- throw new Error("HTTP error! status: ".concat(response.status));
2528
- }
2581
+ heartbeatData = _state.sent();
2529
2582
  return [
2530
2583
  4,
2531
- response.json()
2584
+ postJson(HEARTBEAT_URL, licenseKey, heartbeatData)
2532
2585
  ];
2533
2586
  case 3:
2534
2587
  _state.sent();
@@ -2549,7 +2602,7 @@ function sendHeartbeat(licenseKey) {
2549
2602
  ];
2550
2603
  }
2551
2604
  });
2552
- })();
2605
+ }).apply(this, arguments);
2553
2606
  }
2554
2607
  // src/utils/polyfills.ts
2555
2608
  function polyfillURLSearchParams() {
@@ -3564,17 +3617,62 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3564
3617
  return "vast";
3565
3618
  }
3566
3619
  },
3620
+ {
3621
+ key: "getInputStreamType",
3622
+ value: function getInputStreamType() {
3623
+ var src = this.config.src.toLowerCase();
3624
+ if (src.includes(".m3u8")) return "hls";
3625
+ if (src.includes(".mpd")) return "dash";
3626
+ if (src.includes(".mp4")) return "mp4";
3627
+ return this.isLiveStream ? "live" : "vod";
3628
+ }
3629
+ },
3630
+ {
3631
+ key: "getAnalyticsContext",
3632
+ value: function getAnalyticsContext() {
3633
+ return {
3634
+ inputStreamType: this.getInputStreamType()
3635
+ };
3636
+ }
3637
+ },
3638
+ {
3639
+ key: "getAdUrlFromBids",
3640
+ value: function getAdUrlFromBids(bids) {
3641
+ var _bids_;
3642
+ return bids === null || bids === void 0 ? void 0 : (_bids_ = bids[0]) === null || _bids_ === void 0 ? void 0 : _bids_.vastUrl;
3643
+ }
3644
+ },
3645
+ {
3646
+ key: "trackAdLoaded",
3647
+ value: function trackAdLoaded(bids) {
3648
+ if (!this.config.licenseKey) return;
3649
+ var adUrl = this.getAdUrlFromBids(bids);
3650
+ if (adUrl) {
3651
+ this.lastServedAdUrl = adUrl;
3652
+ }
3653
+ sendAdLoadedTracking(this.config.licenseKey, _object_spread_props(_object_spread({
3654
+ source: this.getAdSource()
3655
+ }, adUrl ? {
3656
+ vastUrl: adUrl
3657
+ } : {}), {
3658
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3659
+ }), this.getAnalyticsContext());
3660
+ }
3661
+ },
3567
3662
  {
3568
3663
  key: "attachAdLayerEventListeners",
3569
3664
  value: function attachAdLayerEventListeners() {
3570
3665
  var _this = this;
3571
3666
  this.adLayer.on("ad_impression", function() {
3572
3667
  if (_this.config.licenseKey) {
3573
- sendAdImpressionTracking(_this.config.licenseKey, {
3668
+ sendAdImpressionTracking(_this.config.licenseKey, _object_spread_props(_object_spread({
3574
3669
  source: _this.getAdSource(),
3575
- adIndex: _this.currentAdIndex,
3670
+ adIndex: _this.currentAdIndex
3671
+ }, _this.lastServedAdUrl ? {
3672
+ adUrl: _this.lastServedAdUrl
3673
+ } : {}), {
3576
3674
  timestamp: /* @__PURE__ */ new Date().toISOString()
3577
- });
3675
+ }), _this.getAnalyticsContext());
3578
3676
  }
3579
3677
  });
3580
3678
  this.adLayer.on("ad_error", function(errorPayload) {
@@ -3668,6 +3766,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3668
3766
  _this.isInAdTransition = false;
3669
3767
  if (!_this.inAdBreak) return;
3670
3768
  _this.currentAdIndex++;
3769
+ _this.trackAdLoaded();
3671
3770
  _this.adLayer.playPreloaded(token).catch(function(err) {
3672
3771
  if (_this.config.debugAdTiming) console.warn("[StormcloudVideoPlayer] playPreloaded failed:", err);
3673
3772
  _this.handleAdFailure();
@@ -3697,6 +3796,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3697
3796
  var freshBids = (_this_pendingNextAdBids = _this.pendingNextAdBids) !== null && _this_pendingNextAdBids !== void 0 ? _this_pendingNextAdBids : bids;
3698
3797
  _this.pendingNextAdBids = null;
3699
3798
  _this.currentAdIndex++;
3799
+ _this.trackAdLoaded(freshBids);
3700
3800
  _this.adLayer.playAd(freshBids).catch(function(err) {
3701
3801
  if (_this.config.debugAdTiming) console.warn("[StormcloudVideoPlayer] playAd(pending) failed:", err);
3702
3802
  _this.handleAdFailure();
@@ -4076,7 +4176,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4076
4176
  }, ((_this_pendingAdBreak1 = this.pendingAdBreak) === null || _this_pendingAdBreak1 === void 0 ? void 0 : _this_pendingAdBreak1.detectedAtFragmentSn) != null && {
4077
4177
  detectedAtFragmentSn: this.pendingAdBreak.detectedAtFragmentSn
4078
4178
  });
4079
- sendAdDetectTracking(this.config.licenseKey, adDetectInfo);
4179
+ sendAdDetectTracking(this.config.licenseKey, adDetectInfo, this.getAnalyticsContext());
4080
4180
  }
4081
4181
  var isManifestMarker = this.isManifestBasedMarker(marker);
4082
4182
  var forceImmediate = (_this_config_immediateManifestAds = this.config.immediateManifestAds) !== null && _this_config_immediateManifestAds !== void 0 ? _this_config_immediateManifestAds : true;
@@ -4145,6 +4245,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4145
4245
  var bids = this.pendingNextAdBids;
4146
4246
  this.pendingNextAdBids = null;
4147
4247
  this.currentAdIndex++;
4248
+ this.trackAdLoaded(bids);
4148
4249
  this.adLayer.playAd(bids).catch(function() {
4149
4250
  return _this.handleAdFailure();
4150
4251
  });
@@ -4399,7 +4500,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4399
4500
  key: "initializeTracking",
4400
4501
  value: function initializeTracking() {
4401
4502
  var _this = this;
4402
- sendInitialTracking(this.config.licenseKey).then(function() {
4503
+ sendInitialTracking(this.config.licenseKey, this.getAnalyticsContext()).then(function() {
4403
4504
  _this.heartbeatInterval = window.setInterval(function() {
4404
4505
  _this.sendHeartbeatIfNeeded();
4405
4506
  }, 5e3);
@@ -4420,7 +4521,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4420
4521
  var now = Date.now();
4421
4522
  if (!this.lastHeartbeatTime || now - this.lastHeartbeatTime > 3e4) {
4422
4523
  this.lastHeartbeatTime = now;
4423
- sendHeartbeat(this.config.licenseKey).catch(function(error) {
4524
+ sendHeartbeat(this.config.licenseKey, this.getAnalyticsContext()).catch(function(error) {
4424
4525
  if (_this.config.debugAdTiming) {
4425
4526
  console.warn("[StormcloudVideoPlayer] Failed to send heartbeat:", error);
4426
4527
  }
@@ -4813,12 +4914,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4813
4914
  10
4814
4915
  ];
4815
4916
  _this.currentAdIndex++;
4816
- if (_this.config.licenseKey) {
4817
- sendAdLoadedTracking(_this.config.licenseKey, {
4818
- source: _this.getAdSource(),
4819
- timestamp: /* @__PURE__ */ new Date().toISOString()
4820
- });
4821
- }
4917
+ _this.trackAdLoaded(bids1);
4822
4918
  return [
4823
4919
  4,
4824
4920
  _this.adLayer.playAd(bids1)
@@ -4923,12 +5019,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4923
5019
  ];
4924
5020
  case 18:
4925
5021
  _this.currentAdIndex++;
4926
- if (_this.config.licenseKey) {
4927
- sendAdLoadedTracking(_this.config.licenseKey, {
4928
- source: _this.getAdSource(),
4929
- timestamp: /* @__PURE__ */ new Date().toISOString()
4930
- });
4931
- }
5022
+ _this.trackAdLoaded(bids2);
4932
5023
  return [
4933
5024
  4,
4934
5025
  _this.adLayer.playAd(bids2)
@@ -5087,12 +5178,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5087
5178
  6
5088
5179
  ];
5089
5180
  this.currentAdIndex++;
5090
- if (this.config.licenseKey) {
5091
- sendAdLoadedTracking(this.config.licenseKey, {
5092
- source: this.getAdSource(),
5093
- timestamp: /* @__PURE__ */ new Date().toISOString()
5094
- });
5095
- }
5181
+ this.trackAdLoaded();
5096
5182
  _state.label = 1;
5097
5183
  case 1:
5098
5184
  _state.trys.push([
@@ -5286,12 +5372,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5286
5372
  5
5287
5373
  ];
5288
5374
  case 3:
5289
- if (this.config.licenseKey) {
5290
- sendAdLoadedTracking(this.config.licenseKey, {
5291
- source: this.getAdSource(),
5292
- timestamp: /* @__PURE__ */ new Date().toISOString()
5293
- });
5294
- }
5375
+ this.trackAdLoaded(bids);
5295
5376
  return [
5296
5377
  4,
5297
5378
  this.adLayer.playAd(bids)
@@ -5437,6 +5518,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5437
5518
  ,
5438
5519
  7
5439
5520
  ]);
5521
+ this.trackAdLoaded(bids);
5440
5522
  return [
5441
5523
  4,
5442
5524
  this.adLayer.playAd(bids)