stormcloud-video-player 0.8.79 → 0.8.81
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/Player.cjs +6 -0
- package/lib/Player.cjs.map +1 -1
- package/lib/Player.d.cts +4 -1
- package/lib/StormcloudPlayer.cjs +1459 -167
- package/lib/StormcloudPlayer.cjs.map +1 -1
- package/lib/StormcloudPlayer.d.cts +3 -0
- package/lib/index.cjs +1547 -169
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +3 -0
- package/lib/index.d.ts +89 -3
- package/lib/index.js +1547 -169
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +452 -88
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -0
- package/lib/player/AdConfigManager.cjs +1024 -97
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/AdConfigManager.d.cts +2 -0
- package/lib/player/AdTimingService.cjs +0 -9
- package/lib/player/AdTimingService.cjs.map +1 -1
- package/lib/player/AdTimingService.d.cts +1 -0
- package/lib/player/EdgePodRequest.d.cts +1 -0
- package/lib/player/FloorLadder.cjs +3 -0
- package/lib/player/FloorLadder.cjs.map +1 -1
- package/lib/player/FloorLadder.d.cts +1 -0
- package/lib/player/HlsEngine.cjs +7 -1
- package/lib/player/HlsEngine.cjs.map +1 -1
- package/lib/player/HlsEngine.d.cts +2 -0
- package/lib/player/OptimizedPodRequest.cjs +21 -6
- package/lib/player/OptimizedPodRequest.cjs.map +1 -1
- package/lib/player/OptimizedPodRequest.d.cts +1 -1
- package/lib/player/PlayerControls.d.cts +1 -0
- package/lib/player/Scte35CueManager.d.cts +1 -0
- package/lib/player/Scte35Parser.d.cts +1 -0
- package/lib/player/StormcloudVideoPlayer.cjs +1459 -167
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +19 -1
- package/lib/player/playerTypes.d.cts +1 -0
- package/lib/players/HlsPlayer.cjs +1459 -167
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -0
- package/lib/players/index.cjs +1459 -167
- package/lib/players/index.cjs.map +1 -1
- package/lib/props.cjs +6 -0
- package/lib/props.cjs.map +1 -1
- package/lib/props.d.cts +3 -0
- package/lib/sdk/hlsAdPlayer.cjs +32 -3
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -0
- package/lib/sdk/pal.cjs +10 -3
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/sdk/pal.d.cts +3 -0
- package/lib/types.d.cts +29 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +1547 -169
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +3 -0
- package/lib/utils/__tests__/adSignals.test.cjs +25817 -0
- package/lib/utils/__tests__/adSignals.test.cjs.map +1 -0
- package/lib/utils/__tests__/adSignals.test.d.cts +2 -0
- package/lib/utils/adIdentity.cjs +421 -0
- package/lib/utils/adIdentity.cjs.map +1 -0
- package/lib/utils/adIdentity.d.cts +30 -0
- package/lib/utils/browserCompat.cjs +13 -0
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/browserCompat.d.cts +2 -1
- package/lib/utils/contentMetadata.cjs +324 -0
- package/lib/utils/contentMetadata.cjs.map +1 -0
- package/lib/utils/contentMetadata.d.cts +51 -0
- package/lib/utils/ctvVastSignals.cjs +250 -181
- package/lib/utils/ctvVastSignals.cjs.map +1 -1
- package/lib/utils/deviceInfo.cjs +698 -0
- package/lib/utils/deviceInfo.cjs.map +1 -0
- package/lib/utils/deviceInfo.d.cts +46 -0
- package/lib/utils/partnerSignals.cjs +294 -0
- package/lib/utils/partnerSignals.cjs.map +1 -0
- package/lib/utils/partnerSignals.d.cts +12 -0
- package/lib/utils/screenActivity.cjs +125 -0
- package/lib/utils/screenActivity.cjs.map +1 -0
- package/lib/utils/screenActivity.d.cts +5 -0
- package/lib/utils/tracking.cjs +406 -56
- package/lib/utils/tracking.cjs.map +1 -1
- package/lib/utils/tracking.d.cts +2 -1
- package/lib/utils/vastEnvironmentSignals.cjs +255 -85
- package/lib/utils/vastEnvironmentSignals.cjs.map +1 -1
- package/lib/utils/vastEnvironmentSignals.d.cts +8 -2
- package/lib/utils/vastMacros.cjs +58 -1
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastMacros.d.cts +21 -0
- package/package.json +1 -1
package/lib/players/index.cjs
CHANGED
|
@@ -445,8 +445,264 @@ var canPlay = {
|
|
|
445
445
|
};
|
|
446
446
|
// src/players/HlsPlayer.tsx
|
|
447
447
|
var import_react2 = require("react");
|
|
448
|
+
// src/utils/adIdentity.ts
|
|
449
|
+
var GOOGLE_ID_TYPES = [
|
|
450
|
+
"aaid",
|
|
451
|
+
"adid",
|
|
452
|
+
"afai",
|
|
453
|
+
"idfa",
|
|
454
|
+
"lgudid",
|
|
455
|
+
"msai",
|
|
456
|
+
"rida",
|
|
457
|
+
"tifa",
|
|
458
|
+
"tvOS",
|
|
459
|
+
"vaid",
|
|
460
|
+
"vida",
|
|
461
|
+
"dpid"
|
|
462
|
+
];
|
|
463
|
+
var MAX_SESSION_ID_AGE_MS = 6 * 60 * 60 * 1e3;
|
|
464
|
+
var DEFAULT_SESSION_ID_MAX_AGE_MS = MAX_SESSION_ID_AGE_MS;
|
|
465
|
+
var DEFAULT_FALLBACK_DEVICE_ID_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
|
|
466
|
+
var DEFAULT_LGUDID_TIMEOUT_MS = 1500;
|
|
467
|
+
var FALLBACK_DEVICE_ID_KEY = "stormcloud.ad.dpid.v2";
|
|
468
|
+
var SESSION_ID_KEY = "stormcloud.ad.sid.v2";
|
|
469
|
+
var LEGACY_SESSION_KEY = "stormcloud.ctv.sid";
|
|
470
|
+
var ZEROED_IDS = /* @__PURE__ */ new Set([
|
|
471
|
+
"00000000-0000-0000-0000-000000000000",
|
|
472
|
+
"38400000-8cf0-11bd-b23e-10b96e40000d"
|
|
473
|
+
]);
|
|
474
|
+
var hostIdentity;
|
|
475
|
+
var memoryStore = {};
|
|
476
|
+
var lgUdidResult;
|
|
477
|
+
var lgUdidPromise;
|
|
478
|
+
var legacyCleared = false;
|
|
479
|
+
function isUsableAdId(value) {
|
|
480
|
+
if (typeof value !== "string") return false;
|
|
481
|
+
var t = value.trim();
|
|
482
|
+
if (!t) return false;
|
|
483
|
+
if (/^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%|\$\{[^}]+\})$/.test(t)) return false;
|
|
484
|
+
if (/^(unknown|null|undefined|none|n\/a)$/i.test(t)) return false;
|
|
485
|
+
return !ZEROED_IDS.has(t.toLowerCase());
|
|
486
|
+
}
|
|
487
|
+
function isZeroedAdId(value) {
|
|
488
|
+
return typeof value === "string" && ZEROED_IDS.has(value.trim().toLowerCase());
|
|
489
|
+
}
|
|
490
|
+
function normalizeIdType(value) {
|
|
491
|
+
if (typeof value !== "string") return void 0;
|
|
492
|
+
var lower = value.trim().toLowerCase();
|
|
493
|
+
if (!lower) return void 0;
|
|
494
|
+
var match = GOOGLE_ID_TYPES.find(function(t) {
|
|
495
|
+
return t.toLowerCase() === lower;
|
|
496
|
+
});
|
|
497
|
+
return match !== null && match !== void 0 ? match : "dpid";
|
|
498
|
+
}
|
|
499
|
+
function createUuid() {
|
|
500
|
+
var _bytes_, _bytes_1, _bytes_i;
|
|
501
|
+
var c = typeof crypto !== "undefined" ? crypto : void 0;
|
|
502
|
+
if (c && typeof c.randomUUID === "function") return c.randomUUID();
|
|
503
|
+
var bytes = new Uint8Array(16);
|
|
504
|
+
if (c && typeof c.getRandomValues === "function") {
|
|
505
|
+
c.getRandomValues(bytes);
|
|
506
|
+
} else {
|
|
507
|
+
for(var i = 0; i < 16; i++)bytes[i] = Math.floor(Math.random() * 256);
|
|
508
|
+
}
|
|
509
|
+
bytes[6] = ((_bytes_ = bytes[6]) !== null && _bytes_ !== void 0 ? _bytes_ : 0) & 15 | 64;
|
|
510
|
+
bytes[8] = ((_bytes_1 = bytes[8]) !== null && _bytes_1 !== void 0 ? _bytes_1 : 0) & 63 | 128;
|
|
511
|
+
var hex = "";
|
|
512
|
+
for(var i1 = 0; i1 < 16; i1++)hex += ((_bytes_i = bytes[i1]) !== null && _bytes_i !== void 0 ? _bytes_i : 0).toString(16).padStart(2, "0");
|
|
513
|
+
return "".concat(hex.slice(0, 8), "-").concat(hex.slice(8, 12), "-").concat(hex.slice(12, 16), "-").concat(hex.slice(16, 20), "-").concat(hex.slice(20));
|
|
514
|
+
}
|
|
515
|
+
function readStored(key) {
|
|
516
|
+
try {
|
|
517
|
+
var _window_localStorage;
|
|
518
|
+
var raw = typeof window !== "undefined" ? (_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.getItem(key) : null;
|
|
519
|
+
if (raw) {
|
|
520
|
+
var parsed = JSON.parse(raw);
|
|
521
|
+
if (parsed && typeof parsed.id === "string" && typeof parsed.createdAt === "number" && isFinite(parsed.createdAt)) {
|
|
522
|
+
return {
|
|
523
|
+
id: parsed.id,
|
|
524
|
+
createdAt: parsed.createdAt
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
} catch (unused) {}
|
|
529
|
+
return memoryStore[key];
|
|
530
|
+
}
|
|
531
|
+
function writeStored(key, value) {
|
|
532
|
+
memoryStore[key] = value;
|
|
533
|
+
try {
|
|
534
|
+
if (typeof window !== "undefined") {
|
|
535
|
+
var _window_localStorage;
|
|
536
|
+
(_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.setItem(key, JSON.stringify(value));
|
|
537
|
+
}
|
|
538
|
+
} catch (unused) {}
|
|
539
|
+
}
|
|
540
|
+
function removeStored(key) {
|
|
541
|
+
delete memoryStore[key];
|
|
542
|
+
try {
|
|
543
|
+
var _window_localStorage;
|
|
544
|
+
if (typeof window !== "undefined") (_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.removeItem(key);
|
|
545
|
+
} catch (unused) {}
|
|
546
|
+
}
|
|
547
|
+
function clearLegacyIdsOnce() {
|
|
548
|
+
if (legacyCleared) return;
|
|
549
|
+
legacyCleared = true;
|
|
550
|
+
try {
|
|
551
|
+
var _window_localStorage;
|
|
552
|
+
if (typeof window !== "undefined") (_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.removeItem(LEGACY_SESSION_KEY);
|
|
553
|
+
} catch (unused) {}
|
|
554
|
+
try {
|
|
555
|
+
if (typeof document !== "undefined") {
|
|
556
|
+
document.cookie = "".concat(encodeURIComponent(LEGACY_SESSION_KEY), "=;path=/;max-age=0;SameSite=Lax");
|
|
557
|
+
}
|
|
558
|
+
} catch (unused) {}
|
|
559
|
+
}
|
|
560
|
+
function clampAge(value, fallback, max) {
|
|
561
|
+
var v = typeof value === "number" && isFinite(value) && value > 0 ? value : fallback;
|
|
562
|
+
if (max != null) v = Math.min(v, max);
|
|
563
|
+
return v;
|
|
564
|
+
}
|
|
565
|
+
function setHostAdIdentity(identity) {
|
|
566
|
+
var _normalizeIdType;
|
|
567
|
+
if (!identity || !isUsableAdId(identity.deviceId)) {
|
|
568
|
+
hostIdentity = void 0;
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
var deviceId = identity.deviceId.trim();
|
|
572
|
+
var changed = !hostIdentity || hostIdentity.deviceId !== deviceId;
|
|
573
|
+
hostIdentity = _object_spread({
|
|
574
|
+
deviceId: deviceId,
|
|
575
|
+
deviceIdType: (_normalizeIdType = normalizeIdType(identity.deviceIdType)) !== null && _normalizeIdType !== void 0 ? _normalizeIdType : "dpid"
|
|
576
|
+
}, typeof identity.limitAdTracking === "boolean" ? {
|
|
577
|
+
limitAdTracking: identity.limitAdTracking
|
|
578
|
+
} : {});
|
|
579
|
+
if (changed) {
|
|
580
|
+
removeStored(SESSION_ID_KEY);
|
|
581
|
+
removeStored(FALLBACK_DEVICE_ID_KEY);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
function getHostAdIdentity() {
|
|
585
|
+
return hostIdentity ? _object_spread({}, hostIdentity) : void 0;
|
|
586
|
+
}
|
|
587
|
+
function resetAdIdentity() {
|
|
588
|
+
removeStored(SESSION_ID_KEY);
|
|
589
|
+
removeStored(FALLBACK_DEVICE_ID_KEY);
|
|
590
|
+
}
|
|
591
|
+
function readSamsungTifa() {
|
|
592
|
+
try {
|
|
593
|
+
var _window_webapis;
|
|
594
|
+
var adinfo = typeof window !== "undefined" ? (_window_webapis = window.webapis) === null || _window_webapis === void 0 ? void 0 : _window_webapis.adinfo : void 0;
|
|
595
|
+
if (!adinfo) return void 0;
|
|
596
|
+
var tifa = typeof adinfo.getTIFA === "function" ? adinfo.getTIFA() : adinfo.tifa;
|
|
597
|
+
var lat = typeof adinfo.isLATEnabled === "function" ? adinfo.isLATEnabled() : void 0;
|
|
598
|
+
if (isZeroedAdId(tifa)) return {
|
|
599
|
+
deviceIdType: "tifa",
|
|
600
|
+
limitAdTracking: true
|
|
601
|
+
};
|
|
602
|
+
if (!isUsableAdId(tifa)) return void 0;
|
|
603
|
+
return _object_spread({
|
|
604
|
+
deviceId: tifa.trim(),
|
|
605
|
+
deviceIdType: "tifa"
|
|
606
|
+
}, typeof lat === "boolean" ? {
|
|
607
|
+
limitAdTracking: lat
|
|
608
|
+
} : {});
|
|
609
|
+
} catch (unused) {
|
|
610
|
+
return void 0;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
function primeLgUdid() {
|
|
614
|
+
var timeoutMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_LGUDID_TIMEOUT_MS;
|
|
615
|
+
if (lgUdidResult || lgUdidPromise) return lgUdidPromise !== null && lgUdidPromise !== void 0 ? lgUdidPromise : Promise.resolve();
|
|
616
|
+
var dev = typeof window !== "undefined" ? window.webOSDev : void 0;
|
|
617
|
+
if (!dev) return Promise.resolve();
|
|
618
|
+
if (typeof dev.LGUDID !== "function") {
|
|
619
|
+
var _dev_lgudid;
|
|
620
|
+
var direct = (_dev_lgudid = dev.lgudid) !== null && _dev_lgudid !== void 0 ? _dev_lgudid : dev.LGUDID;
|
|
621
|
+
if (isZeroedAdId(direct)) lgUdidResult = {
|
|
622
|
+
deviceIdType: "lgudid",
|
|
623
|
+
limitAdTracking: true
|
|
624
|
+
};
|
|
625
|
+
else if (isUsableAdId(direct)) {
|
|
626
|
+
lgUdidResult = {
|
|
627
|
+
deviceId: direct.trim(),
|
|
628
|
+
deviceIdType: "lgudid",
|
|
629
|
+
limitAdTracking: false
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
return Promise.resolve();
|
|
633
|
+
}
|
|
634
|
+
lgUdidPromise = new Promise(function(resolve) {
|
|
635
|
+
var settled = false;
|
|
636
|
+
var finish = function finish() {
|
|
637
|
+
if (settled) return;
|
|
638
|
+
settled = true;
|
|
639
|
+
clearTimeout(timer);
|
|
640
|
+
resolve();
|
|
641
|
+
};
|
|
642
|
+
var timer = setTimeout(finish, Math.max(0, timeoutMs));
|
|
643
|
+
try {
|
|
644
|
+
dev.LGUDID({
|
|
645
|
+
onSuccess: function onSuccess(res) {
|
|
646
|
+
var id = res === null || res === void 0 ? void 0 : res.id;
|
|
647
|
+
if (isZeroedAdId(id)) {
|
|
648
|
+
lgUdidResult = {
|
|
649
|
+
deviceIdType: "lgudid",
|
|
650
|
+
limitAdTracking: true
|
|
651
|
+
};
|
|
652
|
+
} else if (isUsableAdId(id)) {
|
|
653
|
+
lgUdidResult = {
|
|
654
|
+
deviceId: id.trim(),
|
|
655
|
+
deviceIdType: "lgudid",
|
|
656
|
+
limitAdTracking: false
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
finish();
|
|
660
|
+
},
|
|
661
|
+
onFailure: function onFailure() {
|
|
662
|
+
return finish();
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
} catch (unused) {
|
|
666
|
+
finish();
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
return lgUdidPromise;
|
|
670
|
+
}
|
|
671
|
+
function readCachedLgUdid() {
|
|
672
|
+
return lgUdidResult ? _object_spread({}, lgUdidResult) : void 0;
|
|
673
|
+
}
|
|
674
|
+
function getOrRotateFallbackDeviceId() {
|
|
675
|
+
var maxAgeMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_FALLBACK_DEVICE_ID_MAX_AGE_MS, now = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Date.now();
|
|
676
|
+
clearLegacyIdsOnce();
|
|
677
|
+
var age = clampAge(maxAgeMs, DEFAULT_FALLBACK_DEVICE_ID_MAX_AGE_MS);
|
|
678
|
+
var stored = readStored(FALLBACK_DEVICE_ID_KEY);
|
|
679
|
+
if (stored && isUsableAdId(stored.id) && now - stored.createdAt >= 0 && now - stored.createdAt < age) {
|
|
680
|
+
return stored.id;
|
|
681
|
+
}
|
|
682
|
+
var id = createUuid();
|
|
683
|
+
writeStored(FALLBACK_DEVICE_ID_KEY, {
|
|
684
|
+
id: id,
|
|
685
|
+
createdAt: now
|
|
686
|
+
});
|
|
687
|
+
return id;
|
|
688
|
+
}
|
|
689
|
+
function getOrRotateSessionId() {
|
|
690
|
+
var maxAgeMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : DEFAULT_SESSION_ID_MAX_AGE_MS, avoidValue = arguments.length > 1 ? arguments[1] : void 0, now = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Date.now();
|
|
691
|
+
clearLegacyIdsOnce();
|
|
692
|
+
var age = clampAge(maxAgeMs, DEFAULT_SESSION_ID_MAX_AGE_MS, MAX_SESSION_ID_AGE_MS);
|
|
693
|
+
var stored = readStored(SESSION_ID_KEY);
|
|
694
|
+
if (stored && isUsableAdId(stored.id) && stored.id !== avoidValue && now - stored.createdAt >= 0 && now - stored.createdAt < age) {
|
|
695
|
+
return stored.id;
|
|
696
|
+
}
|
|
697
|
+
var id = createUuid();
|
|
698
|
+
while(id === avoidValue)id = createUuid();
|
|
699
|
+
writeStored(SESSION_ID_KEY, {
|
|
700
|
+
id: id,
|
|
701
|
+
createdAt: now
|
|
702
|
+
});
|
|
703
|
+
return id;
|
|
704
|
+
}
|
|
448
705
|
// src/utils/vastEnvironmentSignals.ts
|
|
449
|
-
var CTV_SESSION_STORAGE_KEY = "stormcloud.ctv.sid";
|
|
450
706
|
var PLAYER_ID_STORAGE_KEY = "stormcloud.player.id";
|
|
451
707
|
var DEVICE_ID_STORAGE_KEYS = [
|
|
452
708
|
"rdid",
|
|
@@ -465,49 +721,96 @@ var ANDROID_ID_TYPES = /* @__PURE__ */ new Set([
|
|
|
465
721
|
"adid"
|
|
466
722
|
]);
|
|
467
723
|
function resolveVastEnvironmentSignals(isCtv) {
|
|
468
|
-
var
|
|
469
|
-
var platformDevice = readPlatformNativeDeviceId();
|
|
470
|
-
var bridgeDeviceId = validDeviceId(bridgeSignals.deviceId);
|
|
471
|
-
var realDeviceId = bridgeDeviceId || (isCtv ? validDeviceId(readStoredDeviceId()) : void 0) || validDeviceId(platformDevice.deviceId);
|
|
472
|
-
var deviceId = realDeviceId;
|
|
473
|
-
var deviceIdType = (bridgeDeviceId ? bridgeSignals.deviceIdType : void 0) || readStoredString("deviceIdType") || readStoredString("idtype") || platformDevice.deviceIdType || inferDeviceIdType();
|
|
474
|
-
var platformLat = bridgeDeviceId ? bridgeSignals.limitAdTracking : platformDevice.limitAdTracking;
|
|
475
|
-
var limitAdTracking = deviceId != null ? platformLat !== null && platformLat !== void 0 ? platformLat : readStoredLimitAdTracking() : void 0;
|
|
476
|
-
if (!deviceId && isCtv) {
|
|
477
|
-
var dpid = getOrCreateStoredUuid(PLAYER_ID_STORAGE_KEY);
|
|
478
|
-
if (dpid) {
|
|
479
|
-
deviceId = dpid;
|
|
480
|
-
deviceIdType = "dpid";
|
|
481
|
-
limitAdTracking = platformLat !== null && platformLat !== void 0 ? platformLat : readStoredLimitAdTracking();
|
|
482
|
-
}
|
|
483
|
-
}
|
|
724
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
484
725
|
var deviceTypeHint = resolveDeviceTypeHint(isCtv);
|
|
726
|
+
var identity = resolveDeviceIdentity(isCtv, options);
|
|
727
|
+
var identityFields = _object_spread({}, identity.deviceId ? {
|
|
728
|
+
deviceId: identity.deviceId
|
|
729
|
+
} : {}, identity.deviceId && identity.deviceIdType ? {
|
|
730
|
+
deviceIdType: identity.deviceIdType
|
|
731
|
+
} : {}, identity.deviceId && identity.limitAdTracking != null ? {
|
|
732
|
+
limitAdTracking: identity.limitAdTracking
|
|
733
|
+
} : {}, identity.source ? {
|
|
734
|
+
deviceIdSource: identity.source
|
|
735
|
+
} : {});
|
|
485
736
|
if (isCtv) {
|
|
486
737
|
return _object_spread_props(_object_spread({
|
|
487
738
|
isCtv: true,
|
|
488
|
-
sessionId:
|
|
489
|
-
},
|
|
490
|
-
deviceId: deviceId
|
|
491
|
-
} : {}, deviceId && deviceIdType ? {
|
|
492
|
-
deviceIdType: deviceIdType
|
|
493
|
-
} : {}, deviceId && limitAdTracking != null ? {
|
|
494
|
-
limitAdTracking: limitAdTracking
|
|
495
|
-
} : {}), {
|
|
739
|
+
sessionId: getOrRotateSessionId(options.sessionIdMaxAgeMs, identity.deviceId)
|
|
740
|
+
}, identityFields), {
|
|
496
741
|
deviceTypeHint: deviceTypeHint
|
|
497
742
|
});
|
|
498
743
|
}
|
|
499
744
|
return _object_spread_props(_object_spread({
|
|
500
745
|
isCtv: false
|
|
501
|
-
},
|
|
502
|
-
deviceId: deviceId
|
|
503
|
-
} : {}, deviceId && deviceIdType ? {
|
|
504
|
-
deviceIdType: deviceIdType
|
|
505
|
-
} : {}, deviceId && limitAdTracking != null ? {
|
|
506
|
-
limitAdTracking: limitAdTracking
|
|
507
|
-
} : {}), {
|
|
746
|
+
}, identityFields), {
|
|
508
747
|
deviceTypeHint: deviceTypeHint
|
|
509
748
|
});
|
|
510
749
|
}
|
|
750
|
+
function resolveDeviceIdentity(isCtv, options) {
|
|
751
|
+
var _platform_limitAdTracking;
|
|
752
|
+
var host = getHostAdIdentity();
|
|
753
|
+
if (host) {
|
|
754
|
+
var _host_deviceIdType;
|
|
755
|
+
return _object_spread_props(_object_spread({
|
|
756
|
+
deviceId: host.deviceId,
|
|
757
|
+
deviceIdType: (_host_deviceIdType = host.deviceIdType) !== null && _host_deviceIdType !== void 0 ? _host_deviceIdType : "dpid"
|
|
758
|
+
}, host.limitAdTracking != null ? {
|
|
759
|
+
limitAdTracking: host.limitAdTracking
|
|
760
|
+
} : {}), {
|
|
761
|
+
source: "host"
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
var bridge = readNativeBridgeSignals();
|
|
765
|
+
var bridgeDeviceId = validDeviceId(bridge.deviceId);
|
|
766
|
+
if (bridgeDeviceId) {
|
|
767
|
+
var _normalizeIdType;
|
|
768
|
+
return _object_spread_props(_object_spread({
|
|
769
|
+
deviceId: bridgeDeviceId,
|
|
770
|
+
deviceIdType: (_normalizeIdType = normalizeIdType(bridge.deviceIdType)) !== null && _normalizeIdType !== void 0 ? _normalizeIdType : "dpid"
|
|
771
|
+
}, bridge.limitAdTracking != null ? {
|
|
772
|
+
limitAdTracking: bridge.limitAdTracking
|
|
773
|
+
} : {}), {
|
|
774
|
+
source: "bridge"
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
var platform = readPlatformNativeDeviceId();
|
|
778
|
+
var platformDeviceId = validDeviceId(platform.deviceId);
|
|
779
|
+
if (platformDeviceId) {
|
|
780
|
+
var _platform_deviceIdType;
|
|
781
|
+
return _object_spread_props(_object_spread({
|
|
782
|
+
deviceId: platformDeviceId,
|
|
783
|
+
deviceIdType: (_platform_deviceIdType = platform.deviceIdType) !== null && _platform_deviceIdType !== void 0 ? _platform_deviceIdType : "dpid"
|
|
784
|
+
}, platform.limitAdTracking != null ? {
|
|
785
|
+
limitAdTracking: platform.limitAdTracking
|
|
786
|
+
} : {}), {
|
|
787
|
+
source: "platform"
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
if (!isCtv) return {};
|
|
791
|
+
var storedDeviceId = validDeviceId(readStoredDeviceId());
|
|
792
|
+
if (storedDeviceId) {
|
|
793
|
+
var _normalizeIdType1;
|
|
794
|
+
var storedLat = readStoredLimitAdTracking();
|
|
795
|
+
return _object_spread_props(_object_spread({
|
|
796
|
+
deviceId: storedDeviceId,
|
|
797
|
+
deviceIdType: (_normalizeIdType1 = normalizeIdType(readStoredString("deviceIdType") || readStoredString("idtype"))) !== null && _normalizeIdType1 !== void 0 ? _normalizeIdType1 : "dpid"
|
|
798
|
+
}, storedLat != null ? {
|
|
799
|
+
limitAdTracking: storedLat
|
|
800
|
+
} : {}), {
|
|
801
|
+
source: "stored"
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
var fallbackLat = (_platform_limitAdTracking = platform.limitAdTracking) !== null && _platform_limitAdTracking !== void 0 ? _platform_limitAdTracking : readStoredLimitAdTracking();
|
|
805
|
+
return _object_spread_props(_object_spread({
|
|
806
|
+
deviceId: getOrRotateFallbackDeviceId(options.fallbackDeviceIdMaxAgeMs),
|
|
807
|
+
deviceIdType: "dpid"
|
|
808
|
+
}, fallbackLat != null ? {
|
|
809
|
+
limitAdTracking: fallbackLat
|
|
810
|
+
} : {}), {
|
|
811
|
+
source: "generated"
|
|
812
|
+
});
|
|
813
|
+
}
|
|
511
814
|
var DEVICE_TYPE_HINT = {
|
|
512
815
|
FEATURE_PHONE: 1,
|
|
513
816
|
SMARTPHONE: 2,
|
|
@@ -668,7 +971,7 @@ function resolveNativeDeviceId() {
|
|
|
668
971
|
var bridgeSignals = readNativeBridgeSignals();
|
|
669
972
|
var platformDevice = readPlatformNativeDeviceId();
|
|
670
973
|
var deviceId = bridgeSignals.deviceId || (includeStored ? readStoredDeviceId() : void 0) || platformDevice.deviceId;
|
|
671
|
-
if (!deviceId || isMacroPlaceholder(deviceId) ||
|
|
974
|
+
if (!deviceId || isMacroPlaceholder(deviceId) || isZeroedAdId2(deviceId)) {
|
|
672
975
|
return void 0;
|
|
673
976
|
}
|
|
674
977
|
return deviceId;
|
|
@@ -682,20 +985,10 @@ function getOrCreateStoredUuid(storageKey) {
|
|
|
682
985
|
writePersistentId(storageKey, existing);
|
|
683
986
|
return existing;
|
|
684
987
|
}
|
|
685
|
-
var id =
|
|
988
|
+
var id = createUuid2();
|
|
686
989
|
writePersistentId(storageKey, id);
|
|
687
990
|
return id;
|
|
688
991
|
}
|
|
689
|
-
function getOrCreateCtvSessionId() {
|
|
690
|
-
var existing = readPersistentId(CTV_SESSION_STORAGE_KEY);
|
|
691
|
-
if (existing) {
|
|
692
|
-
writePersistentId(CTV_SESSION_STORAGE_KEY, existing);
|
|
693
|
-
return existing;
|
|
694
|
-
}
|
|
695
|
-
var sessionId = createUuid();
|
|
696
|
-
writePersistentId(CTV_SESSION_STORAGE_KEY, sessionId);
|
|
697
|
-
return sessionId;
|
|
698
|
-
}
|
|
699
992
|
function readPersistentId(storageKey) {
|
|
700
993
|
return readStoredString(storageKey) || readCookie(storageKey);
|
|
701
994
|
}
|
|
@@ -748,7 +1041,7 @@ function writeCookie(name, value) {
|
|
|
748
1041
|
document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + ";path=/;max-age=" + PERSISTENT_ID_COOKIE_MAX_AGE + ";SameSite=Lax";
|
|
749
1042
|
} catch (unused) {}
|
|
750
1043
|
}
|
|
751
|
-
function
|
|
1044
|
+
function createUuid2() {
|
|
752
1045
|
var _bytes_, _bytes_1;
|
|
753
1046
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
754
1047
|
return crypto.randomUUID();
|
|
@@ -782,44 +1075,10 @@ function performanceNow() {
|
|
|
782
1075
|
}
|
|
783
1076
|
function readPlatformNativeDeviceId() {
|
|
784
1077
|
if (typeof window === "undefined") return {};
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
var tifa = typeof adinfo.getTIFA === "function" ? adinfo.getTIFA() : adinfo.tifa;
|
|
790
|
-
if (typeof tifa === "string" && tifa && !isMacroPlaceholder(tifa)) {
|
|
791
|
-
var lat = typeof adinfo.isLATEnabled === "function" ? adinfo.isLATEnabled() : void 0;
|
|
792
|
-
return _object_spread({
|
|
793
|
-
deviceId: tifa,
|
|
794
|
-
deviceIdType: "tifa"
|
|
795
|
-
}, typeof lat === "boolean" ? {
|
|
796
|
-
limitAdTracking: lat
|
|
797
|
-
} : {});
|
|
798
|
-
}
|
|
799
|
-
}
|
|
800
|
-
} catch (unused) {}
|
|
801
|
-
try {
|
|
802
|
-
var webOSDev = window.webOSDev;
|
|
803
|
-
if (webOSDev) {
|
|
804
|
-
var _webOSDev_lgudid;
|
|
805
|
-
var lgudid = typeof webOSDev.LGUDID === "function" ? webOSDev.LGUDID() : (_webOSDev_lgudid = webOSDev.lgudid) !== null && _webOSDev_lgudid !== void 0 ? _webOSDev_lgudid : webOSDev.LGUDID;
|
|
806
|
-
if (typeof lgudid === "string" && lgudid) {
|
|
807
|
-
if (isZeroedAdId(lgudid)) {
|
|
808
|
-
return {
|
|
809
|
-
deviceIdType: "lgudid",
|
|
810
|
-
limitAdTracking: true
|
|
811
|
-
};
|
|
812
|
-
}
|
|
813
|
-
if (!isMacroPlaceholder(lgudid)) {
|
|
814
|
-
return {
|
|
815
|
-
deviceId: lgudid,
|
|
816
|
-
deviceIdType: "lgudid",
|
|
817
|
-
limitAdTracking: false
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
} catch (unused) {}
|
|
1078
|
+
var tifa = readSamsungTifa();
|
|
1079
|
+
if (tifa) return tifa;
|
|
1080
|
+
var lgudid = readCachedLgUdid();
|
|
1081
|
+
if (lgudid) return lgudid;
|
|
823
1082
|
try {
|
|
824
1083
|
var roku = window.Roku;
|
|
825
1084
|
if (roku) {
|
|
@@ -846,7 +1105,7 @@ function isMacroPlaceholder(value) {
|
|
|
846
1105
|
function validDeviceId(value) {
|
|
847
1106
|
return value && !isMacroPlaceholder(value) ? value : void 0;
|
|
848
1107
|
}
|
|
849
|
-
function
|
|
1108
|
+
function isZeroedAdId2(value) {
|
|
850
1109
|
return ZEROED_AD_ID_PATTERNS.has(value.trim().toLowerCase());
|
|
851
1110
|
}
|
|
852
1111
|
function readNativeBridgeSignals() {
|
|
@@ -890,7 +1149,7 @@ function readNativeBridgeSignals() {
|
|
|
890
1149
|
"deviceIdType",
|
|
891
1150
|
"advertisingIdType",
|
|
892
1151
|
"idType"
|
|
893
|
-
]) ||
|
|
1152
|
+
]) || void 0;
|
|
894
1153
|
var limitAdTracking = readBridgeBoolean(source, [
|
|
895
1154
|
"is_lat",
|
|
896
1155
|
"limitAdTracking",
|
|
@@ -1070,6 +1329,308 @@ function normalizeBoolean(value) {
|
|
|
1070
1329
|
}
|
|
1071
1330
|
return void 0;
|
|
1072
1331
|
}
|
|
1332
|
+
// src/utils/contentMetadata.ts
|
|
1333
|
+
var MAX_CONTENT_VALUE_LENGTH = 128;
|
|
1334
|
+
var BRIDGE_KEYS = {
|
|
1335
|
+
channelName: [
|
|
1336
|
+
"channelName",
|
|
1337
|
+
"ct_ch"
|
|
1338
|
+
],
|
|
1339
|
+
programTitle: [
|
|
1340
|
+
"programTitle",
|
|
1341
|
+
"ct_ti"
|
|
1342
|
+
],
|
|
1343
|
+
contentNetwork: [
|
|
1344
|
+
"contentNetwork",
|
|
1345
|
+
"ct_ne"
|
|
1346
|
+
],
|
|
1347
|
+
contentType: [
|
|
1348
|
+
"contentType",
|
|
1349
|
+
"ctt"
|
|
1350
|
+
],
|
|
1351
|
+
contentCategory: [
|
|
1352
|
+
"contentCategory",
|
|
1353
|
+
"ctc"
|
|
1354
|
+
],
|
|
1355
|
+
contentGenre: [
|
|
1356
|
+
"contentGenre",
|
|
1357
|
+
"ctgr"
|
|
1358
|
+
],
|
|
1359
|
+
contentLanguage: [
|
|
1360
|
+
"contentLanguage",
|
|
1361
|
+
"ctlg"
|
|
1362
|
+
],
|
|
1363
|
+
contentDuration: [
|
|
1364
|
+
"contentDuration",
|
|
1365
|
+
"ctd"
|
|
1366
|
+
],
|
|
1367
|
+
contentSeason: [
|
|
1368
|
+
"contentSeason",
|
|
1369
|
+
"cts"
|
|
1370
|
+
],
|
|
1371
|
+
contentEpisode: [
|
|
1372
|
+
"contentEpisode",
|
|
1373
|
+
"cte"
|
|
1374
|
+
],
|
|
1375
|
+
contentRating: [
|
|
1376
|
+
"contentRating",
|
|
1377
|
+
"ctr"
|
|
1378
|
+
],
|
|
1379
|
+
contentId: [
|
|
1380
|
+
"contentId",
|
|
1381
|
+
"ctid"
|
|
1382
|
+
]
|
|
1383
|
+
};
|
|
1384
|
+
function sanitizeContentValue(value) {
|
|
1385
|
+
if (typeof value !== "string") return void 0;
|
|
1386
|
+
var cleaned = value.replace(/[\u0000-\u001f\u007f]/g, " ").replace(/\s+/g, " ").trim();
|
|
1387
|
+
if (!cleaned) return void 0;
|
|
1388
|
+
if (/^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%|\$\{[^}]+\})$/.test(cleaned)) return void 0;
|
|
1389
|
+
if (/^(unknown|null|undefined|none|n\/a|-)$/i.test(cleaned)) return void 0;
|
|
1390
|
+
return cleaned.length > MAX_CONTENT_VALUE_LENGTH ? cleaned.slice(0, MAX_CONTENT_VALUE_LENGTH).trim() : cleaned;
|
|
1391
|
+
}
|
|
1392
|
+
function sanitizeContentScalar(value) {
|
|
1393
|
+
if (typeof value === "number") {
|
|
1394
|
+
return Number.isFinite(value) ? String(value) : void 0;
|
|
1395
|
+
}
|
|
1396
|
+
return sanitizeContentValue(value);
|
|
1397
|
+
}
|
|
1398
|
+
function normalizeContentLanguage(value) {
|
|
1399
|
+
var cleaned = sanitizeContentValue(value);
|
|
1400
|
+
if (!cleaned) return void 0;
|
|
1401
|
+
var match = cleaned.match(/^([A-Za-z]{2})(?:[-_][A-Za-z0-9]{1,8})*$/);
|
|
1402
|
+
return match && match[1] ? match[1].toLowerCase() : void 0;
|
|
1403
|
+
}
|
|
1404
|
+
function normalizeContentDuration(value) {
|
|
1405
|
+
var raw = sanitizeContentScalar(value);
|
|
1406
|
+
if (raw == null || !/^-?\d+(\.\d+)?$/.test(raw)) return void 0;
|
|
1407
|
+
var seconds = Number(raw);
|
|
1408
|
+
if (seconds === -1) return -1;
|
|
1409
|
+
return seconds > 0 ? Math.round(seconds) : void 0;
|
|
1410
|
+
}
|
|
1411
|
+
function bridgeSources() {
|
|
1412
|
+
if (typeof window === "undefined") return [];
|
|
1413
|
+
var w = window;
|
|
1414
|
+
return [
|
|
1415
|
+
w.__STORMCLOUD_CTV__,
|
|
1416
|
+
w.__STORMCLOUD_CTV_AD_INFO__,
|
|
1417
|
+
w.stormcloudCtv
|
|
1418
|
+
].filter(Boolean);
|
|
1419
|
+
}
|
|
1420
|
+
function readBridgeValue2(keys, sanitize) {
|
|
1421
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1422
|
+
try {
|
|
1423
|
+
for(var _iterator = bridgeSources()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1424
|
+
var source = _step.value;
|
|
1425
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
1426
|
+
try {
|
|
1427
|
+
for(var _iterator1 = keys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
1428
|
+
var key = _step1.value;
|
|
1429
|
+
var value = void 0;
|
|
1430
|
+
try {
|
|
1431
|
+
value = source === null || source === void 0 ? void 0 : source[key];
|
|
1432
|
+
if (typeof value === "function") value = value.call(source);
|
|
1433
|
+
} catch (unused) {
|
|
1434
|
+
value = void 0;
|
|
1435
|
+
}
|
|
1436
|
+
var sanitized = sanitize(value);
|
|
1437
|
+
if (sanitized != null) return sanitized;
|
|
1438
|
+
}
|
|
1439
|
+
} catch (err) {
|
|
1440
|
+
_didIteratorError1 = true;
|
|
1441
|
+
_iteratorError1 = err;
|
|
1442
|
+
} finally{
|
|
1443
|
+
try {
|
|
1444
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
1445
|
+
_iterator1.return();
|
|
1446
|
+
}
|
|
1447
|
+
} finally{
|
|
1448
|
+
if (_didIteratorError1) {
|
|
1449
|
+
throw _iteratorError1;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
} catch (err) {
|
|
1455
|
+
_didIteratorError = true;
|
|
1456
|
+
_iteratorError = err;
|
|
1457
|
+
} finally{
|
|
1458
|
+
try {
|
|
1459
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1460
|
+
_iterator.return();
|
|
1461
|
+
}
|
|
1462
|
+
} finally{
|
|
1463
|
+
if (_didIteratorError) {
|
|
1464
|
+
throw _iteratorError;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
}
|
|
1468
|
+
return void 0;
|
|
1469
|
+
}
|
|
1470
|
+
function readBridgeContentValue(keys) {
|
|
1471
|
+
return readBridgeValue2(keys, sanitizeContentValue);
|
|
1472
|
+
}
|
|
1473
|
+
function resolveContentMetadata(config) {
|
|
1474
|
+
var _sanitizeContentValue, _sanitizeContentValue1, _sanitizeContentValue2, _config_contentDetails, _sanitizeContentValue3, _sanitizeContentValue4, _sanitizeContentValue5, _normalizeContentLanguage, _normalizeContentDuration, _sanitizeContentScalar, _sanitizeContentScalar1, _sanitizeContentValue6, _sanitizeContentValue7;
|
|
1475
|
+
var channelName = (_sanitizeContentValue = sanitizeContentValue(config.channelName)) !== null && _sanitizeContentValue !== void 0 ? _sanitizeContentValue : readBridgeContentValue(BRIDGE_KEYS.channelName);
|
|
1476
|
+
var programTitle = (_sanitizeContentValue1 = sanitizeContentValue(config.programTitle)) !== null && _sanitizeContentValue1 !== void 0 ? _sanitizeContentValue1 : readBridgeContentValue(BRIDGE_KEYS.programTitle);
|
|
1477
|
+
var contentNetwork = (_sanitizeContentValue2 = sanitizeContentValue(config.contentNetwork)) !== null && _sanitizeContentValue2 !== void 0 ? _sanitizeContentValue2 : readBridgeContentValue(BRIDGE_KEYS.contentNetwork);
|
|
1478
|
+
var details = (_config_contentDetails = config.contentDetails) !== null && _config_contentDetails !== void 0 ? _config_contentDetails : {};
|
|
1479
|
+
var contentType = (_sanitizeContentValue3 = sanitizeContentValue(details.contentType)) !== null && _sanitizeContentValue3 !== void 0 ? _sanitizeContentValue3 : readBridgeContentValue(BRIDGE_KEYS.contentType);
|
|
1480
|
+
var contentCategory = (_sanitizeContentValue4 = sanitizeContentValue(details.category)) !== null && _sanitizeContentValue4 !== void 0 ? _sanitizeContentValue4 : readBridgeContentValue(BRIDGE_KEYS.contentCategory);
|
|
1481
|
+
var contentGenre = (_sanitizeContentValue5 = sanitizeContentValue(details.genre)) !== null && _sanitizeContentValue5 !== void 0 ? _sanitizeContentValue5 : readBridgeContentValue(BRIDGE_KEYS.contentGenre);
|
|
1482
|
+
var contentLanguage = (_normalizeContentLanguage = normalizeContentLanguage(details.language)) !== null && _normalizeContentLanguage !== void 0 ? _normalizeContentLanguage : readBridgeValue2(BRIDGE_KEYS.contentLanguage, normalizeContentLanguage);
|
|
1483
|
+
var contentDurationSeconds = (_normalizeContentDuration = normalizeContentDuration(details.durationSeconds)) !== null && _normalizeContentDuration !== void 0 ? _normalizeContentDuration : readBridgeValue2(BRIDGE_KEYS.contentDuration, normalizeContentDuration);
|
|
1484
|
+
var contentSeason = (_sanitizeContentScalar = sanitizeContentScalar(details.season)) !== null && _sanitizeContentScalar !== void 0 ? _sanitizeContentScalar : readBridgeValue2(BRIDGE_KEYS.contentSeason, sanitizeContentScalar);
|
|
1485
|
+
var contentEpisode = (_sanitizeContentScalar1 = sanitizeContentScalar(details.episode)) !== null && _sanitizeContentScalar1 !== void 0 ? _sanitizeContentScalar1 : readBridgeValue2(BRIDGE_KEYS.contentEpisode, sanitizeContentScalar);
|
|
1486
|
+
var contentRating = (_sanitizeContentValue6 = sanitizeContentValue(details.rating)) !== null && _sanitizeContentValue6 !== void 0 ? _sanitizeContentValue6 : readBridgeContentValue(BRIDGE_KEYS.contentRating);
|
|
1487
|
+
var contentId = (_sanitizeContentValue7 = sanitizeContentValue(details.contentId)) !== null && _sanitizeContentValue7 !== void 0 ? _sanitizeContentValue7 : readBridgeContentValue(BRIDGE_KEYS.contentId);
|
|
1488
|
+
return _object_spread({}, channelName ? {
|
|
1489
|
+
channelName: channelName
|
|
1490
|
+
} : {}, programTitle ? {
|
|
1491
|
+
programTitle: programTitle
|
|
1492
|
+
} : {}, contentNetwork ? {
|
|
1493
|
+
contentNetwork: contentNetwork
|
|
1494
|
+
} : {}, contentType ? {
|
|
1495
|
+
contentType: contentType
|
|
1496
|
+
} : {}, contentCategory ? {
|
|
1497
|
+
contentCategory: contentCategory
|
|
1498
|
+
} : {}, contentGenre ? {
|
|
1499
|
+
contentGenre: contentGenre
|
|
1500
|
+
} : {}, contentLanguage ? {
|
|
1501
|
+
contentLanguage: contentLanguage
|
|
1502
|
+
} : {}, contentDurationSeconds != null ? {
|
|
1503
|
+
contentDurationSeconds: contentDurationSeconds
|
|
1504
|
+
} : {}, contentSeason ? {
|
|
1505
|
+
contentSeason: contentSeason
|
|
1506
|
+
} : {}, contentEpisode ? {
|
|
1507
|
+
contentEpisode: contentEpisode
|
|
1508
|
+
} : {}, contentRating ? {
|
|
1509
|
+
contentRating: contentRating
|
|
1510
|
+
} : {}, contentId ? {
|
|
1511
|
+
contentId: contentId
|
|
1512
|
+
} : {});
|
|
1513
|
+
}
|
|
1514
|
+
function applyContentMetadataUpdate(target, meta) {
|
|
1515
|
+
var apply = function apply(key, value) {
|
|
1516
|
+
if (value === void 0) return;
|
|
1517
|
+
var clean = value === null ? void 0 : sanitizeContentValue(value);
|
|
1518
|
+
if (clean) target[key] = clean;
|
|
1519
|
+
else delete target[key];
|
|
1520
|
+
};
|
|
1521
|
+
apply("channelName", meta.channelName);
|
|
1522
|
+
apply("programTitle", meta.programTitle);
|
|
1523
|
+
apply("contentNetwork", meta.contentNetwork);
|
|
1524
|
+
if (meta.details === void 0) return;
|
|
1525
|
+
if (meta.details === null) delete target.contentDetails;
|
|
1526
|
+
else target.contentDetails = _object_spread({}, meta.details);
|
|
1527
|
+
}
|
|
1528
|
+
function appendMissingContentParams(url, meta) {
|
|
1529
|
+
if (!meta.channelName && !meta.programTitle && !meta.contentNetwork) return url;
|
|
1530
|
+
try {
|
|
1531
|
+
var parsed = new URL(url);
|
|
1532
|
+
var add = function add(key, value) {
|
|
1533
|
+
if (value && !parsed.searchParams.has(key)) parsed.searchParams.set(key, value);
|
|
1534
|
+
};
|
|
1535
|
+
add("ct_ch", meta.channelName);
|
|
1536
|
+
add("ct_ti", meta.programTitle);
|
|
1537
|
+
add("ct_ne", meta.contentNetwork);
|
|
1538
|
+
return parsed.toString();
|
|
1539
|
+
} catch (unused) {
|
|
1540
|
+
return url;
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
// src/utils/partnerSignals.ts
|
|
1544
|
+
var PLATFORM_IFA_TYPES = /* @__PURE__ */ new Set([
|
|
1545
|
+
"aaid",
|
|
1546
|
+
"adid",
|
|
1547
|
+
"afai",
|
|
1548
|
+
"idfa",
|
|
1549
|
+
"lgudid",
|
|
1550
|
+
"msai",
|
|
1551
|
+
"rida",
|
|
1552
|
+
"tifa",
|
|
1553
|
+
"tvos",
|
|
1554
|
+
"vaid",
|
|
1555
|
+
"vida"
|
|
1556
|
+
]);
|
|
1557
|
+
function toIabIfaType(deviceIdType, source) {
|
|
1558
|
+
if (!deviceIdType) return void 0;
|
|
1559
|
+
var type = deviceIdType.trim().toLowerCase();
|
|
1560
|
+
if (source === "generated") return "sessionid";
|
|
1561
|
+
if (PLATFORM_IFA_TYPES.has(type)) return type;
|
|
1562
|
+
if (source === "platform") return "dpid";
|
|
1563
|
+
return "ppid";
|
|
1564
|
+
}
|
|
1565
|
+
function playbackMethodCode(autoPlay, muted) {
|
|
1566
|
+
if (autoPlay === false) return 3;
|
|
1567
|
+
if (autoPlay !== true || muted == null) return void 0;
|
|
1568
|
+
return muted ? 2 : 1;
|
|
1569
|
+
}
|
|
1570
|
+
function resolvePlayerSize(video) {
|
|
1571
|
+
var width = video ? video.clientWidth : 0;
|
|
1572
|
+
var height = video ? video.clientHeight : 0;
|
|
1573
|
+
if (!(width > 0 && height > 0) && typeof window !== "undefined") {
|
|
1574
|
+
width = window.innerWidth;
|
|
1575
|
+
height = window.innerHeight;
|
|
1576
|
+
}
|
|
1577
|
+
if (!(width > 0 && height > 0)) return {};
|
|
1578
|
+
return {
|
|
1579
|
+
width: Math.round(width),
|
|
1580
|
+
height: Math.round(height)
|
|
1581
|
+
};
|
|
1582
|
+
}
|
|
1583
|
+
function sanitizeUserId(value) {
|
|
1584
|
+
var cleaned = sanitizeContentValue(value);
|
|
1585
|
+
if (!cleaned || /\s/.test(cleaned)) return void 0;
|
|
1586
|
+
return cleaned;
|
|
1587
|
+
}
|
|
1588
|
+
function isPublicIpv4(ip) {
|
|
1589
|
+
var parts = ip.split(".");
|
|
1590
|
+
if (parts.length !== 4) return false;
|
|
1591
|
+
var nums = parts.map(function(p) {
|
|
1592
|
+
return /^\d{1,3}$/.test(p) ? Number(p) : NaN;
|
|
1593
|
+
});
|
|
1594
|
+
if (nums.some(function(n) {
|
|
1595
|
+
return !(n >= 0 && n <= 255);
|
|
1596
|
+
})) return false;
|
|
1597
|
+
var _nums = _sliced_to_array(nums, 2), a = _nums[0], b = _nums[1];
|
|
1598
|
+
if (a === 0 || a === 10 || a === 127 || a >= 224) return false;
|
|
1599
|
+
if (a === 100 && b >= 64 && b <= 127) return false;
|
|
1600
|
+
if (a === 169 && b === 254) return false;
|
|
1601
|
+
if (a === 172 && b >= 16 && b <= 31) return false;
|
|
1602
|
+
if (a === 192 && b === 168) return false;
|
|
1603
|
+
return true;
|
|
1604
|
+
}
|
|
1605
|
+
function isPublicIpv6(ip) {
|
|
1606
|
+
var lower = ip.toLowerCase();
|
|
1607
|
+
if (!/^[0-9a-f:]+$/.test(lower) || lower.split(":").length < 3) return false;
|
|
1608
|
+
if (lower === "::" || lower === "::1") return false;
|
|
1609
|
+
if (/^fe[89ab]/.test(lower)) return false;
|
|
1610
|
+
if (/^f[cd]/.test(lower)) return false;
|
|
1611
|
+
return true;
|
|
1612
|
+
}
|
|
1613
|
+
function sanitizePublicIp(value) {
|
|
1614
|
+
var cleaned = sanitizeContentValue(value);
|
|
1615
|
+
if (!cleaned) return void 0;
|
|
1616
|
+
if (cleaned.includes(".")) return isPublicIpv4(cleaned) ? cleaned : void 0;
|
|
1617
|
+
return isPublicIpv6(cleaned) ? cleaned : void 0;
|
|
1618
|
+
}
|
|
1619
|
+
function resolveUserId(configValue) {
|
|
1620
|
+
var _sanitizeUserId;
|
|
1621
|
+
return (_sanitizeUserId = sanitizeUserId(configValue)) !== null && _sanitizeUserId !== void 0 ? _sanitizeUserId : readBridgeValue2([
|
|
1622
|
+
"userId",
|
|
1623
|
+
"uid"
|
|
1624
|
+
], sanitizeUserId);
|
|
1625
|
+
}
|
|
1626
|
+
function resolveClientIp(configValue) {
|
|
1627
|
+
var _sanitizePublicIp;
|
|
1628
|
+
return (_sanitizePublicIp = sanitizePublicIp(configValue)) !== null && _sanitizePublicIp !== void 0 ? _sanitizePublicIp : readBridgeValue2([
|
|
1629
|
+
"ipAddress",
|
|
1630
|
+
"clientIp",
|
|
1631
|
+
"ip"
|
|
1632
|
+
], sanitizePublicIp);
|
|
1633
|
+
}
|
|
1073
1634
|
// src/utils/vastMacros.ts
|
|
1074
1635
|
var UNEXPANDED_MACRO_PATTERN = /^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%)$/;
|
|
1075
1636
|
var INVALID_VAST_PARAM_KEY = /^\s|\s$/;
|
|
@@ -1387,7 +1948,8 @@ var NESTED_QUERY_PARAM_KEYS = /* @__PURE__ */ new Set([
|
|
|
1387
1948
|
var SCVP_POD_MACROS = /* @__PURE__ */ new Set([
|
|
1388
1949
|
"PMND",
|
|
1389
1950
|
"PMXD",
|
|
1390
|
-
"PMAD"
|
|
1951
|
+
"PMAD",
|
|
1952
|
+
"MABD"
|
|
1391
1953
|
]);
|
|
1392
1954
|
function hasScvpMacros(url) {
|
|
1393
1955
|
return !!url && SCVP_MACRO_DETECT.test(url);
|
|
@@ -1432,12 +1994,15 @@ function resolveScvpMacroValues(ctx) {
|
|
|
1432
1994
|
set("RDID", deviceId);
|
|
1433
1995
|
set("IDTYPE", deviceIdType);
|
|
1434
1996
|
set("IS-LAT", (_toFlag = toFlag(ctx.limitAdTracking)) !== null && _toFlag !== void 0 ? _toFlag : "0");
|
|
1997
|
+
set("IFA", deviceId);
|
|
1998
|
+
set("IFA-TYPE", toIabIfaType(deviceIdType, ctx.deviceIdSource));
|
|
1435
1999
|
}
|
|
1436
2000
|
set("SID", ctx.sessionId);
|
|
1437
2001
|
set("DTH", ctx.deviceTypeHint);
|
|
1438
2002
|
set("GIVN", ctx.palNonce);
|
|
1439
2003
|
set("CT-TI", ctx.programTitle);
|
|
1440
2004
|
set("CT-CH", ctx.channelName);
|
|
2005
|
+
set("CT-NE", ctx.contentNetwork);
|
|
1441
2006
|
set("POD", ctx.pod);
|
|
1442
2007
|
set("CORRELATOR", ctx.correlator);
|
|
1443
2008
|
set("SCOR", ctx.streamCorrelator);
|
|
@@ -1448,6 +2013,26 @@ function resolveScvpMacroValues(ctx) {
|
|
|
1448
2013
|
set("GDPR", (_ctx_consent = ctx.consent) === null || _ctx_consent === void 0 ? void 0 : _ctx_consent.gdpr);
|
|
1449
2014
|
set("GDPR-CONSENT", (_ctx_consent1 = ctx.consent) === null || _ctx_consent1 === void 0 ? void 0 : _ctx_consent1.gdprConsent);
|
|
1450
2015
|
set("US-PRIVACY", (_ctx_consent2 = ctx.consent) === null || _ctx_consent2 === void 0 ? void 0 : _ctx_consent2.usPrivacy);
|
|
2016
|
+
set("PLAYER-WIDTH", ctx.playerWidth);
|
|
2017
|
+
set("PLAYER-HEIGHT", ctx.playerHeight);
|
|
2018
|
+
set("TIMESTAMP", ctx.timestamp);
|
|
2019
|
+
set("LIVE", toFlag(ctx.isLive));
|
|
2020
|
+
set("VPMT", playbackMethodCode(ctx.isCtv ? true : ctx.adWillAutoPlay, ctx.adWillPlayMuted));
|
|
2021
|
+
set("DEVICE-MAKE", ctx.deviceMake);
|
|
2022
|
+
set("DEVICE-MODEL", ctx.deviceModel);
|
|
2023
|
+
set("DEVICE-HWV", ctx.deviceHardwareVersion);
|
|
2024
|
+
set("UA", ctx.userAgent);
|
|
2025
|
+
set("IP", ctx.ipAddress);
|
|
2026
|
+
set("UID", ctx.userId);
|
|
2027
|
+
set("CT-TYPE", ctx.contentType);
|
|
2028
|
+
set("CT-CATEGORY", ctx.contentCategory);
|
|
2029
|
+
set("CT-GENRE", ctx.contentGenre);
|
|
2030
|
+
set("CT-LANGUAGE", ctx.contentLanguage);
|
|
2031
|
+
set("CT-DURATION", ctx.contentDurationSeconds != null ? ctx.contentDurationSeconds : ctx.isLive ? -1 : void 0);
|
|
2032
|
+
set("CT-SEASON", ctx.contentSeason);
|
|
2033
|
+
set("CT-EPISODE", ctx.contentEpisode);
|
|
2034
|
+
set("CT-RATING", ctx.contentRating);
|
|
2035
|
+
set("CT-ID", ctx.contentId);
|
|
1451
2036
|
return values;
|
|
1452
2037
|
}
|
|
1453
2038
|
var keepNone = function keepNone() {
|
|
@@ -1666,6 +2251,9 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
1666
2251
|
if (ctx.channelName) {
|
|
1667
2252
|
params.set("ct_ch", ctx.channelName);
|
|
1668
2253
|
}
|
|
2254
|
+
if (ctx.contentNetwork) {
|
|
2255
|
+
params.set("ct_ne", ctx.contentNetwork);
|
|
2256
|
+
}
|
|
1669
2257
|
var staleKeys = [];
|
|
1670
2258
|
params.forEach(function(value, key) {
|
|
1671
2259
|
if (isMacroPlaceholder2(value)) {
|
|
@@ -2330,8 +2918,17 @@ function detectBrowser() {
|
|
|
2330
2918
|
chromeVersion: chromeVersionNum
|
|
2331
2919
|
};
|
|
2332
2920
|
}
|
|
2921
|
+
var singleDecoderOverride;
|
|
2922
|
+
function setSingleDecoderOverride(value) {
|
|
2923
|
+
singleDecoderOverride = value;
|
|
2924
|
+
}
|
|
2333
2925
|
function requiresMediaPipelineResetAfterAds() {
|
|
2334
2926
|
var _browser_tizenVersion;
|
|
2927
|
+
if (singleDecoderOverride != null) return singleDecoderOverride;
|
|
2928
|
+
try {
|
|
2929
|
+
var globalOverride = typeof window !== "undefined" ? window.__STORMCLOUD_SINGLE_DECODER__ : void 0;
|
|
2930
|
+
if (typeof globalOverride === "boolean") return globalOverride;
|
|
2931
|
+
} catch (unused) {}
|
|
2335
2932
|
var browser = detectBrowser();
|
|
2336
2933
|
return browser.name === "Samsung Tizen" && ((_browser_tizenVersion = browser.tizenVersion) !== null && _browser_tizenVersion !== void 0 ? _browser_tizenVersion : 0) >= 5;
|
|
2337
2934
|
}
|
|
@@ -2491,7 +3088,7 @@ function substituteVastTrackingMacros(url) {
|
|
|
2491
3088
|
});
|
|
2492
3089
|
}
|
|
2493
3090
|
// src/player/OptimizedPodRequest.ts
|
|
2494
|
-
var DEFAULT_REQUEST_SAFETY_MS =
|
|
3091
|
+
var DEFAULT_REQUEST_SAFETY_MS = 2500;
|
|
2495
3092
|
var GAM_AD_OPPORTUNITY_DURATION_MS = 3e4;
|
|
2496
3093
|
var POD_PARAM_KEYS = [
|
|
2497
3094
|
"pmnd",
|
|
@@ -2651,15 +3248,20 @@ function finalizeGamRequestUrl(rawUrl, ctx) {
|
|
|
2651
3248
|
values.set("PMND", String(pod.pmnd));
|
|
2652
3249
|
values.set("PMXD", String(pod.pmxd));
|
|
2653
3250
|
if (pod.pmad != null) values.set("PMAD", String(pod.pmad));
|
|
3251
|
+
values.set("MABD", String(Math.max(1, Math.floor(pod.pmxd / 1e3))));
|
|
2654
3252
|
}
|
|
2655
3253
|
var substituted = substituteScvpMacros(rawUrl, values);
|
|
2656
3254
|
var finalUrl;
|
|
2657
3255
|
try {
|
|
2658
3256
|
var url = new URL(normalizeVastTagUrl(substituted.url));
|
|
3257
|
+
var isGam = GAM_AD_HOSTS.has(url.hostname);
|
|
3258
|
+
var setPodParam = function setPodParam(key, value) {
|
|
3259
|
+
if (isGam || url.searchParams.has(key)) url.searchParams.set(key, String(value));
|
|
3260
|
+
};
|
|
2659
3261
|
if (pod) {
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
if (pod.pmad != null)
|
|
3262
|
+
setPodParam("pmnd", pod.pmnd);
|
|
3263
|
+
setPodParam("pmxd", pod.pmxd);
|
|
3264
|
+
if (pod.pmad != null) setPodParam("pmad", pod.pmad);
|
|
2663
3265
|
else url.searchParams.delete("pmad");
|
|
2664
3266
|
} else {
|
|
2665
3267
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
@@ -2725,7 +3327,9 @@ function validateGamRequestUrl(url, expect) {
|
|
|
2725
3327
|
if (leftover.length > 0) problems.push("unresolved SCVP macros: ".concat(leftover.join(", ")));
|
|
2726
3328
|
var params;
|
|
2727
3329
|
try {
|
|
2728
|
-
|
|
3330
|
+
var parsed = new URL(url);
|
|
3331
|
+
if (!GAM_AD_HOSTS.has(parsed.hostname)) return problems;
|
|
3332
|
+
params = parsed.searchParams;
|
|
2729
3333
|
} catch (unused) {
|
|
2730
3334
|
return problems.concat("URL could not be parsed");
|
|
2731
3335
|
}
|
|
@@ -2915,6 +3519,9 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
2915
3519
|
var mediaCandidateIndex = 0;
|
|
2916
3520
|
var mediaStartTimerId;
|
|
2917
3521
|
var MEDIA_START_TIMEOUT_MS = (_ref = options === null || options === void 0 ? void 0 : options.mediaStartTimeoutMs) !== null && _ref !== void 0 ? _ref : 8e3;
|
|
3522
|
+
var MAX_MEDIA_START_ATTEMPTS = 2;
|
|
3523
|
+
var MEDIA_START_TOTAL_BUDGET_MS = Math.max(MEDIA_START_TIMEOUT_MS, 1e4);
|
|
3524
|
+
var mediaStartBudgetStartedAt = 0;
|
|
2918
3525
|
var VAST_ERROR_MEDIA_TIMEOUT = 402;
|
|
2919
3526
|
var pendingVastRequests = /* @__PURE__ */ new Set();
|
|
2920
3527
|
var pendingRequestAbortReason;
|
|
@@ -4929,12 +5536,14 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
4929
5536
|
clearMediaStartTimer();
|
|
4930
5537
|
if (!(MEDIA_START_TIMEOUT_MS > 0)) return;
|
|
4931
5538
|
var startedAt = Date.now();
|
|
5539
|
+
var budgetLeftMs = mediaStartBudgetStartedAt > 0 ? MEDIA_START_TOTAL_BUDGET_MS - (startedAt - mediaStartBudgetStartedAt) : MEDIA_START_TIMEOUT_MS;
|
|
5540
|
+
var timeoutMs = Math.max(1e3, Math.min(MEDIA_START_TIMEOUT_MS, budgetLeftMs));
|
|
4932
5541
|
mediaStartTimerId = setTimeout(function() {
|
|
4933
5542
|
mediaStartTimerId = void 0;
|
|
4934
5543
|
if (!adPlaying || trackingFired.impression) return;
|
|
4935
|
-
console.warn("[HlsAdPlayer] Ad media did not start playing within ".concat(
|
|
5544
|
+
console.warn("[HlsAdPlayer] Ad media did not start playing within ".concat(timeoutMs, "ms"));
|
|
4936
5545
|
logFunnel("play_resolved_but_never_started", {
|
|
4937
|
-
timeoutMs:
|
|
5546
|
+
timeoutMs: timeoutMs,
|
|
4938
5547
|
elapsedMs: Date.now() - startedAt,
|
|
4939
5548
|
readyState: adVideoElement === null || adVideoElement === void 0 ? void 0 : adVideoElement.readyState,
|
|
4940
5549
|
networkState: adVideoElement === null || adVideoElement === void 0 ? void 0 : adVideoElement.networkState,
|
|
@@ -4943,7 +5552,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
4943
5552
|
vastErrorCode: VAST_ERROR_MEDIA_TIMEOUT
|
|
4944
5553
|
});
|
|
4945
5554
|
recoverFromAdFailure(VAST_ERROR_MEDIA_TIMEOUT);
|
|
4946
|
-
},
|
|
5555
|
+
}, timeoutMs);
|
|
4947
5556
|
}
|
|
4948
5557
|
function resetVideoElementForNextSource() {
|
|
4949
5558
|
clearStallWatchdog();
|
|
@@ -4958,6 +5567,20 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
4958
5567
|
function tryNextMediaCandidate() {
|
|
4959
5568
|
if (!currentAd || trackingFired.impression) return false;
|
|
4960
5569
|
if (mediaCandidateIndex >= mediaCandidates.length - 1) return false;
|
|
5570
|
+
if (mediaCandidateIndex + 1 >= MAX_MEDIA_START_ATTEMPTS) {
|
|
5571
|
+
logFunnel("media_fallback_capped", {
|
|
5572
|
+
reason: "max_attempts",
|
|
5573
|
+
attempts: mediaCandidateIndex + 1
|
|
5574
|
+
});
|
|
5575
|
+
return false;
|
|
5576
|
+
}
|
|
5577
|
+
if (mediaStartBudgetStartedAt > 0 && Date.now() - mediaStartBudgetStartedAt >= MEDIA_START_TOTAL_BUDGET_MS) {
|
|
5578
|
+
logFunnel("media_fallback_capped", {
|
|
5579
|
+
reason: "time_budget",
|
|
5580
|
+
elapsedMs: Date.now() - mediaStartBudgetStartedAt
|
|
5581
|
+
});
|
|
5582
|
+
return false;
|
|
5583
|
+
}
|
|
4961
5584
|
var failedUrl = currentAdMediaFile === null || currentAdMediaFile === void 0 ? void 0 : currentAdMediaFile.url;
|
|
4962
5585
|
mediaCandidateIndex++;
|
|
4963
5586
|
var next = mediaCandidates[mediaCandidateIndex];
|
|
@@ -4991,6 +5614,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
4991
5614
|
}
|
|
4992
5615
|
mediaCandidates = rankMediaCandidates(currentAd.mediaFiles);
|
|
4993
5616
|
mediaCandidateIndex = 0;
|
|
5617
|
+
mediaStartBudgetStartedAt = Date.now();
|
|
4994
5618
|
var mediaFile = mediaCandidates[0];
|
|
4995
5619
|
if (!mediaFile) {
|
|
4996
5620
|
logFunnel("media_unsupported", {
|
|
@@ -5930,6 +6554,7 @@ function getOrCreateNonceLoader(allowStorage) {
|
|
|
5930
6554
|
}
|
|
5931
6555
|
function createPalNonceManager() {
|
|
5932
6556
|
var currentNonce = "";
|
|
6557
|
+
var currentNonceCreatedAt = 0;
|
|
5933
6558
|
var currentNonceManager;
|
|
5934
6559
|
var pendingNonce;
|
|
5935
6560
|
return {
|
|
@@ -5946,6 +6571,9 @@ function createPalNonceManager() {
|
|
|
5946
6571
|
getCurrentNonce: function getCurrentNonce() {
|
|
5947
6572
|
return currentNonce;
|
|
5948
6573
|
},
|
|
6574
|
+
getNonceAgeMs: function getNonceAgeMs() {
|
|
6575
|
+
return currentNonce ? Date.now() - currentNonceCreatedAt : void 0;
|
|
6576
|
+
},
|
|
5949
6577
|
waitForNonce: function waitForNonce(maxWaitMs) {
|
|
5950
6578
|
if (currentNonce) return Promise.resolve(currentNonce);
|
|
5951
6579
|
var pending = pendingNonce;
|
|
@@ -5998,13 +6626,14 @@ function createPalNonceManager() {
|
|
|
5998
6626
|
},
|
|
5999
6627
|
reset: function reset() {
|
|
6000
6628
|
currentNonce = "";
|
|
6629
|
+
currentNonceCreatedAt = 0;
|
|
6001
6630
|
currentNonceManager = void 0;
|
|
6002
6631
|
pendingNonce = void 0;
|
|
6003
6632
|
}
|
|
6004
6633
|
};
|
|
6005
6634
|
function generate(options) {
|
|
6006
6635
|
return _async_to_generator(function() {
|
|
6007
|
-
var _options_allowStorage, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, loader, goog, request, manager, error;
|
|
6636
|
+
var _options_allowStorage, _options_adWillAutoPlay, _options_adWillPlayMuted, _options_playerVolume, _options_continuousPlayback, _options_iconsSupported, _options_supportedApiFrameworks, loader, goog, request, apiFrameworks, manager, error;
|
|
6008
6637
|
return _ts_generator(this, function(_state) {
|
|
6009
6638
|
switch(_state.label){
|
|
6010
6639
|
case 0:
|
|
@@ -6028,10 +6657,11 @@ function createPalNonceManager() {
|
|
|
6028
6657
|
request.playerVolume = (_options_playerVolume = options.playerVolume) !== null && _options_playerVolume !== void 0 ? _options_playerVolume : request.adWillPlayMuted ? 0 : 1;
|
|
6029
6658
|
request.continuousPlayback = (_options_continuousPlayback = options.continuousPlayback) !== null && _options_continuousPlayback !== void 0 ? _options_continuousPlayback : true;
|
|
6030
6659
|
request.descriptionUrl = toDevSafeUrl(options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : ""));
|
|
6031
|
-
request.iconsSupported =
|
|
6660
|
+
request.iconsSupported = (_options_iconsSupported = options.iconsSupported) !== null && _options_iconsSupported !== void 0 ? _options_iconsSupported : false;
|
|
6032
6661
|
request.playerType = "StormcloudVideoPlayer";
|
|
6033
6662
|
request.playerVersion = "1.0";
|
|
6034
|
-
|
|
6663
|
+
apiFrameworks = ((_options_supportedApiFrameworks = options.supportedApiFrameworks) !== null && _options_supportedApiFrameworks !== void 0 ? _options_supportedApiFrameworks : "").trim();
|
|
6664
|
+
if (apiFrameworks) request.supportedApiFrameworks = apiFrameworks;
|
|
6035
6665
|
request.url = toDevSafeUrl(options.descriptionUrl || (typeof window !== "undefined" ? window.location.href : ""));
|
|
6036
6666
|
request.videoWidth = options.videoWidth || 640;
|
|
6037
6667
|
request.videoHeight = options.videoHeight || 480;
|
|
@@ -6061,6 +6691,7 @@ function createPalNonceManager() {
|
|
|
6061
6691
|
manager = _state.sent();
|
|
6062
6692
|
currentNonceManager = manager;
|
|
6063
6693
|
currentNonce = manager.getNonce();
|
|
6694
|
+
currentNonceCreatedAt = Date.now();
|
|
6064
6695
|
console.log("[PAL] Nonce generated successfully");
|
|
6065
6696
|
return [
|
|
6066
6697
|
2,
|
|
@@ -6084,6 +6715,458 @@ function createPalNonceManager() {
|
|
|
6084
6715
|
})();
|
|
6085
6716
|
}
|
|
6086
6717
|
}
|
|
6718
|
+
// src/utils/deviceInfo.ts
|
|
6719
|
+
var CATEGORY_CODES = {
|
|
6720
|
+
"LG TV": "lg_tv",
|
|
6721
|
+
"LG Set-Top Box": "lg_stb",
|
|
6722
|
+
"Samsung TV": "samsung_tv",
|
|
6723
|
+
Other: "other"
|
|
6724
|
+
};
|
|
6725
|
+
var DEVICE_CATEGORIES = [
|
|
6726
|
+
"LG TV",
|
|
6727
|
+
"LG Set-Top Box",
|
|
6728
|
+
"Samsung TV",
|
|
6729
|
+
"Other"
|
|
6730
|
+
];
|
|
6731
|
+
var hostDeviceInfo;
|
|
6732
|
+
var lgDeviceInfo;
|
|
6733
|
+
var platformCache;
|
|
6734
|
+
var primePromise;
|
|
6735
|
+
function cleanString(value) {
|
|
6736
|
+
var maxLength = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 128;
|
|
6737
|
+
if (typeof value !== "string") return void 0;
|
|
6738
|
+
var t = value.replace(/[\u0000-\u001f\u007f]/g, " ").replace(/\s+/g, " ").trim();
|
|
6739
|
+
if (!t || /^(unknown|null|undefined|none|n\/a|-|0)$/i.test(t)) return void 0;
|
|
6740
|
+
return t.length > maxLength ? t.slice(0, maxLength) : t;
|
|
6741
|
+
}
|
|
6742
|
+
function safeCall2(fn, thisArg) {
|
|
6743
|
+
if (typeof fn !== "function") return void 0;
|
|
6744
|
+
try {
|
|
6745
|
+
return fn.call(thisArg);
|
|
6746
|
+
} catch (unused) {
|
|
6747
|
+
return void 0;
|
|
6748
|
+
}
|
|
6749
|
+
}
|
|
6750
|
+
function userAgent() {
|
|
6751
|
+
return typeof navigator !== "undefined" ? navigator.userAgent || "" : "";
|
|
6752
|
+
}
|
|
6753
|
+
function bridgeSources2() {
|
|
6754
|
+
if (typeof window === "undefined") return [];
|
|
6755
|
+
var w = window;
|
|
6756
|
+
return [
|
|
6757
|
+
w.__STORMCLOUD_CTV__,
|
|
6758
|
+
w.__STORMCLOUD_CTV_AD_INFO__,
|
|
6759
|
+
w.stormcloudCtv
|
|
6760
|
+
].filter(Boolean);
|
|
6761
|
+
}
|
|
6762
|
+
function readBridge(keys) {
|
|
6763
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
6764
|
+
try {
|
|
6765
|
+
for(var _iterator = bridgeSources2()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
6766
|
+
var source = _step.value;
|
|
6767
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
6768
|
+
try {
|
|
6769
|
+
for(var _iterator1 = keys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
6770
|
+
var key = _step1.value;
|
|
6771
|
+
var value = void 0;
|
|
6772
|
+
try {
|
|
6773
|
+
value = source === null || source === void 0 ? void 0 : source[key];
|
|
6774
|
+
if (typeof value === "function") value = value.call(source);
|
|
6775
|
+
} catch (unused) {
|
|
6776
|
+
value = void 0;
|
|
6777
|
+
}
|
|
6778
|
+
var clean = cleanString(value);
|
|
6779
|
+
if (clean) return clean;
|
|
6780
|
+
}
|
|
6781
|
+
} catch (err) {
|
|
6782
|
+
_didIteratorError1 = true;
|
|
6783
|
+
_iteratorError1 = err;
|
|
6784
|
+
} finally{
|
|
6785
|
+
try {
|
|
6786
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
6787
|
+
_iterator1.return();
|
|
6788
|
+
}
|
|
6789
|
+
} finally{
|
|
6790
|
+
if (_didIteratorError1) {
|
|
6791
|
+
throw _iteratorError1;
|
|
6792
|
+
}
|
|
6793
|
+
}
|
|
6794
|
+
}
|
|
6795
|
+
}
|
|
6796
|
+
} catch (err) {
|
|
6797
|
+
_didIteratorError = true;
|
|
6798
|
+
_iteratorError = err;
|
|
6799
|
+
} finally{
|
|
6800
|
+
try {
|
|
6801
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
6802
|
+
_iterator.return();
|
|
6803
|
+
}
|
|
6804
|
+
} finally{
|
|
6805
|
+
if (_didIteratorError) {
|
|
6806
|
+
throw _iteratorError;
|
|
6807
|
+
}
|
|
6808
|
+
}
|
|
6809
|
+
}
|
|
6810
|
+
return void 0;
|
|
6811
|
+
}
|
|
6812
|
+
function makeForCategory(category) {
|
|
6813
|
+
if (category === "LG TV" || category === "LG Set-Top Box") return "LG";
|
|
6814
|
+
if (category === "Samsung TV") return "Samsung";
|
|
6815
|
+
return void 0;
|
|
6816
|
+
}
|
|
6817
|
+
function normalizeCategory(value) {
|
|
6818
|
+
var v = cleanString(value);
|
|
6819
|
+
if (!v) return void 0;
|
|
6820
|
+
var exact = DEVICE_CATEGORIES.find(function(c) {
|
|
6821
|
+
return c.toLowerCase() === v.toLowerCase();
|
|
6822
|
+
});
|
|
6823
|
+
if (exact) return exact;
|
|
6824
|
+
var code = v.toLowerCase().replace(/[\s-]+/g, "_");
|
|
6825
|
+
var byCode = Object.keys(CATEGORY_CODES).find(function(c) {
|
|
6826
|
+
return CATEGORY_CODES[c] === code;
|
|
6827
|
+
});
|
|
6828
|
+
return byCode;
|
|
6829
|
+
}
|
|
6830
|
+
function parseUserAgentDeviceInfo(ua) {
|
|
6831
|
+
var sources = [];
|
|
6832
|
+
var out = {
|
|
6833
|
+
platform: "other",
|
|
6834
|
+
sources: sources
|
|
6835
|
+
};
|
|
6836
|
+
var chrome = ua.match(/(?:Chrome|PCBR)\/(\d+)\./) || ua.match(/\s(\d{2,3})\.\d+\.\d+\.\d+\/[\d.]+\s+TV\b/);
|
|
6837
|
+
if (chrome && chrome[1]) out.browserMajorVersion = parseInt(chrome[1], 10);
|
|
6838
|
+
if (/Web0S|webOS/i.test(ua)) {
|
|
6839
|
+
out.platform = "webos";
|
|
6840
|
+
var lg = ua.match(/LGE\s*;\s*([A-Za-z0-9][A-Za-z0-9._-]*)\s*;\s*(\d{2}\.\d{2}\.\d{2})/);
|
|
6841
|
+
if (lg && lg[1] && lg[2]) {
|
|
6842
|
+
out.model = lg[1];
|
|
6843
|
+
out.firmware = lg[2];
|
|
6844
|
+
sources.push("user_agent");
|
|
6845
|
+
}
|
|
6846
|
+
} else if (/Tizen/i.test(ua)) {
|
|
6847
|
+
out.platform = "tizen";
|
|
6848
|
+
var tizen = ua.match(/Tizen\s+(\d+(?:\.\d+)*)/i);
|
|
6849
|
+
if (tizen && tizen[1]) {
|
|
6850
|
+
out.osVersion = "Tizen ".concat(tizen[1]);
|
|
6851
|
+
sources.push("user_agent");
|
|
6852
|
+
}
|
|
6853
|
+
}
|
|
6854
|
+
return out;
|
|
6855
|
+
}
|
|
6856
|
+
function readSamsungProductInfo() {
|
|
6857
|
+
var _cleanString;
|
|
6858
|
+
var _window_webapis;
|
|
6859
|
+
if (typeof window === "undefined") return void 0;
|
|
6860
|
+
var productinfo = (_window_webapis = window.webapis) === null || _window_webapis === void 0 ? void 0 : _window_webapis.productinfo;
|
|
6861
|
+
if (!productinfo) return void 0;
|
|
6862
|
+
var model = (_cleanString = cleanString(safeCall2(productinfo.getRealModel, productinfo), 40)) !== null && _cleanString !== void 0 ? _cleanString : cleanString(safeCall2(productinfo.getModel, productinfo), 40);
|
|
6863
|
+
var firmware = cleanString(safeCall2(productinfo.getFirmware, productinfo), 64);
|
|
6864
|
+
var duid = cleanString(safeCall2(productinfo.getDuid, productinfo), 128);
|
|
6865
|
+
if (!model && !firmware && !duid) return void 0;
|
|
6866
|
+
return _object_spread({}, model ? {
|
|
6867
|
+
model: model
|
|
6868
|
+
} : {}, firmware ? {
|
|
6869
|
+
firmware: firmware
|
|
6870
|
+
} : {}, duid ? {
|
|
6871
|
+
internalDeviceId: duid,
|
|
6872
|
+
internalDeviceIdSource: "samsung_duid"
|
|
6873
|
+
} : {});
|
|
6874
|
+
}
|
|
6875
|
+
function readLgDeviceInfo(timeoutMs) {
|
|
6876
|
+
var webOS = typeof window !== "undefined" ? window.webOS : void 0;
|
|
6877
|
+
if (lgDeviceInfo || !webOS || typeof webOS.deviceInfo !== "function") return Promise.resolve();
|
|
6878
|
+
return new Promise(function(resolve) {
|
|
6879
|
+
var settled = false;
|
|
6880
|
+
var finish = function finish() {
|
|
6881
|
+
if (settled) return;
|
|
6882
|
+
settled = true;
|
|
6883
|
+
clearTimeout(timer);
|
|
6884
|
+
resolve();
|
|
6885
|
+
};
|
|
6886
|
+
var timer = setTimeout(finish, Math.max(0, timeoutMs));
|
|
6887
|
+
try {
|
|
6888
|
+
webOS.deviceInfo(function(info) {
|
|
6889
|
+
var model = cleanString(info === null || info === void 0 ? void 0 : info.modelName, 40);
|
|
6890
|
+
var firmware = cleanString(info === null || info === void 0 ? void 0 : info.version, 64);
|
|
6891
|
+
var sdkVersion = cleanString(info === null || info === void 0 ? void 0 : info.sdkVersion, 32);
|
|
6892
|
+
lgDeviceInfo = _object_spread({}, model ? {
|
|
6893
|
+
model: model
|
|
6894
|
+
} : {}, firmware ? {
|
|
6895
|
+
firmware: firmware
|
|
6896
|
+
} : {}, sdkVersion ? {
|
|
6897
|
+
sdkVersion: sdkVersion
|
|
6898
|
+
} : {});
|
|
6899
|
+
finish();
|
|
6900
|
+
});
|
|
6901
|
+
} catch (unused) {
|
|
6902
|
+
finish();
|
|
6903
|
+
}
|
|
6904
|
+
});
|
|
6905
|
+
}
|
|
6906
|
+
function computePlatformInfo() {
|
|
6907
|
+
var info = parseUserAgentDeviceInfo(userAgent());
|
|
6908
|
+
var sources = _to_consumable_array(info.sources);
|
|
6909
|
+
var samsung = readSamsungProductInfo();
|
|
6910
|
+
if (samsung) {
|
|
6911
|
+
info.platform = "tizen";
|
|
6912
|
+
if (samsung.model) info.model = samsung.model;
|
|
6913
|
+
if (samsung.firmware) info.firmware = samsung.firmware;
|
|
6914
|
+
if (samsung.internalDeviceId) {
|
|
6915
|
+
info.internalDeviceId = samsung.internalDeviceId;
|
|
6916
|
+
info.internalDeviceIdSource = "samsung_duid";
|
|
6917
|
+
}
|
|
6918
|
+
sources.push("samsung_productinfo");
|
|
6919
|
+
}
|
|
6920
|
+
if (lgDeviceInfo) {
|
|
6921
|
+
info.platform = "webos";
|
|
6922
|
+
if (!info.model && lgDeviceInfo.model) info.model = lgDeviceInfo.model;
|
|
6923
|
+
if (!info.firmware && lgDeviceInfo.firmware) info.firmware = lgDeviceInfo.firmware;
|
|
6924
|
+
if (lgDeviceInfo.sdkVersion) info.osVersion = "webOS TV ".concat(lgDeviceInfo.sdkVersion);
|
|
6925
|
+
sources.push("lg_deviceinfo");
|
|
6926
|
+
}
|
|
6927
|
+
var lgUdid = readCachedLgUdid();
|
|
6928
|
+
if ((lgUdid === null || lgUdid === void 0 ? void 0 : lgUdid.deviceId) && !info.internalDeviceId) {
|
|
6929
|
+
info.internalDeviceId = lgUdid.deviceId;
|
|
6930
|
+
info.internalDeviceIdSource = "lg_udid";
|
|
6931
|
+
sources.push("lg_udid");
|
|
6932
|
+
}
|
|
6933
|
+
info.sources = sources;
|
|
6934
|
+
return info;
|
|
6935
|
+
}
|
|
6936
|
+
function categorize(platform, model) {
|
|
6937
|
+
if (platform === "tizen") return "Samsung TV";
|
|
6938
|
+
if (platform === "webos") {
|
|
6939
|
+
var ua = userAgent();
|
|
6940
|
+
if (model && /^STB-/i.test(model) || /\bSTB-\d{4}|LGSTB/i.test(ua)) return "LG Set-Top Box";
|
|
6941
|
+
return "LG TV";
|
|
6942
|
+
}
|
|
6943
|
+
return "Other";
|
|
6944
|
+
}
|
|
6945
|
+
function setHostDeviceInfo(info) {
|
|
6946
|
+
hostDeviceInfo = info ? _object_spread({}, info) : void 0;
|
|
6947
|
+
}
|
|
6948
|
+
function primeDeviceInfo() {
|
|
6949
|
+
var timeoutMs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1500;
|
|
6950
|
+
if (!primePromise) {
|
|
6951
|
+
primePromise = Promise.all([
|
|
6952
|
+
readLgDeviceInfo(timeoutMs),
|
|
6953
|
+
primeLgUdid(timeoutMs)
|
|
6954
|
+
]).catch(function() {
|
|
6955
|
+
return void 0;
|
|
6956
|
+
}).then(function() {
|
|
6957
|
+
platformCache = computePlatformInfo();
|
|
6958
|
+
return getDeviceInfo();
|
|
6959
|
+
});
|
|
6960
|
+
}
|
|
6961
|
+
return primePromise;
|
|
6962
|
+
}
|
|
6963
|
+
function getDeviceInfo() {
|
|
6964
|
+
var _cleanString, _cleanString1, _ref, _cleanString2, _ref1, _cleanString3, _ref2, _normalizeCategory, _ref3, _cleanString4, _cleanString5;
|
|
6965
|
+
var platform = platformCache !== null && platformCache !== void 0 ? platformCache : computePlatformInfo();
|
|
6966
|
+
if (primePromise && !platformCache) {} else {
|
|
6967
|
+
platformCache = platform;
|
|
6968
|
+
}
|
|
6969
|
+
var host = hostDeviceInfo !== null && hostDeviceInfo !== void 0 ? hostDeviceInfo : {};
|
|
6970
|
+
var bridge = {
|
|
6971
|
+
terminalId: readBridge([
|
|
6972
|
+
"terminalId",
|
|
6973
|
+
"terminal_id"
|
|
6974
|
+
]),
|
|
6975
|
+
internalDeviceId: readBridge([
|
|
6976
|
+
"internalDeviceId",
|
|
6977
|
+
"internal_device_id"
|
|
6978
|
+
]),
|
|
6979
|
+
model: readBridge([
|
|
6980
|
+
"deviceModel"
|
|
6981
|
+
]),
|
|
6982
|
+
firmware: readBridge([
|
|
6983
|
+
"firmwareVersion"
|
|
6984
|
+
]),
|
|
6985
|
+
category: normalizeCategory(readBridge([
|
|
6986
|
+
"deviceCategory"
|
|
6987
|
+
])),
|
|
6988
|
+
make: readBridge([
|
|
6989
|
+
"deviceMake"
|
|
6990
|
+
]),
|
|
6991
|
+
hardwareVersion: readBridge([
|
|
6992
|
+
"deviceHardwareVersion",
|
|
6993
|
+
"hardwareVersion"
|
|
6994
|
+
])
|
|
6995
|
+
};
|
|
6996
|
+
var terminalId = (_cleanString = cleanString(host.terminalId)) !== null && _cleanString !== void 0 ? _cleanString : bridge.terminalId;
|
|
6997
|
+
var hostInternalId = (_cleanString1 = cleanString(host.internalDeviceId)) !== null && _cleanString1 !== void 0 ? _cleanString1 : bridge.internalDeviceId;
|
|
6998
|
+
var model = (_ref = (_cleanString2 = cleanString(host.model, 40)) !== null && _cleanString2 !== void 0 ? _cleanString2 : bridge.model) !== null && _ref !== void 0 ? _ref : platform.model;
|
|
6999
|
+
var firmware = (_ref1 = (_cleanString3 = cleanString(host.firmware, 64)) !== null && _cleanString3 !== void 0 ? _cleanString3 : bridge.firmware) !== null && _ref1 !== void 0 ? _ref1 : platform.firmware;
|
|
7000
|
+
var category = (_ref2 = (_normalizeCategory = normalizeCategory(host.category)) !== null && _normalizeCategory !== void 0 ? _normalizeCategory : bridge.category) !== null && _ref2 !== void 0 ? _ref2 : categorize(platform.platform, model);
|
|
7001
|
+
var sources = _to_consumable_array(platform.sources);
|
|
7002
|
+
var bridgeValues = [
|
|
7003
|
+
bridge.terminalId,
|
|
7004
|
+
bridge.internalDeviceId,
|
|
7005
|
+
bridge.model,
|
|
7006
|
+
bridge.firmware,
|
|
7007
|
+
bridge.category,
|
|
7008
|
+
bridge.make,
|
|
7009
|
+
bridge.hardwareVersion
|
|
7010
|
+
];
|
|
7011
|
+
if (bridgeValues.some(function(v) {
|
|
7012
|
+
return v !== void 0;
|
|
7013
|
+
})) sources.unshift("bridge");
|
|
7014
|
+
if (hostDeviceInfo) sources.unshift("host");
|
|
7015
|
+
var internalDeviceId = hostInternalId !== null && hostInternalId !== void 0 ? hostInternalId : platform.internalDeviceId;
|
|
7016
|
+
var internalDeviceIdSource = hostInternalId ? "host" : platform.internalDeviceIdSource;
|
|
7017
|
+
var make = (_ref3 = (_cleanString4 = cleanString(host.make, 40)) !== null && _cleanString4 !== void 0 ? _cleanString4 : bridge.make) !== null && _ref3 !== void 0 ? _ref3 : makeForCategory(category);
|
|
7018
|
+
var hardwareVersion = (_cleanString5 = cleanString(host.hardwareVersion, 40)) !== null && _cleanString5 !== void 0 ? _cleanString5 : bridge.hardwareVersion;
|
|
7019
|
+
var sonifiModel = model && category === "Samsung TV" && !/^SAMSUNG-IPTV-/i.test(model) ? "SAMSUNG-IPTV-".concat(model) : model;
|
|
7020
|
+
return _object_spread_props(_object_spread({
|
|
7021
|
+
category: category,
|
|
7022
|
+
categoryCode: CATEGORY_CODES[category]
|
|
7023
|
+
}, make ? {
|
|
7024
|
+
make: make
|
|
7025
|
+
} : {}, model ? {
|
|
7026
|
+
model: model
|
|
7027
|
+
} : {}, hardwareVersion ? {
|
|
7028
|
+
hardwareVersion: hardwareVersion
|
|
7029
|
+
} : {}, sonifiModel ? {
|
|
7030
|
+
sonifiModel: sonifiModel
|
|
7031
|
+
} : {}, firmware ? {
|
|
7032
|
+
firmware: firmware
|
|
7033
|
+
} : {}, platform.osVersion ? {
|
|
7034
|
+
osVersion: platform.osVersion
|
|
7035
|
+
} : {}, platform.browserMajorVersion != null ? {
|
|
7036
|
+
browserMajorVersion: platform.browserMajorVersion
|
|
7037
|
+
} : {}, internalDeviceId ? {
|
|
7038
|
+
internalDeviceId: internalDeviceId
|
|
7039
|
+
} : {}, internalDeviceId && internalDeviceIdSource ? {
|
|
7040
|
+
internalDeviceIdSource: internalDeviceIdSource
|
|
7041
|
+
} : {}, terminalId ? {
|
|
7042
|
+
terminalId: terminalId
|
|
7043
|
+
} : {}), {
|
|
7044
|
+
sources: sources
|
|
7045
|
+
});
|
|
7046
|
+
}
|
|
7047
|
+
var DEVICE_KEY_VALUE_KEYS = {
|
|
7048
|
+
category: "sc_dev",
|
|
7049
|
+
model: "sc_model",
|
|
7050
|
+
firmware: "sc_fw"
|
|
7051
|
+
};
|
|
7052
|
+
function sanitizeKeyValue(value) {
|
|
7053
|
+
if (typeof value !== "string") return void 0;
|
|
7054
|
+
var v = value.trim().replace(/[^A-Za-z0-9._-]+/g, "_").replace(/^_+|_+$/g, "");
|
|
7055
|
+
return v ? v.slice(0, 40) : void 0;
|
|
7056
|
+
}
|
|
7057
|
+
function deviceKeyValuePairs(info) {
|
|
7058
|
+
var pairs = [
|
|
7059
|
+
[
|
|
7060
|
+
DEVICE_KEY_VALUE_KEYS.category,
|
|
7061
|
+
info.categoryCode
|
|
7062
|
+
]
|
|
7063
|
+
];
|
|
7064
|
+
var model = sanitizeKeyValue(info.model);
|
|
7065
|
+
var firmware = sanitizeKeyValue(info.firmware);
|
|
7066
|
+
if (model) pairs.push([
|
|
7067
|
+
DEVICE_KEY_VALUE_KEYS.model,
|
|
7068
|
+
model
|
|
7069
|
+
]);
|
|
7070
|
+
if (firmware) pairs.push([
|
|
7071
|
+
DEVICE_KEY_VALUE_KEYS.firmware,
|
|
7072
|
+
firmware
|
|
7073
|
+
]);
|
|
7074
|
+
return pairs;
|
|
7075
|
+
}
|
|
7076
|
+
function applyDeviceKeyValues(url, info) {
|
|
7077
|
+
try {
|
|
7078
|
+
var parsed = new URL(url);
|
|
7079
|
+
var pairs = deviceKeyValuePairs(info);
|
|
7080
|
+
var ours = new Set(pairs.map(function(param) {
|
|
7081
|
+
var _param = _sliced_to_array(param, 1), k = _param[0];
|
|
7082
|
+
return k;
|
|
7083
|
+
}));
|
|
7084
|
+
var existing = (parsed.searchParams.get("cust_params") || "").split("&").filter(function(p) {
|
|
7085
|
+
var _p_split_;
|
|
7086
|
+
return p !== "" && !ours.has((_p_split_ = p.split("=")[0]) !== null && _p_split_ !== void 0 ? _p_split_ : "");
|
|
7087
|
+
});
|
|
7088
|
+
var merged = existing.concat(pairs.map(function(param) {
|
|
7089
|
+
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
7090
|
+
return "".concat(k, "=").concat(v);
|
|
7091
|
+
})).join("&");
|
|
7092
|
+
parsed.searchParams.set("cust_params", merged);
|
|
7093
|
+
return parsed.toString();
|
|
7094
|
+
} catch (unused) {
|
|
7095
|
+
return url;
|
|
7096
|
+
}
|
|
7097
|
+
}
|
|
7098
|
+
function deviceInfoAnalyticsFields(info) {
|
|
7099
|
+
return _object_spread({
|
|
7100
|
+
device_category: info.category
|
|
7101
|
+
}, info.model ? {
|
|
7102
|
+
device_model: info.model
|
|
7103
|
+
} : {}, info.sonifiModel ? {
|
|
7104
|
+
sonifi_model: info.sonifiModel
|
|
7105
|
+
} : {}, info.firmware ? {
|
|
7106
|
+
firmware_version: info.firmware
|
|
7107
|
+
} : {}, info.osVersion ? {
|
|
7108
|
+
os_version: info.osVersion
|
|
7109
|
+
} : {}, info.browserMajorVersion != null ? {
|
|
7110
|
+
browser_major_version: info.browserMajorVersion
|
|
7111
|
+
} : {}, info.internalDeviceId ? {
|
|
7112
|
+
internal_device_id: info.internalDeviceId
|
|
7113
|
+
} : {}, info.internalDeviceIdSource ? {
|
|
7114
|
+
internal_device_id_source: info.internalDeviceIdSource
|
|
7115
|
+
} : {}, info.terminalId ? {
|
|
7116
|
+
terminal_id: info.terminalId
|
|
7117
|
+
} : {});
|
|
7118
|
+
}
|
|
7119
|
+
// src/utils/screenActivity.ts
|
|
7120
|
+
var hostStandby = false;
|
|
7121
|
+
function setHostStandby(standby) {
|
|
7122
|
+
hostStandby = !!standby;
|
|
7123
|
+
}
|
|
7124
|
+
function toBoolean(value) {
|
|
7125
|
+
if (typeof value === "boolean") return value;
|
|
7126
|
+
if (typeof value === "number") return value === 1;
|
|
7127
|
+
if (typeof value === "string") {
|
|
7128
|
+
var v = value.trim().toLowerCase();
|
|
7129
|
+
if (v === "true" || v === "1" || v === "yes") return true;
|
|
7130
|
+
if (v === "false" || v === "0" || v === "no") return false;
|
|
7131
|
+
}
|
|
7132
|
+
return void 0;
|
|
7133
|
+
}
|
|
7134
|
+
function bridgeSaysStandby() {
|
|
7135
|
+
if (typeof window === "undefined") return false;
|
|
7136
|
+
var w = window;
|
|
7137
|
+
for(var _i = 0, _iter = [
|
|
7138
|
+
w.__STORMCLOUD_CTV__,
|
|
7139
|
+
w.__STORMCLOUD_CTV_AD_INFO__,
|
|
7140
|
+
w.stormcloudCtv
|
|
7141
|
+
]; _i < _iter.length; _i++){
|
|
7142
|
+
var source = _iter[_i];
|
|
7143
|
+
if (!source) continue;
|
|
7144
|
+
for(var _i1 = 0, _iter1 = [
|
|
7145
|
+
"standby",
|
|
7146
|
+
"isStandby",
|
|
7147
|
+
"screenOff"
|
|
7148
|
+
]; _i1 < _iter1.length; _i1++){
|
|
7149
|
+
var key = _iter1[_i1];
|
|
7150
|
+
var value = void 0;
|
|
7151
|
+
try {
|
|
7152
|
+
value = source[key];
|
|
7153
|
+
if (typeof value === "function") value = value.call(source);
|
|
7154
|
+
} catch (unused) {
|
|
7155
|
+
value = void 0;
|
|
7156
|
+
}
|
|
7157
|
+
if (toBoolean(value) === true) return true;
|
|
7158
|
+
}
|
|
7159
|
+
}
|
|
7160
|
+
return false;
|
|
7161
|
+
}
|
|
7162
|
+
function getScreenInactiveReason() {
|
|
7163
|
+
if (hostStandby) return "host_standby";
|
|
7164
|
+
if (typeof document !== "undefined" && document.visibilityState === "hidden") {
|
|
7165
|
+
return "document_hidden";
|
|
7166
|
+
}
|
|
7167
|
+
if (bridgeSaysStandby()) return "bridge_standby";
|
|
7168
|
+
return void 0;
|
|
7169
|
+
}
|
|
6087
7170
|
// src/utils/trackingIngest.ts
|
|
6088
7171
|
var DEFAULT_TRACKING_INGEST_CONFIG = {
|
|
6089
7172
|
enabled: true,
|
|
@@ -6181,6 +7264,9 @@ function buildAnalyticsContext(config) {
|
|
|
6181
7264
|
if (config.isLiveStream !== void 0) {
|
|
6182
7265
|
context.inputStreamType = config.isLiveStream ? "live" : "vod";
|
|
6183
7266
|
}
|
|
7267
|
+
if (config.sendDeviceInfoToAnalytics) {
|
|
7268
|
+
context.includeDeviceInfo = true;
|
|
7269
|
+
}
|
|
6184
7270
|
return context;
|
|
6185
7271
|
}
|
|
6186
7272
|
function getClientInfo() {
|
|
@@ -6476,7 +7562,7 @@ function buildPlayerMetricEvent() {
|
|
|
6476
7562
|
capture_at: captureAt
|
|
6477
7563
|
}, context.inputStreamType ? {
|
|
6478
7564
|
input_stream_type: context.inputStreamType
|
|
6479
|
-
} : {})
|
|
7565
|
+
} : {}, context.includeDeviceInfo ? deviceInfoAnalyticsFields(getDeviceInfo()) : {})
|
|
6480
7566
|
];
|
|
6481
7567
|
}
|
|
6482
7568
|
});
|
|
@@ -8031,6 +9117,13 @@ var Scte35CueManager = /*#__PURE__*/ function() {
|
|
|
8031
9117
|
return Scte35CueManager;
|
|
8032
9118
|
}();
|
|
8033
9119
|
// src/player/AdConfigManager.ts
|
|
9120
|
+
function isGamAdUrl(rawUrl) {
|
|
9121
|
+
try {
|
|
9122
|
+
return GAM_AD_HOSTS.has(new URL(rawUrl).hostname);
|
|
9123
|
+
} catch (unused) {
|
|
9124
|
+
return false;
|
|
9125
|
+
}
|
|
9126
|
+
}
|
|
8034
9127
|
function withDeferredPodParams(rawUrl, deferNonce) {
|
|
8035
9128
|
try {
|
|
8036
9129
|
var url = new URL(rawUrl);
|
|
@@ -8048,11 +9141,15 @@ function withDeferredPodParams(rawUrl, deferNonce) {
|
|
|
8048
9141
|
}
|
|
8049
9142
|
var AdConfigManager = /*#__PURE__*/ function() {
|
|
8050
9143
|
function AdConfigManager(config, video) {
|
|
9144
|
+
var _this = this;
|
|
8051
9145
|
_class_call_check(this, AdConfigManager);
|
|
8052
9146
|
this.vmapBreaks = [];
|
|
8053
9147
|
this.consumedVmapBreakIds = /* @__PURE__ */ new Set();
|
|
8054
9148
|
this.streamCorrelator = generateCorrelator();
|
|
8055
9149
|
this.consentSignals = {};
|
|
9150
|
+
this.isLiveStream = function() {
|
|
9151
|
+
return !!_this.config.isLiveStream;
|
|
9152
|
+
};
|
|
8056
9153
|
this.podCounter = 0;
|
|
8057
9154
|
this.podAssignedByPrefetch = false;
|
|
8058
9155
|
this.lastHeartbeatTime = 0;
|
|
@@ -8503,9 +9600,22 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
8503
9600
|
{
|
|
8504
9601
|
key: "generatePodVastUrl",
|
|
8505
9602
|
value: function generatePodVastUrl(baseUrl, adPlayer, palNonce, inAdBreak) {
|
|
9603
|
+
var _content_contentDurationSeconds;
|
|
8506
9604
|
var adWillPlayMuted = inAdBreak ? adPlayer.getOriginalMutedState() : this.video.muted;
|
|
8507
|
-
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest
|
|
8508
|
-
|
|
9605
|
+
var envSignals = resolveVastEnvironmentSignals(!!this.config.ctvAdRequest, {
|
|
9606
|
+
fallbackDeviceIdMaxAgeMs: this.config.fallbackDeviceIdMaxAgeMs,
|
|
9607
|
+
sessionIdMaxAgeMs: this.config.sessionIdMaxAgeMs
|
|
9608
|
+
});
|
|
9609
|
+
var content = resolveContentMetadata(this.config);
|
|
9610
|
+
var isLive = this.isLiveStream();
|
|
9611
|
+
var device = getDeviceInfo();
|
|
9612
|
+
var playerSize = resolvePlayerSize(this.video);
|
|
9613
|
+
var videoDuration = this.video.duration;
|
|
9614
|
+
var contentDurationSeconds = (_content_contentDurationSeconds = content.contentDurationSeconds) !== null && _content_contentDurationSeconds !== void 0 ? _content_contentDurationSeconds : !isLive && Number.isFinite(videoDuration) && videoDuration > 0 ? Math.round(videoDuration) : void 0;
|
|
9615
|
+
var userId = resolveUserId(this.config.adUserId);
|
|
9616
|
+
var ipAddress = resolveClientIp(this.config.clientIpAddress);
|
|
9617
|
+
var userAgent2 = typeof navigator !== "undefined" && navigator.userAgent ? navigator.userAgent : void 0;
|
|
9618
|
+
var macroContext = _object_spread(_object_spread_props(_object_spread(_object_spread_props(_object_spread({
|
|
8509
9619
|
correlator: this.viewCorrelator,
|
|
8510
9620
|
streamCorrelator: this.streamCorrelator,
|
|
8511
9621
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
@@ -8519,14 +9629,54 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
8519
9629
|
limitAdTracking: envSignals.limitAdTracking,
|
|
8520
9630
|
deviceTypeHint: envSignals.deviceTypeHint,
|
|
8521
9631
|
adTest: this.config.adTest
|
|
8522
|
-
},
|
|
8523
|
-
programTitle:
|
|
8524
|
-
} : {},
|
|
8525
|
-
channelName:
|
|
9632
|
+
}, content.programTitle ? {
|
|
9633
|
+
programTitle: content.programTitle
|
|
9634
|
+
} : {}, content.channelName ? {
|
|
9635
|
+
channelName: content.channelName
|
|
9636
|
+
} : {}, content.contentNetwork ? {
|
|
9637
|
+
contentNetwork: content.contentNetwork
|
|
8526
9638
|
} : {}), {
|
|
8527
9639
|
consent: this.consentSignals,
|
|
8528
|
-
palNonce: palNonce.getCurrentNonce() || void 0
|
|
8529
|
-
|
|
9640
|
+
palNonce: palNonce.getCurrentNonce() || void 0,
|
|
9641
|
+
deviceIdSource: envSignals.deviceIdSource,
|
|
9642
|
+
isLive: isLive
|
|
9643
|
+
}), playerSize.width ? {
|
|
9644
|
+
playerWidth: playerSize.width
|
|
9645
|
+
} : {}, playerSize.height ? {
|
|
9646
|
+
playerHeight: playerSize.height
|
|
9647
|
+
} : {}), {
|
|
9648
|
+
timestamp: String(Date.now())
|
|
9649
|
+
}), device.make ? {
|
|
9650
|
+
deviceMake: device.make
|
|
9651
|
+
} : {}, device.model ? {
|
|
9652
|
+
deviceModel: device.model
|
|
9653
|
+
} : {}, device.hardwareVersion ? {
|
|
9654
|
+
deviceHardwareVersion: device.hardwareVersion
|
|
9655
|
+
} : {}, userAgent2 ? {
|
|
9656
|
+
userAgent: userAgent2
|
|
9657
|
+
} : {}, ipAddress ? {
|
|
9658
|
+
ipAddress: ipAddress
|
|
9659
|
+
} : {}, userId ? {
|
|
9660
|
+
userId: userId
|
|
9661
|
+
} : {}, content.contentType ? {
|
|
9662
|
+
contentType: content.contentType
|
|
9663
|
+
} : {}, content.contentCategory ? {
|
|
9664
|
+
contentCategory: content.contentCategory
|
|
9665
|
+
} : {}, content.contentGenre ? {
|
|
9666
|
+
contentGenre: content.contentGenre
|
|
9667
|
+
} : {}, content.contentLanguage ? {
|
|
9668
|
+
contentLanguage: content.contentLanguage
|
|
9669
|
+
} : {}, contentDurationSeconds != null ? {
|
|
9670
|
+
contentDurationSeconds: contentDurationSeconds
|
|
9671
|
+
} : {}, content.contentSeason ? {
|
|
9672
|
+
contentSeason: content.contentSeason
|
|
9673
|
+
} : {}, content.contentEpisode ? {
|
|
9674
|
+
contentEpisode: content.contentEpisode
|
|
9675
|
+
} : {}, content.contentRating ? {
|
|
9676
|
+
contentRating: content.contentRating
|
|
9677
|
+
} : {}, content.contentId ? {
|
|
9678
|
+
contentId: content.contentId
|
|
9679
|
+
} : {});
|
|
8530
9680
|
var nonceReady = !!macroContext.palNonce;
|
|
8531
9681
|
var finalUrl;
|
|
8532
9682
|
if (hasScvpMacros(baseUrl)) {
|
|
@@ -8540,6 +9690,31 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
8540
9690
|
} else {
|
|
8541
9691
|
finalUrl = withDeferredPodParams(palNonce.injectNonce(ensureVideoAdType(applyVastMacros(baseUrl, macroContext))), !nonceReady);
|
|
8542
9692
|
}
|
|
9693
|
+
if (isGamAdUrl(finalUrl)) {
|
|
9694
|
+
finalUrl = appendMissingContentParams(finalUrl, content);
|
|
9695
|
+
if (this.config.ctvAdRequest && this.config.sendDeviceKeyValues !== false) {
|
|
9696
|
+
finalUrl = applyDeviceKeyValues(finalUrl, device);
|
|
9697
|
+
}
|
|
9698
|
+
}
|
|
9699
|
+
if (this.debug) {
|
|
9700
|
+
var id = envSignals.deviceId;
|
|
9701
|
+
console.log("[AD-IDENTITY]", {
|
|
9702
|
+
source: envSignals.deviceIdSource,
|
|
9703
|
+
idtype: envSignals.deviceIdType,
|
|
9704
|
+
rdidTail: id ? id.slice(-4) : void 0,
|
|
9705
|
+
isLat: envSignals.limitAdTracking,
|
|
9706
|
+
dth: envSignals.deviceTypeHint,
|
|
9707
|
+
sidTail: envSignals.sessionId ? envSignals.sessionId.slice(-4) : void 0,
|
|
9708
|
+
ct_ch: content.channelName,
|
|
9709
|
+
ct_ti: content.programTitle,
|
|
9710
|
+
ct_ne: content.contentNetwork,
|
|
9711
|
+
ifaType: toIabIfaType(envSignals.deviceIdType, envSignals.deviceIdSource),
|
|
9712
|
+
live: isLive,
|
|
9713
|
+
player: playerSize,
|
|
9714
|
+
make: device.make,
|
|
9715
|
+
model: device.model
|
|
9716
|
+
});
|
|
9717
|
+
}
|
|
8543
9718
|
console.log("[StormcloudVideoPlayer] Prepared optimized-pod request URL (pod=".concat(this.podCounter, "; pmnd/pmxd/pmad resolved at dispatch):"), finalUrl);
|
|
8544
9719
|
return finalUrl;
|
|
8545
9720
|
}
|
|
@@ -8591,7 +9766,6 @@ var AdConfigManager = /*#__PURE__*/ function() {
|
|
|
8591
9766
|
}
|
|
8592
9767
|
},
|
|
8593
9768
|
{
|
|
8594
|
-
// --- Tracking ---
|
|
8595
9769
|
key: "initializeTracking",
|
|
8596
9770
|
value: function initializeTracking() {
|
|
8597
9771
|
var _this = this;
|
|
@@ -8683,7 +9857,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
8683
9857
|
}
|
|
8684
9858
|
},
|
|
8685
9859
|
{
|
|
8686
|
-
// --- Ad stop timer ---
|
|
8687
9860
|
key: "scheduleAdStopCountdown",
|
|
8688
9861
|
value: function scheduleAdStopCountdown(remainingMs) {
|
|
8689
9862
|
var _this = this;
|
|
@@ -8715,7 +9888,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
8715
9888
|
}
|
|
8716
9889
|
},
|
|
8717
9890
|
{
|
|
8718
|
-
// --- Ad start timer ---
|
|
8719
9891
|
key: "scheduleAdStartIn",
|
|
8720
9892
|
value: function scheduleAdStartIn(delayMs) {
|
|
8721
9893
|
var _this = this;
|
|
@@ -8743,7 +9915,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
8743
9915
|
}
|
|
8744
9916
|
},
|
|
8745
9917
|
{
|
|
8746
|
-
// --- PTS drift ---
|
|
8747
9918
|
key: "updatePtsDrift",
|
|
8748
9919
|
value: function updatePtsDrift(ptsSecondsSample) {
|
|
8749
9920
|
var sampleMs = (this.video.currentTime - ptsSecondsSample) * 1e3;
|
|
@@ -8769,7 +9940,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
8769
9940
|
}
|
|
8770
9941
|
},
|
|
8771
9942
|
{
|
|
8772
|
-
// --- Duration boundary ---
|
|
8773
9943
|
key: "beginBreakTiming",
|
|
8774
9944
|
value: function beginBreakTiming(startWallClockMs) {
|
|
8775
9945
|
this.currentAdBreakStartWallClockMs = startWallClockMs;
|
|
@@ -8817,7 +9987,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
8817
9987
|
}
|
|
8818
9988
|
},
|
|
8819
9989
|
{
|
|
8820
|
-
// --- Duration budget ---
|
|
8821
9990
|
key: "getWallClockRemainingAdMs",
|
|
8822
9991
|
value: function getWallClockRemainingAdMs() {
|
|
8823
9992
|
var endWallClockMs = this.getAdBreakEndWallClockMs();
|
|
@@ -8966,7 +10135,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
8966
10135
|
}
|
|
8967
10136
|
},
|
|
8968
10137
|
{
|
|
8969
|
-
// --- Circuit breaker ---
|
|
8970
10138
|
key: "isTemporaryAdError",
|
|
8971
10139
|
value: function isTemporaryAdError(error) {
|
|
8972
10140
|
var _error_message;
|
|
@@ -9100,7 +10268,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
9100
10268
|
}
|
|
9101
10269
|
},
|
|
9102
10270
|
{
|
|
9103
|
-
// --- Watchdog ---
|
|
9104
10271
|
key: "startAdRequestWatchdog",
|
|
9105
10272
|
value: function startAdRequestWatchdog(token) {
|
|
9106
10273
|
var _this = this;
|
|
@@ -9145,7 +10312,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
9145
10312
|
}
|
|
9146
10313
|
},
|
|
9147
10314
|
{
|
|
9148
|
-
// --- Failsafe ---
|
|
9149
10315
|
key: "startAdFailsafeTimer",
|
|
9150
10316
|
value: function startAdFailsafeTimer(token) {
|
|
9151
10317
|
var _this = this;
|
|
@@ -9207,7 +10373,6 @@ var AdTimingService = /*#__PURE__*/ function() {
|
|
|
9207
10373
|
}
|
|
9208
10374
|
},
|
|
9209
10375
|
{
|
|
9210
|
-
// --- Reset for ad break end ---
|
|
9211
10376
|
key: "resetForBreakEnd",
|
|
9212
10377
|
value: function resetForBreakEnd() {
|
|
9213
10378
|
this.clearAdStopTimer();
|
|
@@ -9406,7 +10571,7 @@ var HlsEngine = /*#__PURE__*/ function() {
|
|
|
9406
10571
|
adBehavior: adBehavior
|
|
9407
10572
|
});
|
|
9408
10573
|
}
|
|
9409
|
-
if (!this.config.autoplay) return [
|
|
10574
|
+
if (!(this.config.autoplay && !this.callbacks.shouldHoldContentForAds())) return [
|
|
9410
10575
|
3,
|
|
9411
10576
|
2
|
|
9412
10577
|
];
|
|
@@ -9597,6 +10762,12 @@ var HlsEngine = /*#__PURE__*/ function() {
|
|
|
9597
10762
|
2
|
|
9598
10763
|
];
|
|
9599
10764
|
this.hasInitialBufferCompleted = true;
|
|
10765
|
+
if (this.shouldAutoplayAfterBuffering && this.callbacks.shouldHoldContentForAds()) {
|
|
10766
|
+
this.shouldAutoplayAfterBuffering = false;
|
|
10767
|
+
if (this.debug) {
|
|
10768
|
+
console.log("[StormcloudVideoPlayer] Buffer ready during an ad break; content stays paused until the break ends");
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
9600
10771
|
if (!this.shouldAutoplayAfterBuffering) return [
|
|
9601
10772
|
3,
|
|
9602
10773
|
2
|
|
@@ -10254,9 +11425,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10254
11425
|
}
|
|
10255
11426
|
},
|
|
10256
11427
|
{
|
|
10257
|
-
// ───────────────────────────────────────────────────────────────
|
|
10258
|
-
// IMA event listeners
|
|
10259
|
-
// ───────────────────────────────────────────────────────────────
|
|
10260
11428
|
key: "nextAdRequestUrl",
|
|
10261
11429
|
value: function nextAdRequestUrl(baseVastUrl) {
|
|
10262
11430
|
return this.host.generatePodVastUrl(baseVastUrl);
|
|
@@ -10492,9 +11660,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10492
11660
|
}
|
|
10493
11661
|
},
|
|
10494
11662
|
{
|
|
10495
|
-
// ───────────────────────────────────────────────────────────────
|
|
10496
|
-
// Ad break start
|
|
10497
|
-
// ───────────────────────────────────────────────────────────────
|
|
10498
11663
|
key: "isBreakActive",
|
|
10499
11664
|
value: function isBreakActive() {
|
|
10500
11665
|
return this.slotState !== "IDLE";
|
|
@@ -10522,7 +11687,7 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10522
11687
|
key: "handleAdStart",
|
|
10523
11688
|
value: function handleAdStart(marker) {
|
|
10524
11689
|
return _async_to_generator(function() {
|
|
10525
|
-
var baseVastUrl, edgeConfigured, adBreakDurationMs, currentMuted, currentVolume, epoch, mode, edgeUrl, outcome, podPlayed;
|
|
11690
|
+
var screenInactiveReason, baseVastUrl, edgeConfigured, adBreakDurationMs, currentMuted, currentVolume, epoch, mode, edgeUrl, outcome, podPlayed;
|
|
10526
11691
|
return _ts_generator(this, function(_state) {
|
|
10527
11692
|
switch(_state.label){
|
|
10528
11693
|
case 0:
|
|
@@ -10535,6 +11700,16 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10535
11700
|
2
|
|
10536
11701
|
];
|
|
10537
11702
|
}
|
|
11703
|
+
screenInactiveReason = getScreenInactiveReason();
|
|
11704
|
+
if (screenInactiveReason) {
|
|
11705
|
+
this.logOrchestratorFunnel("break_skipped_screen_inactive", {
|
|
11706
|
+
reason: screenInactiveReason
|
|
11707
|
+
});
|
|
11708
|
+
this.clearPendingAdBreak();
|
|
11709
|
+
return [
|
|
11710
|
+
2
|
|
11711
|
+
];
|
|
11712
|
+
}
|
|
10538
11713
|
baseVastUrl = this.adConfig.apiVastTagUrl;
|
|
10539
11714
|
edgeConfigured = !!this.host.getEdgePodBaseUrl();
|
|
10540
11715
|
if (!baseVastUrl && !edgeConfigured) {
|
|
@@ -10695,12 +11870,9 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10695
11870
|
},
|
|
10696
11871
|
{
|
|
10697
11872
|
key: "startOptimizedPod",
|
|
10698
|
-
value:
|
|
10699
|
-
// Optimized pod (single multi-ad request)
|
|
10700
|
-
// ───────────────────────────────────────────────────────────────
|
|
10701
|
-
function startOptimizedPod(baseVastUrl) {
|
|
11873
|
+
value: function startOptimizedPod(baseVastUrl) {
|
|
10702
11874
|
return _async_to_generator(function() {
|
|
10703
|
-
var podUrl, prefetched, epoch, generation, adPlayer, requestToken, requestUrl, _ref, _this_currentVastUrl, _adPlayer_getPodAdCount, finalizeRequestUrl, podCount, error;
|
|
11875
|
+
var podUrl, prefetched, epoch, generation, adPlayer, requestToken, requestUrl, _ref, _this_currentVastUrl, _adPlayer_getPodAdCount, finalizeRequestUrl, podCount, _this_host_config_maxAdBreakExtensionMs, remainingMs, overrunAllowanceMs, maxAdsCap, maxAds, error;
|
|
10704
11876
|
return _ts_generator(this, function(_state) {
|
|
10705
11877
|
switch(_state.label){
|
|
10706
11878
|
case 0:
|
|
@@ -10808,6 +11980,26 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10808
11980
|
false
|
|
10809
11981
|
];
|
|
10810
11982
|
}
|
|
11983
|
+
if (this.isBreakTimeBounded() && adPlayer.limitPodToBudget) {
|
|
11984
|
+
;
|
|
11985
|
+
remainingMs = this.timing.getRemainingAdMs();
|
|
11986
|
+
overrunAllowanceMs = Math.max(0, (_this_host_config_maxAdBreakExtensionMs = this.host.config.maxAdBreakExtensionMs) !== null && _this_host_config_maxAdBreakExtensionMs !== void 0 ? _this_host_config_maxAdBreakExtensionMs : 0);
|
|
11987
|
+
maxAdsCap = this.adConfig.resolveAdPodConfig().maxAdsPerBreak;
|
|
11988
|
+
maxAds = maxAdsCap != null ? Math.max(1, maxAdsCap - this.timing.totalAdsInBreak) : Number.MAX_SAFE_INTEGER;
|
|
11989
|
+
if (Number.isFinite(remainingMs)) {
|
|
11990
|
+
podCount = adPlayer.limitPodToBudget(remainingMs + overrunAllowanceMs, maxAds);
|
|
11991
|
+
if (podCount < 1) {
|
|
11992
|
+
if (this.timing.activeAdRequestToken === requestToken) {
|
|
11993
|
+
this.timing.activeAdRequestToken = null;
|
|
11994
|
+
}
|
|
11995
|
+
this.recordRequestFailure(new Error("No GAM ad fits the ".concat(Math.round(remainingMs), "ms left in the break")), podUrl);
|
|
11996
|
+
return [
|
|
11997
|
+
2,
|
|
11998
|
+
false
|
|
11999
|
+
];
|
|
12000
|
+
}
|
|
12001
|
+
}
|
|
12002
|
+
}
|
|
10811
12003
|
this.setSlotState("READY", "vast_ready");
|
|
10812
12004
|
if (this.debug) {
|
|
10813
12005
|
console.log(podCount === 1 ? "[POD] Response contained a single ad; playing it and enabling pod top-up" : "[POD] Optimized pod returned ".concat(podCount, " ads; playing pod in one controller"));
|
|
@@ -10877,9 +12069,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
10877
12069
|
}
|
|
10878
12070
|
},
|
|
10879
12071
|
{
|
|
10880
|
-
// ───────────────────────────────────────────────────────────────
|
|
10881
|
-
// Edge-first pods (live SCTE-35 only, GAM fallback)
|
|
10882
|
-
// ───────────────────────────────────────────────────────────────
|
|
10883
12072
|
key: "resetEdgeStateForBreak",
|
|
10884
12073
|
value: function resetEdgeStateForBreak() {
|
|
10885
12074
|
this.edgeExhaustedForBreak = false;
|
|
@@ -11097,9 +12286,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
11097
12286
|
}
|
|
11098
12287
|
},
|
|
11099
12288
|
{
|
|
11100
|
-
// ───────────────────────────────────────────────────────────────
|
|
11101
|
-
// Next-ad scheduling (single flight)
|
|
11102
|
-
// ───────────────────────────────────────────────────────────────
|
|
11103
12289
|
key: "setSlotState",
|
|
11104
12290
|
value: function setSlotState(next, reason) {
|
|
11105
12291
|
if (this.slotState === next) return;
|
|
@@ -11149,6 +12335,8 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
11149
12335
|
{
|
|
11150
12336
|
key: "getStopRequestingReason",
|
|
11151
12337
|
value: function getStopRequestingReason(remainingMs) {
|
|
12338
|
+
var screenInactiveReason = getScreenInactiveReason();
|
|
12339
|
+
if (screenInactiveReason) return "screen_inactive:".concat(screenInactiveReason);
|
|
11152
12340
|
if (this.breakSource === "vmap") {
|
|
11153
12341
|
if (this.adPodQueue.length === 0) return "vmap_queue_empty";
|
|
11154
12342
|
} else if (this.breakSource !== "scte35" || !this.followUpBaseVastUrl && !this.canRequestEdge()) {
|
|
@@ -11422,9 +12610,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
11422
12610
|
}
|
|
11423
12611
|
},
|
|
11424
12612
|
{
|
|
11425
|
-
// ───────────────────────────────────────────────────────────────
|
|
11426
|
-
// Per-request diagnostics
|
|
11427
|
-
// ───────────────────────────────────────────────────────────────
|
|
11428
12613
|
key: "recordRequestDiagnostic",
|
|
11429
12614
|
value: function recordRequestDiagnostic(payload) {
|
|
11430
12615
|
var requestId = payload.requestId;
|
|
@@ -11498,9 +12683,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
11498
12683
|
}
|
|
11499
12684
|
},
|
|
11500
12685
|
{
|
|
11501
|
-
// ───────────────────────────────────────────────────────────────
|
|
11502
|
-
// Single ad playback
|
|
11503
|
-
// ───────────────────────────────────────────────────────────────
|
|
11504
12686
|
key: "createGamDispatchFinalizer",
|
|
11505
12687
|
value: function createGamDispatchFinalizer(requestToken) {
|
|
11506
12688
|
var _this = this;
|
|
@@ -11963,9 +13145,6 @@ var AdBreakOrchestrator = /*#__PURE__*/ function() {
|
|
|
11963
13145
|
}
|
|
11964
13146
|
},
|
|
11965
13147
|
{
|
|
11966
|
-
// ───────────────────────────────────────────────────────────────
|
|
11967
|
-
// Ad break completion
|
|
11968
|
-
// ───────────────────────────────────────────────────────────────
|
|
11969
13148
|
key: "logBreakFunnel",
|
|
11970
13149
|
value: function logBreakFunnel(endReason) {
|
|
11971
13150
|
var funnel = this.breakFunnel;
|
|
@@ -12611,6 +13790,8 @@ var ContentHealthWatchdog = /*#__PURE__*/ function() {
|
|
|
12611
13790
|
return ContentHealthWatchdog;
|
|
12612
13791
|
}();
|
|
12613
13792
|
// src/player/StormcloudVideoPlayer.ts
|
|
13793
|
+
var DEFAULT_PAL_NONCE_MAX_AGE_MS = 5.5 * 60 * 60 * 1e3;
|
|
13794
|
+
var PAL_NONCE_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
|
|
12614
13795
|
var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
12615
13796
|
function StormcloudVideoPlayer(config) {
|
|
12616
13797
|
var _this = this;
|
|
@@ -12621,6 +13802,19 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
12621
13802
|
var browserOverrides = getBrowserConfigOverrides();
|
|
12622
13803
|
this.config = _object_spread({}, browserOverrides, config);
|
|
12623
13804
|
this.video = config.videoElement;
|
|
13805
|
+
if (this.config.forceSingleDecoderMode != null) {
|
|
13806
|
+
setSingleDecoderOverride(this.config.forceSingleDecoderMode);
|
|
13807
|
+
}
|
|
13808
|
+
if (this.config.adDeviceId) {
|
|
13809
|
+
setHostAdIdentity({
|
|
13810
|
+
deviceId: this.config.adDeviceId,
|
|
13811
|
+
deviceIdType: this.config.adDeviceIdType,
|
|
13812
|
+
limitAdTracking: this.config.adLimitAdTracking
|
|
13813
|
+
});
|
|
13814
|
+
}
|
|
13815
|
+
if (this.config.deviceInfo) {
|
|
13816
|
+
setHostDeviceInfo(this.config.deviceInfo);
|
|
13817
|
+
}
|
|
12624
13818
|
logBrowserInfo(config.debugAdTiming);
|
|
12625
13819
|
this.floorLadder = new FloorLadderController();
|
|
12626
13820
|
this.adPlayer = this.createAdPlayer(false);
|
|
@@ -12684,8 +13878,14 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
12684
13878
|
},
|
|
12685
13879
|
hasPendingAdBreak: function hasPendingAdBreak() {
|
|
12686
13880
|
return _this.adBreak.pendingAdBreak !== null;
|
|
13881
|
+
},
|
|
13882
|
+
shouldHoldContentForAds: function shouldHoldContentForAds() {
|
|
13883
|
+
return !!_this.adBreak && _this.adBreak.inAdBreak && !_this.shouldContinueLiveStreamDuringAds();
|
|
12687
13884
|
}
|
|
12688
13885
|
});
|
|
13886
|
+
this.adConfig.isLiveStream = function() {
|
|
13887
|
+
return _this.hlsEngine.isLiveStream;
|
|
13888
|
+
};
|
|
12689
13889
|
this.adBreak = new AdBreakOrchestrator({
|
|
12690
13890
|
config: this.config,
|
|
12691
13891
|
video: this.video,
|
|
@@ -12879,10 +14079,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
12879
14079
|
},
|
|
12880
14080
|
{
|
|
12881
14081
|
key: "load",
|
|
12882
|
-
value:
|
|
12883
|
-
// Lifecycle
|
|
12884
|
-
// ───────────────────────────────────────────────────────────────
|
|
12885
|
-
function load() {
|
|
14082
|
+
value: function load() {
|
|
12886
14083
|
return _async_to_generator(function() {
|
|
12887
14084
|
var _this, error, palDescriptionUrl, continueLiveStreamDuringAds;
|
|
12888
14085
|
return _ts_generator(this, function(_state) {
|
|
@@ -12892,6 +14089,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
12892
14089
|
if (!this.attached) {
|
|
12893
14090
|
this.attach();
|
|
12894
14091
|
}
|
|
14092
|
+
primeDeviceInfo().then(function(info) {
|
|
14093
|
+
if (_this.debug) {
|
|
14094
|
+
console.log("[DEVICE-INFO]", _object_spread_props(_object_spread({}, info), {
|
|
14095
|
+
internalDeviceId: info.internalDeviceId ? "...".concat(info.internalDeviceId.slice(-4)) : void 0
|
|
14096
|
+
}));
|
|
14097
|
+
}
|
|
14098
|
+
}).catch(function() {});
|
|
12895
14099
|
_state.label = 1;
|
|
12896
14100
|
case 1:
|
|
12897
14101
|
_state.trys.push([
|
|
@@ -12926,21 +14130,30 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
12926
14130
|
fetchConsentSignals().catch(function() {
|
|
12927
14131
|
return {};
|
|
12928
14132
|
}).then(function(signals) {
|
|
12929
|
-
var _this_config_lowLatencyMode;
|
|
14133
|
+
var _this_config_palContinuousPlayback, _this_config_lowLatencyMode, _this_config_palIconsSupported, _this_config_palSupportedApiFrameworks;
|
|
12930
14134
|
_this.adConfig.consentSignals = signals;
|
|
12931
14135
|
var muted = _this.video.muted;
|
|
12932
|
-
|
|
14136
|
+
var palSessionId = _this.config.ctvAdRequest ? getOrRotateSessionId(_this.config.sessionIdMaxAgeMs) : void 0;
|
|
14137
|
+
var palOptions = _object_spread({
|
|
12933
14138
|
videoWidth: _this.video.offsetWidth || _this.video.clientWidth || 640,
|
|
12934
14139
|
videoHeight: _this.video.offsetHeight || _this.video.clientHeight || 480,
|
|
12935
14140
|
adWillAutoPlay: !!_this.config.autoplay,
|
|
12936
14141
|
adWillPlayMuted: muted,
|
|
12937
14142
|
playerVolume: muted ? 0 : _this.video.volume,
|
|
12938
|
-
continuousPlayback: (_this_config_lowLatencyMode = _this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false
|
|
14143
|
+
continuousPlayback: (_this_config_palContinuousPlayback = _this.config.palContinuousPlayback) !== null && _this_config_palContinuousPlayback !== void 0 ? _this_config_palContinuousPlayback : _this.config.ctvAdRequest ? true : (_this_config_lowLatencyMode = _this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false,
|
|
14144
|
+
iconsSupported: (_this_config_palIconsSupported = _this.config.palIconsSupported) !== null && _this_config_palIconsSupported !== void 0 ? _this_config_palIconsSupported : false,
|
|
14145
|
+
supportedApiFrameworks: (_this_config_palSupportedApiFrameworks = _this.config.palSupportedApiFrameworks) !== null && _this_config_palSupportedApiFrameworks !== void 0 ? _this_config_palSupportedApiFrameworks : ""
|
|
12939
14146
|
}, palDescriptionUrl ? {
|
|
12940
14147
|
descriptionUrl: palDescriptionUrl
|
|
12941
14148
|
} : {}, signals.storageAllowed != null ? {
|
|
12942
14149
|
allowStorage: signals.storageAllowed
|
|
12943
|
-
} : {}
|
|
14150
|
+
} : {}, palSessionId ? {
|
|
14151
|
+
sessionId: palSessionId
|
|
14152
|
+
} : {});
|
|
14153
|
+
_this.lastPalOptions = palOptions;
|
|
14154
|
+
_this.palSessionId = palSessionId;
|
|
14155
|
+
_this.startPalNonceRefresh();
|
|
14156
|
+
return _this.palNonce.generateNonce(palOptions);
|
|
12944
14157
|
}).catch(function() {});
|
|
12945
14158
|
this.adConfig.initializeTracking();
|
|
12946
14159
|
if (!this.hlsEngine.shouldUseNativeHls(function() {
|
|
@@ -12978,6 +14191,96 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
12978
14191
|
}).call(this);
|
|
12979
14192
|
}
|
|
12980
14193
|
},
|
|
14194
|
+
{
|
|
14195
|
+
key: "startPalNonceRefresh",
|
|
14196
|
+
value: function startPalNonceRefresh() {
|
|
14197
|
+
var _this = this;
|
|
14198
|
+
if (this.palRefreshTimer != null || typeof window === "undefined") return;
|
|
14199
|
+
this.palRefreshTimer = window.setInterval(function() {
|
|
14200
|
+
return _this.refreshPalNonceIfStale();
|
|
14201
|
+
}, PAL_NONCE_CHECK_INTERVAL_MS);
|
|
14202
|
+
}
|
|
14203
|
+
},
|
|
14204
|
+
{
|
|
14205
|
+
key: "refreshPalNonceIfStale",
|
|
14206
|
+
value: function refreshPalNonceIfStale() {
|
|
14207
|
+
var force = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
14208
|
+
var _this_config_palNonceMaxAgeMs;
|
|
14209
|
+
var options = this.lastPalOptions;
|
|
14210
|
+
if (!options) return;
|
|
14211
|
+
var maxAgeMs = (_this_config_palNonceMaxAgeMs = this.config.palNonceMaxAgeMs) !== null && _this_config_palNonceMaxAgeMs !== void 0 ? _this_config_palNonceMaxAgeMs : DEFAULT_PAL_NONCE_MAX_AGE_MS;
|
|
14212
|
+
var ageMs = this.palNonce.getNonceAgeMs();
|
|
14213
|
+
var sessionId = this.config.ctvAdRequest ? getOrRotateSessionId(this.config.sessionIdMaxAgeMs) : void 0;
|
|
14214
|
+
var sessionChanged = sessionId !== this.palSessionId;
|
|
14215
|
+
var stale = ageMs === void 0 || ageMs >= maxAgeMs;
|
|
14216
|
+
if (!force && !stale && !sessionChanged) return;
|
|
14217
|
+
var next = _object_spread({}, options);
|
|
14218
|
+
if (sessionId) next.sessionId = sessionId;
|
|
14219
|
+
else delete next.sessionId;
|
|
14220
|
+
this.lastPalOptions = next;
|
|
14221
|
+
this.palSessionId = sessionId;
|
|
14222
|
+
if (this.debug) {
|
|
14223
|
+
console.log("[PAL] Regenerating nonce", {
|
|
14224
|
+
force: force,
|
|
14225
|
+
stale: stale,
|
|
14226
|
+
sessionChanged: sessionChanged,
|
|
14227
|
+
ageMs: ageMs
|
|
14228
|
+
});
|
|
14229
|
+
}
|
|
14230
|
+
this.palNonce.generateNonce(next).catch(function() {});
|
|
14231
|
+
}
|
|
14232
|
+
},
|
|
14233
|
+
{
|
|
14234
|
+
key: "setAdIdentity",
|
|
14235
|
+
value: function setAdIdentity(identity) {
|
|
14236
|
+
setHostAdIdentity(identity);
|
|
14237
|
+
this.refreshPalNonceIfStale();
|
|
14238
|
+
}
|
|
14239
|
+
},
|
|
14240
|
+
{
|
|
14241
|
+
key: "resetAdIdentity",
|
|
14242
|
+
value: function resetAdIdentity1() {
|
|
14243
|
+
resetAdIdentity();
|
|
14244
|
+
this.refreshPalNonceIfStale(true);
|
|
14245
|
+
}
|
|
14246
|
+
},
|
|
14247
|
+
{
|
|
14248
|
+
key: "setContentMetadata",
|
|
14249
|
+
value: function setContentMetadata(meta) {
|
|
14250
|
+
applyContentMetadataUpdate(this.config, meta);
|
|
14251
|
+
}
|
|
14252
|
+
},
|
|
14253
|
+
{
|
|
14254
|
+
key: "setRequestSignals",
|
|
14255
|
+
value: function setRequestSignals(signals) {
|
|
14256
|
+
if (signals.userId !== void 0) {
|
|
14257
|
+
if (signals.userId) this.config.adUserId = signals.userId;
|
|
14258
|
+
else delete this.config.adUserId;
|
|
14259
|
+
}
|
|
14260
|
+
if (signals.ipAddress !== void 0) {
|
|
14261
|
+
if (signals.ipAddress) this.config.clientIpAddress = signals.ipAddress;
|
|
14262
|
+
else delete this.config.clientIpAddress;
|
|
14263
|
+
}
|
|
14264
|
+
}
|
|
14265
|
+
},
|
|
14266
|
+
{
|
|
14267
|
+
key: "setScreenStandby",
|
|
14268
|
+
value: function setScreenStandby(standby) {
|
|
14269
|
+
setHostStandby(standby);
|
|
14270
|
+
}
|
|
14271
|
+
},
|
|
14272
|
+
{
|
|
14273
|
+
key: "getDeviceInfo",
|
|
14274
|
+
value: function getDeviceInfo1() {
|
|
14275
|
+
return getDeviceInfo();
|
|
14276
|
+
}
|
|
14277
|
+
},
|
|
14278
|
+
{
|
|
14279
|
+
key: "setDeviceInfo",
|
|
14280
|
+
value: function setDeviceInfo(info) {
|
|
14281
|
+
setHostDeviceInfo(info);
|
|
14282
|
+
}
|
|
14283
|
+
},
|
|
12981
14284
|
{
|
|
12982
14285
|
key: "onManifestParsed",
|
|
12983
14286
|
value: function onManifestParsed(isLive) {
|
|
@@ -13112,9 +14415,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
13112
14415
|
}
|
|
13113
14416
|
},
|
|
13114
14417
|
{
|
|
13115
|
-
// ───────────────────────────────────────────────────────────────
|
|
13116
|
-
// SCTE-35 marker orchestration
|
|
13117
|
-
// ───────────────────────────────────────────────────────────────
|
|
13118
14418
|
key: "onScte35Marker",
|
|
13119
14419
|
value: function onScte35Marker(marker, cueKey) {
|
|
13120
14420
|
if (this.debug) {
|
|
@@ -13293,9 +14593,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
13293
14593
|
}
|
|
13294
14594
|
},
|
|
13295
14595
|
{
|
|
13296
|
-
// ───────────────────────────────────────────────────────────────
|
|
13297
|
-
// Ad prefetch
|
|
13298
|
-
// ───────────────────────────────────────────────────────────────
|
|
13299
14596
|
key: "startAdPrefetch",
|
|
13300
14597
|
value: function startAdPrefetch(marker, fragmentSn, cueKey) {
|
|
13301
14598
|
if (this.adBreak.pendingAdBreak || this.adBreak.inAdBreak) return;
|
|
@@ -13334,9 +14631,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
13334
14631
|
}
|
|
13335
14632
|
},
|
|
13336
14633
|
{
|
|
13337
|
-
// ───────────────────────────────────────────────────────────────
|
|
13338
|
-
// VMAP time-based ad breaks
|
|
13339
|
-
// ───────────────────────────────────────────────────────────────
|
|
13340
14634
|
key: "onTimeUpdate",
|
|
13341
14635
|
value: function onTimeUpdate(currentTimeSec) {
|
|
13342
14636
|
var _this = this;
|
|
@@ -13450,9 +14744,6 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
13450
14744
|
}
|
|
13451
14745
|
},
|
|
13452
14746
|
{
|
|
13453
|
-
// ───────────────────────────────────────────────────────────────
|
|
13454
|
-
// Public API
|
|
13455
|
-
// ───────────────────────────────────────────────────────────────
|
|
13456
14747
|
key: "getCurrentAdIndex",
|
|
13457
14748
|
value: function getCurrentAdIndex() {
|
|
13458
14749
|
return this.timing.currentAdIndex;
|
|
@@ -13571,12 +14862,13 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
13571
14862
|
}
|
|
13572
14863
|
},
|
|
13573
14864
|
{
|
|
13574
|
-
// ───────────────────────────────────────────────────────────────
|
|
13575
|
-
// Destroy
|
|
13576
|
-
// ───────────────────────────────────────────────────────────────
|
|
13577
14865
|
key: "destroy",
|
|
13578
14866
|
value: function destroy() {
|
|
13579
14867
|
var _this_adPlayer;
|
|
14868
|
+
if (this.palRefreshTimer != null) {
|
|
14869
|
+
clearInterval(this.palRefreshTimer);
|
|
14870
|
+
this.palRefreshTimer = void 0;
|
|
14871
|
+
}
|
|
13580
14872
|
this.contentWatchdog.stop();
|
|
13581
14873
|
this.adBreak.cancelScheduledRequest();
|
|
13582
14874
|
this.timing.destroy();
|