stormcloud-video-player 0.8.13 → 0.8.15
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 +364 -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 +364 -30
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +356 -27
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +357 -27
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +357 -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 +362 -30
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/ctvVastSignals.cjs +381 -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
package/lib/index.cjs
CHANGED
|
@@ -2548,6 +2548,20 @@ function generateCorrelator() {
|
|
|
2548
2548
|
return String(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER) + 1);
|
|
2549
2549
|
}
|
|
2550
2550
|
var UNEXPANDED_MACRO_PATTERN = /^(\[[^\]]*\]|\{[^}]*\}|%%[^%]*%%)$/;
|
|
2551
|
+
var CTV_UNSUPPORTED_PARAMS = [
|
|
2552
|
+
"description_url",
|
|
2553
|
+
"tfcd",
|
|
2554
|
+
"npa",
|
|
2555
|
+
"min_ad_duration",
|
|
2556
|
+
"max_ad_duration",
|
|
2557
|
+
"unviewed_position_start",
|
|
2558
|
+
"impl",
|
|
2559
|
+
"scor",
|
|
2560
|
+
"vad_type",
|
|
2561
|
+
"gdpr",
|
|
2562
|
+
"gdpr_consent",
|
|
2563
|
+
"us_privacy"
|
|
2564
|
+
];
|
|
2551
2565
|
function applyVastMacros(baseUrl, ctx) {
|
|
2552
2566
|
var url;
|
|
2553
2567
|
try {
|
|
@@ -2557,16 +2571,42 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2557
2571
|
}
|
|
2558
2572
|
var params = url.searchParams;
|
|
2559
2573
|
params.set("correlator", ctx.correlator);
|
|
2560
|
-
|
|
2574
|
+
if (ctx.isCtv) {
|
|
2575
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2576
|
+
try {
|
|
2577
|
+
for(var _iterator = CTV_UNSUPPORTED_PARAMS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2578
|
+
var key = _step.value;
|
|
2579
|
+
params.delete(key);
|
|
2580
|
+
}
|
|
2581
|
+
} catch (err) {
|
|
2582
|
+
_didIteratorError = true;
|
|
2583
|
+
_iteratorError = err;
|
|
2584
|
+
} finally{
|
|
2585
|
+
try {
|
|
2586
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2587
|
+
_iterator.return();
|
|
2588
|
+
}
|
|
2589
|
+
} finally{
|
|
2590
|
+
if (_didIteratorError) {
|
|
2591
|
+
throw _iteratorError;
|
|
2592
|
+
}
|
|
2593
|
+
}
|
|
2594
|
+
}
|
|
2595
|
+
} else {
|
|
2596
|
+
params.set("scor", ctx.streamCorrelator);
|
|
2597
|
+
}
|
|
2561
2598
|
if (ctx.pod != null) {
|
|
2562
2599
|
params.set("pod", String(ctx.pod));
|
|
2563
2600
|
}
|
|
2564
2601
|
if (ctx.adPosition != null) {
|
|
2565
2602
|
params.set("ppos", String(ctx.adPosition));
|
|
2566
2603
|
}
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
params.set("
|
|
2604
|
+
var requestUrl = ctx.contentUrl || ctx.pageUrl;
|
|
2605
|
+
if (requestUrl) {
|
|
2606
|
+
params.set("url", requestUrl);
|
|
2607
|
+
if (!ctx.isCtv) {
|
|
2608
|
+
params.set("description_url", requestUrl);
|
|
2609
|
+
}
|
|
2570
2610
|
}
|
|
2571
2611
|
if (ctx.adWillPlayMuted != null) {
|
|
2572
2612
|
params.set("vpmute", ctx.adWillPlayMuted ? "1" : "0");
|
|
@@ -2574,6 +2614,20 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2574
2614
|
if (ctx.adWillAutoPlay != null) {
|
|
2575
2615
|
params.set("vpa", ctx.adWillAutoPlay ? "auto" : "click");
|
|
2576
2616
|
}
|
|
2617
|
+
if (ctx.appId) {
|
|
2618
|
+
params.set("msid", ctx.appId);
|
|
2619
|
+
}
|
|
2620
|
+
if (ctx.appName) {
|
|
2621
|
+
params.set("an", ctx.appName);
|
|
2622
|
+
}
|
|
2623
|
+
if (ctx.sessionId) {
|
|
2624
|
+
params.set("sid", ctx.sessionId);
|
|
2625
|
+
}
|
|
2626
|
+
if (ctx.deviceTypeHint != null) {
|
|
2627
|
+
params.set("dth", String(ctx.deviceTypeHint));
|
|
2628
|
+
} else if (ctx.isCtv) {
|
|
2629
|
+
params.set("dth", "5");
|
|
2630
|
+
}
|
|
2577
2631
|
if (ctx.deviceId && ctx.deviceIdType) {
|
|
2578
2632
|
params.set("rdid", ctx.deviceId);
|
|
2579
2633
|
params.set("idtype", ctx.deviceIdType);
|
|
@@ -2583,15 +2637,17 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2583
2637
|
params.delete("idtype");
|
|
2584
2638
|
params.delete("is_lat");
|
|
2585
2639
|
}
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2640
|
+
if (!ctx.isCtv) {
|
|
2641
|
+
var consent = ctx.consent;
|
|
2642
|
+
if ((consent === null || consent === void 0 ? void 0 : consent.gdpr) != null) {
|
|
2643
|
+
params.set("gdpr", consent.gdpr);
|
|
2644
|
+
}
|
|
2645
|
+
if ((consent === null || consent === void 0 ? void 0 : consent.gdprConsent) != null) {
|
|
2646
|
+
params.set("gdpr_consent", consent.gdprConsent);
|
|
2647
|
+
}
|
|
2648
|
+
if ((consent === null || consent === void 0 ? void 0 : consent.usPrivacy) != null) {
|
|
2649
|
+
params.set("us_privacy", consent.usPrivacy);
|
|
2650
|
+
}
|
|
2595
2651
|
}
|
|
2596
2652
|
if (ctx.adTest) {
|
|
2597
2653
|
params.set("adtest", "on");
|
|
@@ -2602,23 +2658,23 @@ function applyVastMacros(baseUrl, ctx) {
|
|
|
2602
2658
|
staleKeys.push(key);
|
|
2603
2659
|
}
|
|
2604
2660
|
});
|
|
2605
|
-
var
|
|
2661
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
2606
2662
|
try {
|
|
2607
|
-
for(var
|
|
2608
|
-
var
|
|
2609
|
-
params.delete(
|
|
2663
|
+
for(var _iterator1 = staleKeys[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
2664
|
+
var key1 = _step1.value;
|
|
2665
|
+
params.delete(key1);
|
|
2610
2666
|
}
|
|
2611
2667
|
} catch (err) {
|
|
2612
|
-
|
|
2613
|
-
|
|
2668
|
+
_didIteratorError1 = true;
|
|
2669
|
+
_iteratorError1 = err;
|
|
2614
2670
|
} finally{
|
|
2615
2671
|
try {
|
|
2616
|
-
if (!
|
|
2617
|
-
|
|
2672
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
2673
|
+
_iterator1.return();
|
|
2618
2674
|
}
|
|
2619
2675
|
} finally{
|
|
2620
|
-
if (
|
|
2621
|
-
throw
|
|
2676
|
+
if (_didIteratorError1) {
|
|
2677
|
+
throw _iteratorError1;
|
|
2622
2678
|
}
|
|
2623
2679
|
}
|
|
2624
2680
|
}
|
|
@@ -2881,6 +2937,272 @@ function supportsFeature(feature) {
|
|
|
2881
2937
|
return false;
|
|
2882
2938
|
}
|
|
2883
2939
|
}
|
|
2940
|
+
// src/utils/ctvVastSignals.ts
|
|
2941
|
+
var AIRY_ANDROID_APP_ID = "com.freeairytv.android";
|
|
2942
|
+
var AIRY_APP_NAME = "AiryTV Movies & TV";
|
|
2943
|
+
var AIRY_DEFAULT_CONTENT_URL = "https://live.airy.tv";
|
|
2944
|
+
var CTV_SESSION_STORAGE_KEY = "stormcloud.ctv.sid";
|
|
2945
|
+
var DEVICE_ID_STORAGE_KEYS = [
|
|
2946
|
+
"rdid",
|
|
2947
|
+
"ifa",
|
|
2948
|
+
"advertisingId",
|
|
2949
|
+
"advertising_id",
|
|
2950
|
+
"deviceAdvertisingId",
|
|
2951
|
+
"aaid",
|
|
2952
|
+
"adid",
|
|
2953
|
+
"rida",
|
|
2954
|
+
"tifa"
|
|
2955
|
+
];
|
|
2956
|
+
function resolveCtvVastSignals() {
|
|
2957
|
+
var _ref, _bridgeSignals_limitAdTracking;
|
|
2958
|
+
var bridgeSignals = readNativeBridgeSignals();
|
|
2959
|
+
var deviceId = bridgeSignals.deviceId || readStoredDeviceId();
|
|
2960
|
+
var deviceIdType = bridgeSignals.deviceIdType || readStoredString("deviceIdType") || inferDeviceIdType();
|
|
2961
|
+
var contentUrl = bridgeSignals.contentUrl || readStoredString("contentUrl") || AIRY_DEFAULT_CONTENT_URL;
|
|
2962
|
+
return _object_spread_props(_object_spread({
|
|
2963
|
+
contentUrl: contentUrl,
|
|
2964
|
+
appId: AIRY_ANDROID_APP_ID,
|
|
2965
|
+
appName: AIRY_APP_NAME,
|
|
2966
|
+
sessionId: getOrCreateCtvSessionId()
|
|
2967
|
+
}, deviceId ? {
|
|
2968
|
+
deviceId: deviceId
|
|
2969
|
+
} : {}, deviceId && deviceIdType ? {
|
|
2970
|
+
deviceIdType: deviceIdType
|
|
2971
|
+
} : {}, deviceId ? {
|
|
2972
|
+
limitAdTracking: (_ref = (_bridgeSignals_limitAdTracking = bridgeSignals.limitAdTracking) !== null && _bridgeSignals_limitAdTracking !== void 0 ? _bridgeSignals_limitAdTracking : readStoredLimitAdTracking()) !== null && _ref !== void 0 ? _ref : false
|
|
2973
|
+
} : {}), {
|
|
2974
|
+
deviceTypeHint: 5
|
|
2975
|
+
});
|
|
2976
|
+
}
|
|
2977
|
+
function getOrCreateCtvSessionId() {
|
|
2978
|
+
var existing = readStoredString(CTV_SESSION_STORAGE_KEY);
|
|
2979
|
+
if (existing) {
|
|
2980
|
+
return existing;
|
|
2981
|
+
}
|
|
2982
|
+
var sessionId = createUuid();
|
|
2983
|
+
try {
|
|
2984
|
+
var _window_localStorage;
|
|
2985
|
+
(_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.setItem(CTV_SESSION_STORAGE_KEY, sessionId);
|
|
2986
|
+
} catch (unused) {}
|
|
2987
|
+
return sessionId;
|
|
2988
|
+
}
|
|
2989
|
+
function createUuid() {
|
|
2990
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
2991
|
+
return crypto.randomUUID();
|
|
2992
|
+
}
|
|
2993
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(char) {
|
|
2994
|
+
var value = Math.floor(Math.random() * 16);
|
|
2995
|
+
var nibble = char === "x" ? value : value & 3 | 8;
|
|
2996
|
+
return nibble.toString(16);
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
function readNativeBridgeSignals() {
|
|
3000
|
+
if (typeof window === "undefined") {
|
|
3001
|
+
return {};
|
|
3002
|
+
}
|
|
3003
|
+
var candidates = [
|
|
3004
|
+
window.__STORMCLOUD_CTV_AD_INFO__,
|
|
3005
|
+
window.__STORMCLOUD_CTV__,
|
|
3006
|
+
window.stormcloudCtv,
|
|
3007
|
+
window.AiryTV,
|
|
3008
|
+
window.Android
|
|
3009
|
+
].filter(Boolean);
|
|
3010
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3011
|
+
try {
|
|
3012
|
+
for(var _iterator = candidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3013
|
+
var source = _step.value;
|
|
3014
|
+
var contentUrl = readBridgeValue(source, [
|
|
3015
|
+
"contentUrl",
|
|
3016
|
+
"url",
|
|
3017
|
+
"videoUrl",
|
|
3018
|
+
"canonicalUrl"
|
|
3019
|
+
]) || void 0;
|
|
3020
|
+
var deviceId = readBridgeValue(source, [
|
|
3021
|
+
"rdid",
|
|
3022
|
+
"ifa",
|
|
3023
|
+
"advertisingId",
|
|
3024
|
+
"adId",
|
|
3025
|
+
"deviceId"
|
|
3026
|
+
]) || void 0;
|
|
3027
|
+
if (!contentUrl && !deviceId) continue;
|
|
3028
|
+
var deviceIdType = readBridgeValue(source, [
|
|
3029
|
+
"idtype",
|
|
3030
|
+
"deviceIdType",
|
|
3031
|
+
"advertisingIdType"
|
|
3032
|
+
]) || inferDeviceIdType();
|
|
3033
|
+
var limitAdTracking = readBridgeBoolean(source, [
|
|
3034
|
+
"is_lat",
|
|
3035
|
+
"limitAdTracking",
|
|
3036
|
+
"limitedAdTracking",
|
|
3037
|
+
"lat"
|
|
3038
|
+
]);
|
|
3039
|
+
return _object_spread({}, contentUrl ? {
|
|
3040
|
+
contentUrl: contentUrl
|
|
3041
|
+
} : {}, deviceId ? {
|
|
3042
|
+
deviceId: deviceId
|
|
3043
|
+
} : {}, deviceId && deviceIdType ? {
|
|
3044
|
+
deviceIdType: deviceIdType
|
|
3045
|
+
} : {}, deviceId && limitAdTracking != null ? {
|
|
3046
|
+
limitAdTracking: limitAdTracking
|
|
3047
|
+
} : {});
|
|
3048
|
+
}
|
|
3049
|
+
} catch (err) {
|
|
3050
|
+
_didIteratorError = true;
|
|
3051
|
+
_iteratorError = err;
|
|
3052
|
+
} finally{
|
|
3053
|
+
try {
|
|
3054
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3055
|
+
_iterator.return();
|
|
3056
|
+
}
|
|
3057
|
+
} finally{
|
|
3058
|
+
if (_didIteratorError) {
|
|
3059
|
+
throw _iteratorError;
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
}
|
|
3063
|
+
return {};
|
|
3064
|
+
}
|
|
3065
|
+
function readBridgeValue(source, keys) {
|
|
3066
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3067
|
+
try {
|
|
3068
|
+
for(var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3069
|
+
var key = _step.value;
|
|
3070
|
+
var value = source === null || source === void 0 ? void 0 : source[key];
|
|
3071
|
+
if (typeof value === "string" && value) {
|
|
3072
|
+
return value;
|
|
3073
|
+
}
|
|
3074
|
+
if (typeof value === "function") {
|
|
3075
|
+
try {
|
|
3076
|
+
var result = value.call(source);
|
|
3077
|
+
if (typeof result === "string" && result) {
|
|
3078
|
+
return result;
|
|
3079
|
+
}
|
|
3080
|
+
} catch (unused) {}
|
|
3081
|
+
}
|
|
3082
|
+
}
|
|
3083
|
+
} catch (err) {
|
|
3084
|
+
_didIteratorError = true;
|
|
3085
|
+
_iteratorError = err;
|
|
3086
|
+
} finally{
|
|
3087
|
+
try {
|
|
3088
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3089
|
+
_iterator.return();
|
|
3090
|
+
}
|
|
3091
|
+
} finally{
|
|
3092
|
+
if (_didIteratorError) {
|
|
3093
|
+
throw _iteratorError;
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
return void 0;
|
|
3098
|
+
}
|
|
3099
|
+
function readBridgeBoolean(source, keys) {
|
|
3100
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3101
|
+
try {
|
|
3102
|
+
for(var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3103
|
+
var key = _step.value;
|
|
3104
|
+
var value = source === null || source === void 0 ? void 0 : source[key];
|
|
3105
|
+
var normalized = normalizeBoolean(value);
|
|
3106
|
+
if (normalized != null) {
|
|
3107
|
+
return normalized;
|
|
3108
|
+
}
|
|
3109
|
+
if (typeof value === "function") {
|
|
3110
|
+
try {
|
|
3111
|
+
var result = normalizeBoolean(value.call(source));
|
|
3112
|
+
if (result != null) {
|
|
3113
|
+
return result;
|
|
3114
|
+
}
|
|
3115
|
+
} catch (unused) {}
|
|
3116
|
+
}
|
|
3117
|
+
}
|
|
3118
|
+
} catch (err) {
|
|
3119
|
+
_didIteratorError = true;
|
|
3120
|
+
_iteratorError = err;
|
|
3121
|
+
} finally{
|
|
3122
|
+
try {
|
|
3123
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3124
|
+
_iterator.return();
|
|
3125
|
+
}
|
|
3126
|
+
} finally{
|
|
3127
|
+
if (_didIteratorError) {
|
|
3128
|
+
throw _iteratorError;
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
return void 0;
|
|
3133
|
+
}
|
|
3134
|
+
function readStoredDeviceId() {
|
|
3135
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3136
|
+
try {
|
|
3137
|
+
for(var _iterator = DEVICE_ID_STORAGE_KEYS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3138
|
+
var key = _step.value;
|
|
3139
|
+
var value = readStoredString(key);
|
|
3140
|
+
if (value) {
|
|
3141
|
+
return value;
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
} catch (err) {
|
|
3145
|
+
_didIteratorError = true;
|
|
3146
|
+
_iteratorError = err;
|
|
3147
|
+
} finally{
|
|
3148
|
+
try {
|
|
3149
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3150
|
+
_iterator.return();
|
|
3151
|
+
}
|
|
3152
|
+
} finally{
|
|
3153
|
+
if (_didIteratorError) {
|
|
3154
|
+
throw _iteratorError;
|
|
3155
|
+
}
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
return void 0;
|
|
3159
|
+
}
|
|
3160
|
+
function readStoredString(key) {
|
|
3161
|
+
if (typeof window === "undefined") {
|
|
3162
|
+
return void 0;
|
|
3163
|
+
}
|
|
3164
|
+
try {
|
|
3165
|
+
var _window_localStorage;
|
|
3166
|
+
var value = (_window_localStorage = window.localStorage) === null || _window_localStorage === void 0 ? void 0 : _window_localStorage.getItem(key);
|
|
3167
|
+
return value || void 0;
|
|
3168
|
+
} catch (unused) {
|
|
3169
|
+
return void 0;
|
|
3170
|
+
}
|
|
3171
|
+
}
|
|
3172
|
+
function readStoredLimitAdTracking() {
|
|
3173
|
+
return normalizeBoolean(readStoredString("limitAdTracking") || readStoredString("limitedAdTracking") || readStoredString("is_lat"));
|
|
3174
|
+
}
|
|
3175
|
+
function normalizeBoolean(value) {
|
|
3176
|
+
if (typeof value === "boolean") {
|
|
3177
|
+
return value;
|
|
3178
|
+
}
|
|
3179
|
+
if (typeof value === "number") {
|
|
3180
|
+
return value === 1;
|
|
3181
|
+
}
|
|
3182
|
+
if (typeof value === "string") {
|
|
3183
|
+
var normalized = value.toLowerCase();
|
|
3184
|
+
if (normalized === "1" || normalized === "true" || normalized === "yes") {
|
|
3185
|
+
return true;
|
|
3186
|
+
}
|
|
3187
|
+
if (normalized === "0" || normalized === "false" || normalized === "no") {
|
|
3188
|
+
return false;
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
return void 0;
|
|
3192
|
+
}
|
|
3193
|
+
function inferDeviceIdType() {
|
|
3194
|
+
if (typeof navigator === "undefined") {
|
|
3195
|
+
return void 0;
|
|
3196
|
+
}
|
|
3197
|
+
var ua = navigator.userAgent;
|
|
3198
|
+
if (/Roku/i.test(ua)) return "rida";
|
|
3199
|
+
if (/Tizen|Samsung/i.test(ua)) return "tifa";
|
|
3200
|
+
if (/AppleTV/i.test(ua)) return "tvOS";
|
|
3201
|
+
if (/AFT|Fire TV|Amazon/i.test(ua)) return "afai";
|
|
3202
|
+
if (/Web0S|webOS|LG/i.test(ua)) return "lgudid";
|
|
3203
|
+
if (/Android|Google TV/i.test(ua)) return "aaid";
|
|
3204
|
+
return void 0;
|
|
3205
|
+
}
|
|
2884
3206
|
// src/player/StormcloudVideoPlayer.ts
|
|
2885
3207
|
var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
2886
3208
|
function StormcloudVideoPlayer(config) {
|
|
@@ -5322,17 +5644,24 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5322
5644
|
for(var i = 0; i < count; i++){
|
|
5323
5645
|
this.adRequestPositionInBreak++;
|
|
5324
5646
|
var adWillPlayMuted = this.inAdBreak ? this.adPlayer.getOriginalMutedState() : this.video.muted;
|
|
5647
|
+
var ctvSignals = this.config.ctvAdRequest ? resolveCtvVastSignals() : void 0;
|
|
5325
5648
|
var urlWithMacros = applyVastMacros(baseUrl, {
|
|
5326
5649
|
correlator: generateCorrelator(),
|
|
5327
5650
|
streamCorrelator: this.streamCorrelator,
|
|
5328
5651
|
pod: this.podCounter > 0 ? this.podCounter : void 0,
|
|
5329
5652
|
adPosition: this.adRequestPositionInBreak,
|
|
5330
|
-
|
|
5653
|
+
isCtv: this.config.ctvAdRequest,
|
|
5654
|
+
contentUrl: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.contentUrl,
|
|
5655
|
+
pageUrl: !this.config.ctvAdRequest && typeof window !== "undefined" ? window.location.href : void 0,
|
|
5331
5656
|
adWillPlayMuted: adWillPlayMuted,
|
|
5332
5657
|
adWillAutoPlay: !!this.config.autoplay,
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5658
|
+
appId: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.appId,
|
|
5659
|
+
appName: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.appName,
|
|
5660
|
+
sessionId: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.sessionId,
|
|
5661
|
+
deviceId: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.deviceId,
|
|
5662
|
+
deviceIdType: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.deviceIdType,
|
|
5663
|
+
limitAdTracking: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.limitAdTracking,
|
|
5664
|
+
deviceTypeHint: ctvSignals === null || ctvSignals === void 0 ? void 0 : ctvSignals.deviceTypeHint,
|
|
5336
5665
|
adTest: this.config.adTest,
|
|
5337
5666
|
consent: this.consentSignals
|
|
5338
5667
|
});
|
|
@@ -8137,12 +8466,13 @@ var CRITICAL_PROPS = [
|
|
|
8137
8466
|
"vmapUrl",
|
|
8138
8467
|
"lowLatencyMode",
|
|
8139
8468
|
"driftToleranceMs",
|
|
8140
|
-
"vastMode"
|
|
8469
|
+
"vastMode",
|
|
8470
|
+
"ctvAdRequest"
|
|
8141
8471
|
];
|
|
8142
8472
|
var CONTROLS_HIDE_DELAY = 3e3;
|
|
8143
8473
|
var DEFAULT_PLAYER_ASPECT_RATIO = 16 / 9;
|
|
8144
8474
|
var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
8145
|
-
var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, isLiveStream = props.isLiveStream, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, isVmap = props.isVmap, vmapUrl = props.vmapUrl, minSegmentsBeforePlay = props.minSegmentsBeforePlay, restVideoAttrs = _object_without_properties(props, [
|
|
8475
|
+
var src = props.src, autoplay = props.autoplay, muted = props.muted, lowLatencyMode = props.lowLatencyMode, allowNativeHls = props.allowNativeHls, isLiveStream = props.isLiveStream, driftToleranceMs = props.driftToleranceMs, immediateManifestAds = props.immediateManifestAds, debugAdTiming = props.debugAdTiming, showCustomControls = props.showCustomControls, hideLoadingIndicator = props.hideLoadingIndicator, onVolumeToggle = props.onVolumeToggle, onFullscreenToggle = props.onFullscreenToggle, onControlClick = props.onControlClick, onReady = props.onReady, wrapperClassName = props.wrapperClassName, wrapperStyle = props.wrapperStyle, className = props.className, style = props.style, controls = props.controls, playsInline = props.playsInline, preload = props.preload, poster = props.poster, children = props.children, licenseKey = props.licenseKey, vastMode = props.vastMode, vastTagUrl = props.vastTagUrl, isVmap = props.isVmap, vmapUrl = props.vmapUrl, minSegmentsBeforePlay = props.minSegmentsBeforePlay, ctvAdRequest = props.ctvAdRequest, restVideoAttrs = _object_without_properties(props, [
|
|
8146
8476
|
"src",
|
|
8147
8477
|
"autoplay",
|
|
8148
8478
|
"muted",
|
|
@@ -8172,7 +8502,8 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8172
8502
|
"vastTagUrl",
|
|
8173
8503
|
"isVmap",
|
|
8174
8504
|
"vmapUrl",
|
|
8175
|
-
"minSegmentsBeforePlay"
|
|
8505
|
+
"minSegmentsBeforePlay",
|
|
8506
|
+
"ctvAdRequest"
|
|
8176
8507
|
]);
|
|
8177
8508
|
var videoRef = (0, import_react.useRef)(null);
|
|
8178
8509
|
var playerRef = (0, import_react.useRef)(null);
|
|
@@ -8361,6 +8692,7 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
8361
8692
|
if (isVmap !== void 0) cfg.isVmap = isVmap;
|
|
8362
8693
|
if (vmapUrl !== void 0) cfg.vmapUrl = vmapUrl;
|
|
8363
8694
|
if (minSegmentsBeforePlay !== void 0) cfg.minSegmentsBeforePlay = minSegmentsBeforePlay;
|
|
8695
|
+
if (ctvAdRequest !== void 0) cfg.ctvAdRequest = ctvAdRequest;
|
|
8364
8696
|
var player = new StormcloudVideoPlayer(cfg);
|
|
8365
8697
|
playerRef.current = player;
|
|
8366
8698
|
player.load().then(function() {
|
|
@@ -9706,6 +10038,7 @@ var HlsPlayer = /*#__PURE__*/ function(_import_react3_Component) {
|
|
|
9706
10038
|
if (_this1.props.licenseKey !== void 0) config.licenseKey = _this1.props.licenseKey;
|
|
9707
10039
|
if (_this1.props.adFailsafeTimeoutMs !== void 0) config.adFailsafeTimeoutMs = _this1.props.adFailsafeTimeoutMs;
|
|
9708
10040
|
if (_this1.props.minSegmentsBeforePlay !== void 0) config.minSegmentsBeforePlay = _this1.props.minSegmentsBeforePlay;
|
|
10041
|
+
if (_this1.props.ctvAdRequest !== void 0) config.ctvAdRequest = _this1.props.ctvAdRequest;
|
|
9709
10042
|
_this1.player = new StormcloudVideoPlayer(config);
|
|
9710
10043
|
(_this_props_onMount = (_this_props = _this1.props).onMount) === null || _this_props_onMount === void 0 ? void 0 : _this_props_onMount.call(_this_props, _this1);
|
|
9711
10044
|
return [
|
|
@@ -10470,6 +10803,7 @@ var SUPPORTED_PROPS = [
|
|
|
10470
10803
|
"vmapUrl",
|
|
10471
10804
|
"adFailsafeTimeoutMs",
|
|
10472
10805
|
"minSegmentsBeforePlay",
|
|
10806
|
+
"ctvAdRequest",
|
|
10473
10807
|
"onReady",
|
|
10474
10808
|
"onStart",
|
|
10475
10809
|
"onPlay",
|