stormcloud-video-player 0.8.13 → 0.8.14
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 +354 -30
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +2 -3
- package/lib/index.d.ts +2 -3
- package/lib/index.js +354 -30
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +346 -27
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +347 -27
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +347 -27
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/{types-BM5cceAy.d.cts → types-CWWADkvd.d.cts} +1 -3
- package/lib/ui/StormcloudVideoPlayer.cjs +352 -30
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/ctvVastSignals.cjs +371 -0
- package/lib/utils/ctvVastSignals.cjs.map +1 -0
- package/lib/utils/ctvVastSignals.d.cts +13 -0
- package/lib/utils/tracking.d.cts +1 -1
- package/lib/utils/vastMacros.cjs +79 -23
- package/lib/utils/vastMacros.cjs.map +1 -1
- package/lib/utils/vastMacros.d.cts +6 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import { S as StormcloudVideoPlayerConfig } from '../types-
|
|
2
|
+
import { S as StormcloudVideoPlayerConfig } from '../types-CWWADkvd.cjs';
|
|
3
3
|
|
|
4
4
|
interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
|
|
5
5
|
onMount?: (player: any) => void;
|
package/lib/players/index.cjs
CHANGED
|
@@ -2376,6 +2376,20 @@ function generateCorrelator() {
|
|
|
2376
2376
|
return String(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) + 1);
|
|
2377
2377
|
}
|
|
2378
2378
|
var UNEXPANDED_MACRO_PATTERN = /^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%)$/;
|
|
2379
|
+
var CTV_UNSUPPORTED_PARAMS = [
|
|
2380
|
+
"description_url",
|
|
2381
|
+
"tfcd",
|
|
2382
|
+
"npa",
|
|
2383
|
+
"min_ad_duration",
|
|
2384
|
+
"max_ad_duration",
|
|
2385
|
+
"unviewed_position_start",
|
|
2386
|
+
"impl",
|
|
2387
|
+
"scor",
|
|
2388
|
+
"vad_type",
|
|
2389
|
+
"gdpr",
|
|
2390
|
+
"gdpr_consent",
|
|
2391
|
+
"us_privacy"
|
|
2392
|
+
];
|
|
2379
2393
|
function applyVastMacros(baseUrl, ctx) {
|
|
2380
2394
|
var url;
|
|
2381
2395
|
try {
|
|
@@ -2385,16 +2399,42 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2385
2399
|
}
|
|
2386
2400
|
var params = url.searchParams;
|
|
2387
2401
|
params.set("correlator", ctx.correlator);
|
|
2388
|
-
|
|
2402
|
+
if (ctx.isCtv) {
|
|
2403
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2404
|
+
try {
|
|
2405
|
+
for(var _iterator = CTV_UNSUPPORTED_PARAMS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2406
|
+
var key = _step.value;
|
|
2407
|
+
params.delete(key);
|
|
2408
|
+
}
|
|
2409
|
+
} catch (err) {
|
|
2410
|
+
_didIteratorError = true;
|
|
2411
|
+
_iteratorError = err;
|
|
2412
|
+
} finally{
|
|
2413
|
+
try {
|
|
2414
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2415
|
+
_iterator.return();
|
|
2416
|
+
}
|
|
2417
|
+
} finally{
|
|
2418
|
+
if (_didIteratorError) {
|
|
2419
|
+
throw _iteratorError;
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
} else {
|
|
2424
|
+
params.set("scor", ctx.streamCorrelator);
|
|
2425
|
+
}
|
|
2389
2426
|
if (ctx.pod != null) {
|
|
2390
2427
|
params.set("pod", String(ctx.pod));
|
|
2391
2428
|
}
|
|
2392
2429
|
if (ctx.adPosition != null) {
|
|
2393
2430
|
params.set("ppos", String(ctx.adPosition));
|
|
2394
2431
|
}
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
params.set("
|
|
2432
|
+
var requestUrl = ctx.contentUrl || ctx.pageUrl;
|
|
2433
|
+
if (requestUrl) {
|
|
2434
|
+
params.set("url", requestUrl);
|
|
2435
|
+
if (!ctx.isCtv) {
|
|
2436
|
+
params.set("description_url", requestUrl);
|
|
2437
|
+
}
|
|
2398
2438
|
}
|
|
2399
2439
|
if (ctx.adWillPlayMuted != null) {
|
|
2400
2440
|
params.set("vpmute", ctx.adWillPlayMuted ? "1" : "0");
|
|
@@ -2402,6 +2442,20 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2402
2442
|
if (ctx.adWillAutoPlay != null) {
|
|
2403
2443
|
params.set("vpa", ctx.adWillAutoPlay ? "auto" : "click");
|
|
2404
2444
|
}
|
|
2445
|
+
if (ctx.appId) {
|
|
2446
|
+
params.set("msid", ctx.appId);
|
|
2447
|
+
}
|
|
2448
|
+
if (ctx.appName) {
|
|
2449
|
+
params.set("an", ctx.appName);
|
|
2450
|
+
}
|
|
2451
|
+
if (ctx.sessionId) {
|
|
2452
|
+
params.set("sid", ctx.sessionId);
|
|
2453
|
+
}
|
|
2454
|
+
if (ctx.deviceTypeHint != null) {
|
|
2455
|
+
params.set("dth", String(ctx.deviceTypeHint));
|
|
2456
|
+
} else if (ctx.isCtv) {
|
|
2457
|
+
params.set("dth", "5");
|
|
2458
|
+
}
|
|
2405
2459
|
if (ctx.deviceId && ctx.deviceIdType) {
|
|
2406
2460
|
params.set("rdid", ctx.deviceId);
|
|
2407
2461
|
params.set("idtype", ctx.deviceIdType);
|
|
@@ -2411,15 +2465,17 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2411
2465
|
params.delete("idtype");
|
|
2412
2466
|
params.delete("is_lat");
|
|
2413
2467
|
}
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2468
|
+
if (!ctx.isCtv) {
|
|
2469
|
+
var consent = ctx.consent;
|
|
2470
|
+
if ((consent === null || consent === void 0 ? void 0 : consent.gdpr) != null) {
|
|
2471
|
+
params.set("gdpr", consent.gdpr);
|
|
2472
|
+
}
|
|
2473
|
+
if ((consent === null || consent === void 0 ? void 0 : consent.gdprConsent) != null) {
|
|
2474
|
+
params.set("gdpr_consent", consent.gdprConsent);
|
|
2475
|
+
}
|
|
2476
|
+
if ((consent === null || consent === void 0 ? void 0 : consent.usPrivacy) != null) {
|
|
2477
|
+
params.set("us_privacy", consent.usPrivacy);
|
|
2478
|
+
}
|
|
2423
2479
|
}
|
|
2424
2480
|
if (ctx.adTest) {
|
|
2425
2481
|
params.set("adtest", "on");
|
|
@@ -2430,23 +2486,23 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2430
2486
|
staleKeys.push(key);
|
|
2431
2487
|
}
|
|
2432
2488
|
});
|
|
2433
|
-
var
|
|
2489
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
2434
2490
|
try {
|
|
2435
|
-
for(var
|
|
2436
|
-
var
|
|
2437
|
-
params.delete(
|
|
2491
|
+
for(var _iterator1 = staleKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2492
|
+
var key1 = _step1.value;
|
|
2493
|
+
params.delete(key1);
|
|
2438
2494
|
}
|
|
2439
2495
|
} catch (err) {
|
|
2440
|
-
|
|
2441
|
-
|
|
2496
|
+
_didIteratorError1 = true;
|
|
2497
|
+
_iteratorError1 = err;
|
|
2442
2498
|
} finally{
|
|
2443
2499
|
try {
|
|
2444
|
-
if (!
|
|
2445
|
-
|
|
2500
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
2501
|
+
_iterator1.return();
|
|
2446
2502
|
}
|
|
2447
2503
|
} finally{
|
|
2448
|
-
if (
|
|
2449
|
-
throw
|
|
2504
|
+
if (_didIteratorError1) {
|
|
2505
|
+
throw _iteratorError1;
|
|
2450
2506
|
}
|
|
2451
2507
|
}
|
|
2452
2508
|
}
|
|
@@ -2686,6 +2742,262 @@ function logBrowserInfo() {
|
|
|
2686
2742
|
userAgent: navigator.userAgent
|
|
2687
2743
|
}));
|
|
2688
2744
|
}
|
|
2745
|
+
// src/utils/ctvVastSignals.ts
|
|
2746
|
+
var AIRY_ANDROID_APP_ID = "com.freeairytv.android";
|
|
2747
|
+
var AIRY_APP_NAME = "AiryTV Movies & TV";
|
|
2748
|
+
var CTV_SESSION_STORAGE_KEY = "stormcloud.ctv.sid";
|
|
2749
|
+
var DEVICE_ID_STORAGE_KEYS = [
|
|
2750
|
+
"rdid",
|
|
2751
|
+
"ifa",
|
|
2752
|
+
"advertisingId",
|
|
2753
|
+
"advertising_id",
|
|
2754
|
+
"deviceAdvertisingId",
|
|
2755
|
+
"aaid",
|
|
2756
|
+
"adid",
|
|
2757
|
+
"rida",
|
|
2758
|
+
"tifa"
|
|
2759
|
+
];
|
|
2760
|
+
function resolveCtvVastSignals() {
|
|
2761
|
+
var _ref, _bridgeSignals_limitAdTracking;
|
|
2762
|
+
var bridgeSignals = readNativeBridgeSignals();
|
|
2763
|
+
var deviceId = bridgeSignals.deviceId || readStoredDeviceId();
|
|
2764
|
+
var deviceIdType = bridgeSignals.deviceIdType || readStoredString("deviceIdType") || inferDeviceIdType();
|
|
2765
|
+
return _object_spread_props(_object_spread({
|
|
2766
|
+
contentUrl: "https://".concat(AIRY_ANDROID_APP_ID, ".example.com"),
|
|
2767
|
+
appId: AIRY_ANDROID_APP_ID,
|
|
2768
|
+
appName: AIRY_APP_NAME,
|
|
2769
|
+
sessionId: getOrCreateCtvSessionId()
|
|
2770
|
+
}, deviceId ? {
|
|
2771
|
+
deviceId: deviceId
|
|
2772
|
+
} : {}, deviceId && deviceIdType ? {
|
|
2773
|
+
deviceIdType: deviceIdType
|
|
2774
|
+
} : {}, deviceId ? {
|
|
2775
|
+
limitAdTracking: (_ref = (_bridgeSignals_limitAdTracking = bridgeSignals.limitAdTracking) !== null && _bridgeSignals_limitAdTracking !== void 0 ? _bridgeSignals_limitAdTracking : readStoredLimitAdTracking()) !== null && _ref !== void 0 ? _ref : false
|
|
2776
|
+
} : {}), {
|
|
2777
|
+
deviceTypeHint: 5
|
|
2778
|
+
});
|
|
2779
|
+
}
|
|
2780
|
+
function getOrCreateCtvSessionId() {
|
|
2781
|
+
var existing = readStoredString(CTV_SESSION_STORAGE_KEY);
|
|
2782
|
+
if (existing) {
|
|
2783
|
+
return existing;
|
|
2784
|
+
}
|
|
2785
|
+
var sessionId = createUuid();
|
|
2786
|
+
try {
|
|
2787
|
+
var _window_localStorage;
|
|
2788
|
+
(_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.setItem(CTV_SESSION_STORAGE_KEY, sessionId);
|
|
2789
|
+
} catch (unused) {}
|
|
2790
|
+
return sessionId;
|
|
2791
|
+
}
|
|
2792
|
+
function createUuid() {
|
|
2793
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
2794
|
+
return crypto.randomUUID();
|
|
2795
|
+
}
|
|
2796
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(char) {
|
|
2797
|
+
var value = Math.floor(Math.random() * 16);
|
|
2798
|
+
var nibble = char === "x" ? value : value & 3 | 8;
|
|
2799
|
+
return nibble.toString(16);
|
|
2800
|
+
});
|
|
2801
|
+
}
|
|
2802
|
+
function readNativeBridgeSignals() {
|
|
2803
|
+
if (typeof window === "undefined") {
|
|
2804
|
+
return {};
|
|
2805
|
+
}
|
|
2806
|
+
var candidates = [
|
|
2807
|
+
window.__STORMCLOUD_CTV_AD_INFO__,
|
|
2808
|
+
window.__STORMCLOUD_CTV__,
|
|
2809
|
+
window.stormcloudCtv,
|
|
2810
|
+
window.AiryTV,
|
|
2811
|
+
window.Android
|
|
2812
|
+
].filter(Boolean);
|
|
2813
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2814
|
+
try {
|
|
2815
|
+
for(var _iterator = candidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2816
|
+
var source = _step.value;
|
|
2817
|
+
var deviceId = readBridgeValue(source, [
|
|
2818
|
+
"rdid",
|
|
2819
|
+
"ifa",
|
|
2820
|
+
"advertisingId",
|
|
2821
|
+
"adId",
|
|
2822
|
+
"deviceId"
|
|
2823
|
+
]) || void 0;
|
|
2824
|
+
if (!deviceId) continue;
|
|
2825
|
+
var deviceIdType = readBridgeValue(source, [
|
|
2826
|
+
"idtype",
|
|
2827
|
+
"deviceIdType",
|
|
2828
|
+
"advertisingIdType"
|
|
2829
|
+
]) || inferDeviceIdType();
|
|
2830
|
+
var limitAdTracking = readBridgeBoolean(source, [
|
|
2831
|
+
"is_lat",
|
|
2832
|
+
"limitAdTracking",
|
|
2833
|
+
"limitedAdTracking",
|
|
2834
|
+
"lat"
|
|
2835
|
+
]);
|
|
2836
|
+
return _object_spread({
|
|
2837
|
+
deviceId: deviceId
|
|
2838
|
+
}, deviceIdType ? {
|
|
2839
|
+
deviceIdType: deviceIdType
|
|
2840
|
+
} : {}, limitAdTracking != null ? {
|
|
2841
|
+
limitAdTracking: limitAdTracking
|
|
2842
|
+
} : {});
|
|
2843
|
+
}
|
|
2844
|
+
} catch (err) {
|
|
2845
|
+
_didIteratorError = true;
|
|
2846
|
+
_iteratorError = err;
|
|
2847
|
+
} finally{
|
|
2848
|
+
try {
|
|
2849
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2850
|
+
_iterator.return();
|
|
2851
|
+
}
|
|
2852
|
+
} finally{
|
|
2853
|
+
if (_didIteratorError) {
|
|
2854
|
+
throw _iteratorError;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
return {};
|
|
2859
|
+
}
|
|
2860
|
+
function readBridgeValue(source, keys) {
|
|
2861
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2862
|
+
try {
|
|
2863
|
+
for(var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2864
|
+
var key = _step.value;
|
|
2865
|
+
var value = source === null || source === void 0 ? void 0 : source[key];
|
|
2866
|
+
if (typeof value === "string" && value) {
|
|
2867
|
+
return value;
|
|
2868
|
+
}
|
|
2869
|
+
if (typeof value === "function") {
|
|
2870
|
+
try {
|
|
2871
|
+
var result = value.call(source);
|
|
2872
|
+
if (typeof result === "string" && result) {
|
|
2873
|
+
return result;
|
|
2874
|
+
}
|
|
2875
|
+
} catch (unused) {}
|
|
2876
|
+
}
|
|
2877
|
+
}
|
|
2878
|
+
} catch (err) {
|
|
2879
|
+
_didIteratorError = true;
|
|
2880
|
+
_iteratorError = err;
|
|
2881
|
+
} finally{
|
|
2882
|
+
try {
|
|
2883
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2884
|
+
_iterator.return();
|
|
2885
|
+
}
|
|
2886
|
+
} finally{
|
|
2887
|
+
if (_didIteratorError) {
|
|
2888
|
+
throw _iteratorError;
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2892
|
+
return void 0;
|
|
2893
|
+
}
|
|
2894
|
+
function readBridgeBoolean(source, keys) {
|
|
2895
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2896
|
+
try {
|
|
2897
|
+
for(var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2898
|
+
var key = _step.value;
|
|
2899
|
+
var value = source === null || source === void 0 ? void 0 : source[key];
|
|
2900
|
+
var normalized = normalizeBoolean(value);
|
|
2901
|
+
if (normalized != null) {
|
|
2902
|
+
return normalized;
|
|
2903
|
+
}
|
|
2904
|
+
if (typeof value === "function") {
|
|
2905
|
+
try {
|
|
2906
|
+
var result = normalizeBoolean(value.call(source));
|
|
2907
|
+
if (result != null) {
|
|
2908
|
+
return result;
|
|
2909
|
+
}
|
|
2910
|
+
} catch (unused) {}
|
|
2911
|
+
}
|
|
2912
|
+
}
|
|
2913
|
+
} catch (err) {
|
|
2914
|
+
_didIteratorError = true;
|
|
2915
|
+
_iteratorError = err;
|
|
2916
|
+
} finally{
|
|
2917
|
+
try {
|
|
2918
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2919
|
+
_iterator.return();
|
|
2920
|
+
}
|
|
2921
|
+
} finally{
|
|
2922
|
+
if (_didIteratorError) {
|
|
2923
|
+
throw _iteratorError;
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
return void 0;
|
|
2928
|
+
}
|
|
2929
|
+
function readStoredDeviceId() {
|
|
2930
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2931
|
+
try {
|
|
2932
|
+
for(var _iterator = DEVICE_ID_STORAGE_KEYS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2933
|
+
var key = _step.value;
|
|
2934
|
+
var value = readStoredString(key);
|
|
2935
|
+
if (value) {
|
|
2936
|
+
return value;
|
|
2937
|
+
}
|
|
2938
|
+
}
|
|
2939
|
+
} catch (err) {
|
|
2940
|
+
_didIteratorError = true;
|
|
2941
|
+
_iteratorError = err;
|
|
2942
|
+
} finally{
|
|
2943
|
+
try {
|
|
2944
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2945
|
+
_iterator.return();
|
|
2946
|
+
}
|
|
2947
|
+
} finally{
|
|
2948
|
+
if (_didIteratorError) {
|
|
2949
|
+
throw _iteratorError;
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
return void 0;
|
|
2954
|
+
}
|
|
2955
|
+
function readStoredString(key) {
|
|
2956
|
+
if (typeof window === "undefined") {
|
|
2957
|
+
return void 0;
|
|
2958
|
+
}
|
|
2959
|
+
try {
|
|
2960
|
+
var _window_localStorage;
|
|
2961
|
+
var value = (_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.getItem(key);
|
|
2962
|
+
return value || void 0;
|
|
2963
|
+
} catch (unused) {
|
|
2964
|
+
return void 0;
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
function readStoredLimitAdTracking() {
|
|
2968
|
+
return normalizeBoolean(readStoredString("limitAdTracking") || readStoredString("limitedAdTracking") || readStoredString("is_lat"));
|
|
2969
|
+
}
|
|
2970
|
+
function normalizeBoolean(value) {
|
|
2971
|
+
if (typeof value === "boolean") {
|
|
2972
|
+
return value;
|
|
2973
|
+
}
|
|
2974
|
+
if (typeof value === "number") {
|
|
2975
|
+
return value === 1;
|
|
2976
|
+
}
|
|
2977
|
+
if (typeof value === "string") {
|
|
2978
|
+
var normalized = value.toLowerCase();
|
|
2979
|
+
if (normalized === "1" || normalized === "true" || normalized === "yes") {
|
|
2980
|
+
return true;
|
|
2981
|
+
}
|
|
2982
|
+
if (normalized === "0" || normalized === "false" || normalized === "no") {
|
|
2983
|
+
return false;
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
return void 0;
|
|
2987
|
+
}
|
|
2988
|
+
function inferDeviceIdType() {
|
|
2989
|
+
if (typeof navigator === "undefined") {
|
|
2990
|
+
return void 0;
|
|
2991
|
+
}
|
|
2992
|
+
var ua = navigator.userAgent;
|
|
2993
|
+
if (/Roku/i.test(ua)) return "rida";
|
|
2994
|
+
if (/Tizen|Samsung/i.test(ua)) return "tifa";
|
|
2995
|
+
if (/AppleTV/i.test(ua)) return "tvOS";
|
|
2996
|
+
if (/AFT|Fire TV|Amazon/i.test(ua)) return "afai";
|
|
2997
|
+
if (/Web0S|webOS|LG/i.test(ua)) return "lgudid";
|
|
2998
|
+
if (/Android|Google TV/i.test(ua)) return "aaid";
|
|
2999
|
+
return void 0;
|
|
3000
|
+
}
|
|
2689
3001
|
// src/player/StormcloudVideoPlayer.ts
|
|
2690
3002
|
var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
2691
3003
|
function StormcloudVideoPlayer(config) {
|
|
@@ -5127,17 +5439,24 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5127
5439
|
for(var i = 0; i < count; i++){
|
|
5128
5440
|
this.adRequestPositionInBreak++;
|
|
5129
5441
|
var adWillPlayMuted = this.inAdBreak ? this.adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5442
|
+
var ctvSignals = this.config.ctvAdRequest ? resolveCtvVastSignals() : void 0;
|
|
5130
5443
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5131
5444
|
correlator: generateCorrelator(),
|
|
5132
5445
|
streamCorrelator: this.streamCorrelator,
|
|
5133
5446
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5134
5447
|
adPosition: this.adRequestPositionInBreak,
|
|
5135
|
-
|
|
5448
|
+
isCtv: this.config.ctvAdRequest,
|
|
5449
|
+
contentUrl: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.contentUrl,
|
|
5450
|
+
pageUrl: !this.config.ctvAdRequest && typeof window !== "undefined" ? window.location.href : void 0,
|
|
5136
5451
|
adWillPlayMuted: adWillPlayMuted,
|
|
5137
5452
|
adWillAutoPlay: !!this.config.autoplay,
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5453
|
+
appId: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.appId,
|
|
5454
|
+
appName: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.appName,
|
|
5455
|
+
sessionId: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.sessionId,
|
|
5456
|
+
deviceId: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.deviceId,
|
|
5457
|
+
deviceIdType: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.deviceIdType,
|
|
5458
|
+
limitAdTracking: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.limitAdTracking,
|
|
5459
|
+
deviceTypeHint: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.deviceTypeHint,
|
|
5141
5460
|
adTest: this.config.adTest,
|
|
5142
5461
|
consent: this.consentSignals
|
|
5143
5462
|
});
|
|
@@ -7979,6 +8298,7 @@ var HlsPlayer = /*#__PURE__*/ function(_import_react2_Component) {
|
|
|
7979
8298
|
if (_this1.props.licenseKey !== void 0) config.licenseKey = _this1.props.licenseKey;
|
|
7980
8299
|
if (_this1.props.adFailsafeTimeoutMs !== void 0) config.adFailsafeTimeoutMs = _this1.props.adFailsafeTimeoutMs;
|
|
7981
8300
|
if (_this1.props.minSegmentsBeforePlay !== void 0) config.minSegmentsBeforePlay = _this1.props.minSegmentsBeforePlay;
|
|
8301
|
+
if (_this1.props.ctvAdRequest !== void 0) config.ctvAdRequest = _this1.props.ctvAdRequest;
|
|
7982
8302
|
_this1.player = new StormcloudVideoPlayer(config);
|
|
7983
8303
|
(_this_props_onMount = (_this_props = _this1.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this1);
|
|
7984
8304
|
return [
|