stormcloud-video-player 0.8.55 → 0.8.57
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/README.md +2 -2
- package/dist/stormcloud-vp.min.js +1 -3
- package/lib/index.cjs +377 -359
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +12 -30
- package/lib/index.d.ts +12 -30
- package/lib/index.js +357 -303
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +140 -212
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -1
- package/lib/player/AdConfigManager.cjs +103 -211
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +1 -2
- package/lib/player/AdTimingService.cjs.map +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 +350 -281
- 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/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +350 -281
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +350 -281
- 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/sdk/pal.cjs.map +1 -1
- package/lib/{types-DpbgEvSH.d.cts → types-cTqIKw_D.d.cts} +0 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +350 -281
- 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/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs +135 -212
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/lib/utils/trackingIngest.cjs +322 -0
- package/lib/utils/trackingIngest.cjs.map +1 -0
- package/lib/utils/trackingIngest.d.cts +14 -0
- 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 -3
- package/lib/utils/mqttClient.cjs +0 -305
- package/lib/utils/mqttClient.cjs.map +0 -1
- package/lib/utils/mqttClient.d.cts +0 -13
- package/lib/utils/mqttConfig.cjs +0 -139
- package/lib/utils/mqttConfig.cjs.map +0 -1
- package/lib/utils/mqttConfig.d.cts +0 -20
- package/src/certs/emqxsl-ca.crt +0 -22
|
@@ -218,11 +218,9 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
218
218
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
219
219
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
220
220
|
}
|
|
221
|
-
var __create = Object.create;
|
|
222
221
|
var __defProp = Object.defineProperty;
|
|
223
222
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
224
223
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
225
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
226
224
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
227
225
|
var __export = function __export(target, all) {
|
|
228
226
|
for(var name in all)__defProp(target, name, {
|
|
@@ -261,16 +259,6 @@ var __copyProps = function __copyProps(to, from, except, desc) {
|
|
|
261
259
|
}
|
|
262
260
|
return to;
|
|
263
261
|
};
|
|
264
|
-
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
265
|
-
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
266
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
267
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
268
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
269
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
270
|
-
value: mod,
|
|
271
|
-
enumerable: true
|
|
272
|
-
}) : target, mod);
|
|
273
|
-
};
|
|
274
262
|
var __toCommonJS = function __toCommonJS(mod) {
|
|
275
263
|
return __copyProps(__defProp({}, "__esModule", {
|
|
276
264
|
value: true
|
|
@@ -284,160 +272,83 @@ __export(AdBreakOrchestrator_exports, {
|
|
|
284
272
|
}
|
|
285
273
|
});
|
|
286
274
|
module.exports = __toCommonJS(AdBreakOrchestrator_exports);
|
|
287
|
-
// src/utils/
|
|
288
|
-
var
|
|
275
|
+
// src/utils/trackingIngest.ts
|
|
276
|
+
var DEFAULT_TRACKING_INGEST_CONFIG = {
|
|
289
277
|
enabled: true,
|
|
290
|
-
|
|
291
|
-
brokerPort: 8883,
|
|
292
|
-
wsPort: 8084,
|
|
293
|
-
username: "for-sonifi",
|
|
294
|
-
password: "sonifi-mqtt",
|
|
295
|
-
topicPrefix: "adstorm/players",
|
|
296
|
-
qos: 1
|
|
278
|
+
baseUrl: "https://player-analytics-ingest-api-760490581852.us-central1.run.app/api/adstorm/player-tracking"
|
|
297
279
|
};
|
|
298
|
-
var
|
|
299
|
-
function
|
|
300
|
-
return
|
|
301
|
-
}
|
|
302
|
-
function buildMQTTBrokerUrl() {
|
|
303
|
-
if (mqttConfig.brokerUrl) return mqttConfig.brokerUrl;
|
|
304
|
-
return "wss://".concat(mqttConfig.brokerAddress, ":").concat(mqttConfig.wsPort, "/mqtt");
|
|
305
|
-
}
|
|
306
|
-
function buildPlayerTopic(licenseKey, channel) {
|
|
307
|
-
return "".concat(mqttConfig.topicPrefix, "/").concat(licenseKey, "/").concat(channel);
|
|
280
|
+
var trackingIngestConfig = _object_spread({}, DEFAULT_TRACKING_INGEST_CONFIG);
|
|
281
|
+
function isTrackingIngestEnabled() {
|
|
282
|
+
return trackingIngestConfig.enabled === true;
|
|
308
283
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
var LOG = "[StormcloudVideoPlayer][MQTT]";
|
|
312
|
-
var KEEPALIVE_SECONDS = 30;
|
|
313
|
-
var CONNECT_TIMEOUT_MS = 1e4;
|
|
314
|
-
var RECONNECT_BASE_MS = 5e3;
|
|
315
|
-
var RECONNECT_MAX_MS = 6e4;
|
|
316
|
-
var MAX_RECONNECT_ATTEMPTS = 8;
|
|
317
|
-
var COOLDOWN_MS = 10 * 6e4;
|
|
318
|
-
var client = null;
|
|
319
|
-
var status = "disconnected";
|
|
320
|
-
var reconnectAttempts = 0;
|
|
321
|
-
var reconnectTimer = null;
|
|
322
|
-
var stopped = false;
|
|
323
|
-
function clearReconnectTimer() {
|
|
324
|
-
if (reconnectTimer) {
|
|
325
|
-
clearTimeout(reconnectTimer);
|
|
326
|
-
reconnectTimer = null;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
function teardownClient() {
|
|
330
|
-
if (client) {
|
|
331
|
-
try {
|
|
332
|
-
client.removeAllListeners();
|
|
333
|
-
client.end(true);
|
|
334
|
-
} catch (unused) {}
|
|
335
|
-
client = null;
|
|
336
|
-
}
|
|
284
|
+
function normalizeIngestBaseUrl(baseUrl) {
|
|
285
|
+
return baseUrl.replace(/\/+$/, "");
|
|
337
286
|
}
|
|
338
|
-
function
|
|
339
|
-
|
|
340
|
-
if (
|
|
341
|
-
|
|
342
|
-
teardownClient();
|
|
343
|
-
status = "disconnected";
|
|
344
|
-
reconnectTimer = setTimeout(function() {
|
|
345
|
-
reconnectTimer = null;
|
|
346
|
-
reconnectAttempts = 0;
|
|
347
|
-
openConnection();
|
|
348
|
-
}, COOLDOWN_MS);
|
|
349
|
-
return;
|
|
287
|
+
function buildTrackingIngestUrl(channel) {
|
|
288
|
+
var base = normalizeIngestBaseUrl(trackingIngestConfig.baseUrl);
|
|
289
|
+
if (channel === "impressions") {
|
|
290
|
+
return "".concat(base, "/impressions/ingest");
|
|
350
291
|
}
|
|
351
|
-
|
|
352
|
-
var jitter = Math.floor(Math.random() * 1e3);
|
|
353
|
-
reconnectAttempts += 1;
|
|
354
|
-
reconnectTimer = setTimeout(function() {
|
|
355
|
-
reconnectTimer = null;
|
|
356
|
-
openConnection();
|
|
357
|
-
}, delay + jitter);
|
|
292
|
+
return "".concat(base, "/metrics/ingest");
|
|
358
293
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
stopped = false;
|
|
416
|
-
reconnectAttempts = 0;
|
|
417
|
-
openConnection();
|
|
418
|
-
}
|
|
419
|
-
function ensureMQTTClient() {
|
|
420
|
-
if (isMQTTEnabled() && !client && !reconnectTimer) {
|
|
421
|
-
initMQTTClient();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function publishMQTT(topic, payload) {
|
|
425
|
-
if (!isMQTTEnabled()) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
ensureMQTTClient();
|
|
429
|
-
if (!client || !client.connected) {
|
|
430
|
-
return false;
|
|
431
|
-
}
|
|
432
|
-
try {
|
|
433
|
-
client.publish(topic, JSON.stringify(payload), {
|
|
434
|
-
qos: mqttConfig.qos
|
|
294
|
+
function ingestPlayerTracking(licenseKey, channel, body) {
|
|
295
|
+
return _async_to_generator(function() {
|
|
296
|
+
var response, error;
|
|
297
|
+
return _ts_generator(this, function(_state) {
|
|
298
|
+
switch(_state.label){
|
|
299
|
+
case 0:
|
|
300
|
+
if (!isTrackingIngestEnabled() || !licenseKey) {
|
|
301
|
+
return [
|
|
302
|
+
2,
|
|
303
|
+
false
|
|
304
|
+
];
|
|
305
|
+
}
|
|
306
|
+
_state.label = 1;
|
|
307
|
+
case 1:
|
|
308
|
+
_state.trys.push([
|
|
309
|
+
1,
|
|
310
|
+
3,
|
|
311
|
+
,
|
|
312
|
+
4
|
|
313
|
+
]);
|
|
314
|
+
return [
|
|
315
|
+
4,
|
|
316
|
+
fetch(buildTrackingIngestUrl(channel), {
|
|
317
|
+
method: "POST",
|
|
318
|
+
headers: {
|
|
319
|
+
"Content-Type": "application/json",
|
|
320
|
+
Authorization: "License-Key ".concat(licenseKey)
|
|
321
|
+
},
|
|
322
|
+
body: JSON.stringify(body)
|
|
323
|
+
})
|
|
324
|
+
];
|
|
325
|
+
case 2:
|
|
326
|
+
response = _state.sent();
|
|
327
|
+
if (!response.ok) {
|
|
328
|
+
console.warn("[StormcloudVideoPlayer] Tracking ingest failed (".concat(response.status, ") for ").concat(channel));
|
|
329
|
+
return [
|
|
330
|
+
2,
|
|
331
|
+
false
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
return [
|
|
335
|
+
2,
|
|
336
|
+
true
|
|
337
|
+
];
|
|
338
|
+
case 3:
|
|
339
|
+
error = _state.sent();
|
|
340
|
+
console.warn("[StormcloudVideoPlayer] Tracking ingest error for ".concat(channel, ":"), error);
|
|
341
|
+
return [
|
|
342
|
+
2,
|
|
343
|
+
false
|
|
344
|
+
];
|
|
345
|
+
case 4:
|
|
346
|
+
return [
|
|
347
|
+
2
|
|
348
|
+
];
|
|
349
|
+
}
|
|
435
350
|
});
|
|
436
|
-
|
|
437
|
-
} catch (err) {
|
|
438
|
-
console.warn("".concat(LOG, " publish failed on ").concat(topic, ":"), err);
|
|
439
|
-
return false;
|
|
440
|
-
}
|
|
351
|
+
})();
|
|
441
352
|
}
|
|
442
353
|
// src/utils/vastEnvironmentSignals.ts
|
|
443
354
|
var PLAYER_ID_STORAGE_KEY = "stormcloud.player.id";
|
|
@@ -1121,7 +1032,7 @@ function getBrowserID(clientInfo) {
|
|
|
1121
1032
|
})();
|
|
1122
1033
|
}
|
|
1123
1034
|
function canPublish(licenseKey) {
|
|
1124
|
-
return Boolean(
|
|
1035
|
+
return Boolean(isTrackingIngestEnabled() && licenseKey);
|
|
1125
1036
|
}
|
|
1126
1037
|
function buildPlayerMetricEvent() {
|
|
1127
1038
|
return _async_to_generator(function() {
|
|
@@ -1163,21 +1074,6 @@ function buildPlayerMetricEvent() {
|
|
|
1163
1074
|
});
|
|
1164
1075
|
}).apply(this, arguments);
|
|
1165
1076
|
}
|
|
1166
|
-
function publishTracking(licenseKey, channel, body) {
|
|
1167
|
-
var debug = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
1168
|
-
ensureMQTTClient();
|
|
1169
|
-
var topic = buildPlayerTopic(licenseKey, channel);
|
|
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
|
-
}
|
|
1180
|
-
}
|
|
1181
1077
|
function sendAdLoadedTracking(_0, _1) {
|
|
1182
1078
|
return _async_to_generator(function(licenseKey, adLoadedInfo) {
|
|
1183
1079
|
var context, error;
|
|
@@ -1224,7 +1120,7 @@ function sendAdLoadedTracking(_0, _1) {
|
|
|
1224
1120
|
}
|
|
1225
1121
|
function sendAdImpressionTracking(_0, _1) {
|
|
1226
1122
|
return _async_to_generator(function(licenseKey, adImpressionInfo) {
|
|
1227
|
-
var context,
|
|
1123
|
+
var context, metricEvent, error;
|
|
1228
1124
|
var _arguments = arguments;
|
|
1229
1125
|
return _ts_generator(this, function(_state) {
|
|
1230
1126
|
switch(_state.label){
|
|
@@ -1237,9 +1133,9 @@ function sendAdImpressionTracking(_0, _1) {
|
|
|
1237
1133
|
case 1:
|
|
1238
1134
|
_state.trys.push([
|
|
1239
1135
|
1,
|
|
1240
|
-
|
|
1136
|
+
5,
|
|
1241
1137
|
,
|
|
1242
|
-
|
|
1138
|
+
6
|
|
1243
1139
|
]);
|
|
1244
1140
|
return [
|
|
1245
1141
|
4,
|
|
@@ -1249,30 +1145,43 @@ function sendAdImpressionTracking(_0, _1) {
|
|
|
1249
1145
|
];
|
|
1250
1146
|
case 2:
|
|
1251
1147
|
metricEvent = _state.sent();
|
|
1252
|
-
publishTracking(licenseKey, "heartbeat", metricEvent, !!context.debugAdTiming);
|
|
1253
|
-
publishTracking(licenseKey, "impressions", {
|
|
1254
|
-
events: [
|
|
1255
|
-
{
|
|
1256
|
-
event_id: createUuid(),
|
|
1257
|
-
player_id: metricEvent.player_id,
|
|
1258
|
-
ad_played_count: 1,
|
|
1259
|
-
ad_url: (_adImpressionInfo_adUrl = adImpressionInfo.adUrl) !== null && _adImpressionInfo_adUrl !== void 0 ? _adImpressionInfo_adUrl : adImpressionInfo.adId,
|
|
1260
|
-
capture_at: adImpressionInfo.timestamp
|
|
1261
|
-
}
|
|
1262
|
-
]
|
|
1263
|
-
}, !!context.debugAdTiming);
|
|
1264
1148
|
return [
|
|
1265
|
-
|
|
1266
|
-
|
|
1149
|
+
4,
|
|
1150
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
1151
|
+
events: [
|
|
1152
|
+
metricEvent
|
|
1153
|
+
]
|
|
1154
|
+
})
|
|
1267
1155
|
];
|
|
1268
1156
|
case 3:
|
|
1157
|
+
_state.sent();
|
|
1158
|
+
return [
|
|
1159
|
+
4,
|
|
1160
|
+
ingestPlayerTracking(licenseKey, "impressions", {
|
|
1161
|
+
events: [
|
|
1162
|
+
{
|
|
1163
|
+
player_id: metricEvent.player_id,
|
|
1164
|
+
ad_played_count: 1,
|
|
1165
|
+
ad_url: adImpressionInfo.adUrl,
|
|
1166
|
+
capture_at: adImpressionInfo.timestamp
|
|
1167
|
+
}
|
|
1168
|
+
]
|
|
1169
|
+
})
|
|
1170
|
+
];
|
|
1171
|
+
case 4:
|
|
1172
|
+
_state.sent();
|
|
1173
|
+
return [
|
|
1174
|
+
3,
|
|
1175
|
+
6
|
|
1176
|
+
];
|
|
1177
|
+
case 5:
|
|
1269
1178
|
error = _state.sent();
|
|
1270
1179
|
console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
|
|
1271
1180
|
return [
|
|
1272
1181
|
3,
|
|
1273
|
-
|
|
1182
|
+
6
|
|
1274
1183
|
];
|
|
1275
|
-
case
|
|
1184
|
+
case 6:
|
|
1276
1185
|
return [
|
|
1277
1186
|
2
|
|
1278
1187
|
];
|
|
@@ -1295,9 +1204,9 @@ function sendHeartbeat(_0) {
|
|
|
1295
1204
|
case 1:
|
|
1296
1205
|
_state.trys.push([
|
|
1297
1206
|
1,
|
|
1298
|
-
|
|
1207
|
+
4,
|
|
1299
1208
|
,
|
|
1300
|
-
|
|
1209
|
+
5
|
|
1301
1210
|
]);
|
|
1302
1211
|
return [
|
|
1303
1212
|
4,
|
|
@@ -1305,19 +1214,28 @@ function sendHeartbeat(_0) {
|
|
|
1305
1214
|
];
|
|
1306
1215
|
case 2:
|
|
1307
1216
|
heartbeatData = _state.sent();
|
|
1308
|
-
publishTracking(licenseKey, "heartbeat", heartbeatData, !!context.debugAdTiming);
|
|
1309
1217
|
return [
|
|
1310
|
-
|
|
1311
|
-
|
|
1218
|
+
4,
|
|
1219
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
1220
|
+
events: [
|
|
1221
|
+
heartbeatData
|
|
1222
|
+
]
|
|
1223
|
+
})
|
|
1312
1224
|
];
|
|
1313
1225
|
case 3:
|
|
1226
|
+
_state.sent();
|
|
1227
|
+
return [
|
|
1228
|
+
3,
|
|
1229
|
+
5
|
|
1230
|
+
];
|
|
1231
|
+
case 4:
|
|
1314
1232
|
error = _state.sent();
|
|
1315
1233
|
console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
|
|
1316
1234
|
return [
|
|
1317
1235
|
3,
|
|
1318
|
-
|
|
1236
|
+
5
|
|
1319
1237
|
];
|
|
1320
|
-
case
|
|
1238
|
+
case 5:
|
|
1321
1239
|
return [
|
|
1322
1240
|
2
|
|
1323
1241
|
];
|
|
@@ -1385,22 +1303,27 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1385
1303
|
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
1304
|
}
|
|
1387
1305
|
});
|
|
1388
|
-
adPlayer.on("
|
|
1389
|
-
|
|
1306
|
+
adPlayer.on("all_ads_completed", function() {
|
|
1307
|
+
sendAdImpressionTracking(_this.host.config.licenseKey, {
|
|
1390
1308
|
source: "hls",
|
|
1391
1309
|
adIndex: _this.timing.currentAdIndex,
|
|
1392
1310
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1311
|
+
}, _this.analyticsContext).catch(function() {});
|
|
1312
|
+
_this.timing.recordPlayedAdDuration(_this.host.getAdPlayer());
|
|
1313
|
+
var remaining = _this.timing.getRemainingAdMs();
|
|
1314
|
+
_this.timing.consecutiveFailures = 0;
|
|
1315
|
+
if (_this.debug) {
|
|
1316
|
+
console.log("[StormcloudVideoPlayer] all_ads_completed event received - remaining=".concat(remaining, "ms, queued ads=").concat(_this.adRequestQueue.length), _this.adRequestQueue.length > 0 ? {
|
|
1317
|
+
queuedUrls: _to_consumable_array(_this.adRequestQueue)
|
|
1318
|
+
} : {});
|
|
1398
1319
|
}
|
|
1399
|
-
|
|
1400
|
-
if (_this.
|
|
1401
|
-
|
|
1320
|
+
if (_this.inAdBreak) {
|
|
1321
|
+
if (_this.timing.hasTimeToStartAnotherAd()) {
|
|
1322
|
+
_this.tryNextAvailableAdWithRateLimit();
|
|
1323
|
+
} else {
|
|
1324
|
+
_this.handleAdPodComplete();
|
|
1402
1325
|
}
|
|
1403
|
-
}
|
|
1326
|
+
}
|
|
1404
1327
|
});
|
|
1405
1328
|
adPlayer.on("ad_error", function(errorPayload) {
|
|
1406
1329
|
var errorMessage = "Ad playback failed";
|
|
@@ -1443,6 +1366,11 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
1443
1366
|
}
|
|
1444
1367
|
});
|
|
1445
1368
|
adPlayer.on("content_resume", function() {
|
|
1369
|
+
sendAdImpressionTracking(_this.host.config.licenseKey, {
|
|
1370
|
+
source: "hls",
|
|
1371
|
+
adIndex: _this.timing.currentAdIndex,
|
|
1372
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1373
|
+
}, _this.analyticsContext).catch(function() {});
|
|
1446
1374
|
if (!_this.host.video.muted) {
|
|
1447
1375
|
_this.host.video.muted = true;
|
|
1448
1376
|
if (_this.debug) {
|