stormcloud-video-player 0.8.24 → 0.8.25

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 (37) hide show
  1. package/dist/stormcloud-vp.min.js +1 -1
  2. package/lib/index.cjs +38 -11
  3. package/lib/index.cjs.map +1 -1
  4. package/lib/index.d.cts +3 -1
  5. package/lib/index.d.ts +3 -1
  6. package/lib/index.js +35 -12
  7. package/lib/index.js.map +1 -1
  8. package/lib/player/AdBreakOrchestrator.cjs +30 -7
  9. package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
  10. package/lib/player/AdBreakOrchestrator.d.cts +2 -1
  11. package/lib/player/AdConfigManager.cjs +20 -3
  12. package/lib/player/AdConfigManager.cjs.map +1 -1
  13. package/lib/player/AdConfigManager.d.cts +1 -1
  14. package/lib/player/AdPreloadPool.d.cts +1 -1
  15. package/lib/player/AdTimingService.d.cts +1 -1
  16. package/lib/player/HlsEngine.d.cts +1 -1
  17. package/lib/player/PlayerControls.d.cts +1 -1
  18. package/lib/player/Scte35CueManager.d.cts +1 -1
  19. package/lib/player/Scte35Parser.d.cts +1 -1
  20. package/lib/player/StormcloudVideoPlayer.cjs +34 -11
  21. package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
  22. package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
  23. package/lib/player/playerTypes.d.cts +1 -1
  24. package/lib/players/HlsPlayer.cjs +34 -11
  25. package/lib/players/HlsPlayer.cjs.map +1 -1
  26. package/lib/players/HlsPlayer.d.cts +1 -1
  27. package/lib/players/index.cjs +34 -11
  28. package/lib/players/index.cjs.map +1 -1
  29. package/lib/sdk/hlsAdPlayer.d.cts +1 -1
  30. package/lib/{types-DNiBmPKK.d.cts → types-Bz4aRmzc.d.cts} +1 -0
  31. package/lib/ui/StormcloudVideoPlayer.cjs +34 -11
  32. package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
  33. package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
  34. package/lib/utils/tracking.cjs +22 -1
  35. package/lib/utils/tracking.cjs.map +1 -1
  36. package/lib/utils/tracking.d.cts +3 -2
  37. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { b as AdBreak, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-DNiBmPKK.cjs';
1
+ import { b as AdBreak, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-Bz4aRmzc.cjs';
2
2
  import { PalNonceManager } from '../sdk/pal.cjs';
3
3
  import { VastConsentSignals } from '../utils/vastMacros.cjs';
4
4
 
@@ -1,4 +1,4 @@
1
- import { A as AdController, S as Scte35Marker } from '../types-DNiBmPKK.cjs';
1
+ import { A as AdController, S as Scte35Marker } from '../types-Bz4aRmzc.cjs';
2
2
  import { AdTimingService } from './AdTimingService.cjs';
3
3
 
4
4
  interface AdPreloadPoolDeps {
@@ -1,4 +1,4 @@
1
- import { a as StormcloudVideoPlayerConfig, S as Scte35Marker, A as AdController } from '../types-DNiBmPKK.cjs';
1
+ import { a as StormcloudVideoPlayerConfig, S as Scte35Marker, A as AdController } from '../types-Bz4aRmzc.cjs';
2
2
 
3
3
  interface AdTimingCallbacks {
4
4
  onAdStopTimerFired(): void;
@@ -1,5 +1,5 @@
1
1
  import Hls from 'hls.js';
2
- import { a as StormcloudVideoPlayerConfig, S as Scte35Marker } from '../types-DNiBmPKK.cjs';
2
+ import { a as StormcloudVideoPlayerConfig, S as Scte35Marker } from '../types-Bz4aRmzc.cjs';
3
3
  import { Scte35CueContext } from './playerTypes.cjs';
4
4
  import { Scte35CueManager } from './Scte35CueManager.cjs';
5
5
  import { AdTimingService } from './AdTimingService.cjs';
@@ -1,4 +1,4 @@
1
- import { A as AdController } from '../types-DNiBmPKK.cjs';
1
+ import { A as AdController } from '../types-Bz4aRmzc.cjs';
2
2
 
3
3
  declare function getAdAudioVolume(adPlayer: AdController): number;
4
4
  declare function toggleMute(video: HTMLVideoElement, adPlayer: AdController, debug: boolean): void;
@@ -1,4 +1,4 @@
1
- import { S as Scte35Marker } from '../types-DNiBmPKK.cjs';
1
+ import { S as Scte35Marker } from '../types-Bz4aRmzc.cjs';
2
2
  import { Scte35CueSource, Scte35CueReadiness, Scte35CueContext } from './playerTypes.cjs';
3
3
 
4
4
  interface Scte35CueManagerCallbacks {
@@ -1,4 +1,4 @@
1
- import { S as Scte35Marker, I as Id3TagInfo } from '../types-DNiBmPKK.cjs';
1
+ import { S as Scte35Marker, I as Id3TagInfo } from '../types-Bz4aRmzc.cjs';
2
2
 
3
3
  declare function parseCueOutDuration(value: string): number | undefined;
4
4
  declare function parseCueOutCont(value: string): {
@@ -1945,6 +1945,16 @@ function normalizeBoolean(value) {
1945
1945
  }
1946
1946
  // src/utils/tracking.ts
1947
1947
  var cachedBrowserId = null;
1948
+ function buildAnalyticsContext(config) {
1949
+ var context = {};
1950
+ if (config.debugAdTiming) {
1951
+ context.debugAdTiming = true;
1952
+ }
1953
+ if (config.isLiveStream !== void 0) {
1954
+ context.inputStreamType = config.isLiveStream ? "live" : "vod";
1955
+ }
1956
+ return context;
1957
+ }
1948
1958
  function getClientInfo() {
1949
1959
  var _screen, _screen1, _screen2, _screen3, _screen_orientation, _screen4, _screen5, _window, _window1, _window_screen_orientation, _window_screen, _navigator_languages;
1950
1960
  var ua = navigator.userAgent;
@@ -2203,19 +2213,26 @@ function canPublish(licenseKey) {
2203
2213
  }
2204
2214
  function buildPlayerMetricEvent() {
2205
2215
  return _async_to_generator(function() {
2206
- var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, playerId, captureAt;
2216
+ var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, debugAdTiming, playerId, captureAt;
2207
2217
  var _arguments = arguments;
2208
2218
  return _ts_generator(this, function(_state) {
2209
2219
  switch(_state.label){
2210
2220
  case 0:
2211
2221
  context = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, flags = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
2212
2222
  clientInfo = getClientInfo();
2223
+ debugAdTiming = !!context.debugAdTiming;
2224
+ if (debugAdTiming) {
2225
+ console.log("[StormcloudVideoPlayer] clientInfo: ", JSON.stringify(clientInfo, null, 2));
2226
+ }
2213
2227
  return [
2214
2228
  4,
2215
2229
  getBrowserID(clientInfo)
2216
2230
  ];
2217
2231
  case 1:
2218
2232
  playerId = _state.sent();
2233
+ if (debugAdTiming) {
2234
+ console.log("[StormcloudVideoPlayer] playerId: ", playerId);
2235
+ }
2219
2236
  captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
2220
2237
  return [
2221
2238
  2,
@@ -4859,7 +4876,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
4859
4876
  key: "initializeTracking",
4860
4877
  value: function initializeTracking() {
4861
4878
  var _this = this;
4862
- sendInitialTracking(this.config.licenseKey).then(function() {
4879
+ sendInitialTracking(this.config.licenseKey, buildAnalyticsContext(this.config)).then(function() {
4863
4880
  _this.heartbeatInterval = window.setInterval(function() {
4864
4881
  _this.sendHeartbeatIfNeeded();
4865
4882
  }, 5e3);
@@ -4880,7 +4897,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
4880
4897
  var now = Date.now();
4881
4898
  if (!this.lastHeartbeatTime || now - this.lastHeartbeatTime > 3e4) {
4882
4899
  this.lastHeartbeatTime = now;
4883
- sendHeartbeat(this.config.licenseKey).catch(function(error) {
4900
+ sendHeartbeat(this.config.licenseKey, buildAnalyticsContext(this.config)).catch(function(error) {
4884
4901
  if (_this.debug) {
4885
4902
  console.warn("[StormcloudVideoPlayer] Failed to send heartbeat:", error);
4886
4903
  }
@@ -6660,6 +6677,12 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
6660
6677
  return !!this.host.config.debugAdTiming;
6661
6678
  }
6662
6679
  },
6680
+ {
6681
+ key: "analyticsContext",
6682
+ get: function get() {
6683
+ return buildAnalyticsContext(this.host.config);
6684
+ }
6685
+ },
6663
6686
  {
6664
6687
  // ───────────────────────────────────────────────────────────────
6665
6688
  // IMA event listeners
@@ -6673,7 +6696,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
6673
6696
  source: "hls",
6674
6697
  adIndex: _this.timing.currentAdIndex,
6675
6698
  timestamp: /* @__PURE__ */ new Date().toISOString()
6676
- }).catch(function() {});
6699
+ }, _this.analyticsContext).catch(function() {});
6677
6700
  _this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
6678
6701
  var remaining = _this.timing.getRemainingAdMs();
6679
6702
  _this.timing.consecutiveFailures = 0;
@@ -6735,7 +6758,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
6735
6758
  source: "hls",
6736
6759
  adIndex: _this.timing.currentAdIndex,
6737
6760
  timestamp: /* @__PURE__ */ new Date().toISOString()
6738
- }).catch(function() {});
6761
+ }, _this.analyticsContext).catch(function() {});
6739
6762
  if (!_this.host.video.muted) {
6740
6763
  _this.host.video.muted = true;
6741
6764
  if (_this.debug) {
@@ -6882,7 +6905,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
6882
6905
  source: "hls",
6883
6906
  vastUrl: firstAdUrl,
6884
6907
  timestamp: /* @__PURE__ */ new Date().toISOString()
6885
- }).catch(function() {});
6908
+ }, this.analyticsContext).catch(function() {});
6886
6909
  if (this.debug) {
6887
6910
  console.log("[CONTINUOUS-FETCH] Using preloaded ad from pool (preloaded in advance, ready immediately!)");
6888
6911
  }
@@ -6996,7 +7019,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
6996
7019
  source: "hls",
6997
7020
  vastUrl: firstAdUrl,
6998
7021
  timestamp: /* @__PURE__ */ new Date().toISOString()
6999
- }).catch(function() {});
7022
+ }, this.analyticsContext).catch(function() {});
7000
7023
  if (this.debug) {
7001
7024
  console.log("[CONTINUOUS-FETCH] First ad request successful, starting playback");
7002
7025
  }
@@ -7460,7 +7483,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7460
7483
  source: "hls",
7461
7484
  vastUrl: preloaded.vastUrl,
7462
7485
  timestamp: /* @__PURE__ */ new Date().toISOString()
7463
- }).catch(function() {});
7486
+ }, this.analyticsContext).catch(function() {});
7464
7487
  _state.label = 1;
7465
7488
  case 1:
7466
7489
  _state.trys.push([
@@ -7693,7 +7716,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
7693
7716
  source: "hls",
7694
7717
  vastUrl: vastTagUrl,
7695
7718
  timestamp: /* @__PURE__ */ new Date().toISOString()
7696
- }).catch(function() {});
7719
+ }, this.analyticsContext).catch(function() {});
7697
7720
  this.timing.clearAdRequestWatchdog();
7698
7721
  if (this.timing.activeAdRequestToken !== requestToken) return [
7699
7722
  2
@@ -8485,7 +8508,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
8485
8508
  sendAdDetectTracking(this.config.licenseKey, _object_spread({
8486
8509
  source: "scte35",
8487
8510
  timestamp: /* @__PURE__ */ new Date().toISOString()
8488
- }, detectPayload)).catch(function() {});
8511
+ }, detectPayload), buildAnalyticsContext(this.config)).catch(function() {});
8489
8512
  }
8490
8513
  var hasPrefetchedAds = this.adBreak.pendingAdBreak && this.adBreak.pendingAdBreak.vastUrls.length > 0;
8491
8514
  var durationMs = marker.durationSeconds != null ? marker.durationSeconds * 1e3 : ((_this_adBreak_pendingAdBreak = this.adBreak.pendingAdBreak) === null || _this_adBreak_pendingAdBreak === void 0 ? void 0 : _this_adBreak_pendingAdBreak.marker.durationSeconds) != null ? this.adBreak.pendingAdBreak.marker.durationSeconds * 1e3 : void 0;
@@ -8658,7 +8681,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
8658
8681
  sendAdDetectTracking(this.config.licenseKey, _object_spread({
8659
8682
  source: "scte35",
8660
8683
  timestamp: /* @__PURE__ */ new Date().toISOString()
8661
- }, detectPayload)).catch(function() {});
8684
+ }, detectPayload), buildAnalyticsContext(this.config)).catch(function() {});
8662
8685
  if (this.debug) {
8663
8686
  console.log("[PREFETCH] Starting ad prefetch for upcoming ad break");
8664
8687
  console.log("[PREFETCH] Pre-generated ".concat(generatedUrls.length, " VAST URLs"));