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.
package/lib/index.js CHANGED
@@ -2659,40 +2659,66 @@ function getBrowserID(clientInfo) {
2659
2659
  });
2660
2660
  })();
2661
2661
  }
2662
- function sendInitialTracking(licenseKey) {
2662
+ var PLAYER_TRACKING_BASE_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking";
2663
+ var TRACK_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/metrics/ingest");
2664
+ var HEARTBEAT_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/heartbeat");
2665
+ var IMPRESSIONS_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/impressions/ingest");
2666
+ function buildHeaders(licenseKey) {
2667
+ var headers = {
2668
+ "Content-Type": "application/json"
2669
+ };
2670
+ if (licenseKey) {
2671
+ headers["Authorization"] = "Bearer ".concat(licenseKey);
2672
+ }
2673
+ return headers;
2674
+ }
2675
+ function sendTrackRequest(licenseKey, body) {
2663
2676
  return _async_to_generator(function() {
2664
- var clientInfo, browserId, trackingData, headers, response, error;
2677
+ var response;
2665
2678
  return _ts_generator(this, function(_state) {
2666
2679
  switch(_state.label){
2667
2680
  case 0:
2668
- _state.trys.push([
2669
- 0,
2670
- 4,
2671
- ,
2672
- 5
2673
- ]);
2674
- clientInfo = getClientInfo();
2675
2681
  return [
2676
2682
  4,
2677
- getBrowserID(clientInfo)
2683
+ fetch(TRACK_URL, {
2684
+ method: "POST",
2685
+ headers: buildHeaders(licenseKey),
2686
+ body: JSON.stringify(body)
2687
+ })
2678
2688
  ];
2679
2689
  case 1:
2680
- browserId = _state.sent();
2681
- trackingData = _object_spread({
2682
- browserId: browserId
2683
- }, clientInfo);
2684
- headers = {
2685
- "Content-Type": "application/json"
2686
- };
2690
+ response = _state.sent();
2691
+ if (!response.ok) {
2692
+ throw new Error("HTTP error! status: ".concat(response.status));
2693
+ }
2694
+ return [
2695
+ 4,
2696
+ response.json()
2697
+ ];
2698
+ case 2:
2699
+ _state.sent();
2700
+ return [
2701
+ 2
2702
+ ];
2703
+ }
2704
+ });
2705
+ })();
2706
+ }
2707
+ function postJson(url, licenseKey, body) {
2708
+ return _async_to_generator(function() {
2709
+ var response;
2710
+ return _ts_generator(this, function(_state) {
2711
+ switch(_state.label){
2712
+ case 0:
2687
2713
  return [
2688
2714
  4,
2689
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track", {
2715
+ fetch(url, {
2690
2716
  method: "POST",
2691
- headers: headers,
2692
- body: JSON.stringify(trackingData)
2717
+ headers: buildHeaders(licenseKey),
2718
+ body: JSON.stringify(body)
2693
2719
  })
2694
2720
  ];
2695
- case 2:
2721
+ case 1:
2696
2722
  response = _state.sent();
2697
2723
  if (!response.ok) {
2698
2724
  throw new Error("HTTP error! status: ".concat(response.status));
@@ -2701,35 +2727,63 @@ function sendInitialTracking(licenseKey) {
2701
2727
  4,
2702
2728
  response.json()
2703
2729
  ];
2704
- case 3:
2730
+ case 2:
2705
2731
  _state.sent();
2706
2732
  return [
2707
- 3,
2708
- 5
2733
+ 2
2709
2734
  ];
2710
- case 4:
2711
- error = _state.sent();
2712
- console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
2735
+ }
2736
+ });
2737
+ })();
2738
+ }
2739
+ function buildPlayerMetricEvent(_0) {
2740
+ return _async_to_generator(function(licenseKey) {
2741
+ var context, flags, _flags_captureAt, clientInfo, browserId, captureAt;
2742
+ var _arguments = arguments;
2743
+ return _ts_generator(this, function(_state) {
2744
+ switch(_state.label){
2745
+ case 0:
2746
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2747
+ clientInfo = getClientInfo();
2713
2748
  return [
2714
- 3,
2715
- 5
2749
+ 4,
2750
+ getBrowserID(clientInfo)
2716
2751
  ];
2717
- case 5:
2752
+ case 1:
2753
+ browserId = _state.sent();
2754
+ captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
2718
2755
  return [
2719
- 2
2756
+ 2,
2757
+ {
2758
+ player_id: browserId,
2759
+ browserId: browserId,
2760
+ device_type: clientInfo.deviceType,
2761
+ deviceType: clientInfo.deviceType,
2762
+ input_stream_type: context.inputStreamType,
2763
+ os: clientInfo.os,
2764
+ ad_loaded: flags.adLoaded,
2765
+ ad_detect: flags.adDetect,
2766
+ license_key: licenseKey,
2767
+ capture_at: captureAt,
2768
+ timestamp: captureAt
2769
+ }
2720
2770
  ];
2721
2771
  }
2722
2772
  });
2723
- })();
2773
+ }).apply(this, arguments);
2724
2774
  }
2725
- function sendHeartbeat(licenseKey) {
2726
- return _async_to_generator(function() {
2727
- var clientInfo, browserId, heartbeatData, headers, response, error;
2775
+ function sendInitialTracking(_0) {
2776
+ return _async_to_generator(function(licenseKey) {
2777
+ var context, clientInfo, browserId, trackingData, error;
2778
+ var _arguments = arguments;
2728
2779
  return _ts_generator(this, function(_state) {
2729
2780
  switch(_state.label){
2730
2781
  case 0:
2782
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
2783
+ _state.label = 1;
2784
+ case 1:
2731
2785
  _state.trys.push([
2732
- 0,
2786
+ 1,
2733
2787
  4,
2734
2788
  ,
2735
2789
  5
@@ -2739,35 +2793,29 @@ function sendHeartbeat(licenseKey) {
2739
2793
  4,
2740
2794
  getBrowserID(clientInfo)
2741
2795
  ];
2742
- case 1:
2796
+ case 2:
2743
2797
  browserId = _state.sent();
2744
- heartbeatData = {
2745
- browserId: browserId,
2746
- timestamp: /* @__PURE__ */ new Date().toISOString()
2747
- };
2748
- headers = {
2749
- "Content-Type": "application/json"
2750
- };
2751
- if (licenseKey) {
2752
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2753
- }
2798
+ trackingData = _object_spread({
2799
+ browserId: browserId
2800
+ }, clientInfo);
2754
2801
  return [
2755
2802
  4,
2756
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/heartbeat", {
2757
- method: "POST",
2758
- headers: headers,
2759
- body: JSON.stringify(heartbeatData)
2803
+ sendTrackRequest(licenseKey, {
2804
+ events: [
2805
+ {
2806
+ player_id: browserId,
2807
+ device_type: clientInfo.deviceType,
2808
+ input_stream_type: context.inputStreamType,
2809
+ os: clientInfo.os,
2810
+ ad_loaded: false,
2811
+ ad_detect: false,
2812
+ license_key: licenseKey,
2813
+ capture_at: /* @__PURE__ */ new Date().toISOString()
2814
+ }
2815
+ ],
2816
+ trackingData: trackingData
2760
2817
  })
2761
2818
  ];
2762
- case 2:
2763
- response = _state.sent();
2764
- if (!response.ok) {
2765
- throw new Error("HTTP error! status: ".concat(response.status));
2766
- }
2767
- return [
2768
- 4,
2769
- response.json()
2770
- ];
2771
2819
  case 3:
2772
2820
  _state.sent();
2773
2821
  return [
@@ -2776,7 +2824,7 @@ function sendHeartbeat(licenseKey) {
2776
2824
  ];
2777
2825
  case 4:
2778
2826
  error = _state.sent();
2779
- console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
2827
+ console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
2780
2828
  return [
2781
2829
  3,
2782
2830
  5
@@ -2787,95 +2835,74 @@ function sendHeartbeat(licenseKey) {
2787
2835
  ];
2788
2836
  }
2789
2837
  });
2790
- })();
2838
+ }).apply(this, arguments);
2791
2839
  }
2792
- var TRACK_API_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track";
2793
- function mapToAdTrackingSource(source, adPlayerType) {
2794
- if (source === "prebid" || source === "ima" || source === "hls") {
2795
- return source;
2796
- }
2797
- if (source === "preload" || source === "ssp") {
2798
- return source === "ssp" ? "prebid" : "ima";
2799
- }
2800
- return adPlayerType === "hls" ? "hls" : "ima";
2801
- }
2802
- function postAdTracking(licenseKey, body) {
2803
- return _async_to_generator(function() {
2804
- var headers, response;
2840
+ function sendAdDetectTracking(_0, _1) {
2841
+ return _async_to_generator(function(licenseKey, adDetectInfo) {
2842
+ var context, error;
2843
+ var _arguments = arguments;
2805
2844
  return _ts_generator(this, function(_state) {
2806
2845
  switch(_state.label){
2807
2846
  case 0:
2808
- headers = {
2809
- "Content-Type": "application/json"
2810
- };
2811
- if (licenseKey) {
2812
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2813
- }
2814
- return [
2815
- 4,
2816
- fetch(TRACK_API_URL, {
2817
- method: "POST",
2818
- headers: headers,
2819
- body: JSON.stringify(body)
2820
- })
2821
- ];
2847
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2848
+ _state.label = 1;
2822
2849
  case 1:
2823
- response = _state.sent();
2824
- if (!response.ok) {
2825
- throw new Error("HTTP error! status: ".concat(response.status));
2826
- }
2850
+ _state.trys.push([
2851
+ 1,
2852
+ 3,
2853
+ ,
2854
+ 4
2855
+ ]);
2827
2856
  return [
2828
2857
  4,
2829
- response.json()
2858
+ sendHeartbeat(licenseKey, context, {
2859
+ adDetect: true,
2860
+ captureAt: adDetectInfo.timestamp
2861
+ })
2830
2862
  ];
2831
2863
  case 2:
2832
2864
  _state.sent();
2865
+ return [
2866
+ 3,
2867
+ 4
2868
+ ];
2869
+ case 3:
2870
+ error = _state.sent();
2871
+ console.error("[StormcloudVideoPlayer] Error sending ad detect tracking:", error);
2872
+ return [
2873
+ 3,
2874
+ 4
2875
+ ];
2876
+ case 4:
2833
2877
  return [
2834
2878
  2
2835
2879
  ];
2836
2880
  }
2837
2881
  });
2838
- })();
2882
+ }).apply(this, arguments);
2839
2883
  }
2840
- function sendAdDetectTracking(licenseKey, payload) {
2841
- return _async_to_generator(function() {
2842
- var _payload_source, _payload_timestamp, clientInfo, browserId, adDetectInfo, body, error;
2884
+ function sendAdLoadedTracking(_0, _1) {
2885
+ return _async_to_generator(function(licenseKey, adLoadedInfo) {
2886
+ var context, error;
2887
+ var _arguments = arguments;
2843
2888
  return _ts_generator(this, function(_state) {
2844
2889
  switch(_state.label){
2845
2890
  case 0:
2891
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2892
+ _state.label = 1;
2893
+ case 1:
2846
2894
  _state.trys.push([
2847
- 0,
2895
+ 1,
2848
2896
  3,
2849
2897
  ,
2850
2898
  4
2851
2899
  ]);
2852
- clientInfo = getClientInfo();
2853
- return [
2854
- 4,
2855
- getBrowserID(clientInfo)
2856
- ];
2857
- case 1:
2858
- browserId = _state.sent();
2859
- adDetectInfo = _object_spread({
2860
- source: (_payload_source = payload.source) !== null && _payload_source !== void 0 ? _payload_source : "scte35",
2861
- timestamp: (_payload_timestamp = payload.timestamp) !== null && _payload_timestamp !== void 0 ? _payload_timestamp : /* @__PURE__ */ new Date().toISOString()
2862
- }, payload.durationSeconds != null && {
2863
- durationSeconds: payload.durationSeconds
2864
- }, payload.ptsSeconds != null && {
2865
- ptsSeconds: payload.ptsSeconds
2866
- }, payload.detectedAtFragmentSn != null && {
2867
- detectedAtFragmentSn: payload.detectedAtFragmentSn
2868
- });
2869
- body = _object_spread_props(_object_spread({
2870
- browserId: browserId
2871
- }, clientInfo, licenseKey && {
2872
- licenseKey: licenseKey
2873
- }), {
2874
- adDetectInfo: adDetectInfo
2875
- });
2876
2900
  return [
2877
2901
  4,
2878
- postAdTracking(licenseKey, body)
2902
+ sendHeartbeat(licenseKey, context, {
2903
+ adLoaded: true,
2904
+ captureAt: adLoadedInfo.timestamp
2905
+ })
2879
2906
  ];
2880
2907
  case 2:
2881
2908
  _state.sent();
@@ -2885,7 +2912,7 @@ function sendAdDetectTracking(licenseKey, payload) {
2885
2912
  ];
2886
2913
  case 3:
2887
2914
  error = _state.sent();
2888
- console.error("[StormcloudVideoPlayer] Error sending ad-detect tracking:", error);
2915
+ console.error("[StormcloudVideoPlayer] Error sending ad loaded tracking:", error);
2889
2916
  return [
2890
2917
  3,
2891
2918
  4
@@ -2896,126 +2923,116 @@ function sendAdDetectTracking(licenseKey, payload) {
2896
2923
  ];
2897
2924
  }
2898
2925
  });
2899
- })();
2926
+ }).apply(this, arguments);
2900
2927
  }
2901
- function sendAdLoadedTracking(licenseKey, payload, adPlayerType) {
2902
- return _async_to_generator(function() {
2903
- var clientInfo, browserId, source, adLoadedInfo, body, error;
2928
+ function sendAdImpressionTracking(_0, _1) {
2929
+ return _async_to_generator(function(licenseKey, adImpressionInfo) {
2930
+ var context, metricEvent, error;
2931
+ var _arguments = arguments;
2904
2932
  return _ts_generator(this, function(_state) {
2905
2933
  switch(_state.label){
2906
2934
  case 0:
2935
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2936
+ _state.label = 1;
2937
+ case 1:
2907
2938
  _state.trys.push([
2908
- 0,
2909
- 3,
2939
+ 1,
2940
+ 4,
2910
2941
  ,
2911
- 4
2942
+ 5
2912
2943
  ]);
2913
- clientInfo = getClientInfo();
2914
2944
  return [
2915
2945
  4,
2916
- getBrowserID(clientInfo)
2946
+ buildPlayerMetricEvent(licenseKey, context, {
2947
+ captureAt: adImpressionInfo.timestamp
2948
+ })
2917
2949
  ];
2918
- case 1:
2919
- browserId = _state.sent();
2920
- source = mapToAdTrackingSource(payload.source, adPlayerType);
2921
- adLoadedInfo = _object_spread({
2922
- source: source,
2923
- timestamp: /* @__PURE__ */ new Date().toISOString()
2924
- }, payload.vastUrl != null && {
2925
- vastUrl: payload.vastUrl
2926
- }, payload.durationSeconds != null && {
2927
- durationSeconds: payload.durationSeconds
2928
- });
2929
- body = _object_spread_props(_object_spread({
2930
- browserId: browserId
2931
- }, clientInfo, licenseKey && {
2932
- licenseKey: licenseKey
2933
- }), {
2934
- adLoadedInfo: adLoadedInfo
2935
- });
2950
+ case 2:
2951
+ metricEvent = _state.sent();
2936
2952
  return [
2937
2953
  4,
2938
- postAdTracking(licenseKey, body)
2954
+ Promise.all([
2955
+ postJson(HEARTBEAT_URL, licenseKey, metricEvent),
2956
+ postJson(IMPRESSIONS_URL, licenseKey, {
2957
+ events: [
2958
+ {
2959
+ player_id: metricEvent.player_id,
2960
+ ad_played_count: 1,
2961
+ ad_url: adImpressionInfo.adUrl,
2962
+ license_key: licenseKey,
2963
+ capture_at: adImpressionInfo.timestamp
2964
+ }
2965
+ ]
2966
+ })
2967
+ ])
2939
2968
  ];
2940
- case 2:
2969
+ case 3:
2941
2970
  _state.sent();
2942
2971
  return [
2943
2972
  3,
2944
- 4
2973
+ 5
2945
2974
  ];
2946
- case 3:
2975
+ case 4:
2947
2976
  error = _state.sent();
2948
- console.error("[StormcloudVideoPlayer] Error sending ad-loaded tracking:", error);
2977
+ console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
2949
2978
  return [
2950
2979
  3,
2951
- 4
2980
+ 5
2952
2981
  ];
2953
- case 4:
2982
+ case 5:
2954
2983
  return [
2955
2984
  2
2956
2985
  ];
2957
2986
  }
2958
2987
  });
2959
- })();
2988
+ }).apply(this, arguments);
2960
2989
  }
2961
- function sendAdImpressionTracking(licenseKey, payload, adPlayerType) {
2962
- return _async_to_generator(function() {
2963
- var clientInfo, browserId, source, adImpressionInfo, body, error;
2990
+ function sendHeartbeat(_0) {
2991
+ return _async_to_generator(function(licenseKey) {
2992
+ var context, flags, heartbeatData, error;
2993
+ var _arguments = arguments;
2964
2994
  return _ts_generator(this, function(_state) {
2965
2995
  switch(_state.label){
2966
2996
  case 0:
2997
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2998
+ _state.label = 1;
2999
+ case 1:
2967
3000
  _state.trys.push([
2968
- 0,
2969
- 3,
3001
+ 1,
3002
+ 4,
2970
3003
  ,
2971
- 4
3004
+ 5
2972
3005
  ]);
2973
- clientInfo = getClientInfo();
2974
3006
  return [
2975
3007
  4,
2976
- getBrowserID(clientInfo)
3008
+ buildPlayerMetricEvent(licenseKey, context, flags)
2977
3009
  ];
2978
- case 1:
2979
- browserId = _state.sent();
2980
- source = mapToAdTrackingSource(payload.source, adPlayerType);
2981
- adImpressionInfo = _object_spread({
2982
- source: source,
2983
- adIndex: payload.adIndex,
2984
- timestamp: /* @__PURE__ */ new Date().toISOString()
2985
- }, payload.durationSeconds != null && {
2986
- durationSeconds: payload.durationSeconds
2987
- });
2988
- body = _object_spread_props(_object_spread({
2989
- browserId: browserId
2990
- }, clientInfo, licenseKey && {
2991
- licenseKey: licenseKey
2992
- }), {
2993
- adImpressionInfo: adImpressionInfo
2994
- });
3010
+ case 2:
3011
+ heartbeatData = _state.sent();
2995
3012
  return [
2996
3013
  4,
2997
- postAdTracking(licenseKey, body)
3014
+ postJson(HEARTBEAT_URL, licenseKey, heartbeatData)
2998
3015
  ];
2999
- case 2:
3016
+ case 3:
3000
3017
  _state.sent();
3001
3018
  return [
3002
3019
  3,
3003
- 4
3020
+ 5
3004
3021
  ];
3005
- case 3:
3022
+ case 4:
3006
3023
  error = _state.sent();
3007
- console.error("[StormcloudVideoPlayer] Error sending ad-impression tracking:", error);
3024
+ console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
3008
3025
  return [
3009
3026
  3,
3010
- 4
3027
+ 5
3011
3028
  ];
3012
- case 4:
3029
+ case 5:
3013
3030
  return [
3014
3031
  2
3015
3032
  ];
3016
3033
  }
3017
3034
  });
3018
- })();
3035
+ }).apply(this, arguments);
3019
3036
  }
3020
3037
  // src/utils/polyfills.ts
3021
3038
  function polyfillURLSearchParams() {
@@ -3811,8 +3828,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3811
3828
  var _this = this;
3812
3829
  this.ima.on("all_ads_completed", function() {
3813
3830
  sendAdImpressionTracking(_this.config.licenseKey, {
3814
- adIndex: _this.currentAdIndex
3815
- }, _this.config.adPlayerType).catch(function() {});
3831
+ source: "ima",
3832
+ adIndex: _this.currentAdIndex,
3833
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3834
+ }).catch(function() {});
3816
3835
  var remaining = _this.getRemainingAdMs();
3817
3836
  _this.consecutiveFailures = 0;
3818
3837
  if (_this.config.debugAdTiming) {
@@ -3873,8 +3892,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3873
3892
  });
3874
3893
  this.ima.on("content_resume", function() {
3875
3894
  sendAdImpressionTracking(_this.config.licenseKey, {
3876
- adIndex: _this.currentAdIndex
3877
- }, _this.config.adPlayerType).catch(function() {});
3895
+ source: "ima",
3896
+ adIndex: _this.currentAdIndex,
3897
+ timestamp: /* @__PURE__ */ new Date().toISOString()
3898
+ }).catch(function() {});
3878
3899
  if (!_this.video.muted) {
3879
3900
  _this.video.muted = true;
3880
3901
  _this.video.volume = 0;
@@ -4508,7 +4529,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4508
4529
  var detectPayload = {};
4509
4530
  if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4510
4531
  if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4511
- sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4532
+ sendAdDetectTracking(this.config.licenseKey, _object_spread({
4533
+ source: "scte35",
4534
+ timestamp: /* @__PURE__ */ new Date().toISOString()
4535
+ }, detectPayload)).catch(function() {});
4512
4536
  }
4513
4537
  var hasPrefetchedAds = this.pendingAdBreak && this.pendingAdBreak.vastUrls.length > 0;
4514
4538
  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;
@@ -5750,7 +5774,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5750
5774
  if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
5751
5775
  if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
5752
5776
  if (fragmentSn !== void 0) detectPayload.detectedAtFragmentSn = fragmentSn;
5753
- sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
5777
+ sendAdDetectTracking(this.config.licenseKey, _object_spread({
5778
+ source: "scte35",
5779
+ timestamp: /* @__PURE__ */ new Date().toISOString()
5780
+ }, detectPayload)).catch(function() {});
5754
5781
  if (this.config.debugAdTiming) {
5755
5782
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
5756
5783
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
@@ -6231,9 +6258,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6231
6258
  preloadedController = preloaded.imaController;
6232
6259
  usePreloadedAd = true;
6233
6260
  sendAdLoadedTracking(this.config.licenseKey, {
6234
- source: "preload",
6235
- vastUrl: firstAdUrl
6236
- }, this.config.adPlayerType).catch(function() {});
6261
+ source: "ima",
6262
+ vastUrl: firstAdUrl,
6263
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6264
+ }).catch(function() {});
6237
6265
  if (this.config.debugAdTiming) {
6238
6266
  console.log("[CONTINUOUS-FETCH] \uD83D\uDE80 Using preloaded ad from pool (preloaded in advance, ready immediately!)");
6239
6267
  console.log("[CONTINUOUS-FETCH] Pool still has ".concat(this.preloadPool.length, " preloaded ads ready"));
@@ -6323,9 +6351,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6323
6351
  case 5:
6324
6352
  _state.sent();
6325
6353
  sendAdLoadedTracking(this.config.licenseKey, {
6326
- source: "ssp",
6327
- vastUrl: firstAdUrl
6328
- }, this.config.adPlayerType).catch(function() {});
6354
+ source: "ima",
6355
+ vastUrl: firstAdUrl,
6356
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6357
+ }).catch(function() {});
6329
6358
  if (this.config.debugAdTiming) {
6330
6359
  console.log("[CONTINUOUS-FETCH] \u2705 First ad request successful, starting playback");
6331
6360
  }
@@ -6721,9 +6750,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6721
6750
  console.log("[CONTINUOUS-FETCH] \uD83C\uDFAF Using preloaded ad from pool (".concat(this.preloadPool.length, " remaining in pool)"));
6722
6751
  }
6723
6752
  sendAdLoadedTracking(this.config.licenseKey, {
6724
- source: "preload",
6725
- vastUrl: preloaded.vastUrl
6726
- }, this.config.adPlayerType).catch(function() {});
6753
+ source: "ima",
6754
+ vastUrl: preloaded.vastUrl,
6755
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6756
+ }).catch(function() {});
6727
6757
  _state.label = 1;
6728
6758
  case 1:
6729
6759
  _state.trys.push([
@@ -7475,9 +7505,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7475
7505
  case 3:
7476
7506
  _state.sent();
7477
7507
  sendAdLoadedTracking(this.config.licenseKey, {
7478
- source: "ssp",
7479
- vastUrl: vastTagUrl
7480
- }, this.config.adPlayerType).catch(function() {});
7508
+ source: "ima",
7509
+ vastUrl: vastTagUrl,
7510
+ timestamp: /* @__PURE__ */ new Date().toISOString()
7511
+ }).catch(function() {});
7481
7512
  this.clearAdRequestWatchdog();
7482
7513
  if (this.activeAdRequestToken !== requestToken) {
7483
7514
  return [