stormcloud-video-player 0.8.3 → 0.8.5

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.
@@ -1371,6 +1371,99 @@ function createPalNonceManager() {
1371
1371
  }
1372
1372
  };
1373
1373
  }
1374
+ // src/utils/mqttConfig.ts
1375
+ var DEFAULT_MQTT_CONFIG = {
1376
+ enabled: true,
1377
+ brokerAddress: "vecbae77.ala.us-east-1.emqxsl.com",
1378
+ brokerPort: 8883,
1379
+ wsPort: 8084,
1380
+ username: "for-sonifi",
1381
+ password: "sonifi-mqtt",
1382
+ topicPrefix: "adstorm/players",
1383
+ qos: 1
1384
+ };
1385
+ var mqttConfig = _object_spread({}, DEFAULT_MQTT_CONFIG);
1386
+ function isMQTTEnabled() {
1387
+ return mqttConfig.enabled;
1388
+ }
1389
+ function buildMQTTBrokerUrl() {
1390
+ if (mqttConfig.brokerUrl) return mqttConfig.brokerUrl;
1391
+ return "wss://".concat(mqttConfig.brokerAddress, ":").concat(mqttConfig.wsPort, "/mqtt");
1392
+ }
1393
+ function buildPlayerTopic(licenseKey, channel) {
1394
+ return "".concat(mqttConfig.topicPrefix, "/").concat(licenseKey, "/").concat(channel);
1395
+ }
1396
+ // src/utils/mqttClient.ts
1397
+ var import_mqtt = __toESM(require("mqtt"), 1);
1398
+ var LOG = "[StormcloudVideoPlayer][MQTT]";
1399
+ var client = null;
1400
+ var status = "disconnected";
1401
+ function initMQTTClient() {
1402
+ if (client || !isMQTTEnabled()) return;
1403
+ var url = buildMQTTBrokerUrl();
1404
+ status = "connecting";
1405
+ var clientId = "stormcloud-vp-".concat(Math.random().toString(36).slice(2, 9));
1406
+ try {
1407
+ client = import_mqtt.default.connect(url, {
1408
+ clientId: clientId,
1409
+ username: mqttConfig.username,
1410
+ password: mqttConfig.password,
1411
+ keepalive: 60,
1412
+ clean: true,
1413
+ reconnectPeriod: 5e3,
1414
+ connectTimeout: 1e4,
1415
+ queueQoSZero: false
1416
+ });
1417
+ } catch (err) {
1418
+ status = "error";
1419
+ console.warn("".concat(LOG, " connect() threw:"), err);
1420
+ return;
1421
+ }
1422
+ client.on("connect", function() {
1423
+ status = "connected";
1424
+ console.info("".concat(LOG, " connected to ").concat(url));
1425
+ });
1426
+ client.on("reconnect", function() {
1427
+ status = "connecting";
1428
+ console.info("".concat(LOG, " reconnecting…"));
1429
+ });
1430
+ client.on("offline", function() {
1431
+ status = "disconnected";
1432
+ console.warn("".concat(LOG, " offline"));
1433
+ });
1434
+ client.on("error", function(err) {
1435
+ status = "error";
1436
+ console.warn("".concat(LOG, " error:"), err.message);
1437
+ });
1438
+ client.on("close", function() {
1439
+ if (status === "connected") {
1440
+ status = "disconnected";
1441
+ }
1442
+ });
1443
+ }
1444
+ function ensureMQTTClient() {
1445
+ if (isMQTTEnabled() && !client) {
1446
+ initMQTTClient();
1447
+ }
1448
+ }
1449
+ function publishMQTT(topic, payload) {
1450
+ if (!isMQTTEnabled()) {
1451
+ return false;
1452
+ }
1453
+ ensureMQTTClient();
1454
+ if (!client) {
1455
+ return false;
1456
+ }
1457
+ try {
1458
+ client.publish(topic, JSON.stringify(payload), {
1459
+ qos: mqttConfig.qos
1460
+ });
1461
+ return true;
1462
+ } catch (err) {
1463
+ console.warn("".concat(LOG, " publish failed on ").concat(topic, ":"), err);
1464
+ return false;
1465
+ }
1466
+ }
1374
1467
  // src/utils/tracking.ts
1375
1468
  var cachedBrowserId = null;
1376
1469
  function getClientInfo() {
@@ -1517,7 +1610,7 @@ function getClientInfo() {
1517
1610
  }
1518
1611
  function getBrowserID(clientInfo) {
1519
1612
  return _async_to_generator(function() {
1520
- var fingerprintString, encodedData, utf8, buffer, i, hashBuffer, hashArray, hashHex, error, hash, i1, char, fallbackHash, timestamp, random;
1613
+ var _crypto_subtle, fingerprintString, encodedData, utf8, buffer, i, hashBuffer, hashHex, unused, hash, i1, char, fallbackHash, timestamp, random;
1521
1614
  return _ts_generator(this, function(_state) {
1522
1615
  switch(_state.label){
1523
1616
  case 0:
@@ -1528,7 +1621,7 @@ function getBrowserID(clientInfo) {
1528
1621
  ];
1529
1622
  }
1530
1623
  fingerprintString = JSON.stringify(clientInfo);
1531
- if (!(typeof crypto !== "undefined" && crypto.subtle && crypto.subtle.digest)) return [
1624
+ if (!(typeof crypto !== "undefined" && ((_crypto_subtle = crypto.subtle) === null || _crypto_subtle === void 0 ? void 0 : _crypto_subtle.digest))) return [
1532
1625
  3,
1533
1626
  5
1534
1627
  ];
@@ -1566,8 +1659,7 @@ function getBrowserID(clientInfo) {
1566
1659
  ];
1567
1660
  case 3:
1568
1661
  hashBuffer = _state.sent();
1569
- hashArray = Array.from(new Uint8Array(hashBuffer));
1570
- hashHex = hashArray.map(function(b) {
1662
+ hashHex = Array.from(new Uint8Array(hashBuffer)).map(function(b) {
1571
1663
  return b.toString(16).padStart(2, "0");
1572
1664
  }).join("");
1573
1665
  cachedBrowserId = hashHex;
@@ -1576,8 +1668,8 @@ function getBrowserID(clientInfo) {
1576
1668
  hashHex
1577
1669
  ];
1578
1670
  case 4:
1579
- error = _state.sent();
1580
- console.warn("[StormcloudVideoPlayer] crypto.subtle.digest not supported, using fallback hash");
1671
+ unused = _state.sent();
1672
+ console.warn("[StormcloudVideoPlayer] crypto.subtle not supported, using fallback hash");
1581
1673
  return [
1582
1674
  3,
1583
1675
  5
@@ -1601,177 +1693,91 @@ function getBrowserID(clientInfo) {
1601
1693
  });
1602
1694
  })();
1603
1695
  }
1604
- var PLAYER_TRACKING_BASE_URL = "https://adstorm.co/api-adstorm-dev/adstorm/player-tracking";
1605
- var TRACK_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/metrics/ingest");
1606
- var HEARTBEAT_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/heartbeat");
1607
- var IMPRESSIONS_URL = "".concat(PLAYER_TRACKING_BASE_URL, "/impressions/ingest");
1608
- function buildHeaders(licenseKey) {
1609
- var headers = {
1610
- "Content-Type": "application/json"
1611
- };
1612
- if (licenseKey) {
1613
- headers["Authorization"] = "Bearer ".concat(licenseKey);
1614
- }
1615
- return headers;
1616
- }
1617
- function sendTrackRequest(licenseKey, body) {
1618
- return _async_to_generator(function() {
1619
- var response;
1620
- return _ts_generator(this, function(_state) {
1621
- switch(_state.label){
1622
- case 0:
1623
- return [
1624
- 4,
1625
- fetch(TRACK_URL, {
1626
- method: "POST",
1627
- headers: buildHeaders(licenseKey),
1628
- body: JSON.stringify(body)
1629
- })
1630
- ];
1631
- case 1:
1632
- response = _state.sent();
1633
- if (!response.ok) {
1634
- throw new Error("HTTP error! status: ".concat(response.status));
1635
- }
1636
- return [
1637
- 4,
1638
- response.json()
1639
- ];
1640
- case 2:
1641
- _state.sent();
1642
- return [
1643
- 2
1644
- ];
1645
- }
1646
- });
1647
- })();
1696
+ function canPublish(licenseKey) {
1697
+ return Boolean(isMQTTEnabled() && licenseKey);
1648
1698
  }
1649
- function postJson(url, licenseKey, body) {
1699
+ function buildPlayerMetricEvent() {
1650
1700
  return _async_to_generator(function() {
1651
- var response;
1652
- return _ts_generator(this, function(_state) {
1653
- switch(_state.label){
1654
- case 0:
1655
- return [
1656
- 4,
1657
- fetch(url, {
1658
- method: "POST",
1659
- headers: buildHeaders(licenseKey),
1660
- body: JSON.stringify(body)
1661
- })
1662
- ];
1663
- case 1:
1664
- response = _state.sent();
1665
- if (!response.ok) {
1666
- throw new Error("HTTP error! status: ".concat(response.status));
1667
- }
1668
- return [
1669
- 4,
1670
- response.json()
1671
- ];
1672
- case 2:
1673
- _state.sent();
1674
- return [
1675
- 2
1676
- ];
1677
- }
1678
- });
1679
- })();
1680
- }
1681
- function buildPlayerMetricEvent(_0) {
1682
- return _async_to_generator(function(licenseKey) {
1683
- var context, flags, _flags_captureAt, clientInfo, browserId, captureAt;
1701
+ var context, flags, _flags_captureAt, _flags_adLoaded, _flags_adDetect, clientInfo, playerId, captureAt;
1684
1702
  var _arguments = arguments;
1685
1703
  return _ts_generator(this, function(_state) {
1686
1704
  switch(_state.label){
1687
1705
  case 0:
1688
- context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
1706
+ context = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : {}, flags = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
1689
1707
  clientInfo = getClientInfo();
1690
1708
  return [
1691
1709
  4,
1692
1710
  getBrowserID(clientInfo)
1693
1711
  ];
1694
1712
  case 1:
1695
- browserId = _state.sent();
1713
+ playerId = _state.sent();
1696
1714
  captureAt = (_flags_captureAt = flags.captureAt) !== null && _flags_captureAt !== void 0 ? _flags_captureAt : /* @__PURE__ */ new Date().toISOString();
1697
1715
  return [
1698
1716
  2,
1699
- {
1700
- player_id: browserId,
1701
- browserId: browserId,
1717
+ _object_spread({
1718
+ player_id: playerId,
1702
1719
  device_type: clientInfo.deviceType,
1703
- deviceType: clientInfo.deviceType,
1704
- input_stream_type: context.inputStreamType,
1705
- os: clientInfo.os,
1706
- ad_loaded: flags.adLoaded,
1707
- ad_detect: flags.adDetect,
1708
- license_key: licenseKey,
1709
- capture_at: captureAt,
1710
- timestamp: captureAt
1711
- }
1720
+ os: clientInfo.os.toLowerCase(),
1721
+ ad_loaded: (_flags_adLoaded = flags.adLoaded) !== null && _flags_adLoaded !== void 0 ? _flags_adLoaded : false,
1722
+ ad_detect: (_flags_adDetect = flags.adDetect) !== null && _flags_adDetect !== void 0 ? _flags_adDetect : false,
1723
+ capture_at: captureAt
1724
+ }, context.inputStreamType ? {
1725
+ input_stream_type: context.inputStreamType
1726
+ } : {})
1712
1727
  ];
1713
1728
  }
1714
1729
  });
1715
1730
  }).apply(this, arguments);
1716
1731
  }
1732
+ function publishTracking(licenseKey, channel, body) {
1733
+ ensureMQTTClient();
1734
+ publishMQTT(buildPlayerTopic(licenseKey, channel), body);
1735
+ }
1717
1736
  function sendInitialTracking(_0) {
1718
1737
  return _async_to_generator(function(licenseKey) {
1719
- var context, clientInfo, browserId, trackingData, error;
1738
+ var context, metricEvent, error;
1720
1739
  var _arguments = arguments;
1721
1740
  return _ts_generator(this, function(_state) {
1722
1741
  switch(_state.label){
1723
1742
  case 0:
1724
1743
  context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {};
1744
+ if (!canPublish(licenseKey)) return [
1745
+ 2
1746
+ ];
1725
1747
  _state.label = 1;
1726
1748
  case 1:
1727
1749
  _state.trys.push([
1728
1750
  1,
1729
- 4,
1751
+ 3,
1730
1752
  ,
1731
- 5
1753
+ 4
1732
1754
  ]);
1733
- clientInfo = getClientInfo();
1734
- return [
1735
- 4,
1736
- getBrowserID(clientInfo)
1737
- ];
1738
- case 2:
1739
- browserId = _state.sent();
1740
- trackingData = _object_spread({
1741
- browserId: browserId
1742
- }, clientInfo);
1743
1755
  return [
1744
1756
  4,
1745
- sendTrackRequest(licenseKey, {
1746
- events: [
1747
- {
1748
- player_id: browserId,
1749
- device_type: clientInfo.deviceType,
1750
- input_stream_type: context.inputStreamType,
1751
- os: clientInfo.os,
1752
- ad_loaded: false,
1753
- ad_detect: false,
1754
- license_key: licenseKey,
1755
- capture_at: /* @__PURE__ */ new Date().toISOString()
1756
- }
1757
- ],
1758
- trackingData: trackingData
1757
+ buildPlayerMetricEvent(context, {
1758
+ adLoaded: false,
1759
+ adDetect: false
1759
1760
  })
1760
1761
  ];
1761
- case 3:
1762
- _state.sent();
1762
+ case 2:
1763
+ metricEvent = _state.sent();
1764
+ publishTracking(licenseKey, "metrics", {
1765
+ events: [
1766
+ metricEvent
1767
+ ]
1768
+ });
1763
1769
  return [
1764
1770
  3,
1765
- 5
1771
+ 4
1766
1772
  ];
1767
- case 4:
1773
+ case 3:
1768
1774
  error = _state.sent();
1769
1775
  console.error("[StormcloudVideoPlayer] Error sending initial tracking data:", error);
1770
1776
  return [
1771
1777
  3,
1772
- 5
1778
+ 4
1773
1779
  ];
1774
- case 5:
1780
+ case 4:
1775
1781
  return [
1776
1782
  2
1777
1783
  ];
@@ -1875,53 +1881,48 @@ function sendAdImpressionTracking(_0, _1) {
1875
1881
  switch(_state.label){
1876
1882
  case 0:
1877
1883
  context = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
1884
+ if (!canPublish(licenseKey)) return [
1885
+ 2
1886
+ ];
1878
1887
  _state.label = 1;
1879
1888
  case 1:
1880
1889
  _state.trys.push([
1881
1890
  1,
1882
- 4,
1891
+ 3,
1883
1892
  ,
1884
- 5
1893
+ 4
1885
1894
  ]);
1886
1895
  return [
1887
1896
  4,
1888
- buildPlayerMetricEvent(licenseKey, context, {
1897
+ buildPlayerMetricEvent(context, {
1889
1898
  captureAt: adImpressionInfo.timestamp
1890
1899
  })
1891
1900
  ];
1892
1901
  case 2:
1893
1902
  metricEvent = _state.sent();
1894
- return [
1895
- 4,
1896
- Promise.all([
1897
- postJson(HEARTBEAT_URL, licenseKey, metricEvent),
1898
- postJson(IMPRESSIONS_URL, licenseKey, {
1899
- events: [
1900
- {
1901
- player_id: metricEvent.player_id,
1902
- ad_played_count: 1,
1903
- ad_url: adImpressionInfo.adUrl,
1904
- license_key: licenseKey,
1905
- capture_at: adImpressionInfo.timestamp
1906
- }
1907
- ]
1908
- })
1909
- ])
1910
- ];
1911
- case 3:
1912
- _state.sent();
1903
+ publishTracking(licenseKey, "heartbeat", metricEvent);
1904
+ publishTracking(licenseKey, "impressions", {
1905
+ events: [
1906
+ {
1907
+ player_id: metricEvent.player_id,
1908
+ ad_played_count: 1,
1909
+ ad_url: adImpressionInfo.adUrl,
1910
+ capture_at: adImpressionInfo.timestamp
1911
+ }
1912
+ ]
1913
+ });
1913
1914
  return [
1914
1915
  3,
1915
- 5
1916
+ 4
1916
1917
  ];
1917
- case 4:
1918
+ case 3:
1918
1919
  error = _state.sent();
1919
1920
  console.error("[StormcloudVideoPlayer] Error sending ad impression tracking:", error);
1920
1921
  return [
1921
1922
  3,
1922
- 5
1923
+ 4
1923
1924
  ];
1924
- case 5:
1925
+ case 4:
1925
1926
  return [
1926
1927
  2
1927
1928
  ];
@@ -1937,38 +1938,36 @@ function sendHeartbeat(_0) {
1937
1938
  switch(_state.label){
1938
1939
  case 0:
1939
1940
  context = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : {}, flags = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
1941
+ if (!canPublish(licenseKey)) return [
1942
+ 2
1943
+ ];
1940
1944
  _state.label = 1;
1941
1945
  case 1:
1942
1946
  _state.trys.push([
1943
1947
  1,
1944
- 4,
1948
+ 3,
1945
1949
  ,
1946
- 5
1950
+ 4
1947
1951
  ]);
1948
1952
  return [
1949
1953
  4,
1950
- buildPlayerMetricEvent(licenseKey, context, flags)
1954
+ buildPlayerMetricEvent(context, flags)
1951
1955
  ];
1952
1956
  case 2:
1953
1957
  heartbeatData = _state.sent();
1954
- return [
1955
- 4,
1956
- postJson(HEARTBEAT_URL, licenseKey, heartbeatData)
1957
- ];
1958
- case 3:
1959
- _state.sent();
1958
+ publishTracking(licenseKey, "heartbeat", heartbeatData);
1960
1959
  return [
1961
1960
  3,
1962
- 5
1961
+ 4
1963
1962
  ];
1964
- case 4:
1963
+ case 3:
1965
1964
  error = _state.sent();
1966
1965
  console.error("[StormcloudVideoPlayer] Error sending heartbeat:", error);
1967
1966
  return [
1968
1967
  3,
1969
- 5
1968
+ 4
1970
1969
  ];
1971
- case 5:
1970
+ case 4:
1972
1971
  return [
1973
1972
  2
1974
1973
  ];
@@ -2227,6 +2226,166 @@ function initializePolyfills() {
2227
2226
  polyfillTextEncoder();
2228
2227
  polyfillPromiseFinally();
2229
2228
  }
2229
+ // src/utils/vastMacros.ts
2230
+ function generateCorrelator() {
2231
+ if (typeof crypto !== "undefined" && crypto.getRandomValues) {
2232
+ try {
2233
+ var _buf_, _buf_1;
2234
+ var buf = new Uint32Array(2);
2235
+ crypto.getRandomValues(buf);
2236
+ var value = ((_buf_ = buf[0]) !== null && _buf_ !== void 0 ? _buf_ : 0) * 2097152 + (((_buf_1 = buf[1]) !== null && _buf_1 !== void 0 ? _buf_1 : 0) & 2097151);
2237
+ if (value > 0) {
2238
+ return String(value);
2239
+ }
2240
+ } catch (unused) {}
2241
+ }
2242
+ return String(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) + 1);
2243
+ }
2244
+ var UNEXPANDED_MACRO_PATTERN = /^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%)$/;
2245
+ function applyVastMacros(baseUrl, ctx) {
2246
+ var url;
2247
+ try {
2248
+ url = new URL(baseUrl);
2249
+ } catch (unused) {
2250
+ return replaceCorrelatorFallback(baseUrl, ctx.correlator);
2251
+ }
2252
+ var params = url.searchParams;
2253
+ params.set("correlator", ctx.correlator);
2254
+ params.set("scor", ctx.streamCorrelator);
2255
+ if (ctx.pod != null) {
2256
+ params.set("pod", String(ctx.pod));
2257
+ }
2258
+ if (ctx.adPosition != null) {
2259
+ params.set("ppos", String(ctx.adPosition));
2260
+ }
2261
+ if (ctx.pageUrl) {
2262
+ params.set("url", ctx.pageUrl);
2263
+ params.set("description_url", ctx.pageUrl);
2264
+ }
2265
+ if (ctx.adWillPlayMuted != null) {
2266
+ params.set("vpmute", ctx.adWillPlayMuted ? "1" : "0");
2267
+ }
2268
+ if (ctx.adWillAutoPlay != null) {
2269
+ params.set("vpa", ctx.adWillAutoPlay ? "auto" : "click");
2270
+ }
2271
+ if (ctx.deviceId && ctx.deviceIdType) {
2272
+ params.set("rdid", ctx.deviceId);
2273
+ params.set("idtype", ctx.deviceIdType);
2274
+ params.set("is_lat", ctx.limitAdTracking ? "1" : "0");
2275
+ } else {
2276
+ params.delete("rdid");
2277
+ params.delete("idtype");
2278
+ params.delete("is_lat");
2279
+ }
2280
+ var consent = ctx.consent;
2281
+ if ((consent === null || consent === void 0 ? void 0 : consent.gdpr) != null) {
2282
+ params.set("gdpr", consent.gdpr);
2283
+ }
2284
+ if ((consent === null || consent === void 0 ? void 0 : consent.gdprConsent) != null) {
2285
+ params.set("gdpr_consent", consent.gdprConsent);
2286
+ }
2287
+ if ((consent === null || consent === void 0 ? void 0 : consent.usPrivacy) != null) {
2288
+ params.set("us_privacy", consent.usPrivacy);
2289
+ }
2290
+ if (ctx.adTest) {
2291
+ params.set("adtest", "on");
2292
+ }
2293
+ var staleKeys = [];
2294
+ params.forEach(function(value, key) {
2295
+ if (UNEXPANDED_MACRO_PATTERN.test(value)) {
2296
+ staleKeys.push(key);
2297
+ }
2298
+ });
2299
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2300
+ try {
2301
+ for(var _iterator = staleKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2302
+ var key = _step.value;
2303
+ params.delete(key);
2304
+ }
2305
+ } catch (err) {
2306
+ _didIteratorError = true;
2307
+ _iteratorError = err;
2308
+ } finally{
2309
+ try {
2310
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
2311
+ _iterator.return();
2312
+ }
2313
+ } finally{
2314
+ if (_didIteratorError) {
2315
+ throw _iteratorError;
2316
+ }
2317
+ }
2318
+ }
2319
+ return url.toString();
2320
+ }
2321
+ function replaceCorrelatorFallback(baseUrl, correlator) {
2322
+ var correlatorRegex = /([?&])correlator=([^&]*)/;
2323
+ if (correlatorRegex.test(baseUrl)) {
2324
+ return baseUrl.replace(correlatorRegex, "$1correlator=".concat(correlator));
2325
+ }
2326
+ var sep = baseUrl.includes("?") ? "&" : "?";
2327
+ return "".concat(baseUrl).concat(sep, "correlator=").concat(correlator);
2328
+ }
2329
+ function fetchConsentSignals() {
2330
+ var timeoutMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1500;
2331
+ var signals = {};
2332
+ if (typeof window === "undefined") {
2333
+ return Promise.resolve(signals);
2334
+ }
2335
+ var tasks = [];
2336
+ var tcfApi = window.__tcfapi;
2337
+ if (typeof tcfApi === "function") {
2338
+ tasks.push(new Promise(function(resolve) {
2339
+ var settled = false;
2340
+ try {
2341
+ tcfApi("addEventListener", 2, function(tcData, success) {
2342
+ if (settled) return;
2343
+ if (success && tcData && (tcData.eventStatus === "tcloaded" || tcData.eventStatus === "useractioncomplete")) {
2344
+ settled = true;
2345
+ signals.gdpr = tcData.gdprApplies ? "1" : "0";
2346
+ if (typeof tcData.tcString === "string" && tcData.tcString) {
2347
+ signals.gdprConsent = tcData.tcString;
2348
+ }
2349
+ try {
2350
+ tcfApi("removeEventListener", 2, function() {}, tcData.listenerId);
2351
+ } catch (unused) {}
2352
+ resolve();
2353
+ }
2354
+ });
2355
+ } catch (unused) {
2356
+ resolve();
2357
+ }
2358
+ setTimeout(function() {
2359
+ if (!settled) {
2360
+ settled = true;
2361
+ resolve();
2362
+ }
2363
+ }, timeoutMs);
2364
+ }));
2365
+ }
2366
+ var uspApi = window.__uspapi;
2367
+ if (typeof uspApi === "function") {
2368
+ tasks.push(new Promise(function(resolve) {
2369
+ try {
2370
+ uspApi("getUSPData", 1, function(data, success) {
2371
+ if (success && typeof (data === null || data === void 0 ? void 0 : data.uspString) === "string" && data.uspString) {
2372
+ signals.usPrivacy = data.uspString;
2373
+ }
2374
+ resolve();
2375
+ });
2376
+ } catch (unused) {
2377
+ resolve();
2378
+ }
2379
+ setTimeout(resolve, timeoutMs);
2380
+ }));
2381
+ }
2382
+ if (tasks.length === 0) {
2383
+ return Promise.resolve(signals);
2384
+ }
2385
+ return Promise.all(tasks).then(function() {
2386
+ return signals;
2387
+ });
2388
+ }
2230
2389
  // src/utils/browserCompat.ts
2231
2390
  function getChromeVersion(ua) {
2232
2391
  var match = ua.match(/Chrome\/(\d+)/);
@@ -2452,6 +2611,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2452
2611
  this.preloadPoolLoopRunning = false;
2453
2612
  this.adDetectSentForCurrentBreak = false;
2454
2613
  this.palPlaybackStarted = false;
2614
+ this.streamCorrelator = generateCorrelator();
2615
+ this.consentSignals = {};
2616
+ this.podCounter = 0;
2617
+ this.podAssignedByPrefetch = false;
2618
+ this.adRequestPositionInBreak = 0;
2455
2619
  this.continuousFetchLoopRunning = false;
2456
2620
  initializePolyfills();
2457
2621
  var browserOverrides = getBrowserConfigOverrides();
@@ -2524,6 +2688,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2524
2688
  adWillPlayMuted: !!this.config.muted,
2525
2689
  continuousPlayback: (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
2526
2690
  }).catch(function() {});
2691
+ fetchConsentSignals().then(function(signals) {
2692
+ _this.consentSignals = signals;
2693
+ }).catch(function() {});
2527
2694
  this.initializeTracking();
2528
2695
  if (!this.shouldUseNativeHls()) return [
2529
2696
  3,
@@ -2591,7 +2758,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
2591
2758
  var _level_details, _level_details1;
2592
2759
  return (level === null || level === void 0 ? void 0 : (_level_details = level.details) === null || _level_details === void 0 ? void 0 : _level_details.live) === true || (level === null || level === void 0 ? void 0 : (_level_details1 = level.details) === null || _level_details1 === void 0 ? void 0 : _level_details1.type) === "LIVE";
2593
2760
  })) !== null && _ref !== void 0 ? _ref : false;
2594
- if (!this.isLiveStream && this.vmapBreaks.length === 0 && this.apiVastTagUrl) {
2761
+ if (!this.isVmapEnabled() && !this.isLiveStream && this.vmapBreaks.length === 0 && this.apiVastTagUrl) {
2595
2762
  prerollKey = "synthetic-vod-preroll";
2596
2763
  if (!this.consumedVmapBreakIds.has(prerollKey)) {
2597
2764
  this.vmapBreaks = [
@@ -3176,12 +3343,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
3176
3343
  _this.palNonce.sendPlaybackStart();
3177
3344
  }
3178
3345
  });
3179
- this.video.addEventListener("ended", function() {
3346
+ this.endedHandler = function() {
3180
3347
  if (_this.palPlaybackStarted) {
3181
3348
  _this.palPlaybackStarted = false;
3182
3349
  _this.palNonce.sendPlaybackEnd();
3183
3350
  }
3184
- });
3351
+ _this.onVideoEnded();
3352
+ };
3353
+ this.video.addEventListener("ended", this.endedHandler);
3185
3354
  this.video.addEventListener("mousedown", function(e) {
3186
3355
  _this.palNonce.sendAdTouch(e);
3187
3356
  });
@@ -4503,6 +4672,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4503
4672
  }
4504
4673
  }
4505
4674
  },
4675
+ {
4676
+ key: "isVmapEnabled",
4677
+ value: function isVmapEnabled() {
4678
+ var _this_config_vmapUrl;
4679
+ return !!(this.config.isVmap && ((_this_config_vmapUrl = this.config.vmapUrl) === null || _this_config_vmapUrl === void 0 ? void 0 : _this_config_vmapUrl.trim()));
4680
+ }
4681
+ },
4506
4682
  {
4507
4683
  key: "fetchAdConfiguration",
4508
4684
  value: function fetchAdConfiguration() {
@@ -4511,7 +4687,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4511
4687
  return _ts_generator(this, function(_state) {
4512
4688
  switch(_state.label){
4513
4689
  case 0:
4514
- if (!this.config.vmapUrl) return [
4690
+ if (!this.isVmapEnabled()) return [
4515
4691
  3,
4516
4692
  2
4517
4693
  ];
@@ -4521,7 +4697,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4521
4697
  ];
4522
4698
  case 1:
4523
4699
  _state.sent();
4524
- _state.label = 2;
4700
+ if (this.config.debugAdTiming) {
4701
+ console.log("[StormcloudVideoPlayer] VMAP mode enabled");
4702
+ }
4703
+ return [
4704
+ 2
4705
+ ];
4525
4706
  case 2:
4526
4707
  vastMode = this.config.vastMode || "default";
4527
4708
  if (this.config.debugAdTiming) {
@@ -4689,7 +4870,16 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4689
4870
  }
4690
4871
  return [];
4691
4872
  }
4692
- var adBreakNodes = Array.from(doc.querySelectorAll("AdBreak, vmap\\:AdBreak"));
4873
+ var VMAP_NS = "http://www.iab.net/videosuite/vmap";
4874
+ var adBreakNodes = Array.from(doc.getElementsByTagNameNS(VMAP_NS, "AdBreak"));
4875
+ if (adBreakNodes.length === 0) {
4876
+ adBreakNodes = Array.from(doc.querySelectorAll("AdBreak, vmap\\:AdBreak"));
4877
+ }
4878
+ if (adBreakNodes.length === 0) {
4879
+ adBreakNodes = Array.from(doc.getElementsByTagName("*")).filter(function(el) {
4880
+ return el.localName === "AdBreak";
4881
+ });
4882
+ }
4693
4883
  var parsed = [];
4694
4884
  adBreakNodes.forEach(function(node, index) {
4695
4885
  var timeOffsetRaw = (node.getAttribute("timeOffset") || "").trim();
@@ -4697,7 +4887,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4697
4887
  if (startTimeMs == null) {
4698
4888
  return;
4699
4889
  }
4700
- var adTagNode = node.querySelector("AdTagURI, vmap\\:AdTagURI");
4890
+ var adTagNode = node.getElementsByTagNameNS(VMAP_NS, "AdTagURI")[0];
4891
+ if (!adTagNode) {
4892
+ var _node_querySelector;
4893
+ adTagNode = (_node_querySelector = node.querySelector("AdTagURI, vmap\\:AdTagURI")) !== null && _node_querySelector !== void 0 ? _node_querySelector : void 0;
4894
+ }
4701
4895
  var adTagUrl = ((adTagNode === null || adTagNode === void 0 ? void 0 : adTagNode.textContent) || "").trim();
4702
4896
  if (!adTagUrl) {
4703
4897
  return;
@@ -4793,25 +4987,35 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4793
4987
  return this.getRemainingAdMs();
4794
4988
  }
4795
4989
  },
4990
+ {
4991
+ key: "beginNewAdPod",
4992
+ value: function beginNewAdPod() {
4993
+ this.podCounter++;
4994
+ this.adRequestPositionInBreak = 0;
4995
+ }
4996
+ },
4796
4997
  {
4797
4998
  key: "generateVastUrlsWithCorrelators",
4798
4999
  value: function generateVastUrlsWithCorrelators(baseUrl, count) {
4799
5000
  var urls = [];
4800
- var baseTimestamp = Date.now();
4801
5001
  for(var i = 0; i < count; i++){
4802
- var timestamp = baseTimestamp + i;
4803
- var random = Math.floor(Math.random() * 1e12);
4804
- var uniqueCorrelator = "".concat(timestamp, "_").concat(random, "_").concat(i);
4805
- var urlWithCorrelator = void 0;
4806
- var correlatorRegex = /([?&])correlator=([^&]*)/;
4807
- if (correlatorRegex.test(baseUrl)) {
4808
- urlWithCorrelator = baseUrl.replace(correlatorRegex, "$1correlator=".concat(uniqueCorrelator));
4809
- } else if (baseUrl.includes("?")) {
4810
- urlWithCorrelator = "".concat(baseUrl, "&correlator=").concat(uniqueCorrelator);
4811
- } else {
4812
- urlWithCorrelator = "".concat(baseUrl, "?correlator=").concat(uniqueCorrelator);
4813
- }
4814
- urls.push(this.palNonce.injectNonce(urlWithCorrelator));
5002
+ this.adRequestPositionInBreak++;
5003
+ var adWillPlayMuted = this.inAdBreak ? this.adPlayer.getOriginalMutedState() : this.video.muted;
5004
+ var urlWithMacros = applyVastMacros(baseUrl, {
5005
+ correlator: generateCorrelator(),
5006
+ streamCorrelator: this.streamCorrelator,
5007
+ pod: this.podCounter > 0 ? this.podCounter : void 0,
5008
+ adPosition: this.adRequestPositionInBreak,
5009
+ pageUrl: typeof window !== "undefined" ? window.location.href : void 0,
5010
+ adWillPlayMuted: adWillPlayMuted,
5011
+ adWillAutoPlay: !!this.config.autoplay,
5012
+ deviceId: this.config.deviceId,
5013
+ deviceIdType: this.config.deviceIdType,
5014
+ limitAdTracking: this.config.limitAdTracking,
5015
+ adTest: this.config.adTest,
5016
+ consent: this.consentSignals
5017
+ });
5018
+ urls.push(this.palNonce.injectNonce(urlWithMacros));
4815
5019
  }
4816
5020
  return urls;
4817
5021
  }
@@ -4881,6 +5085,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4881
5085
  }
4882
5086
  return;
4883
5087
  }
5088
+ this.beginNewAdPod();
5089
+ this.podAssignedByPrefetch = true;
4884
5090
  var urlsToPregenerate = 5;
4885
5091
  var generatedUrls = this.generateVastUrlsWithCorrelators(baseVastUrl, urlsToPregenerate);
4886
5092
  this.pendingAdBreak = _object_spread_props(_object_spread({
@@ -4918,6 +5124,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
4918
5124
  }
4919
5125
  this.pendingAdBreak = null;
4920
5126
  this.pendingScte35CueKey = void 0;
5127
+ this.podAssignedByPrefetch = false;
4921
5128
  }
4922
5129
  },
4923
5130
  {
@@ -5354,6 +5561,11 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
5354
5561
  this.continuousFetchingActive = true;
5355
5562
  this.isShowingPlaceholder = false;
5356
5563
  this.totalAdRequestsInBreak = 0;
5564
+ if (this.podAssignedByPrefetch) {
5565
+ this.podAssignedByPrefetch = false;
5566
+ } else {
5567
+ this.beginNewAdPod();
5568
+ }
5357
5569
  currentMuted = this.video.muted;
5358
5570
  currentVolume = this.video.volume;
5359
5571
  this.adPlayer.updateOriginalMutedState(currentMuted, currentVolume);
@@ -6254,23 +6466,49 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6254
6466
  key: "onTimeUpdate",
6255
6467
  value: function onTimeUpdate(currentTimeSec) {
6256
6468
  var _this = this;
6469
+ if (!this.isVmapEnabled() || this.vmapBreaks.length === 0) {
6470
+ return;
6471
+ }
6257
6472
  if (this.adPlayer.isAdPlaying() || this.inAdBreak) return;
6258
6473
  var nowMs = currentTimeSec * 1e3;
6259
6474
  var breakToPlay = this.findBreakForTime(nowMs);
6260
6475
  if (breakToPlay) {
6261
- void this.handleMidAdJoin(breakToPlay, nowMs).catch(function(error) {
6476
+ void this.handleVmapAdBreak(breakToPlay, nowMs).catch(function(error) {
6262
6477
  if (_this.config.debugAdTiming) {
6263
- console.warn("[StormcloudVideoPlayer] Mid-roll VMAP join failed gracefully:", error);
6478
+ console.warn("[StormcloudVideoPlayer] VMAP ad break failed gracefully:", error);
6264
6479
  }
6265
6480
  });
6266
6481
  }
6267
6482
  }
6268
6483
  },
6269
6484
  {
6270
- key: "handleMidAdJoin",
6271
- value: function handleMidAdJoin(adBreak, nowMs) {
6485
+ key: "onVideoEnded",
6486
+ value: function onVideoEnded() {
6487
+ var _this = this;
6488
+ if (!this.isVmapEnabled() || this.vmapBreaks.length === 0) {
6489
+ return;
6490
+ }
6491
+ if (this.adPlayer.isAdPlaying() || this.inAdBreak) {
6492
+ return;
6493
+ }
6494
+ var durationMs = Number.isFinite(this.video.duration) ? Math.floor(this.video.duration * 1e3) : 0;
6495
+ var postroll = this.vmapBreaks.find(function(b) {
6496
+ return b.startTimeMs === -1 && !_this.consumedVmapBreakIds.has(_this.getAdBreakKey(b));
6497
+ });
6498
+ if (postroll) {
6499
+ void this.handleVmapAdBreak(postroll, durationMs).catch(function(error) {
6500
+ if (_this.config.debugAdTiming) {
6501
+ console.warn("[StormcloudVideoPlayer] VMAP post-roll failed gracefully:", error);
6502
+ }
6503
+ });
6504
+ }
6505
+ }
6506
+ },
6507
+ {
6508
+ key: "handleVmapAdBreak",
6509
+ value: function handleVmapAdBreak(adBreak, nowMs) {
6272
6510
  return _async_to_generator(function() {
6273
- var _adBreak_durationMs, _this_config_driftToleranceMs, key, breakStartMs, durationMs, endMs, tol, inWindow, remainingMs, tags, first, rest, error;
6511
+ var _adBreak_durationMs, key, breakStartMs, durationMs, endMs, inWindow, tags, first, rest, error;
6274
6512
  return _ts_generator(this, function(_state) {
6275
6513
  switch(_state.label){
6276
6514
  case 0:
@@ -6288,25 +6526,28 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6288
6526
  }
6289
6527
  durationMs = (_adBreak_durationMs = adBreak.durationMs) !== null && _adBreak_durationMs !== void 0 ? _adBreak_durationMs : 0;
6290
6528
  endMs = breakStartMs + durationMs;
6291
- tol = (_this_config_driftToleranceMs = this.config.driftToleranceMs) !== null && _this_config_driftToleranceMs !== void 0 ? _this_config_driftToleranceMs : 1e3;
6292
- inWindow = durationMs > 0 ? nowMs > breakStartMs && nowMs < endMs : nowMs + tol >= breakStartMs;
6529
+ inWindow = durationMs > 0 ? nowMs >= breakStartMs && nowMs < endMs : nowMs >= breakStartMs;
6293
6530
  if (!inWindow) return [
6294
6531
  3,
6295
6532
  4
6296
6533
  ];
6297
6534
  this.consumedVmapBreakIds.add(key);
6298
- remainingMs = durationMs > 0 ? Math.max(0, endMs - nowMs) : 0;
6299
- tags = this.selectVastTagsForBreak(adBreak) || (this.apiVastTagUrl ? [
6300
- this.apiVastTagUrl
6301
- ] : void 0);
6302
- if (!(tags && tags.length > 0)) return [
6303
- 3,
6304
- 4
6305
- ];
6535
+ tags = this.selectVastTagsForBreak(adBreak);
6536
+ if (!tags || tags.length === 0) {
6537
+ return [
6538
+ 2
6539
+ ];
6540
+ }
6306
6541
  first = tags[0];
6307
6542
  rest = tags.slice(1);
6308
6543
  this.adPodQueue = rest;
6309
6544
  this.adPlayer.updateOriginalMutedState(this.video.muted, this.video.volume);
6545
+ this.showAds = true;
6546
+ this.inAdBreak = true;
6547
+ this.currentAdBreakStartWallClockMs = Date.now();
6548
+ if (!this.video.paused) {
6549
+ this.video.pause();
6550
+ }
6310
6551
  _state.label = 1;
6311
6552
  case 1:
6312
6553
  _state.trys.push([
@@ -6321,10 +6562,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6321
6562
  ];
6322
6563
  case 2:
6323
6564
  _state.sent();
6324
- this.inAdBreak = true;
6325
- this.expectedAdBreakDurationMs = remainingMs;
6326
- this.currentAdBreakStartWallClockMs = Date.now();
6327
- this.scheduleAdStopCountdown(remainingMs);
6328
6565
  return [
6329
6566
  3,
6330
6567
  4
@@ -6332,8 +6569,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
6332
6569
  case 3:
6333
6570
  error = _state.sent();
6334
6571
  this.adPodQueue = [];
6572
+ this.inAdBreak = false;
6573
+ this.showAds = false;
6335
6574
  if (this.config.debugAdTiming) {
6336
- console.warn("[StormcloudVideoPlayer] Mid-roll VMAP ad request failed:", error);
6575
+ console.warn("[StormcloudVideoPlayer] VMAP ad request failed:", error);
6337
6576
  }
6338
6577
  return [
6339
6578
  3,
@@ -7045,9 +7284,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7045
7284
  {
7046
7285
  key: "findBreakForTime",
7047
7286
  value: function findBreakForTime(nowMs) {
7048
- var _this_config_driftToleranceMs;
7049
7287
  var schedule = this.vmapBreaks;
7050
- var tol = (_this_config_driftToleranceMs = this.config.driftToleranceMs) !== null && _this_config_driftToleranceMs !== void 0 ? _this_config_driftToleranceMs : 1e3;
7051
7288
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
7052
7289
  try {
7053
7290
  for(var _iterator = schedule[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
@@ -7059,9 +7296,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7059
7296
  if (breakStartMs == null) {
7060
7297
  continue;
7061
7298
  }
7062
- var end = breakStartMs + (b.durationMs || 0);
7063
- var effectiveTol = breakStartMs === 0 ? Math.max(tol, 3e4) : tol;
7064
- if (nowMs >= breakStartMs && (b.durationMs ? nowMs < end : nowMs <= breakStartMs + effectiveTol)) {
7299
+ if (b.durationMs) {
7300
+ var end = breakStartMs + b.durationMs;
7301
+ if (nowMs >= breakStartMs && nowMs < end) {
7302
+ return b;
7303
+ }
7304
+ continue;
7305
+ }
7306
+ if (nowMs >= breakStartMs) {
7065
7307
  return b;
7066
7308
  }
7067
7309
  }
@@ -7269,6 +7511,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
7269
7511
  this.video.removeEventListener("timeupdate", this.timeUpdateHandler);
7270
7512
  delete this.timeUpdateHandler;
7271
7513
  }
7514
+ if (this.endedHandler) {
7515
+ this.video.removeEventListener("ended", this.endedHandler);
7516
+ delete this.endedHandler;
7517
+ }
7272
7518
  if (this.emptiedHandler) {
7273
7519
  this.video.removeEventListener("emptied", this.emptiedHandler);
7274
7520
  delete this.emptiedHandler;
@@ -7299,6 +7545,7 @@ var CRITICAL_PROPS = [
7299
7545
  "allowNativeHls",
7300
7546
  "isLiveStream",
7301
7547
  "licenseKey",
7548
+ "isVmap",
7302
7549
  "vmapUrl",
7303
7550
  "lowLatencyMode",
7304
7551
  "driftToleranceMs",
@@ -7307,7 +7554,7 @@ var CRITICAL_PROPS = [
7307
7554
  var CONTROLS_HIDE_DELAY = 3e3;
7308
7555
  var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
7309
7556
  var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7310
- var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, isLiveStream = props.isLiveStream, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, vmapUrl = props.vmapUrl, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
7557
+ var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, isLiveStream = props.isLiveStream, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, isVmap = props.isVmap, vmapUrl = props.vmapUrl, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
7311
7558
  "src",
7312
7559
  "autoplay",
7313
7560
  "muted",
@@ -7335,6 +7582,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7335
7582
  "licenseKey",
7336
7583
  "vastMode",
7337
7584
  "vastTagUrl",
7585
+ "isVmap",
7338
7586
  "vmapUrl",
7339
7587
  "minSegmentsBeforePlay"
7340
7588
  ]);
@@ -7477,6 +7725,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7477
7725
  allowNativeHls,
7478
7726
  isLiveStream,
7479
7727
  licenseKey,
7728
+ isVmap,
7480
7729
  vmapUrl,
7481
7730
  lowLatencyMode,
7482
7731
  driftToleranceMs,
@@ -7521,6 +7770,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
7521
7770
  if (licenseKey !== void 0) cfg.licenseKey = licenseKey;
7522
7771
  if (vastMode !== void 0) cfg.vastMode = vastMode;
7523
7772
  if (vastTagUrl !== void 0) cfg.vastTagUrl = vastTagUrl;
7773
+ if (isVmap !== void 0) cfg.isVmap = isVmap;
7524
7774
  if (vmapUrl !== void 0) cfg.vmapUrl = vmapUrl;
7525
7775
  if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
7526
7776
  var player = new StormcloudVideoPlayer(cfg);