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
|
@@ -722,6 +722,16 @@ function normalizeBoolean(value) {
|
|
|
722
722
|
}
|
|
723
723
|
// src/utils/tracking.ts
|
|
724
724
|
var cachedBrowserId = null;
|
|
725
|
+
function buildAnalyticsContext(config) {
|
|
726
|
+
var context = {};
|
|
727
|
+
if (config.debugAdTiming) {
|
|
728
|
+
context.debugAdTiming = true;
|
|
729
|
+
}
|
|
730
|
+
if (config.isLiveStream !== void 0) {
|
|
731
|
+
context.inputStreamType = config.isLiveStream ? "live" : "vod";
|
|
732
|
+
}
|
|
733
|
+
return context;
|
|
734
|
+
}
|
|
725
735
|
function getClientInfo() {
|
|
726
736
|
var _screen, _screen1, _screen2, _screen3, _screen_orientation, _screen4, _screen5, _window, _window1, _window_screen_orientation, _window_screen, _navigator_languages;
|
|
727
737
|
var ua = navigator.userAgent;
|
|
@@ -980,19 +990,26 @@ function canPublish(licenseKey) {
|
|
|
980
990
|
}
|
|
981
991
|
function buildPlayerMetricEvent() {
|
|
982
992
|
return _async_to_generator(function() {
|
|
983
|
-
var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, playerId, captureAt;
|
|
993
|
+
var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, debugAdTiming, playerId, captureAt;
|
|
984
994
|
var _arguments = arguments;
|
|
985
995
|
return _ts_generator(this, function(_state) {
|
|
986
996
|
switch(_state.label){
|
|
987
997
|
case 0:
|
|
988
998
|
context = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, flags = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
|
|
989
999
|
clientInfo = getClientInfo();
|
|
1000
|
+
debugAdTiming = !!context.debugAdTiming;
|
|
1001
|
+
if (debugAdTiming) {
|
|
1002
|
+
console.log("[StormcloudVideoPlayer] clientInfo: ", JSON.stringify(clientInfo, null, 2));
|
|
1003
|
+
}
|
|
990
1004
|
return [
|
|
991
1005
|
4,
|
|
992
1006
|
getBrowserID(clientInfo)
|
|
993
1007
|
];
|
|
994
1008
|
case 1:
|
|
995
1009
|
playerId = _state.sent();
|
|
1010
|
+
if (debugAdTiming) {
|
|
1011
|
+
console.log("[StormcloudVideoPlayer] playerId: ", playerId);
|
|
1012
|
+
}
|
|
996
1013
|
captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
|
|
997
1014
|
return [
|
|
998
1015
|
2,
|
|
@@ -1193,6 +1210,12 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1193
1210
|
return !!this.host.config.debugAdTiming;
|
|
1194
1211
|
}
|
|
1195
1212
|
},
|
|
1213
|
+
{
|
|
1214
|
+
key: "analyticsContext",
|
|
1215
|
+
get: function get() {
|
|
1216
|
+
return buildAnalyticsContext(this.host.config);
|
|
1217
|
+
}
|
|
1218
|
+
},
|
|
1196
1219
|
{
|
|
1197
1220
|
// ───────────────────────────────────────────────────────────────
|
|
1198
1221
|
// IMA event listeners
|
|
@@ -1206,7 +1229,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1206
1229
|
source: "hls",
|
|
1207
1230
|
adIndex: _this.timing.currentAdIndex,
|
|
1208
1231
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
1209
|
-
}).catch(function() {});
|
|
1232
|
+
}, _this.analyticsContext).catch(function() {});
|
|
1210
1233
|
_this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
|
|
1211
1234
|
var remaining = _this.timing.getRemainingAdMs();
|
|
1212
1235
|
_this.timing.consecutiveFailures = 0;
|
|
@@ -1268,7 +1291,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1268
1291
|
source: "hls",
|
|
1269
1292
|
adIndex: _this.timing.currentAdIndex,
|
|
1270
1293
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
1271
|
-
}).catch(function() {});
|
|
1294
|
+
}, _this.analyticsContext).catch(function() {});
|
|
1272
1295
|
if (!_this.host.video.muted) {
|
|
1273
1296
|
_this.host.video.muted = true;
|
|
1274
1297
|
if (_this.debug) {
|
|
@@ -1415,7 +1438,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1415
1438
|
source: "hls",
|
|
1416
1439
|
vastUrl: firstAdUrl,
|
|
1417
1440
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
1418
|
-
}).catch(function() {});
|
|
1441
|
+
}, this.analyticsContext).catch(function() {});
|
|
1419
1442
|
if (this.debug) {
|
|
1420
1443
|
console.log("[CONTINUOUS-FETCH] Using preloaded ad from pool (preloaded in advance, ready immediately!)");
|
|
1421
1444
|
}
|
|
@@ -1529,7 +1552,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1529
1552
|
source: "hls",
|
|
1530
1553
|
vastUrl: firstAdUrl,
|
|
1531
1554
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
1532
|
-
}).catch(function() {});
|
|
1555
|
+
}, this.analyticsContext).catch(function() {});
|
|
1533
1556
|
if (this.debug) {
|
|
1534
1557
|
console.log("[CONTINUOUS-FETCH] First ad request successful, starting playback");
|
|
1535
1558
|
}
|
|
@@ -1993,7 +2016,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1993
2016
|
source: "hls",
|
|
1994
2017
|
vastUrl: preloaded.vastUrl,
|
|
1995
2018
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
1996
|
-
}).catch(function() {});
|
|
2019
|
+
}, this.analyticsContext).catch(function() {});
|
|
1997
2020
|
_state.label = 1;
|
|
1998
2021
|
case 1:
|
|
1999
2022
|
_state.trys.push([
|
|
@@ -2226,7 +2249,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
2226
2249
|
source: "hls",
|
|
2227
2250
|
vastUrl: vastTagUrl,
|
|
2228
2251
|
timestamp: /* @__PURE__ */ new Date().toISOString()
|
|
2229
|
-
}).catch(function() {});
|
|
2252
|
+
}, this.analyticsContext).catch(function() {});
|
|
2230
2253
|
this.timing.clearAdRequestWatchdog();
|
|
2231
2254
|
if (this.timing.activeAdRequestToken !== requestToken) return [
|
|
2232
2255
|
2
|