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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-
|
|
1
|
+
import { S as Scte35Marker, a as StormcloudVideoPlayerConfig, A as AdController } from '../types-cTqIKw_D.cjs';
|
|
2
2
|
import { AdTimingService } from './AdTimingService.cjs';
|
|
3
3
|
import { AdConfigManager } from './AdConfigManager.cjs';
|
|
4
4
|
import { Scte35CueManager } from './Scte35CueManager.cjs';
|
|
@@ -254,11 +254,9 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
254
254
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
255
255
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
256
256
|
}
|
|
257
|
-
var __create = Object.create;
|
|
258
257
|
var __defProp = Object.defineProperty;
|
|
259
258
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
260
259
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
261
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
262
260
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
263
261
|
var __export = function __export(target, all) {
|
|
264
262
|
for(var name in all)__defProp(target, name, {
|
|
@@ -297,16 +295,6 @@ var __copyProps = function __copyProps(to, from, except, desc) {
|
|
|
297
295
|
}
|
|
298
296
|
return to;
|
|
299
297
|
};
|
|
300
|
-
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
301
|
-
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
302
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
303
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
304
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
305
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
306
|
-
value: mod,
|
|
307
|
-
enumerable: true
|
|
308
|
-
}) : target, mod);
|
|
309
|
-
};
|
|
310
298
|
var __toCommonJS = function __toCommonJS(mod) {
|
|
311
299
|
return __copyProps(__defProp({}, "__esModule", {
|
|
312
300
|
value: true
|
|
@@ -1282,163 +1270,83 @@ function toDevSafeUrl(rawUrl) {
|
|
|
1282
1270
|
var cleanPath = url.pathname.replace(/\/{2,}/g, "/") || "/index.html";
|
|
1283
1271
|
return "file://".concat(cleanPath);
|
|
1284
1272
|
}
|
|
1285
|
-
// src/utils/
|
|
1286
|
-
var
|
|
1273
|
+
// src/utils/trackingIngest.ts
|
|
1274
|
+
var DEFAULT_TRACKING_INGEST_CONFIG = {
|
|
1287
1275
|
enabled: true,
|
|
1288
|
-
|
|
1289
|
-
brokerPort: 8883,
|
|
1290
|
-
wsPort: 8084,
|
|
1291
|
-
username: "for-sonifi",
|
|
1292
|
-
password: "sonifi-mqtt",
|
|
1293
|
-
topicPrefix: "adstorm/players",
|
|
1294
|
-
qos: 1
|
|
1276
|
+
baseUrl: "https://player-analytics-ingest-api-760490581852.us-central1.run.app/api/adstorm/player-tracking"
|
|
1295
1277
|
};
|
|
1296
|
-
var
|
|
1297
|
-
function
|
|
1298
|
-
|
|
1299
|
-
}
|
|
1300
|
-
function isMQTTEnabled() {
|
|
1301
|
-
return mqttConfig.enabled;
|
|
1302
|
-
}
|
|
1303
|
-
function buildMQTTBrokerUrl() {
|
|
1304
|
-
if (mqttConfig.brokerUrl) return mqttConfig.brokerUrl;
|
|
1305
|
-
return "wss://".concat(mqttConfig.brokerAddress, ":").concat(mqttConfig.wsPort, "/mqtt");
|
|
1306
|
-
}
|
|
1307
|
-
function buildPlayerTopic(licenseKey, channel) {
|
|
1308
|
-
return "".concat(mqttConfig.topicPrefix, "/").concat(licenseKey, "/").concat(channel);
|
|
1309
|
-
}
|
|
1310
|
-
// src/utils/mqttClient.ts
|
|
1311
|
-
var import_mqtt = __toESM(require("mqtt"), 1);
|
|
1312
|
-
var LOG = "[StormcloudVideoPlayer][MQTT]";
|
|
1313
|
-
var KEEPALIVE_SECONDS = 30;
|
|
1314
|
-
var CONNECT_TIMEOUT_MS = 1e4;
|
|
1315
|
-
var RECONNECT_BASE_MS = 5e3;
|
|
1316
|
-
var RECONNECT_MAX_MS = 6e4;
|
|
1317
|
-
var MAX_RECONNECT_ATTEMPTS = 8;
|
|
1318
|
-
var COOLDOWN_MS = 10 * 6e4;
|
|
1319
|
-
var client = null;
|
|
1320
|
-
var status = "disconnected";
|
|
1321
|
-
var reconnectAttempts = 0;
|
|
1322
|
-
var reconnectTimer = null;
|
|
1323
|
-
var stopped = false;
|
|
1324
|
-
function clearReconnectTimer() {
|
|
1325
|
-
if (reconnectTimer) {
|
|
1326
|
-
clearTimeout(reconnectTimer);
|
|
1327
|
-
reconnectTimer = null;
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
function teardownClient() {
|
|
1331
|
-
if (client) {
|
|
1332
|
-
try {
|
|
1333
|
-
client.removeAllListeners();
|
|
1334
|
-
client.end(true);
|
|
1335
|
-
} catch (unused) {}
|
|
1336
|
-
client = null;
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
function scheduleReconnect() {
|
|
1340
|
-
if (stopped || !isMQTTEnabled() || reconnectTimer) return;
|
|
1341
|
-
if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
|
|
1342
|
-
console.warn("".concat(LOG, " giving up after ").concat(reconnectAttempts, " attempts; cooling down for ").concat(COOLDOWN_MS / 6e4, "m"));
|
|
1343
|
-
teardownClient();
|
|
1344
|
-
status = "disconnected";
|
|
1345
|
-
reconnectTimer = setTimeout(function() {
|
|
1346
|
-
reconnectTimer = null;
|
|
1347
|
-
reconnectAttempts = 0;
|
|
1348
|
-
openConnection();
|
|
1349
|
-
}, COOLDOWN_MS);
|
|
1350
|
-
return;
|
|
1351
|
-
}
|
|
1352
|
-
var delay = Math.min(RECONNECT_MAX_MS, RECONNECT_BASE_MS * Math.pow(2, reconnectAttempts));
|
|
1353
|
-
var jitter = Math.floor(Math.random() * 1e3);
|
|
1354
|
-
reconnectAttempts += 1;
|
|
1355
|
-
reconnectTimer = setTimeout(function() {
|
|
1356
|
-
reconnectTimer = null;
|
|
1357
|
-
openConnection();
|
|
1358
|
-
}, delay + jitter);
|
|
1359
|
-
}
|
|
1360
|
-
function openConnection() {
|
|
1361
|
-
if (stopped || !isMQTTEnabled()) return;
|
|
1362
|
-
teardownClient();
|
|
1363
|
-
var url = buildMQTTBrokerUrl();
|
|
1364
|
-
status = "connecting";
|
|
1365
|
-
var clientId = "stormcloud-vp-".concat(Math.random().toString(36).slice(2, 9));
|
|
1366
|
-
try {
|
|
1367
|
-
client = import_mqtt.default.connect(url, {
|
|
1368
|
-
clientId: clientId,
|
|
1369
|
-
username: mqttConfig.username,
|
|
1370
|
-
password: mqttConfig.password,
|
|
1371
|
-
keepalive: KEEPALIVE_SECONDS,
|
|
1372
|
-
clean: true,
|
|
1373
|
-
// Disable MQTT.js internal reconnect; we manage reconnection ourselves.
|
|
1374
|
-
reconnectPeriod: 0,
|
|
1375
|
-
connectTimeout: CONNECT_TIMEOUT_MS,
|
|
1376
|
-
queueQoSZero: false,
|
|
1377
|
-
reschedulePings: true,
|
|
1378
|
-
// Root-cause fix for the Tizen 4.0 "Keepalive timeout" loop: MQTT.js's
|
|
1379
|
-
// default timerVariant "auto" runs the keepalive interval inside a
|
|
1380
|
-
// Blob-URL Web Worker (via worker-timers). On Samsung Tizen 4.0 (old
|
|
1381
|
-
// WebKit) served from a file:// origin that worker can't tick reliably,
|
|
1382
|
-
// so the keepalive counter trips onKeepaliveTimeout almost immediately
|
|
1383
|
-
// after connect. Force the native setInterval timer instead; the main
|
|
1384
|
-
// thread is free because video is decoded by the native AVPlay pipeline.
|
|
1385
|
-
timerVariant: "native"
|
|
1386
|
-
});
|
|
1387
|
-
} catch (err) {
|
|
1388
|
-
status = "error";
|
|
1389
|
-
console.warn("".concat(LOG, " connect() threw:"), err);
|
|
1390
|
-
scheduleReconnect();
|
|
1391
|
-
return;
|
|
1392
|
-
}
|
|
1393
|
-
client.on("connect", function() {
|
|
1394
|
-
status = "connected";
|
|
1395
|
-
reconnectAttempts = 0;
|
|
1396
|
-
clearReconnectTimer();
|
|
1397
|
-
console.info("".concat(LOG, " connected to ").concat(url));
|
|
1398
|
-
});
|
|
1399
|
-
client.on("offline", function() {
|
|
1400
|
-
if (status === "connected") status = "disconnected";
|
|
1401
|
-
console.warn("".concat(LOG, " offline"));
|
|
1402
|
-
scheduleReconnect();
|
|
1403
|
-
});
|
|
1404
|
-
client.on("error", function(err) {
|
|
1405
|
-
status = "error";
|
|
1406
|
-
console.warn("".concat(LOG, " error:"), err.message);
|
|
1407
|
-
scheduleReconnect();
|
|
1408
|
-
});
|
|
1409
|
-
client.on("close", function() {
|
|
1410
|
-
if (status === "connected") status = "disconnected";
|
|
1411
|
-
scheduleReconnect();
|
|
1412
|
-
});
|
|
1278
|
+
var trackingIngestConfig = _object_spread({}, DEFAULT_TRACKING_INGEST_CONFIG);
|
|
1279
|
+
function isTrackingIngestEnabled() {
|
|
1280
|
+
return trackingIngestConfig.enabled === true;
|
|
1413
1281
|
}
|
|
1414
|
-
function
|
|
1415
|
-
|
|
1416
|
-
stopped = false;
|
|
1417
|
-
reconnectAttempts = 0;
|
|
1418
|
-
openConnection();
|
|
1282
|
+
function normalizeIngestBaseUrl(baseUrl) {
|
|
1283
|
+
return baseUrl.replace(/\/+$/, "");
|
|
1419
1284
|
}
|
|
1420
|
-
function
|
|
1421
|
-
|
|
1422
|
-
|
|
1285
|
+
function buildTrackingIngestUrl(channel) {
|
|
1286
|
+
var base = normalizeIngestBaseUrl(trackingIngestConfig.baseUrl);
|
|
1287
|
+
if (channel === "impressions") {
|
|
1288
|
+
return "".concat(base, "/impressions/ingest");
|
|
1423
1289
|
}
|
|
1290
|
+
return "".concat(base, "/metrics/ingest");
|
|
1424
1291
|
}
|
|
1425
|
-
function
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1292
|
+
function ingestPlayerTracking(licenseKey, channel, body) {
|
|
1293
|
+
return _async_to_generator(function() {
|
|
1294
|
+
var response, error;
|
|
1295
|
+
return _ts_generator(this, function(_state) {
|
|
1296
|
+
switch(_state.label){
|
|
1297
|
+
case 0:
|
|
1298
|
+
if (!isTrackingIngestEnabled() || !licenseKey) {
|
|
1299
|
+
return [
|
|
1300
|
+
2,
|
|
1301
|
+
false
|
|
1302
|
+
];
|
|
1303
|
+
}
|
|
1304
|
+
_state.label = 1;
|
|
1305
|
+
case 1:
|
|
1306
|
+
_state.trys.push([
|
|
1307
|
+
1,
|
|
1308
|
+
3,
|
|
1309
|
+
,
|
|
1310
|
+
4
|
|
1311
|
+
]);
|
|
1312
|
+
return [
|
|
1313
|
+
4,
|
|
1314
|
+
fetch(buildTrackingIngestUrl(channel), {
|
|
1315
|
+
method: "POST",
|
|
1316
|
+
headers: {
|
|
1317
|
+
"Content-Type": "application/json",
|
|
1318
|
+
Authorization: "License-Key ".concat(licenseKey)
|
|
1319
|
+
},
|
|
1320
|
+
body: JSON.stringify(body)
|
|
1321
|
+
})
|
|
1322
|
+
];
|
|
1323
|
+
case 2:
|
|
1324
|
+
response = _state.sent();
|
|
1325
|
+
if (!response.ok) {
|
|
1326
|
+
console.warn("[StormcloudVideoPlayer] Tracking ingest failed (".concat(response.status, ") for ").concat(channel));
|
|
1327
|
+
return [
|
|
1328
|
+
2,
|
|
1329
|
+
false
|
|
1330
|
+
];
|
|
1331
|
+
}
|
|
1332
|
+
return [
|
|
1333
|
+
2,
|
|
1334
|
+
true
|
|
1335
|
+
];
|
|
1336
|
+
case 3:
|
|
1337
|
+
error = _state.sent();
|
|
1338
|
+
console.warn("[StormcloudVideoPlayer] Tracking ingest error for ".concat(channel, ":"), error);
|
|
1339
|
+
return [
|
|
1340
|
+
2,
|
|
1341
|
+
false
|
|
1342
|
+
];
|
|
1343
|
+
case 4:
|
|
1344
|
+
return [
|
|
1345
|
+
2
|
|
1346
|
+
];
|
|
1347
|
+
}
|
|
1436
1348
|
});
|
|
1437
|
-
|
|
1438
|
-
} catch (err) {
|
|
1439
|
-
console.warn("".concat(LOG, " publish failed on ").concat(topic, ":"), err);
|
|
1440
|
-
return false;
|
|
1441
|
-
}
|
|
1349
|
+
})();
|
|
1442
1350
|
}
|
|
1443
1351
|
// src/utils/tracking.ts
|
|
1444
1352
|
var cachedBrowserId = null;
|
|
@@ -1706,7 +1614,7 @@ function getBrowserID(clientInfo) {
|
|
|
1706
1614
|
})();
|
|
1707
1615
|
}
|
|
1708
1616
|
function canPublish(licenseKey) {
|
|
1709
|
-
return Boolean(
|
|
1617
|
+
return Boolean(isTrackingIngestEnabled() && licenseKey);
|
|
1710
1618
|
}
|
|
1711
1619
|
function buildPlayerMetricEvent() {
|
|
1712
1620
|
return _async_to_generator(function() {
|
|
@@ -1748,21 +1656,6 @@ function buildPlayerMetricEvent() {
|
|
|
1748
1656
|
});
|
|
1749
1657
|
}).apply(this, arguments);
|
|
1750
1658
|
}
|
|
1751
|
-
function publishTracking(licenseKey, channel, body) {
|
|
1752
|
-
var debug = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
1753
|
-
ensureMQTTClient();
|
|
1754
|
-
var topic = buildPlayerTopic(licenseKey, channel);
|
|
1755
|
-
var published = publishMQTT(topic, body);
|
|
1756
|
-
if (debug) {
|
|
1757
|
-
console.log("[StormcloudVideoPlayer] publishTracking:", JSON.stringify({
|
|
1758
|
-
licenseKey: licenseKey,
|
|
1759
|
-
channel: channel,
|
|
1760
|
-
topic: topic,
|
|
1761
|
-
body: body,
|
|
1762
|
-
published: published
|
|
1763
|
-
}, null, 2));
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
1659
|
function sendInitialTracking(_0) {
|
|
1767
1660
|
return _async_to_generator(function(licenseKey) {
|
|
1768
1661
|
var context, metricEvent, error;
|
|
@@ -1778,9 +1671,9 @@ function sendInitialTracking(_0) {
|
|
|
1778
1671
|
case 1:
|
|
1779
1672
|
_state.trys.push([
|
|
1780
1673
|
1,
|
|
1781
|
-
|
|
1674
|
+
4,
|
|
1782
1675
|
,
|
|
1783
|
-
|
|
1676
|
+
5
|
|
1784
1677
|
]);
|
|
1785
1678
|
return [
|
|
1786
1679
|
4,
|
|
@@ -1791,23 +1684,28 @@ function sendInitialTracking(_0) {
|
|
|
1791
1684
|
];
|
|
1792
1685
|
case 2:
|
|
1793
1686
|
metricEvent = _state.sent();
|
|
1794
|
-
publishTracking(licenseKey, "metrics", {
|
|
1795
|
-
events: [
|
|
1796
|
-
metricEvent
|
|
1797
|
-
]
|
|
1798
|
-
}, !!context.debugAdTiming);
|
|
1799
1687
|
return [
|
|
1800
|
-
|
|
1801
|
-
|
|
1688
|
+
4,
|
|
1689
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
1690
|
+
events: [
|
|
1691
|
+
metricEvent
|
|
1692
|
+
]
|
|
1693
|
+
})
|
|
1802
1694
|
];
|
|
1803
1695
|
case 3:
|
|
1696
|
+
_state.sent();
|
|
1697
|
+
return [
|
|
1698
|
+
3,
|
|
1699
|
+
5
|
|
1700
|
+
];
|
|
1701
|
+
case 4:
|
|
1804
1702
|
error = _state.sent();
|
|
1805
1703
|
console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
|
|
1806
1704
|
return [
|
|
1807
1705
|
3,
|
|
1808
|
-
|
|
1706
|
+
5
|
|
1809
1707
|
];
|
|
1810
|
-
case
|
|
1708
|
+
case 5:
|
|
1811
1709
|
return [
|
|
1812
1710
|
2
|
|
1813
1711
|
];
|
|
@@ -1830,9 +1728,9 @@ function sendHeartbeat(_0) {
|
|
|
1830
1728
|
case 1:
|
|
1831
1729
|
_state.trys.push([
|
|
1832
1730
|
1,
|
|
1833
|
-
|
|
1731
|
+
4,
|
|
1834
1732
|
,
|
|
1835
|
-
|
|
1733
|
+
5
|
|
1836
1734
|
]);
|
|
1837
1735
|
return [
|
|
1838
1736
|
4,
|
|
@@ -1840,19 +1738,28 @@ function sendHeartbeat(_0) {
|
|
|
1840
1738
|
];
|
|
1841
1739
|
case 2:
|
|
1842
1740
|
heartbeatData = _state.sent();
|
|
1843
|
-
publishTracking(licenseKey, "heartbeat", heartbeatData, !!context.debugAdTiming);
|
|
1844
1741
|
return [
|
|
1845
|
-
|
|
1846
|
-
|
|
1742
|
+
4,
|
|
1743
|
+
ingestPlayerTracking(licenseKey, "metrics", {
|
|
1744
|
+
events: [
|
|
1745
|
+
heartbeatData
|
|
1746
|
+
]
|
|
1747
|
+
})
|
|
1847
1748
|
];
|
|
1848
1749
|
case 3:
|
|
1750
|
+
_state.sent();
|
|
1751
|
+
return [
|
|
1752
|
+
3,
|
|
1753
|
+
5
|
|
1754
|
+
];
|
|
1755
|
+
case 4:
|
|
1849
1756
|
error = _state.sent();
|
|
1850
1757
|
console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
|
|
1851
1758
|
return [
|
|
1852
1759
|
3,
|
|
1853
|
-
|
|
1760
|
+
5
|
|
1854
1761
|
];
|
|
1855
|
-
case
|
|
1762
|
+
case 5:
|
|
1856
1763
|
return [
|
|
1857
1764
|
2
|
|
1858
1765
|
];
|
|
@@ -1977,7 +1884,6 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
1977
1884
|
];
|
|
1978
1885
|
case 4:
|
|
1979
1886
|
data = _state.sent();
|
|
1980
|
-
this.applyMqttConfigFromResponse(data);
|
|
1981
1887
|
imaPayload = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : (_data_response_ima = _data_response.ima) === null || _data_response_ima === void 0 ? void 0 : (_data_response_ima_publisherdeskima = _data_response_ima["publisherdesk.ima"]) === null || _data_response_ima_publisherdeskima === void 0 ? void 0 : _data_response_ima_publisherdeskima.payload;
|
|
1982
1888
|
if (imaPayload) {
|
|
1983
1889
|
decodedPayload = imaPayload;
|
|
@@ -2011,20 +1917,6 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
2011
1917
|
}).call(this);
|
|
2012
1918
|
}
|
|
2013
1919
|
},
|
|
2014
|
-
{
|
|
2015
|
-
key: "applyMqttConfigFromResponse",
|
|
2016
|
-
value: function applyMqttConfigFromResponse(data) {
|
|
2017
|
-
var _data_response;
|
|
2018
|
-
var mqttConfig2 = (_data_response = data.response) === null || _data_response === void 0 ? void 0 : _data_response.mqtt_config;
|
|
2019
|
-
if (!mqttConfig2 || (typeof mqttConfig2 === "undefined" ? "undefined" : _type_of(mqttConfig2)) !== "object") {
|
|
2020
|
-
return;
|
|
2021
|
-
}
|
|
2022
|
-
applyMQTTConfig(mqttConfig2);
|
|
2023
|
-
if (this.debug) {
|
|
2024
|
-
console.log("[StormcloudVideoPlayer] Applied MQTT config from /ads/web:", mqttConfig2);
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
},
|
|
2028
1920
|
{
|
|
2029
1921
|
key: "fetchAndParseVmap",
|
|
2030
1922
|
value: function fetchAndParseVmap(vmapUrl) {
|