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.
- package/dist/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +38 -11
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +3 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +35 -12
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +30 -7
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +2 -1
- package/lib/player/AdConfigManager.cjs +20 -3
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -1
- package/lib/player/AdPreloadPool.d.cts +1 -1
- package/lib/player/AdTimingService.d.cts +1 -1
- package/lib/player/HlsEngine.d.cts +1 -1
- package/lib/player/PlayerControls.d.cts +1 -1
- package/lib/player/Scte35CueManager.d.cts +1 -1
- package/lib/player/Scte35Parser.d.cts +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +34 -11
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +34 -11
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +34 -11
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/{types-DNiBmPKK.d.cts → types-Bz4aRmzc.d.cts} +1 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +34 -11
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/tracking.cjs +22 -1
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +3 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import { a as StormcloudVideoPlayerConfig } from '../types-
|
|
2
|
+
import { a as StormcloudVideoPlayerConfig } from '../types-Bz4aRmzc.cjs';
|
|
3
3
|
|
|
4
4
|
interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
|
|
5
5
|
onMount?: (player: any) => void;
|
package/lib/players/index.cjs
CHANGED
|
@@ -2032,6 +2032,16 @@ function normalizeBoolean(value) {
|
|
|
2032
2032
|
}
|
|
2033
2033
|
// src/utils/tracking.ts
|
|
2034
2034
|
var cachedBrowserId = null;
|
|
2035
|
+
function buildAnalyticsContext(config) {
|
|
2036
|
+
var context = {};
|
|
2037
|
+
if (config.debugAdTiming) {
|
|
2038
|
+
context.debugAdTiming = true;
|
|
2039
|
+
}
|
|
2040
|
+
if (config.isLiveStream !== void 0) {
|
|
2041
|
+
context.inputStreamType = config.isLiveStream ? "live" : "vod";
|
|
2042
|
+
}
|
|
2043
|
+
return context;
|
|
2044
|
+
}
|
|
2035
2045
|
function getClientInfo() {
|
|
2036
2046
|
var _screen, _screen1, _screen2, _screen3, _screen_orientation, _screen4, _screen5, _window, _window1, _window_screen_orientation, _window_screen, _navigator_languages;
|
|
2037
2047
|
var ua = navigator.userAgent;
|
|
@@ -2290,19 +2300,26 @@ function canPublish(licenseKey) {
|
|
|
2290
2300
|
}
|
|
2291
2301
|
function buildPlayerMetricEvent() {
|
|
2292
2302
|
return _async_to_generator(function() {
|
|
2293
|
-
var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, playerId, captureAt;
|
|
2303
|
+
var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, debugAdTiming, playerId, captureAt;
|
|
2294
2304
|
var _arguments = arguments;
|
|
2295
2305
|
return _ts_generator(this, function(_state) {
|
|
2296
2306
|
switch(_state.label){
|
|
2297
2307
|
case 0:
|
|
2298
2308
|
context = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, flags = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
|
|
2299
2309
|
clientInfo = getClientInfo();
|
|
2310
|
+
debugAdTiming = !!context.debugAdTiming;
|
|
2311
|
+
if (debugAdTiming) {
|
|
2312
|
+
console.log("[StormcloudVideoPlayer] clientInfo: ", JSON.stringify(clientInfo, null, 2));
|
|
2313
|
+
}
|
|
2300
2314
|
return [
|
|
2301
2315
|
4,
|
|
2302
2316
|
getBrowserID(clientInfo)
|
|
2303
2317
|
];
|
|
2304
2318
|
case 1:
|
|
2305
2319
|
playerId = _state.sent();
|
|
2320
|
+
if (debugAdTiming) {
|
|
2321
|
+
console.log("[StormcloudVideoPlayer] playerId: ", playerId);
|
|
2322
|
+
}
|
|
2306
2323
|
captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
|
|
2307
2324
|
return [
|
|
2308
2325
|
2,
|
|
@@ -4946,7 +4963,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
4946
4963
|
key: "initializeTracking",
|
|
4947
4964
|
value: function initializeTracking() {
|
|
4948
4965
|
var _this = this;
|
|
4949
|
-
sendInitialTracking(this.config.licenseKey).then(function() {
|
|
4966
|
+
sendInitialTracking(this.config.licenseKey, buildAnalyticsContext(this.config)).then(function() {
|
|
4950
4967
|
_this.heartbeatInterval = window.setInterval(function() {
|
|
4951
4968
|
_this.sendHeartbeatIfNeeded();
|
|
4952
4969
|
}, 5e3);
|
|
@@ -4967,7 +4984,7 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
4967
4984
|
var now = Date.now();
|
|
4968
4985
|
if (!this.lastHeartbeatTime || now - this.lastHeartbeatTime > 3e4) {
|
|
4969
4986
|
this.lastHeartbeatTime = now;
|
|
4970
|
-
sendHeartbeat(this.config.licenseKey).catch(function(error) {
|
|
4987
|
+
sendHeartbeat(this.config.licenseKey, buildAnalyticsContext(this.config)).catch(function(error) {
|
|
4971
4988
|
if (_this.debug) {
|
|
4972
4989
|
console.warn("[StormcloudVideoPlayer] Failed to send heartbeat:", error);
|
|
4973
4990
|
}
|
|
@@ -6747,6 +6764,12 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
6747
6764
|
return !!this.host.config.debugAdTiming;
|
|
6748
6765
|
}
|
|
6749
6766
|
},
|
|
6767
|
+
{
|
|
6768
|
+
key: "analyticsContext",
|
|
6769
|
+
get: function get() {
|
|
6770
|
+
return buildAnalyticsContext(this.host.config);
|
|
6771
|
+
}
|
|
6772
|
+
},
|
|
6750
6773
|
{
|
|
6751
6774
|
// ───────────────────────────────────────────────────────────────
|
|
6752
6775
|
// IMA event listeners
|
|
@@ -6760,7 +6783,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
6760
6783
|
source: "hls",
|
|
6761
6784
|
adIndex: _this.timing.currentAdIndex,
|
|
6762
6785
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
6763
|
-
}).catch(function() {});
|
|
6786
|
+
}, _this.analyticsContext).catch(function() {});
|
|
6764
6787
|
_this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
|
|
6765
6788
|
var remaining = _this.timing.getRemainingAdMs();
|
|
6766
6789
|
_this.timing.consecutiveFailures = 0;
|
|
@@ -6822,7 +6845,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
6822
6845
|
source: "hls",
|
|
6823
6846
|
adIndex: _this.timing.currentAdIndex,
|
|
6824
6847
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
6825
|
-
}).catch(function() {});
|
|
6848
|
+
}, _this.analyticsContext).catch(function() {});
|
|
6826
6849
|
if (!_this.host.video.muted) {
|
|
6827
6850
|
_this.host.video.muted = true;
|
|
6828
6851
|
if (_this.debug) {
|
|
@@ -6969,7 +6992,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
6969
6992
|
source: "hls",
|
|
6970
6993
|
vastUrl: firstAdUrl,
|
|
6971
6994
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
6972
|
-
}).catch(function() {});
|
|
6995
|
+
}, this.analyticsContext).catch(function() {});
|
|
6973
6996
|
if (this.debug) {
|
|
6974
6997
|
console.log("[CONTINUOUS-FETCH] Using preloaded ad from pool (preloaded in advance, ready immediately!)");
|
|
6975
6998
|
}
|
|
@@ -7083,7 +7106,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7083
7106
|
source: "hls",
|
|
7084
7107
|
vastUrl: firstAdUrl,
|
|
7085
7108
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
7086
|
-
}).catch(function() {});
|
|
7109
|
+
}, this.analyticsContext).catch(function() {});
|
|
7087
7110
|
if (this.debug) {
|
|
7088
7111
|
console.log("[CONTINUOUS-FETCH] First ad request successful, starting playback");
|
|
7089
7112
|
}
|
|
@@ -7547,7 +7570,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7547
7570
|
source: "hls",
|
|
7548
7571
|
vastUrl: preloaded.vastUrl,
|
|
7549
7572
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
7550
|
-
}).catch(function() {});
|
|
7573
|
+
}, this.analyticsContext).catch(function() {});
|
|
7551
7574
|
_state.label = 1;
|
|
7552
7575
|
case 1:
|
|
7553
7576
|
_state.trys.push([
|
|
@@ -7780,7 +7803,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
7780
7803
|
source: "hls",
|
|
7781
7804
|
vastUrl: vastTagUrl,
|
|
7782
7805
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
7783
|
-
}).catch(function() {});
|
|
7806
|
+
}, this.analyticsContext).catch(function() {});
|
|
7784
7807
|
this.timing.clearAdRequestWatchdog();
|
|
7785
7808
|
if (this.timing.activeAdRequestToken !== requestToken) return [
|
|
7786
7809
|
2
|
|
@@ -8572,7 +8595,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
8572
8595
|
sendAdDetectTracking(this.config.licenseKey, _object_spread({
|
|
8573
8596
|
source: "scte35",
|
|
8574
8597
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
8575
|
-
}, detectPayload)).catch(function() {});
|
|
8598
|
+
}, detectPayload), buildAnalyticsContext(this.config)).catch(function() {});
|
|
8576
8599
|
}
|
|
8577
8600
|
var hasPrefetchedAds = this.adBreak.pendingAdBreak && this.adBreak.pendingAdBreak.vastUrls.length > 0;
|
|
8578
8601
|
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;
|
|
@@ -8745,7 +8768,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
8745
8768
|
sendAdDetectTracking(this.config.licenseKey, _object_spread({
|
|
8746
8769
|
source: "scte35",
|
|
8747
8770
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
8748
|
-
}, detectPayload)).catch(function() {});
|
|
8771
|
+
}, detectPayload), buildAnalyticsContext(this.config)).catch(function() {});
|
|
8749
8772
|
if (this.debug) {
|
|
8750
8773
|
console.log("[PREFETCH] Starting ad prefetch for upcoming ad break");
|
|
8751
8774
|
console.log("[PREFETCH] Pre-generated ".concat(generatedUrls.length, " VAST URLs"));
|