stormcloud-video-player 0.8.55 → 0.8.56
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 +2 -2
- package/lib/index.cjs +222 -82
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +222 -82
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +27 -29
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -1
- package/lib/player/AdConfigManager.cjs +3 -14
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -1
- package/lib/player/AdTimingService.d.cts +1 -1
- package/lib/player/HlsEngine.cjs.map +1 -1
- package/lib/player/HlsEngine.d.cts +1 -1
- package/lib/player/PlaceholderLayer.cjs.map +1 -1
- package/lib/player/PlayerControls.cjs.map +1 -1
- package/lib/player/PlayerControls.d.cts +1 -1
- package/lib/player/Scte35CueManager.cjs.map +1 -1
- package/lib/player/Scte35CueManager.d.cts +1 -1
- package/lib/player/Scte35Parser.cjs.map +1 -1
- package/lib/player/Scte35Parser.d.cts +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +222 -82
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/player/playerTypes.cjs.map +1 -1
- package/lib/player/playerTypes.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +222 -82
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +222 -82
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +194 -52
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/{types-DpbgEvSH.d.cts → types-cTqIKw_D.d.cts} +0 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +222 -82
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/ctvVastSignals.cjs.map +1 -1
- package/lib/utils/devUrl.cjs.map +1 -1
- package/lib/utils/mqttClient.cjs.map +1 -1
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs +7 -19
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/lib/utils/vastEnvironmentSignals.cjs +0 -4
- package/lib/utils/vastEnvironmentSignals.cjs.map +1 -1
- package/lib/utils/vastEnvironmentSignals.d.cts +1 -2
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastTrackingMacros.cjs +185 -0
- package/lib/utils/vastTrackingMacros.cjs.map +1 -0
- package/lib/utils/vastTrackingMacros.d.cts +19 -0
- package/package.json +1 -1
|
@@ -1164,19 +1164,8 @@ function buildPlayerMetricEvent() {
|
|
|
1164
1164
|
}).apply(this, arguments);
|
|
1165
1165
|
}
|
|
1166
1166
|
function publishTracking(licenseKey, channel, body) {
|
|
1167
|
-
var debug = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
1168
1167
|
ensureMQTTClient();
|
|
1169
|
-
|
|
1170
|
-
var published = publishMQTT(topic, body);
|
|
1171
|
-
if (debug) {
|
|
1172
|
-
console.log("[StormcloudVideoPlayer] publishTracking:", JSON.stringify({
|
|
1173
|
-
licenseKey: licenseKey,
|
|
1174
|
-
channel: channel,
|
|
1175
|
-
topic: topic,
|
|
1176
|
-
body: body,
|
|
1177
|
-
published: published
|
|
1178
|
-
}, null, 2));
|
|
1179
|
-
}
|
|
1168
|
+
publishMQTT(buildPlayerTopic(licenseKey, channel), body);
|
|
1180
1169
|
}
|
|
1181
1170
|
function sendAdLoadedTracking(_0, _1) {
|
|
1182
1171
|
return _async_to_generator(function(licenseKey, adLoadedInfo) {
|
|
@@ -1224,7 +1213,7 @@ function sendAdLoadedTracking(_0, _1) {
|
|
|
1224
1213
|
}
|
|
1225
1214
|
function sendAdImpressionTracking(_0, _1) {
|
|
1226
1215
|
return _async_to_generator(function(licenseKey, adImpressionInfo) {
|
|
1227
|
-
var context,
|
|
1216
|
+
var context, metricEvent, error;
|
|
1228
1217
|
var _arguments = arguments;
|
|
1229
1218
|
return _ts_generator(this, function(_state) {
|
|
1230
1219
|
switch(_state.label){
|
|
@@ -1249,18 +1238,17 @@ function sendAdImpressionTracking(_0, _1) {
|
|
|
1249
1238
|
];
|
|
1250
1239
|
case 2:
|
|
1251
1240
|
metricEvent = _state.sent();
|
|
1252
|
-
publishTracking(licenseKey, "heartbeat", metricEvent
|
|
1241
|
+
publishTracking(licenseKey, "heartbeat", metricEvent);
|
|
1253
1242
|
publishTracking(licenseKey, "impressions", {
|
|
1254
1243
|
events: [
|
|
1255
1244
|
{
|
|
1256
|
-
event_id: createUuid(),
|
|
1257
1245
|
player_id: metricEvent.player_id,
|
|
1258
1246
|
ad_played_count: 1,
|
|
1259
|
-
ad_url:
|
|
1247
|
+
ad_url: adImpressionInfo.adUrl,
|
|
1260
1248
|
capture_at: adImpressionInfo.timestamp
|
|
1261
1249
|
}
|
|
1262
1250
|
]
|
|
1263
|
-
}
|
|
1251
|
+
});
|
|
1264
1252
|
return [
|
|
1265
1253
|
3,
|
|
1266
1254
|
4
|
|
@@ -1305,7 +1293,7 @@ function sendHeartbeat(_0) {
|
|
|
1305
1293
|
];
|
|
1306
1294
|
case 2:
|
|
1307
1295
|
heartbeatData = _state.sent();
|
|
1308
|
-
publishTracking(licenseKey, "heartbeat", heartbeatData
|
|
1296
|
+
publishTracking(licenseKey, "heartbeat", heartbeatData);
|
|
1309
1297
|
return [
|
|
1310
1298
|
3,
|
|
1311
1299
|
4
|
|
@@ -1385,22 +1373,27 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1385
1373
|
console.log("[POD] Playing pod ad ".concat((payload === null || payload === void 0 ? void 0 : payload.index) != null ? payload.index + 1 : "?", "/").concat((_ref = payload === null || payload === void 0 ? void 0 : payload.total) !== null && _ref !== void 0 ? _ref : "?"));
|
|
1386
1374
|
}
|
|
1387
1375
|
});
|
|
1388
|
-
adPlayer.on("
|
|
1389
|
-
|
|
1376
|
+
adPlayer.on("all_ads_completed", function() {
|
|
1377
|
+
sendAdImpressionTracking(_this.host.config.licenseKey, {
|
|
1390
1378
|
source: "hls",
|
|
1391
1379
|
adIndex: _this.timing.currentAdIndex,
|
|
1392
1380
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1381
|
+
}, _this.analyticsContext).catch(function() {});
|
|
1382
|
+
_this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
|
|
1383
|
+
var remaining = _this.timing.getRemainingAdMs();
|
|
1384
|
+
_this.timing.consecutiveFailures = 0;
|
|
1385
|
+
if (_this.debug) {
|
|
1386
|
+
console.log("[StormcloudVideoPlayer] all_ads_completed event received - remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length), _this.adRequestQueue.length > 0 ? {
|
|
1387
|
+
queuedUrls: _to_consumable_array(_this.adRequestQueue)
|
|
1388
|
+
} : {});
|
|
1398
1389
|
}
|
|
1399
|
-
|
|
1400
|
-
if (_this.
|
|
1401
|
-
|
|
1390
|
+
if (_this.inAdBreak) {
|
|
1391
|
+
if (_this.timing.hasTimeToStartAnotherAd()) {
|
|
1392
|
+
_this.tryNextAvailableAdWithRateLimit();
|
|
1393
|
+
} else {
|
|
1394
|
+
_this.handleAdPodComplete();
|
|
1402
1395
|
}
|
|
1403
|
-
}
|
|
1396
|
+
}
|
|
1404
1397
|
});
|
|
1405
1398
|
adPlayer.on("ad_error", function(errorPayload) {
|
|
1406
1399
|
var errorMessage = "Ad playback failed";
|
|
@@ -1443,6 +1436,11 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1443
1436
|
}
|
|
1444
1437
|
});
|
|
1445
1438
|
adPlayer.on("content_resume", function() {
|
|
1439
|
+
sendAdImpressionTracking(_this.host.config.licenseKey, {
|
|
1440
|
+
source: "hls",
|
|
1441
|
+
adIndex: _this.timing.currentAdIndex,
|
|
1442
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1443
|
+
}, _this.analyticsContext).catch(function() {});
|
|
1446
1444
|
if (!_this.host.video.muted) {
|
|
1447
1445
|
_this.host.video.muted = true;
|
|
1448
1446
|
if (_this.debug) {
|