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 { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-DNiBmPKK.cjs';
1
+ import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-Bz4aRmzc.cjs';
2
2
  import { AdTimingService } from './AdTimingService.cjs';
3
3
  import { AdPreloadPool } from './AdPreloadPool.cjs';
4
4
  import { AdConfigManager } from './AdConfigManager.cjs';
@@ -44,6 +44,7 @@ declare class AdBreakOrchestrator {
44
44
  private readonly placeholder;
45
45
  constructor(host: AdBreakOrchestratorHost, timing: AdTimingService, preloadPool: AdPreloadPool, adConfig: AdConfigManager, cueManager: Scte35CueManager, placeholder: PlaceholderLayer);
46
46
  private get debug();
47
+ private get analyticsContext();
47
48
  attachImaEventListeners(): void;
48
49
  recreateAdController(): void;
49
50
  clearPendingAdBreak(): void;
@@ -1270,6 +1270,16 @@ function publishMQTT(topic, payload) {
1270
1270
  }
1271
1271
  // src/utils/tracking.ts
1272
1272
  var cachedBrowserId = null;
1273
+ function buildAnalyticsContext(config) {
1274
+ var context = {};
1275
+ if (config.debugAdTiming) {
1276
+ context.debugAdTiming = true;
1277
+ }
1278
+ if (config.isLiveStream !== void 0) {
1279
+ context.inputStreamType = config.isLiveStream ? "live" : "vod";
1280
+ }
1281
+ return context;
1282
+ }
1273
1283
  function getClientInfo() {
1274
1284
  var _screen, _screen1, _screen2, _screen3, _screen_orientation, _screen4, _screen5, _window, _window1, _window_screen_orientation, _window_screen, _navigator_languages;
1275
1285
  var ua = navigator.userAgent;
@@ -1528,19 +1538,26 @@ function canPublish(licenseKey) {
1528
1538
  }
1529
1539
  function buildPlayerMetricEvent() {
1530
1540
  return _async_to_generator(function() {
1531
- var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, playerId, captureAt;
1541
+ var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, debugAdTiming, playerId, captureAt;
1532
1542
  var _arguments = arguments;
1533
1543
  return _ts_generator(this, function(_state) {
1534
1544
  switch(_state.label){
1535
1545
  case 0:
1536
1546
  context = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, flags = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
1537
1547
  clientInfo = getClientInfo();
1548
+ debugAdTiming = !!context.debugAdTiming;
1549
+ if (debugAdTiming) {
1550
+ console.log("[StormcloudVideoPlayer] clientInfo: ", JSON.stringify(clientInfo, null, 2));
1551
+ }
1538
1552
  return [
1539
1553
  4,
1540
1554
  getBrowserID(clientInfo)
1541
1555
  ];
1542
1556
  case 1:
1543
1557
  playerId = _state.sent();
1558
+ if (debugAdTiming) {
1559
+ console.log("[StormcloudVideoPlayer] playerId: ", playerId);
1560
+ }
1544
1561
  captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
1545
1562
  return [
1546
1563
  2,
@@ -2132,7 +2149,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
2132
2149
  key: "initializeTracking",
2133
2150
  value: function initializeTracking() {
2134
2151
  var _this = this;
2135
- sendInitialTracking(this.config.licenseKey).then(function() {
2152
+ sendInitialTracking(this.config.licenseKey, buildAnalyticsContext(this.config)).then(function() {
2136
2153
  _this.heartbeatInterval = window.setInterval(function() {
2137
2154
  _this.sendHeartbeatIfNeeded();
2138
2155
  }, 5e3);
@@ -2153,7 +2170,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
2153
2170
  var now = Date.now();
2154
2171
  if (!this.lastHeartbeatTime || now - this.lastHeartbeatTime > 3e4) {
2155
2172
  this.lastHeartbeatTime = now;
2156
- sendHeartbeat(this.config.licenseKey).catch(function(error) {
2173
+ sendHeartbeat(this.config.licenseKey, buildAnalyticsContext(this.config)).catch(function(error) {
2157
2174
  if (_this.debug) {
2158
2175
  console.warn("[StormcloudVideoPlayer] Failed to send heartbeat:", error);
2159
2176
  }