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.cjs CHANGED
@@ -2834,40 +2834,66 @@ function getBrowserID(clientInfo) {
2834
2834
  });
2835
2835
  })();
2836
2836
  }
2837
- function sendInitialTracking(licenseKey) {
2837
+ var PLAYER_TRACKING_BASE_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking";
2838
+ var TRACK_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/metrics/ingest");
2839
+ var HEARTBEAT_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/heartbeat");
2840
+ var IMPRESSIONS_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/impressions/ingest");
2841
+ function buildHeaders(licenseKey) {
2842
+ var headers = {
2843
+ "Content-Type": "application/json"
2844
+ };
2845
+ if (licenseKey) {
2846
+ headers["Authorization"] = "Bearer ".concat(licenseKey);
2847
+ }
2848
+ return headers;
2849
+ }
2850
+ function sendTrackRequest(licenseKey, body) {
2838
2851
  return _async_to_generator(function() {
2839
- var clientInfo, browserId, trackingData, headers, response, error;
2852
+ var response;
2840
2853
  return _ts_generator(this, function(_state) {
2841
2854
  switch(_state.label){
2842
2855
  case 0:
2843
- _state.trys.push([
2844
- 0,
2845
- 4,
2846
- ,
2847
- 5
2848
- ]);
2849
- clientInfo = getClientInfo();
2850
2856
  return [
2851
2857
  4,
2852
- getBrowserID(clientInfo)
2858
+ fetch(TRACK_URL, {
2859
+ method: "POST",
2860
+ headers: buildHeaders(licenseKey),
2861
+ body: JSON.stringify(body)
2862
+ })
2853
2863
  ];
2854
2864
  case 1:
2855
- browserId = _state.sent();
2856
- trackingData = _object_spread({
2857
- browserId: browserId
2858
- }, clientInfo);
2859
- headers = {
2860
- "Content-Type": "application/json"
2861
- };
2865
+ response = _state.sent();
2866
+ if (!response.ok) {
2867
+ throw new Error("HTTP error! status: ".concat(response.status));
2868
+ }
2869
+ return [
2870
+ 4,
2871
+ response.json()
2872
+ ];
2873
+ case 2:
2874
+ _state.sent();
2875
+ return [
2876
+ 2
2877
+ ];
2878
+ }
2879
+ });
2880
+ })();
2881
+ }
2882
+ function postJson(url, licenseKey, body) {
2883
+ return _async_to_generator(function() {
2884
+ var response;
2885
+ return _ts_generator(this, function(_state) {
2886
+ switch(_state.label){
2887
+ case 0:
2862
2888
  return [
2863
2889
  4,
2864
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track", {
2890
+ fetch(url, {
2865
2891
  method: "POST",
2866
- headers: headers,
2867
- body: JSON.stringify(trackingData)
2892
+ headers: buildHeaders(licenseKey),
2893
+ body: JSON.stringify(body)
2868
2894
  })
2869
2895
  ];
2870
- case 2:
2896
+ case 1:
2871
2897
  response = _state.sent();
2872
2898
  if (!response.ok) {
2873
2899
  throw new Error("HTTP error! status: ".concat(response.status));
@@ -2876,35 +2902,63 @@ function sendInitialTracking(licenseKey) {
2876
2902
  4,
2877
2903
  response.json()
2878
2904
  ];
2879
- case 3:
2905
+ case 2:
2880
2906
  _state.sent();
2881
2907
  return [
2882
- 3,
2883
- 5
2908
+ 2
2884
2909
  ];
2885
- case 4:
2886
- error = _state.sent();
2887
- console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
2910
+ }
2911
+ });
2912
+ })();
2913
+ }
2914
+ function buildPlayerMetricEvent(_0) {
2915
+ return _async_to_generator(function(licenseKey) {
2916
+ var context, flags, _flags_captureAt, clientInfo, browserId, captureAt;
2917
+ var _arguments = arguments;
2918
+ return _ts_generator(this, function(_state) {
2919
+ switch(_state.label){
2920
+ case 0:
2921
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
2922
+ clientInfo = getClientInfo();
2888
2923
  return [
2889
- 3,
2890
- 5
2924
+ 4,
2925
+ getBrowserID(clientInfo)
2891
2926
  ];
2892
- case 5:
2927
+ case 1:
2928
+ browserId = _state.sent();
2929
+ captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
2893
2930
  return [
2894
- 2
2931
+ 2,
2932
+ {
2933
+ player_id: browserId,
2934
+ browserId: browserId,
2935
+ device_type: clientInfo.deviceType,
2936
+ deviceType: clientInfo.deviceType,
2937
+ input_stream_type: context.inputStreamType,
2938
+ os: clientInfo.os,
2939
+ ad_loaded: flags.adLoaded,
2940
+ ad_detect: flags.adDetect,
2941
+ license_key: licenseKey,
2942
+ capture_at: captureAt,
2943
+ timestamp: captureAt
2944
+ }
2895
2945
  ];
2896
2946
  }
2897
2947
  });
2898
- })();
2948
+ }).apply(this, arguments);
2899
2949
  }
2900
- function sendHeartbeat(licenseKey) {
2901
- return _async_to_generator(function() {
2902
- var clientInfo, browserId, heartbeatData, headers, response, error;
2950
+ function sendInitialTracking(_0) {
2951
+ return _async_to_generator(function(licenseKey) {
2952
+ var context, clientInfo, browserId, trackingData, error;
2953
+ var _arguments = arguments;
2903
2954
  return _ts_generator(this, function(_state) {
2904
2955
  switch(_state.label){
2905
2956
  case 0:
2957
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
2958
+ _state.label = 1;
2959
+ case 1:
2906
2960
  _state.trys.push([
2907
- 0,
2961
+ 1,
2908
2962
  4,
2909
2963
  ,
2910
2964
  5
@@ -2914,35 +2968,29 @@ function sendHeartbeat(licenseKey) {
2914
2968
  4,
2915
2969
  getBrowserID(clientInfo)
2916
2970
  ];
2917
- case 1:
2971
+ case 2:
2918
2972
  browserId = _state.sent();
2919
- heartbeatData = {
2920
- browserId: browserId,
2921
- timestamp: /* @__PURE__ */ new Date().toISOString()
2922
- };
2923
- headers = {
2924
- "Content-Type": "application/json"
2925
- };
2926
- if (licenseKey) {
2927
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2928
- }
2973
+ trackingData = _object_spread({
2974
+ browserId: browserId
2975
+ }, clientInfo);
2929
2976
  return [
2930
2977
  4,
2931
- fetch("https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/heartbeat", {
2932
- method: "POST",
2933
- headers: headers,
2934
- body: JSON.stringify(heartbeatData)
2978
+ sendTrackRequest(licenseKey, {
2979
+ events: [
2980
+ {
2981
+ player_id: browserId,
2982
+ device_type: clientInfo.deviceType,
2983
+ input_stream_type: context.inputStreamType,
2984
+ os: clientInfo.os,
2985
+ ad_loaded: false,
2986
+ ad_detect: false,
2987
+ license_key: licenseKey,
2988
+ capture_at: /* @__PURE__ */ new Date().toISOString()
2989
+ }
2990
+ ],
2991
+ trackingData: trackingData
2935
2992
  })
2936
2993
  ];
2937
- case 2:
2938
- response = _state.sent();
2939
- if (!response.ok) {
2940
- throw new Error("HTTP error! status: ".concat(response.status));
2941
- }
2942
- return [
2943
- 4,
2944
- response.json()
2945
- ];
2946
2994
  case 3:
2947
2995
  _state.sent();
2948
2996
  return [
@@ -2951,7 +2999,7 @@ function sendHeartbeat(licenseKey) {
2951
2999
  ];
2952
3000
  case 4:
2953
3001
  error = _state.sent();
2954
- console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
3002
+ console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
2955
3003
  return [
2956
3004
  3,
2957
3005
  5
@@ -2962,95 +3010,74 @@ function sendHeartbeat(licenseKey) {
2962
3010
  ];
2963
3011
  }
2964
3012
  });
2965
- })();
3013
+ }).apply(this, arguments);
2966
3014
  }
2967
- var TRACK_API_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track";
2968
- function mapToAdTrackingSource(source, adPlayerType) {
2969
- if (source === "prebid" || source === "ima" || source === "hls") {
2970
- return source;
2971
- }
2972
- if (source === "preload" || source === "ssp") {
2973
- return source === "ssp" ? "prebid" : "ima";
2974
- }
2975
- return adPlayerType === "hls" ? "hls" : "ima";
2976
- }
2977
- function postAdTracking(licenseKey, body) {
2978
- return _async_to_generator(function() {
2979
- var headers, response;
3015
+ function sendAdDetectTracking(_0, _1) {
3016
+ return _async_to_generator(function(licenseKey, adDetectInfo) {
3017
+ var context, error;
3018
+ var _arguments = arguments;
2980
3019
  return _ts_generator(this, function(_state) {
2981
3020
  switch(_state.label){
2982
3021
  case 0:
2983
- headers = {
2984
- "Content-Type": "application/json"
2985
- };
2986
- if (licenseKey) {
2987
- headers["Authorization"] = "Bearer ".concat(licenseKey);
2988
- }
2989
- return [
2990
- 4,
2991
- fetch(TRACK_API_URL, {
2992
- method: "POST",
2993
- headers: headers,
2994
- body: JSON.stringify(body)
2995
- })
2996
- ];
3022
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
3023
+ _state.label = 1;
2997
3024
  case 1:
2998
- response = _state.sent();
2999
- if (!response.ok) {
3000
- throw new Error("HTTP error! status: ".concat(response.status));
3001
- }
3025
+ _state.trys.push([
3026
+ 1,
3027
+ 3,
3028
+ ,
3029
+ 4
3030
+ ]);
3002
3031
  return [
3003
3032
  4,
3004
- response.json()
3033
+ sendHeartbeat(licenseKey, context, {
3034
+ adDetect: true,
3035
+ captureAt: adDetectInfo.timestamp
3036
+ })
3005
3037
  ];
3006
3038
  case 2:
3007
3039
  _state.sent();
3040
+ return [
3041
+ 3,
3042
+ 4
3043
+ ];
3044
+ case 3:
3045
+ error = _state.sent();
3046
+ console.error("[StormcloudVideoPlayer] Error sending ad detect tracking:", error);
3047
+ return [
3048
+ 3,
3049
+ 4
3050
+ ];
3051
+ case 4:
3008
3052
  return [
3009
3053
  2
3010
3054
  ];
3011
3055
  }
3012
3056
  });
3013
- })();
3057
+ }).apply(this, arguments);
3014
3058
  }
3015
- function sendAdDetectTracking(licenseKey, payload) {
3016
- return _async_to_generator(function() {
3017
- var _payload_source, _payload_timestamp, clientInfo, browserId, adDetectInfo, body, error;
3059
+ function sendAdLoadedTracking(_0, _1) {
3060
+ return _async_to_generator(function(licenseKey, adLoadedInfo) {
3061
+ var context, error;
3062
+ var _arguments = arguments;
3018
3063
  return _ts_generator(this, function(_state) {
3019
3064
  switch(_state.label){
3020
3065
  case 0:
3066
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
3067
+ _state.label = 1;
3068
+ case 1:
3021
3069
  _state.trys.push([
3022
- 0,
3070
+ 1,
3023
3071
  3,
3024
3072
  ,
3025
3073
  4
3026
3074
  ]);
3027
- clientInfo = getClientInfo();
3028
- return [
3029
- 4,
3030
- getBrowserID(clientInfo)
3031
- ];
3032
- case 1:
3033
- browserId = _state.sent();
3034
- adDetectInfo = _object_spread({
3035
- source: (_payload_source = payload.source) !== null && _payload_source !== void 0 ? _payload_source : "scte35",
3036
- timestamp: (_payload_timestamp = payload.timestamp) !== null && _payload_timestamp !== void 0 ? _payload_timestamp : /* @__PURE__ */ new Date().toISOString()
3037
- }, payload.durationSeconds != null && {
3038
- durationSeconds: payload.durationSeconds
3039
- }, payload.ptsSeconds != null && {
3040
- ptsSeconds: payload.ptsSeconds
3041
- }, payload.detectedAtFragmentSn != null && {
3042
- detectedAtFragmentSn: payload.detectedAtFragmentSn
3043
- });
3044
- body = _object_spread_props(_object_spread({
3045
- browserId: browserId
3046
- }, clientInfo, licenseKey && {
3047
- licenseKey: licenseKey
3048
- }), {
3049
- adDetectInfo: adDetectInfo
3050
- });
3051
3075
  return [
3052
3076
  4,
3053
- postAdTracking(licenseKey, body)
3077
+ sendHeartbeat(licenseKey, context, {
3078
+ adLoaded: true,
3079
+ captureAt: adLoadedInfo.timestamp
3080
+ })
3054
3081
  ];
3055
3082
  case 2:
3056
3083
  _state.sent();
@@ -3060,7 +3087,7 @@ function sendAdDetectTracking(licenseKey, payload) {
3060
3087
  ];
3061
3088
  case 3:
3062
3089
  error = _state.sent();
3063
- console.error("[StormcloudVideoPlayer] Error sending ad-detect tracking:", error);
3090
+ console.error("[StormcloudVideoPlayer] Error sending ad loaded tracking:", error);
3064
3091
  return [
3065
3092
  3,
3066
3093
  4
@@ -3071,126 +3098,116 @@ function sendAdDetectTracking(licenseKey, payload) {
3071
3098
  ];
3072
3099
  }
3073
3100
  });
3074
- })();
3101
+ }).apply(this, arguments);
3075
3102
  }
3076
- function sendAdLoadedTracking(licenseKey, payload, adPlayerType) {
3077
- return _async_to_generator(function() {
3078
- var clientInfo, browserId, source, adLoadedInfo, body, error;
3103
+ function sendAdImpressionTracking(_0, _1) {
3104
+ return _async_to_generator(function(licenseKey, adImpressionInfo) {
3105
+ var context, metricEvent, error;
3106
+ var _arguments = arguments;
3079
3107
  return _ts_generator(this, function(_state) {
3080
3108
  switch(_state.label){
3081
3109
  case 0:
3110
+ context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
3111
+ _state.label = 1;
3112
+ case 1:
3082
3113
  _state.trys.push([
3083
- 0,
3084
- 3,
3114
+ 1,
3115
+ 4,
3085
3116
  ,
3086
- 4
3117
+ 5
3087
3118
  ]);
3088
- clientInfo = getClientInfo();
3089
3119
  return [
3090
3120
  4,
3091
- getBrowserID(clientInfo)
3121
+ buildPlayerMetricEvent(licenseKey, context, {
3122
+ captureAt: adImpressionInfo.timestamp
3123
+ })
3092
3124
  ];
3093
- case 1:
3094
- browserId = _state.sent();
3095
- source = mapToAdTrackingSource(payload.source, adPlayerType);
3096
- adLoadedInfo = _object_spread({
3097
- source: source,
3098
- timestamp: /* @__PURE__ */ new Date().toISOString()
3099
- }, payload.vastUrl != null && {
3100
- vastUrl: payload.vastUrl
3101
- }, payload.durationSeconds != null && {
3102
- durationSeconds: payload.durationSeconds
3103
- });
3104
- body = _object_spread_props(_object_spread({
3105
- browserId: browserId
3106
- }, clientInfo, licenseKey && {
3107
- licenseKey: licenseKey
3108
- }), {
3109
- adLoadedInfo: adLoadedInfo
3110
- });
3125
+ case 2:
3126
+ metricEvent = _state.sent();
3111
3127
  return [
3112
3128
  4,
3113
- postAdTracking(licenseKey, body)
3129
+ Promise.all([
3130
+ postJson(HEARTBEAT_URL, licenseKey, metricEvent),
3131
+ postJson(IMPRESSIONS_URL, licenseKey, {
3132
+ events: [
3133
+ {
3134
+ player_id: metricEvent.player_id,
3135
+ ad_played_count: 1,
3136
+ ad_url: adImpressionInfo.adUrl,
3137
+ license_key: licenseKey,
3138
+ capture_at: adImpressionInfo.timestamp
3139
+ }
3140
+ ]
3141
+ })
3142
+ ])
3114
3143
  ];
3115
- case 2:
3144
+ case 3:
3116
3145
  _state.sent();
3117
3146
  return [
3118
3147
  3,
3119
- 4
3148
+ 5
3120
3149
  ];
3121
- case 3:
3150
+ case 4:
3122
3151
  error = _state.sent();
3123
- console.error("[StormcloudVideoPlayer] Error sending ad-loaded tracking:", error);
3152
+ console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
3124
3153
  return [
3125
3154
  3,
3126
- 4
3155
+ 5
3127
3156
  ];
3128
- case 4:
3157
+ case 5:
3129
3158
  return [
3130
3159
  2
3131
3160
  ];
3132
3161
  }
3133
3162
  });
3134
- })();
3163
+ }).apply(this, arguments);
3135
3164
  }
3136
- function sendAdImpressionTracking(licenseKey, payload, adPlayerType) {
3137
- return _async_to_generator(function() {
3138
- var clientInfo, browserId, source, adImpressionInfo, body, error;
3165
+ function sendHeartbeat(_0) {
3166
+ return _async_to_generator(function(licenseKey) {
3167
+ var context, flags, heartbeatData, error;
3168
+ var _arguments = arguments;
3139
3169
  return _ts_generator(this, function(_state) {
3140
3170
  switch(_state.label){
3141
3171
  case 0:
3172
+ context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
3173
+ _state.label = 1;
3174
+ case 1:
3142
3175
  _state.trys.push([
3143
- 0,
3144
- 3,
3176
+ 1,
3177
+ 4,
3145
3178
  ,
3146
- 4
3179
+ 5
3147
3180
  ]);
3148
- clientInfo = getClientInfo();
3149
3181
  return [
3150
3182
  4,
3151
- getBrowserID(clientInfo)
3183
+ buildPlayerMetricEvent(licenseKey, context, flags)
3152
3184
  ];
3153
- case 1:
3154
- browserId = _state.sent();
3155
- source = mapToAdTrackingSource(payload.source, adPlayerType);
3156
- adImpressionInfo = _object_spread({
3157
- source: source,
3158
- adIndex: payload.adIndex,
3159
- timestamp: /* @__PURE__ */ new Date().toISOString()
3160
- }, payload.durationSeconds != null && {
3161
- durationSeconds: payload.durationSeconds
3162
- });
3163
- body = _object_spread_props(_object_spread({
3164
- browserId: browserId
3165
- }, clientInfo, licenseKey && {
3166
- licenseKey: licenseKey
3167
- }), {
3168
- adImpressionInfo: adImpressionInfo
3169
- });
3185
+ case 2:
3186
+ heartbeatData = _state.sent();
3170
3187
  return [
3171
3188
  4,
3172
- postAdTracking(licenseKey, body)
3189
+ postJson(HEARTBEAT_URL, licenseKey, heartbeatData)
3173
3190
  ];
3174
- case 2:
3191
+ case 3:
3175
3192
  _state.sent();
3176
3193
  return [
3177
3194
  3,
3178
- 4
3195
+ 5
3179
3196
  ];
3180
- case 3:
3197
+ case 4:
3181
3198
  error = _state.sent();
3182
- console.error("[StormcloudVideoPlayer] Error sending ad-impression tracking:", error);
3199
+ console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
3183
3200
  return [
3184
3201
  3,
3185
- 4
3202
+ 5
3186
3203
  ];
3187
- case 4:
3204
+ case 5:
3188
3205
  return [
3189
3206
  2
3190
3207
  ];
3191
3208
  }
3192
3209
  });
3193
- })();
3210
+ }).apply(this, arguments);
3194
3211
  }
3195
3212
  // src/utils/polyfills.ts
3196
3213
  function polyfillURLSearchParams() {
@@ -3983,8 +4000,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3983
4000
  var _this = this;
3984
4001
  this.ima.on("all_ads_completed", function() {
3985
4002
  sendAdImpressionTracking(_this.config.licenseKey, {
3986
- adIndex: _this.currentAdIndex
3987
- }, _this.config.adPlayerType).catch(function() {});
4003
+ source: "ima",
4004
+ adIndex: _this.currentAdIndex,
4005
+ timestamp: /* @__PURE__ */ new Date().toISOString()
4006
+ }).catch(function() {});
3988
4007
  var remaining = _this.getRemainingAdMs();
3989
4008
  _this.consecutiveFailures = 0;
3990
4009
  if (_this.config.debugAdTiming) {
@@ -4045,8 +4064,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4045
4064
  });
4046
4065
  this.ima.on("content_resume", function() {
4047
4066
  sendAdImpressionTracking(_this.config.licenseKey, {
4048
- adIndex: _this.currentAdIndex
4049
- }, _this.config.adPlayerType).catch(function() {});
4067
+ source: "ima",
4068
+ adIndex: _this.currentAdIndex,
4069
+ timestamp: /* @__PURE__ */ new Date().toISOString()
4070
+ }).catch(function() {});
4050
4071
  if (!_this.video.muted) {
4051
4072
  _this.video.muted = true;
4052
4073
  _this.video.volume = 0;
@@ -4680,7 +4701,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4680
4701
  var detectPayload = {};
4681
4702
  if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
4682
4703
  if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
4683
- sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
4704
+ sendAdDetectTracking(this.config.licenseKey, _object_spread({
4705
+ source: "scte35",
4706
+ timestamp: /* @__PURE__ */ new Date().toISOString()
4707
+ }, detectPayload)).catch(function() {});
4684
4708
  }
4685
4709
  var hasPrefetchedAds = this.pendingAdBreak && this.pendingAdBreak.vastUrls.length > 0;
4686
4710
  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;
@@ -5922,7 +5946,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5922
5946
  if (marker.durationSeconds != null) detectPayload.durationSeconds = marker.durationSeconds;
5923
5947
  if (marker.ptsSeconds != null) detectPayload.ptsSeconds = marker.ptsSeconds;
5924
5948
  if (fragmentSn !== void 0) detectPayload.detectedAtFragmentSn = fragmentSn;
5925
- sendAdDetectTracking(this.config.licenseKey, detectPayload).catch(function() {});
5949
+ sendAdDetectTracking(this.config.licenseKey, _object_spread({
5950
+ source: "scte35",
5951
+ timestamp: /* @__PURE__ */ new Date().toISOString()
5952
+ }, detectPayload)).catch(function() {});
5926
5953
  if (this.config.debugAdTiming) {
5927
5954
  console.log("[PREFETCH] \uD83D\uDD04 Starting ad prefetch for upcoming ad break");
5928
5955
  console.log("[PREFETCH] \uD83D\uDCCB Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
@@ -6403,9 +6430,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6403
6430
  preloadedController = preloaded.imaController;
6404
6431
  usePreloadedAd = true;
6405
6432
  sendAdLoadedTracking(this.config.licenseKey, {
6406
- source: "preload",
6407
- vastUrl: firstAdUrl
6408
- }, this.config.adPlayerType).catch(function() {});
6433
+ source: "ima",
6434
+ vastUrl: firstAdUrl,
6435
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6436
+ }).catch(function() {});
6409
6437
  if (this.config.debugAdTiming) {
6410
6438
  console.log("[CONTINUOUS-FETCH] \uD83D\uDE80 Using preloaded ad from pool (preloaded in advance, ready immediately!)");
6411
6439
  console.log("[CONTINUOUS-FETCH] Pool still has ".concat(this.preloadPool.length, " preloaded ads ready"));
@@ -6495,9 +6523,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6495
6523
  case 5:
6496
6524
  _state.sent();
6497
6525
  sendAdLoadedTracking(this.config.licenseKey, {
6498
- source: "ssp",
6499
- vastUrl: firstAdUrl
6500
- }, this.config.adPlayerType).catch(function() {});
6526
+ source: "ima",
6527
+ vastUrl: firstAdUrl,
6528
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6529
+ }).catch(function() {});
6501
6530
  if (this.config.debugAdTiming) {
6502
6531
  console.log("[CONTINUOUS-FETCH] \u2705 First ad request successful, starting playback");
6503
6532
  }
@@ -6893,9 +6922,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6893
6922
  console.log("[CONTINUOUS-FETCH] \uD83C\uDFAF Using preloaded ad from pool (".concat(this.preloadPool.length, " remaining in pool)"));
6894
6923
  }
6895
6924
  sendAdLoadedTracking(this.config.licenseKey, {
6896
- source: "preload",
6897
- vastUrl: preloaded.vastUrl
6898
- }, this.config.adPlayerType).catch(function() {});
6925
+ source: "ima",
6926
+ vastUrl: preloaded.vastUrl,
6927
+ timestamp: /* @__PURE__ */ new Date().toISOString()
6928
+ }).catch(function() {});
6899
6929
  _state.label = 1;
6900
6930
  case 1:
6901
6931
  _state.trys.push([
@@ -7647,9 +7677,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7647
7677
  case 3:
7648
7678
  _state.sent();
7649
7679
  sendAdLoadedTracking(this.config.licenseKey, {
7650
- source: "ssp",
7651
- vastUrl: vastTagUrl
7652
- }, this.config.adPlayerType).catch(function() {});
7680
+ source: "ima",
7681
+ vastUrl: vastTagUrl,
7682
+ timestamp: /* @__PURE__ */ new Date().toISOString()
7683
+ }).catch(function() {});
7653
7684
  this.clearAdRequestWatchdog();
7654
7685
  if (this.activeAdRequestToken !== requestToken) {
7655
7686
  return [