stormcloud-video-player 0.3.60 → 0.3.61

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.
@@ -2608,40 +2608,66 @@ function getBrowserID(clientInfo) {
2608
2608
  });
2609
2609
  })();
2610
2610
  }
2611
- function sendInitialTracking(licenseKey) {
2611
+ var PLAYER_TRACKING_BASE_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking";
2612
+ var TRACK_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/metrics/ingest");
2613
+ var HEARTBEAT_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/heartbeat");
2614
+ var IMPRESSIONS_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/impressions/ingest");
2615
+ function buildHeaders(licenseKey) {
2616
+ var headers = {
2617
+ "Content-Type": "application/json"
2618
+ };
2619
+ if (licenseKey) {
2620
+ headers["Authorization"] = "Bearer ".concat(licenseKey);
2621
+ }
2622
+ return headers;
2623
+ }
2624
+ function sendTrackRequest(licenseKey, body) {
2612
2625
  return _async_to_generator(function() {
2613
- var clientInfo, browserId, trackingData, headers, response, error;
2626
+ var response;
2614
2627
  return _ts_generator(this, function(_state) {
2615
2628
  switch(_state.label){
2616
2629
  case 0:
2617
- _state.trys.push([
2618
- 0,
2619
- 4,
2620
- ,
2621
- 5
2622
- ]);
2623
- clientInfo = getClientInfo();
2624
2630
  return [
2625
2631
  4,
2626
- getBrowserID(clientInfo)
2632
+ fetch(TRACK_URL, {
2633
+ method: "POST",
2634
+ headers: buildHeaders(licenseKey),
2635
+ body: JSON.stringify(body)
2636
+ })
2627
2637
  ];
2628
2638
  case 1:
2629
- browserId = _state.sent();
2630
- trackingData = _object_spread({
2631
- browserId: browserId
2632
- }, clientInfo);
2633
- headers = {
2634
- "Content-Type": "application/json"
2635
- };
2639
+ response = _state.sent();
2640
+ if (!response.ok) {
2641
+ throw new Error("HTTP error! status: ".concat(response.status));
2642
+ }
2636
2643
  return [
2637
2644
  4,
2638
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track", {
2645
+ response.json()
2646
+ ];
2647
+ case 2:
2648
+ _state.sent();
2649
+ return [
2650
+ 2
2651
+ ];
2652
+ }
2653
+ });
2654
+ })();
2655
+ }
2656
+ function postJson(url, licenseKey, body) {
2657
+ return _async_to_generator(function() {
2658
+ var response;
2659
+ return _ts_generator(this, function(_state) {
2660
+ switch(_state.label){
2661
+ case 0:
2662
+ return [
2663
+ 4,
2664
+ fetch(url, {
2639
2665
  method: "POST",
2640
- headers: headers,
2641
- body: JSON.stringify(trackingData)
2666
+ headers: buildHeaders(licenseKey),
2667
+ body: JSON.stringify(body)
2642
2668
  })
2643
2669
  ];
2644
- case 2:
2670
+ case 1:
2645
2671
  response = _state.sent();
2646
2672
  if (!response.ok) {
2647
2673
  throw new Error("HTTP error! status: ".concat(response.status));
@@ -2650,35 +2676,63 @@ function sendInitialTracking(licenseKey) {
2650
2676
  4,
2651
2677
  response.json()
2652
2678
  ];
2653
- case 3:
2679
+ case 2:
2654
2680
  _state.sent();
2655
2681
  return [
2656
- 3,
2657
- 5
2682
+ 2
2658
2683
  ];
2659
- case 4:
2660
- error = _state.sent();
2661
- console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
2684
+ }
2685
+ });
2686
+ })();
2687
+ }
2688
+ function buildPlayerMetricEvent(_0) {
2689
+ return _async_to_generator(function(licenseKey) {
2690
+ var context, flags, _flags_captureAt, clientInfo, browserId, captureAt;
2691
+ var _arguments = arguments;
2692
+ return _ts_generator(this, function(_state) {
2693
+ switch(_state.label){
2694
+ case 0:
2695
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2696
+ clientInfo = getClientInfo();
2662
2697
  return [
2663
- 3,
2664
- 5
2698
+ 4,
2699
+ getBrowserID(clientInfo)
2665
2700
  ];
2666
- case 5:
2701
+ case 1:
2702
+ browserId = _state.sent();
2703
+ captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
2667
2704
  return [
2668
- 2
2705
+ 2,
2706
+ {
2707
+ player_id: browserId,
2708
+ browserId: browserId,
2709
+ device_type: clientInfo.deviceType,
2710
+ deviceType: clientInfo.deviceType,
2711
+ input_stream_type: context.inputStreamType,
2712
+ os: clientInfo.os,
2713
+ ad_loaded: flags.adLoaded,
2714
+ ad_detect: flags.adDetect,
2715
+ license_key: licenseKey,
2716
+ capture_at: captureAt,
2717
+ timestamp: captureAt
2718
+ }
2669
2719
  ];
2670
2720
  }
2671
2721
  });
2672
- })();
2722
+ }).apply(this, arguments);
2673
2723
  }
2674
- function sendHeartbeat(licenseKey) {
2675
- return _async_to_generator(function() {
2676
- var clientInfo, browserId, heartbeatData, headers, response, error;
2724
+ function sendInitialTracking(_0) {
2725
+ return _async_to_generator(function(licenseKey) {
2726
+ var context, clientInfo, browserId, trackingData, error;
2727
+ var _arguments = arguments;
2677
2728
  return _ts_generator(this, function(_state) {
2678
2729
  switch(_state.label){
2679
2730
  case 0:
2731
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
2732
+ _state.label = 1;
2733
+ case 1:
2680
2734
  _state.trys.push([
2681
- 0,
2735
+ 1,
2682
2736
  4,
2683
2737
  ,
2684
2738
  5
@@ -2688,35 +2742,29 @@ function sendHeartbeat(licenseKey) {
2688
2742
  4,
2689
2743
  getBrowserID(clientInfo)
2690
2744
  ];
2691
- case 1:
2745
+ case 2:
2692
2746
  browserId = _state.sent();
2693
- heartbeatData = {
2694
- browserId: browserId,
2695
- timestamp: /* @__PURE__ */ new Date().toISOString()
2696
- };
2697
- headers = {
2698
- "Content-Type": "application/json"
2699
- };
2700
- if (licenseKey) {
2701
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2702
- }
2747
+ trackingData = _object_spread({
2748
+ browserId: browserId
2749
+ }, clientInfo);
2703
2750
  return [
2704
2751
  4,
2705
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/heartbeat", {
2706
- method: "POST",
2707
- headers: headers,
2708
- body: JSON.stringify(heartbeatData)
2752
+ sendTrackRequest(licenseKey, {
2753
+ events: [
2754
+ {
2755
+ player_id: browserId,
2756
+ device_type: clientInfo.deviceType,
2757
+ input_stream_type: context.inputStreamType,
2758
+ os: clientInfo.os,
2759
+ ad_loaded: false,
2760
+ ad_detect: false,
2761
+ license_key: licenseKey,
2762
+ capture_at: /* @__PURE__ */ new Date().toISOString()
2763
+ }
2764
+ ],
2765
+ trackingData: trackingData
2709
2766
  })
2710
2767
  ];
2711
- case 2:
2712
- response = _state.sent();
2713
- if (!response.ok) {
2714
- throw new Error("HTTP error! status: ".concat(response.status));
2715
- }
2716
- return [
2717
- 4,
2718
- response.json()
2719
- ];
2720
2768
  case 3:
2721
2769
  _state.sent();
2722
2770
  return [
@@ -2725,7 +2773,7 @@ function sendHeartbeat(licenseKey) {
2725
2773
  ];
2726
2774
  case 4:
2727
2775
  error = _state.sent();
2728
- console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
2776
+ console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
2729
2777
  return [
2730
2778
  3,
2731
2779
  5
@@ -2736,95 +2784,74 @@ function sendHeartbeat(licenseKey) {
2736
2784
  ];
2737
2785
  }
2738
2786
  });
2739
- })();
2740
- }
2741
- var TRACK_API_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track";
2742
- function mapToAdTrackingSource(source, adPlayerType) {
2743
- if (source === "prebid" || source === "ima" || source === "hls") {
2744
- return source;
2745
- }
2746
- if (source === "preload" || source === "ssp") {
2747
- return source === "ssp" ? "prebid" : "ima";
2748
- }
2749
- return adPlayerType === "hls" ? "hls" : "ima";
2787
+ }).apply(this, arguments);
2750
2788
  }
2751
- function postAdTracking(licenseKey, body) {
2752
- return _async_to_generator(function() {
2753
- var headers, response;
2789
+ function sendAdDetectTracking(_0, _1) {
2790
+ return _async_to_generator(function(licenseKey, adDetectInfo) {
2791
+ var context, error;
2792
+ var _arguments = arguments;
2754
2793
  return _ts_generator(this, function(_state) {
2755
2794
  switch(_state.label){
2756
2795
  case 0:
2757
- headers = {
2758
- "Content-Type": "application/json"
2759
- };
2760
- if (licenseKey) {
2761
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2762
- }
2763
- return [
2764
- 4,
2765
- fetch(TRACK_API_URL, {
2766
- method: "POST",
2767
- headers: headers,
2768
- body: JSON.stringify(body)
2769
- })
2770
- ];
2796
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2797
+ _state.label = 1;
2771
2798
  case 1:
2772
- response = _state.sent();
2773
- if (!response.ok) {
2774
- throw new Error("HTTP error! status: ".concat(response.status));
2775
- }
2799
+ _state.trys.push([
2800
+ 1,
2801
+ 3,
2802
+ ,
2803
+ 4
2804
+ ]);
2776
2805
  return [
2777
2806
  4,
2778
- response.json()
2807
+ sendHeartbeat(licenseKey, context, {
2808
+ adDetect: true,
2809
+ captureAt: adDetectInfo.timestamp
2810
+ })
2779
2811
  ];
2780
2812
  case 2:
2781
2813
  _state.sent();
2814
+ return [
2815
+ 3,
2816
+ 4
2817
+ ];
2818
+ case 3:
2819
+ error = _state.sent();
2820
+ console.error("[StormcloudVideoPlayer] Error sending ad detect tracking:", error);
2821
+ return [
2822
+ 3,
2823
+ 4
2824
+ ];
2825
+ case 4:
2782
2826
  return [
2783
2827
  2
2784
2828
  ];
2785
2829
  }
2786
2830
  });
2787
- })();
2831
+ }).apply(this, arguments);
2788
2832
  }
2789
- function sendAdDetectTracking(licenseKey, payload) {
2790
- return _async_to_generator(function() {
2791
- var _payload_source, _payload_timestamp, clientInfo, browserId, adDetectInfo, body, error;
2833
+ function sendAdLoadedTracking(_0, _1) {
2834
+ return _async_to_generator(function(licenseKey, adLoadedInfo) {
2835
+ var context, error;
2836
+ var _arguments = arguments;
2792
2837
  return _ts_generator(this, function(_state) {
2793
2838
  switch(_state.label){
2794
2839
  case 0:
2840
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2841
+ _state.label = 1;
2842
+ case 1:
2795
2843
  _state.trys.push([
2796
- 0,
2844
+ 1,
2797
2845
  3,
2798
2846
  ,
2799
2847
  4
2800
2848
  ]);
2801
- clientInfo = getClientInfo();
2802
- return [
2803
- 4,
2804
- getBrowserID(clientInfo)
2805
- ];
2806
- case 1:
2807
- browserId = _state.sent();
2808
- adDetectInfo = _object_spread({
2809
- source: (_payload_source = payload.source) !== null && _payload_source !== void 0 ? _payload_source : "scte35",
2810
- timestamp: (_payload_timestamp = payload.timestamp) !== null && _payload_timestamp !== void 0 ? _payload_timestamp : /* @__PURE__ */ new Date().toISOString()
2811
- }, payload.durationSeconds != null && {
2812
- durationSeconds: payload.durationSeconds
2813
- }, payload.ptsSeconds != null && {
2814
- ptsSeconds: payload.ptsSeconds
2815
- }, payload.detectedAtFragmentSn != null && {
2816
- detectedAtFragmentSn: payload.detectedAtFragmentSn
2817
- });
2818
- body = _object_spread_props(_object_spread({
2819
- browserId: browserId
2820
- }, clientInfo, licenseKey && {
2821
- licenseKey: licenseKey
2822
- }), {
2823
- adDetectInfo: adDetectInfo
2824
- });
2825
2849
  return [
2826
2850
  4,
2827
- postAdTracking(licenseKey, body)
2851
+ sendHeartbeat(licenseKey, context, {
2852
+ adLoaded: true,
2853
+ captureAt: adLoadedInfo.timestamp
2854
+ })
2828
2855
  ];
2829
2856
  case 2:
2830
2857
  _state.sent();
@@ -2834,7 +2861,7 @@ function sendAdDetectTracking(licenseKey, payload) {
2834
2861
  ];
2835
2862
  case 3:
2836
2863
  error = _state.sent();
2837
- console.error("[StormcloudVideoPlayer] Error sending ad-detect tracking:", error);
2864
+ console.error("[StormcloudVideoPlayer] Error sending ad loaded tracking:", error);
2838
2865
  return [
2839
2866
  3,
2840
2867
  4
@@ -2845,126 +2872,116 @@ function sendAdDetectTracking(licenseKey, payload) {
2845
2872
  ];
2846
2873
  }
2847
2874
  });
2848
- })();
2875
+ }).apply(this, arguments);
2849
2876
  }
2850
- function sendAdLoadedTracking(licenseKey, payload, adPlayerType) {
2851
- return _async_to_generator(function() {
2852
- var clientInfo, browserId, source, adLoadedInfo, body, error;
2877
+ function sendAdImpressionTracking(_0, _1) {
2878
+ return _async_to_generator(function(licenseKey, adImpressionInfo) {
2879
+ var context, metricEvent, error;
2880
+ var _arguments = arguments;
2853
2881
  return _ts_generator(this, function(_state) {
2854
2882
  switch(_state.label){
2855
2883
  case 0:
2884
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2885
+ _state.label = 1;
2886
+ case 1:
2856
2887
  _state.trys.push([
2857
- 0,
2858
- 3,
2888
+ 1,
2889
+ 4,
2859
2890
  ,
2860
- 4
2891
+ 5
2861
2892
  ]);
2862
- clientInfo = getClientInfo();
2863
2893
  return [
2864
2894
  4,
2865
- getBrowserID(clientInfo)
2895
+ buildPlayerMetricEvent(licenseKey, context, {
2896
+ captureAt: adImpressionInfo.timestamp
2897
+ })
2866
2898
  ];
2867
- case 1:
2868
- browserId = _state.sent();
2869
- source = mapToAdTrackingSource(payload.source, adPlayerType);
2870
- adLoadedInfo = _object_spread({
2871
- source: source,
2872
- timestamp: /* @__PURE__ */ new Date().toISOString()
2873
- }, payload.vastUrl != null && {
2874
- vastUrl: payload.vastUrl
2875
- }, payload.durationSeconds != null && {
2876
- durationSeconds: payload.durationSeconds
2877
- });
2878
- body = _object_spread_props(_object_spread({
2879
- browserId: browserId
2880
- }, clientInfo, licenseKey && {
2881
- licenseKey: licenseKey
2882
- }), {
2883
- adLoadedInfo: adLoadedInfo
2884
- });
2899
+ case 2:
2900
+ metricEvent = _state.sent();
2885
2901
  return [
2886
2902
  4,
2887
- postAdTracking(licenseKey, body)
2903
+ Promise.all([
2904
+ postJson(HEARTBEAT_URL, licenseKey, metricEvent),
2905
+ postJson(IMPRESSIONS_URL, licenseKey, {
2906
+ events: [
2907
+ {
2908
+ player_id: metricEvent.player_id,
2909
+ ad_played_count: 1,
2910
+ ad_url: adImpressionInfo.adUrl,
2911
+ license_key: licenseKey,
2912
+ capture_at: adImpressionInfo.timestamp
2913
+ }
2914
+ ]
2915
+ })
2916
+ ])
2888
2917
  ];
2889
- case 2:
2918
+ case 3:
2890
2919
  _state.sent();
2891
2920
  return [
2892
2921
  3,
2893
- 4
2922
+ 5
2894
2923
  ];
2895
- case 3:
2924
+ case 4:
2896
2925
  error = _state.sent();
2897
- console.error("[StormcloudVideoPlayer] Error sending ad-loaded tracking:", error);
2926
+ console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
2898
2927
  return [
2899
2928
  3,
2900
- 4
2929
+ 5
2901
2930
  ];
2902
- case 4:
2931
+ case 5:
2903
2932
  return [
2904
2933
  2
2905
2934
  ];
2906
2935
  }
2907
2936
  });
2908
- })();
2937
+ }).apply(this, arguments);
2909
2938
  }
2910
- function sendAdImpressionTracking(licenseKey, payload, adPlayerType) {
2911
- return _async_to_generator(function() {
2912
- var clientInfo, browserId, source, adImpressionInfo, body, error;
2939
+ function sendHeartbeat(_0) {
2940
+ return _async_to_generator(function(licenseKey) {
2941
+ var context, flags, heartbeatData, error;
2942
+ var _arguments = arguments;
2913
2943
  return _ts_generator(this, function(_state) {
2914
2944
  switch(_state.label){
2915
2945
  case 0:
2946
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2947
+ _state.label = 1;
2948
+ case 1:
2916
2949
  _state.trys.push([
2917
- 0,
2918
- 3,
2950
+ 1,
2951
+ 4,
2919
2952
  ,
2920
- 4
2953
+ 5
2921
2954
  ]);
2922
- clientInfo = getClientInfo();
2923
2955
  return [
2924
2956
  4,
2925
- getBrowserID(clientInfo)
2957
+ buildPlayerMetricEvent(licenseKey, context, flags)
2926
2958
  ];
2927
- case 1:
2928
- browserId = _state.sent();
2929
- source = mapToAdTrackingSource(payload.source, adPlayerType);
2930
- adImpressionInfo = _object_spread({
2931
- source: source,
2932
- adIndex: payload.adIndex,
2933
- timestamp: /* @__PURE__ */ new Date().toISOString()
2934
- }, payload.durationSeconds != null && {
2935
- durationSeconds: payload.durationSeconds
2936
- });
2937
- body = _object_spread_props(_object_spread({
2938
- browserId: browserId
2939
- }, clientInfo, licenseKey && {
2940
- licenseKey: licenseKey
2941
- }), {
2942
- adImpressionInfo: adImpressionInfo
2943
- });
2959
+ case 2:
2960
+ heartbeatData = _state.sent();
2944
2961
  return [
2945
2962
  4,
2946
- postAdTracking(licenseKey, body)
2963
+ postJson(HEARTBEAT_URL, licenseKey, heartbeatData)
2947
2964
  ];
2948
- case 2:
2965
+ case 3:
2949
2966
  _state.sent();
2950
2967
  return [
2951
2968
  3,
2952
- 4
2969
+ 5
2953
2970
  ];
2954
- case 3:
2971
+ case 4:
2955
2972
  error = _state.sent();
2956
- console.error("[StormcloudVideoPlayer] Error sending ad-impression tracking:", error);
2973
+ console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
2957
2974
  return [
2958
2975
  3,
2959
- 4
2976
+ 5
2960
2977
  ];
2961
- case 4:
2978
+ case 5:
2962
2979
  return [
2963
2980
  2
2964
2981
  ];
2965
2982
  }
2966
2983
  });
2967
- })();
2984
+ }).apply(this, arguments);
2968
2985
  }
2969
2986
  // src/utils/polyfills.ts
2970
2987
  function polyfillURLSearchParams() {
@@ -3757,8 +3774,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3757
3774
  var _this = this;
3758
3775
  this.ima.on("all_ads_completed", function() {
3759
3776
  sendAdImpressionTracking(_this.config.licenseKey, {
3760
- adIndex: _this.currentAdIndex
3761
- }, _this.config.adPlayerType).catch(function() {});
3777
+ source: "ima",
3778
+ adIndex: _this.currentAdIndex,
3779
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3780
+ }).catch(function() {});
3762
3781
  var remaining = _this.getRemainingAdMs();
3763
3782
  _this.consecutiveFailures = 0;
3764
3783
  if (_this.config.debugAdTiming) {
@@ -3819,8 +3838,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3819
3838
  });
3820
3839
  this.ima.on("content_resume", function() {
3821
3840
  sendAdImpressionTracking(_this.config.licenseKey, {
3822
- adIndex: _this.currentAdIndex
3823
- }, _this.config.adPlayerType).catch(function() {});
3841
+ source: "ima",
3842
+ adIndex: _this.currentAdIndex,
3843
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3844
+ }).catch(function() {});
3824
3845
  if (!_this.video.muted) {
3825
3846
  _this.video.muted = true;
3826
3847
  _this.video.volume = 0;
@@ -4454,7 +4475,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4454
4475
  var detectPayload = {};
4455
4476
  if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4456
4477
  if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4457
- sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4478
+ sendAdDetectTracking(this.config.licenseKey, _object_spread({
4479
+ source: "scte35",
4480
+ timestamp: /* @__PURE__ */ new Date().toISOString()
4481
+ }, detectPayload)).catch(function() {});
4458
4482
  }
4459
4483
  var hasPrefetchedAds = this.pendingAdBreak && this.pendingAdBreak.vastUrls.length > 0;
4460
4484
  var durationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : ((_this_pendingAdBreak = this.pendingAdBreak) === null || _this_pendingAdBreak === void 0 ? void 0 : _this_pendingAdBreak.marker.durationSeconds) != null ? this.pendingAdBreak.marker.durationSeconds * 1e3 : void 0;
@@ -5696,7 +5720,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5696
5720
  if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
5697
5721
  if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
5698
5722
  if (fragmentSn !== void 0) detectPayload.detectedAtFragmentSn = fragmentSn;
5699
- sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
5723
+ sendAdDetectTracking(this.config.licenseKey, _object_spread({
5724
+ source: "scte35",
5725
+ timestamp: /* @__PURE__ */ new Date().toISOString()
5726
+ }, detectPayload)).catch(function() {});
5700
5727
  if (this.config.debugAdTiming) {
5701
5728
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
5702
5729
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
@@ -6177,9 +6204,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6177
6204
  preloadedController = preloaded.imaController;
6178
6205
  usePreloadedAd = true;
6179
6206
  sendAdLoadedTracking(this.config.licenseKey, {
6180
- source: "preload",
6181
- vastUrl: firstAdUrl
6182
- }, this.config.adPlayerType).catch(function() {});
6207
+ source: "ima",
6208
+ vastUrl: firstAdUrl,
6209
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6210
+ }).catch(function() {});
6183
6211
  if (this.config.debugAdTiming) {
6184
6212
  console.log("[CONTINUOUS-FETCH] \uD83D\uDE80 Using preloaded ad from pool (preloaded in advance, ready immediately!)");
6185
6213
  console.log("[CONTINUOUS-FETCH] Pool still has ".concat(this.preloadPool.length, " preloaded ads ready"));
@@ -6269,9 +6297,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6269
6297
  case 5:
6270
6298
  _state.sent();
6271
6299
  sendAdLoadedTracking(this.config.licenseKey, {
6272
- source: "ssp",
6273
- vastUrl: firstAdUrl
6274
- }, this.config.adPlayerType).catch(function() {});
6300
+ source: "ima",
6301
+ vastUrl: firstAdUrl,
6302
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6303
+ }).catch(function() {});
6275
6304
  if (this.config.debugAdTiming) {
6276
6305
  console.log("[CONTINUOUS-FETCH] \u2705 First ad request successful, starting playback");
6277
6306
  }
@@ -6667,9 +6696,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6667
6696
  console.log("[CONTINUOUS-FETCH] \uD83C\uDFAF Using preloaded ad from pool (".concat(this.preloadPool.length, " remaining in pool)"));
6668
6697
  }
6669
6698
  sendAdLoadedTracking(this.config.licenseKey, {
6670
- source: "preload",
6671
- vastUrl: preloaded.vastUrl
6672
- }, this.config.adPlayerType).catch(function() {});
6699
+ source: "ima",
6700
+ vastUrl: preloaded.vastUrl,
6701
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6702
+ }).catch(function() {});
6673
6703
  _state.label = 1;
6674
6704
  case 1:
6675
6705
  _state.trys.push([
@@ -7421,9 +7451,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7421
7451
  case 3:
7422
7452
  _state.sent();
7423
7453
  sendAdLoadedTracking(this.config.licenseKey, {
7424
- source: "ssp",
7425
- vastUrl: vastTagUrl
7426
- }, this.config.adPlayerType).catch(function() {});
7454
+ source: "ima",
7455
+ vastUrl: vastTagUrl,
7456
+ timestamp: /* @__PURE__ */ new Date().toISOString()
7457
+ }).catch(function() {});
7427
7458
  this.clearAdRequestWatchdog();
7428
7459
  if (this.activeAdRequestToken !== requestToken) {
7429
7460
  return [