stormcloud-video-player 0.8.22 → 0.8.23
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 +1 -1
- package/lib/index.cjs +124 -25
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +124 -25
- package/lib/index.js.map +1 -1
- package/lib/player/AdBreakOrchestrator.cjs +7 -0
- package/lib/player/AdBreakOrchestrator.cjs.map +1 -1
- package/lib/player/AdBreakOrchestrator.d.cts +1 -0
- package/lib/player/AdConfigManager.cjs +79 -11
- package/lib/player/AdConfigManager.cjs.map +1 -1
- package/lib/player/HlsEngine.cjs +12 -3
- package/lib/player/HlsEngine.cjs.map +1 -1
- package/lib/player/HlsEngine.d.cts +1 -0
- package/lib/player/StormcloudVideoPlayer.cjs +120 -24
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +121 -24
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +121 -24
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +122 -25
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/ctvVastSignals.cjs +72 -4
- package/lib/utils/ctvVastSignals.cjs.map +1 -1
- package/lib/utils/vastEnvironmentSignals.cjs +72 -4
- package/lib/utils/vastEnvironmentSignals.cjs.map +1 -1
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@ interface AdBreakOrchestratorHost {
|
|
|
15
15
|
setAdPlayer(player: AdController): void;
|
|
16
16
|
createAdPlayer(continueLiveStreamDuringAds: boolean): AdController;
|
|
17
17
|
shouldContinueLiveStreamDuringAds(): boolean;
|
|
18
|
+
getLiveSyncPosition(): number | undefined;
|
|
18
19
|
generateVastUrls(baseUrl: string, count: number): string[];
|
|
19
20
|
}
|
|
20
21
|
declare class AdBreakOrchestrator {
|
|
@@ -371,12 +371,14 @@ var ANDROID_ID_TYPES = /* @__PURE__ */ new Set([
|
|
|
371
371
|
"adid"
|
|
372
372
|
]);
|
|
373
373
|
function resolveVastEnvironmentSignals(isCtv) {
|
|
374
|
-
var _ref
|
|
374
|
+
var _ref;
|
|
375
375
|
var bridgeSignals = readNativeBridgeSignals();
|
|
376
|
+
var platformDevice = readPlatformNativeDeviceId();
|
|
376
377
|
var lg = isCtv && isLgWebOS();
|
|
377
|
-
var deviceId = bridgeSignals.deviceId || readStoredDeviceId() || (lg ? getLgTestDeviceId() : void 0);
|
|
378
|
-
var deviceIdType = bridgeSignals.deviceIdType || readStoredString("deviceIdType") || readStoredString("idtype") || inferDeviceIdType() || (lg ? "lgudid" : void 0);
|
|
379
|
-
var
|
|
378
|
+
var deviceId = bridgeSignals.deviceId || readStoredDeviceId() || platformDevice.deviceId || (lg && platformDevice.limitAdTracking !== true ? getLgTestDeviceId() : void 0);
|
|
379
|
+
var deviceIdType = bridgeSignals.deviceIdType || readStoredString("deviceIdType") || readStoredString("idtype") || platformDevice.deviceIdType || inferDeviceIdType() || (lg ? "lgudid" : void 0);
|
|
380
|
+
var platformLat = bridgeSignals.deviceId ? bridgeSignals.limitAdTracking : platformDevice.limitAdTracking;
|
|
381
|
+
var limitAdTracking = deviceId != null ? (_ref = platformLat !== null && platformLat !== void 0 ? platformLat : readStoredLimitAdTracking()) !== null && _ref !== void 0 ? _ref : false : void 0;
|
|
380
382
|
if (isCtv) {
|
|
381
383
|
return _object_spread_props(_object_spread({
|
|
382
384
|
isCtv: true,
|
|
@@ -447,6 +449,72 @@ function createUuid() {
|
|
|
447
449
|
return nibble.toString(16);
|
|
448
450
|
});
|
|
449
451
|
}
|
|
452
|
+
function readPlatformNativeDeviceId() {
|
|
453
|
+
if (typeof window === "undefined") return {};
|
|
454
|
+
try {
|
|
455
|
+
var _window_webapis;
|
|
456
|
+
var adinfo = (_window_webapis = window.webapis) === null || _window_webapis === void 0 ? void 0 : _window_webapis.adinfo;
|
|
457
|
+
if (adinfo) {
|
|
458
|
+
var tifa = typeof adinfo.getTIFA === "function" ? adinfo.getTIFA() : adinfo.tifa;
|
|
459
|
+
if (typeof tifa === "string" && tifa && !isMacroPlaceholder(tifa)) {
|
|
460
|
+
var lat = typeof adinfo.isLATEnabled === "function" ? adinfo.isLATEnabled() : void 0;
|
|
461
|
+
return _object_spread({
|
|
462
|
+
deviceId: tifa,
|
|
463
|
+
deviceIdType: "tifa"
|
|
464
|
+
}, typeof lat === "boolean" ? {
|
|
465
|
+
limitAdTracking: lat
|
|
466
|
+
} : {});
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
} catch (unused) {}
|
|
470
|
+
try {
|
|
471
|
+
var webOSDev = window.webOSDev;
|
|
472
|
+
if (webOSDev) {
|
|
473
|
+
var _webOSDev_lgudid;
|
|
474
|
+
var lgudid = typeof webOSDev.LGUDID === "function" ? webOSDev.LGUDID() : (_webOSDev_lgudid = webOSDev.lgudid) !== null && _webOSDev_lgudid !== void 0 ? _webOSDev_lgudid : webOSDev.LGUDID;
|
|
475
|
+
if (typeof lgudid === "string" && lgudid) {
|
|
476
|
+
if (isZeroedAdId(lgudid)) {
|
|
477
|
+
return {
|
|
478
|
+
deviceIdType: "lgudid",
|
|
479
|
+
limitAdTracking: true
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
if (!isMacroPlaceholder(lgudid)) {
|
|
483
|
+
return {
|
|
484
|
+
deviceId: lgudid,
|
|
485
|
+
deviceIdType: "lgudid",
|
|
486
|
+
limitAdTracking: false
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
} catch (unused) {}
|
|
492
|
+
try {
|
|
493
|
+
var roku = window.Roku;
|
|
494
|
+
if (roku) {
|
|
495
|
+
var rida = typeof roku.getPublisherUniqueId === "function" ? roku.getPublisherUniqueId() : roku.rida;
|
|
496
|
+
if (typeof rida === "string" && rida && !isMacroPlaceholder(rida)) {
|
|
497
|
+
return {
|
|
498
|
+
deviceId: rida,
|
|
499
|
+
deviceIdType: "rida",
|
|
500
|
+
limitAdTracking: false
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
} catch (unused) {}
|
|
505
|
+
return {};
|
|
506
|
+
}
|
|
507
|
+
var ZEROED_AD_ID_PATTERNS = /* @__PURE__ */ new Set([
|
|
508
|
+
"38400000-8cf0-11bd-b23e-10b96e40000d",
|
|
509
|
+
"00000000-0000-0000-0000-000000000000"
|
|
510
|
+
]);
|
|
511
|
+
function isMacroPlaceholder(value) {
|
|
512
|
+
var t = value.trim();
|
|
513
|
+
return !t || /^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%)$/.test(t) || /^(unknown|null|undefined|none|n\/a|\$\{[^}]+\})$/i.test(t) || ZEROED_AD_ID_PATTERNS.has(t.toLowerCase());
|
|
514
|
+
}
|
|
515
|
+
function isZeroedAdId(value) {
|
|
516
|
+
return ZEROED_AD_ID_PATTERNS.has(value.trim().toLowerCase());
|
|
517
|
+
}
|
|
450
518
|
function readNativeBridgeSignals() {
|
|
451
519
|
if (typeof window === "undefined") {
|
|
452
520
|
return {};
|
|
@@ -787,7 +855,7 @@ var INLINE_DEVICE_MACRO_REPLACEMENTS = [
|
|
|
787
855
|
}
|
|
788
856
|
}
|
|
789
857
|
];
|
|
790
|
-
function
|
|
858
|
+
function isMacroPlaceholder2(value) {
|
|
791
859
|
if (value == null) return true;
|
|
792
860
|
var trimmed = value.trim();
|
|
793
861
|
if (!trimmed) return true;
|
|
@@ -846,11 +914,11 @@ function applyDeviceIdentityParams(params, ctx) {
|
|
|
846
914
|
if (runtimeId) {
|
|
847
915
|
params.set("rdid", runtimeId);
|
|
848
916
|
params.set("idtype", runtimeType || tagType || "aaid");
|
|
849
|
-
params.set("is_lat", latValue !== null && latValue !== void 0 ? latValue :
|
|
917
|
+
params.set("is_lat", latValue !== null && latValue !== void 0 ? latValue : isMacroPlaceholder2(tagLat) ? "0" : tagLat);
|
|
850
918
|
return;
|
|
851
919
|
}
|
|
852
|
-
var tagRdidValid = Boolean(tagRdid && !
|
|
853
|
-
var tagTypeValid = Boolean(tagType && !
|
|
920
|
+
var tagRdidValid = Boolean(tagRdid && !isMacroPlaceholder2(tagRdid));
|
|
921
|
+
var tagTypeValid = Boolean(tagType && !isMacroPlaceholder2(tagType));
|
|
854
922
|
if (tagRdidValid && tagTypeValid && runtimeType && !isEquivalentDeviceIdType(tagType, runtimeType)) {
|
|
855
923
|
params.delete("rdid");
|
|
856
924
|
params.delete("idtype");
|
|
@@ -858,10 +926,10 @@ function applyDeviceIdentityParams(params, ctx) {
|
|
|
858
926
|
return;
|
|
859
927
|
}
|
|
860
928
|
if (tagRdidValid) {
|
|
861
|
-
if (
|
|
929
|
+
if (isMacroPlaceholder2(tagType) && runtimeType) {
|
|
862
930
|
params.set("idtype", runtimeType);
|
|
863
931
|
}
|
|
864
|
-
if (
|
|
932
|
+
if (isMacroPlaceholder2(tagLat)) {
|
|
865
933
|
params.set("is_lat", latValue !== null && latValue !== void 0 ? latValue : "0");
|
|
866
934
|
}
|
|
867
935
|
return;
|
|
@@ -1047,7 +1115,7 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
1047
1115
|
}
|
|
1048
1116
|
var staleKeys = [];
|
|
1049
1117
|
params.forEach(function(value, key) {
|
|
1050
|
-
if (
|
|
1118
|
+
if (isMacroPlaceholder2(value)) {
|
|
1051
1119
|
staleKeys.push(key);
|
|
1052
1120
|
}
|
|
1053
1121
|
});
|