@hopeplayer/core 1.0.15 → 1.0.17
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/README.md +24 -14
- package/dist/HopePlayerElement.d.ts +37 -0
- package/dist/HopePlayerElement.d.ts.map +1 -1
- package/dist/chunks/adTriggers-4SueRFgK.js +415 -0
- package/dist/chunks/adTriggers-4SueRFgK.js.map +1 -0
- package/dist/chunks/{index-BCMVXNL0.js → ads-DPL7m9PV.js} +135 -158
- package/dist/chunks/ads-DPL7m9PV.js.map +1 -0
- package/dist/chunks/{index-BeJNpAyx.js → audio-LkYgd5Wq.js} +7 -7
- package/dist/chunks/audio-LkYgd5Wq.js.map +1 -0
- package/dist/chunks/{ScratchSound-0XKHUcJK.js → audioScratchSound-7XkwCCDm.js} +1 -1
- package/dist/chunks/audioScratchSound-7XkwCCDm.js.map +1 -0
- package/dist/chunks/cast-DCAT2agI.js +387 -0
- package/dist/chunks/cast-DCAT2agI.js.map +1 -0
- package/dist/chunks/{index-rENB3n9O.js → countdownScreen-CI-u6jjA.js} +1 -1
- package/dist/chunks/countdownScreen-CI-u6jjA.js.map +1 -0
- package/dist/chunks/{index-Q8FMOHj0.js → dai-B9Tth1Iv.js} +1 -1
- package/dist/chunks/dai-B9Tth1Iv.js.map +1 -0
- package/dist/chunks/{index-DCXX1ZJG.js → debugPanel-Bnc_7GOn.js} +1 -1
- package/dist/chunks/debugPanel-Bnc_7GOn.js.map +1 -0
- package/dist/chunks/{index-DXWK4EFa.js → dubbing-kNMPpyHl.js} +1 -1
- package/dist/chunks/dubbing-kNMPpyHl.js.map +1 -0
- package/dist/chunks/{index-BBmuCtKu.js → geoChecker-BRtvHwI-.js} +1 -1
- package/dist/chunks/geoChecker-BRtvHwI-.js.map +1 -0
- package/dist/chunks/{index-Ca8hocby.js → gesture-BzPCgi87.js} +1 -1
- package/dist/chunks/gesture-BzPCgi87.js.map +1 -0
- package/dist/chunks/gpt-CGXHTG_H.js +18 -0
- package/dist/chunks/gpt-CGXHTG_H.js.map +1 -0
- package/dist/chunks/{index-3QALpwsf.js → inViewAutoplay-CRJe7GA4.js} +1 -1
- package/dist/chunks/inViewAutoplay-CRJe7GA4.js.map +1 -0
- package/dist/chunks/{index-7IBf8Y-R.js → liveWallClock-ChUTtzLD.js} +1 -1
- package/dist/chunks/liveWallClock-ChUTtzLD.js.map +1 -0
- package/dist/chunks/{index-f0vSgRIK.js → loopSection-CvF4l5uf.js} +1 -1
- package/dist/chunks/loopSection-CvF4l5uf.js.map +1 -0
- package/dist/chunks/{index-DRlQC-ev.js → markers-DE4O8xbw.js} +2 -2
- package/dist/chunks/markers-DE4O8xbw.js.map +1 -0
- package/dist/chunks/{index-CaMVTgh0.js → pauseAd-BQQe21X4.js} +55 -68
- package/dist/chunks/pauseAd-BQQe21X4.js.map +1 -0
- package/dist/chunks/{index-w7pACyTw.js → player-C886oKP-.js} +726 -391
- package/dist/chunks/player-C886oKP-.js.map +1 -0
- package/dist/chunks/{index-DpUZXNJS.js → playlist-CI3mRZjo.js} +2 -2
- package/dist/chunks/playlist-CI3mRZjo.js.map +1 -0
- package/dist/chunks/{VideoPrebid-CpckFzSq.js → prebid-CRY3i2OT.js} +1 -1
- package/dist/chunks/prebid-CRY3i2OT.js.map +1 -0
- package/dist/chunks/{index-DT8-oMPm.js → qrResume-BNy8XCp_.js} +1 -1
- package/dist/chunks/qrResume-BNy8XCp_.js.map +1 -0
- package/dist/chunks/redirectScreen-CJ3q9OX4.js +208 -0
- package/dist/chunks/redirectScreen-CJ3q9OX4.js.map +1 -0
- package/dist/chunks/rewardedUnlock-EyGMB9PK.js +264 -0
- package/dist/chunks/rewardedUnlock-EyGMB9PK.js.map +1 -0
- package/dist/chunks/{index-BOoNcKeR.js → segments-C2HKU6XK.js} +2 -2
- package/dist/chunks/segments-C2HKU6XK.js.map +1 -0
- package/dist/chunks/{index-D5P-LWbg.js → sponsorship-DyFwGmEb.js} +20 -20
- package/dist/chunks/sponsorship-DyFwGmEb.js.map +1 -0
- package/dist/chunks/{index-BvoB2O1p.js → spriteThumbnails-D0NQ5CCp.js} +2 -2
- package/dist/chunks/spriteThumbnails-D0NQ5CCp.js.map +1 -0
- package/dist/chunks/{index-DGtpFgHV.js → statsPanel-DSClIwA3.js} +1 -1
- package/dist/chunks/statsPanel-DSClIwA3.js.map +1 -0
- package/dist/chunks/{index-CDDke5rz.js → sticky-D_eLCNFk.js} +1 -1
- package/dist/chunks/sticky-D_eLCNFk.js.map +1 -0
- package/dist/chunks/{index-ClQg_X1N.js → story-D5Got6-6.js} +2 -2
- package/dist/chunks/{index-ClQg_X1N.js.map → story-D5Got6-6.js.map} +1 -1
- package/dist/chunks/{index-C5oGMHF_.js → tapGestures-DrC42DiI.js} +1 -1
- package/dist/chunks/tapGestures-DrC42DiI.js.map +1 -0
- package/dist/hls/SourceManager.d.ts +8 -0
- package/dist/hls/SourceManager.d.ts.map +1 -1
- package/dist/hls/sourceGroups.d.ts +19 -0
- package/dist/hls/sourceGroups.d.ts.map +1 -0
- package/dist/hope-player.js +1 -1
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/types.d.ts +12 -0
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/plugins/ad-triggers/AdTriggers.d.ts +99 -0
- package/dist/plugins/ad-triggers/AdTriggers.d.ts.map +1 -0
- package/dist/plugins/ad-triggers/index.d.ts +7 -0
- package/dist/plugins/ad-triggers/index.d.ts.map +1 -0
- package/dist/plugins/ads/AdsController.d.ts +8 -0
- package/dist/plugins/ads/AdsController.d.ts.map +1 -1
- package/dist/plugins/ads/generateVastUrl.d.ts +10 -0
- package/dist/plugins/ads/generateVastUrl.d.ts.map +1 -1
- package/dist/plugins/cast/CastController.d.ts +107 -0
- package/dist/plugins/cast/CastController.d.ts.map +1 -0
- package/dist/plugins/cast/RemoteMediaProxy.d.ts +41 -0
- package/dist/plugins/cast/RemoteMediaProxy.d.ts.map +1 -0
- package/dist/plugins/cast/castSdk.d.ts +160 -0
- package/dist/plugins/cast/castSdk.d.ts.map +1 -0
- package/dist/plugins/cast/index.d.ts +7 -0
- package/dist/plugins/cast/index.d.ts.map +1 -0
- package/dist/plugins/pause-ad/loadGpt.d.ts +2 -0
- package/dist/plugins/pause-ad/loadGpt.d.ts.map +1 -1
- package/dist/plugins/redirect-screen/RedirectScreen.d.ts +26 -3
- package/dist/plugins/redirect-screen/RedirectScreen.d.ts.map +1 -1
- package/dist/plugins/rewarded/RewardedUnlock.d.ts +2 -5
- package/dist/plugins/rewarded/RewardedUnlock.d.ts.map +1 -1
- package/dist/plugins/rewarded/gpt.d.ts +6 -2
- package/dist/plugins/rewarded/gpt.d.ts.map +1 -1
- package/dist/plugins/sponsorship/SponsorshipLayer.d.ts.map +1 -1
- package/dist/types/index.d.ts +308 -3
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -1
- package/dist/chunks/ScratchSound-0XKHUcJK.js.map +0 -1
- package/dist/chunks/VideoPrebid-CpckFzSq.js.map +0 -1
- package/dist/chunks/index-3QALpwsf.js.map +0 -1
- package/dist/chunks/index-7IBf8Y-R.js.map +0 -1
- package/dist/chunks/index-BBmuCtKu.js.map +0 -1
- package/dist/chunks/index-BCMVXNL0.js.map +0 -1
- package/dist/chunks/index-BOoNcKeR.js.map +0 -1
- package/dist/chunks/index-BeJNpAyx.js.map +0 -1
- package/dist/chunks/index-BvoB2O1p.js.map +0 -1
- package/dist/chunks/index-C5oGMHF_.js.map +0 -1
- package/dist/chunks/index-CDDke5rz.js.map +0 -1
- package/dist/chunks/index-Ca8hocby.js.map +0 -1
- package/dist/chunks/index-CaMVTgh0.js.map +0 -1
- package/dist/chunks/index-D5P-LWbg.js.map +0 -1
- package/dist/chunks/index-D6r-BGAV.js +0 -77
- package/dist/chunks/index-D6r-BGAV.js.map +0 -1
- package/dist/chunks/index-DCXX1ZJG.js.map +0 -1
- package/dist/chunks/index-DGtpFgHV.js.map +0 -1
- package/dist/chunks/index-DRlQC-ev.js.map +0 -1
- package/dist/chunks/index-DT8-oMPm.js.map +0 -1
- package/dist/chunks/index-DXWK4EFa.js.map +0 -1
- package/dist/chunks/index-DpUZXNJS.js.map +0 -1
- package/dist/chunks/index-Q8FMOHj0.js.map +0 -1
- package/dist/chunks/index-TkG8IO6q.js +0 -239
- package/dist/chunks/index-TkG8IO6q.js.map +0 -1
- package/dist/chunks/index-f0vSgRIK.js.map +0 -1
- package/dist/chunks/index-rENB3n9O.js.map +0 -1
- package/dist/chunks/index-w7pACyTw.js.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (d, e, t) =>
|
|
4
|
-
|
|
1
|
+
var P = Object.defineProperty;
|
|
2
|
+
var k = (d, e, t) => e in d ? P(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
|
|
3
|
+
var r = (d, e, t) => k(d, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { t as E, g as M, m as L } from "./player-C886oKP-.js";
|
|
5
|
+
const x = 8e3;
|
|
6
|
+
class C {
|
|
5
7
|
constructor(e) {
|
|
6
8
|
/** Reklam yüzünden çıkılan yüzey — reklam bitince geri dönüş butonu için. */
|
|
7
9
|
r(this, "exited", null);
|
|
@@ -41,7 +43,7 @@ class k {
|
|
|
41
43
|
const t = this.ctx.labels(), i = document.createElement("button");
|
|
42
44
|
i.type = "button", i.className = "hp-ad-return", i.setAttribute("part", "ad-return"), i.textContent = e === "fullscreen" ? t.adReturnFullscreen : t.adReturnPip, i.addEventListener("click", (s) => {
|
|
43
45
|
s.stopPropagation(), this.hideButton(), e === "fullscreen" ? this.ctx.enterFullscreen() : this.enterPip();
|
|
44
|
-
}), i.addEventListener("pointerdown", (s) => s.stopPropagation()), this.ctx.containerEl.appendChild(i), this.button = i, this.hideTimer = setTimeout(() => this.hideButton(),
|
|
46
|
+
}), i.addEventListener("pointerdown", (s) => s.stopPropagation()), this.ctx.containerEl.appendChild(i), this.button = i, this.hideTimer = setTimeout(() => this.hideButton(), x);
|
|
45
47
|
}
|
|
46
48
|
enterPip() {
|
|
47
49
|
var t, i;
|
|
@@ -57,60 +59,19 @@ class k {
|
|
|
57
59
|
this.hideButton(), this.exited = null;
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
|
-
const
|
|
62
|
+
const b = "https://imasdk.googleapis.com/js/sdkloader/ima3.js";
|
|
61
63
|
let g = null;
|
|
62
|
-
function
|
|
64
|
+
function S() {
|
|
63
65
|
var d;
|
|
64
66
|
return (d = window.google) != null && d.ima ? Promise.resolve(window.google.ima) : g || (g = new Promise((e, t) => {
|
|
65
67
|
const i = document.createElement("script");
|
|
66
|
-
i.src =
|
|
68
|
+
i.src = b, i.async = !0, i.onload = () => {
|
|
67
69
|
var s;
|
|
68
70
|
(s = window.google) != null && s.ima ? e(window.google.ima) : t(new Error("IMA SDK yüklendi ama window.google.ima yok"));
|
|
69
71
|
}, i.onerror = () => t(new Error("IMA SDK yüklenemedi (reklam engelleyici olabilir)")), document.head.appendChild(i);
|
|
70
72
|
}), g);
|
|
71
73
|
}
|
|
72
|
-
|
|
73
|
-
var i;
|
|
74
|
-
const e = (i = window.adTaxonomy) == null ? void 0 : i.keyValues;
|
|
75
|
-
if (!e || typeof e != "object") return "";
|
|
76
|
-
const t = [];
|
|
77
|
-
for (const [s, a] of Object.entries(e))
|
|
78
|
-
a == null || a === "" || t.push(`${s}=${a}`);
|
|
79
|
-
return t.join("&");
|
|
80
|
-
}
|
|
81
|
-
function C(d, e = {}) {
|
|
82
|
-
const t = encodeURIComponent(document.referrer || window.location.href), i = encodeURIComponent(window.location.href), s = Date.now();
|
|
83
|
-
let a = d;
|
|
84
|
-
const o = {
|
|
85
|
-
referrer_url: t,
|
|
86
|
-
description_url: i,
|
|
87
|
-
timestamp: s
|
|
88
|
-
};
|
|
89
|
-
for (const [n, c] of Object.entries(o)) {
|
|
90
|
-
const h = `[${n}]`;
|
|
91
|
-
if (a.includes(h))
|
|
92
|
-
a = a.replace(h, String(c));
|
|
93
|
-
else if (!new URLSearchParams(a.split("?")[1]).has(n)) {
|
|
94
|
-
const l = a.includes("?") ? "&" : "?";
|
|
95
|
-
a += `${l}${n}=${c}`;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const n = new URL(a);
|
|
100
|
-
if (n.pathname.includes("/vmap/")) return d;
|
|
101
|
-
const h = [];
|
|
102
|
-
e.includeRefreshCount && h.push(`adrefreshCount=${e.adRefreshCount ?? 0}`);
|
|
103
|
-
const l = x();
|
|
104
|
-
if (l && h.push(l), h.length) {
|
|
105
|
-
const u = n.searchParams.get("cust_params");
|
|
106
|
-
n.searchParams.set("cust_params", u ? `${u}&${h.join("&")}` : h.join("&"));
|
|
107
|
-
}
|
|
108
|
-
return n.toString();
|
|
109
|
-
} catch {
|
|
110
|
-
return a;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
class b {
|
|
74
|
+
class R {
|
|
114
75
|
constructor(e) {
|
|
115
76
|
r(this, "adRetryCount", 0);
|
|
116
77
|
r(this, "chain", {});
|
|
@@ -136,26 +97,26 @@ class b {
|
|
|
136
97
|
s("retry-disabled");
|
|
137
98
|
return;
|
|
138
99
|
}
|
|
139
|
-
const
|
|
140
|
-
if (this.adRetryCount >=
|
|
100
|
+
const a = this.resolveMaxRetry();
|
|
101
|
+
if (this.adRetryCount >= a) {
|
|
141
102
|
this.reset(), s("retry-limit");
|
|
142
103
|
return;
|
|
143
104
|
}
|
|
144
105
|
this.cancelPending(), this.adRetryCount++;
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const
|
|
106
|
+
const o = this.getChainState(e, t);
|
|
107
|
+
o.attemptsOnCurrent++;
|
|
108
|
+
const l = this.config.maxAttemptsPerTag ?? 1 / 0;
|
|
109
|
+
o.attemptsOnCurrent > l && o.index < o.tags.length - 1 && (o.index++, o.attemptsOnCurrent = 1);
|
|
110
|
+
const c = o.tags[o.index], h = this.adRetryCount;
|
|
150
111
|
this.retryTimer = setTimeout(() => {
|
|
151
|
-
this.retryTimer = null, i(
|
|
112
|
+
this.retryTimer = null, i(c, h);
|
|
152
113
|
}, this.applyJitter(this.resolveRetryDelay()));
|
|
153
114
|
}
|
|
154
115
|
getChainState(e, t) {
|
|
155
116
|
const i = this.chain[e];
|
|
156
117
|
if (i) return i;
|
|
157
|
-
const s = (Array.isArray(t) ? t : [t]).filter((
|
|
158
|
-
return this.chain[e] =
|
|
118
|
+
const s = (Array.isArray(t) ? t : [t]).filter((a) => !!a), n = { tags: s.length ? s : [t], index: 0, attemptsOnCurrent: 0 };
|
|
119
|
+
return this.chain[e] = n, n;
|
|
159
120
|
}
|
|
160
121
|
resolveRetryDelay() {
|
|
161
122
|
const e = this.config.retryDelayPattern;
|
|
@@ -180,7 +141,7 @@ class b {
|
|
|
180
141
|
return Math.max(0, Math.round(e * i));
|
|
181
142
|
}
|
|
182
143
|
}
|
|
183
|
-
function
|
|
144
|
+
function T(d, e) {
|
|
184
145
|
var t;
|
|
185
146
|
try {
|
|
186
147
|
(t = d == null ? void 0 : d.settings) != null && t.setPrivacySettings && (d.settings.setPrivacySettings({ nonPersonalizedAds: !0 }), console.warn(`[HopePlayer consent] non-personalized ads zorlandı (${e})`));
|
|
@@ -188,63 +149,63 @@ function E(d, e) {
|
|
|
188
149
|
console.warn("[HopePlayer consent] setPrivacySettings hatası:", i);
|
|
189
150
|
}
|
|
190
151
|
}
|
|
191
|
-
function
|
|
152
|
+
function B(d, e) {
|
|
192
153
|
if (d.consentAware) {
|
|
193
154
|
try {
|
|
194
155
|
typeof window.__uspapi == "function" && window.__uspapi("getUSPData", 1, (t, i) => {
|
|
195
|
-
!i || !(t != null && t.uspString) || t.uspString.charAt(2) === "Y" &&
|
|
156
|
+
!i || !(t != null && t.uspString) || t.uspString.charAt(2) === "Y" && T(e, "USP/CCPA opt-out");
|
|
196
157
|
});
|
|
197
158
|
} catch (t) {
|
|
198
159
|
console.warn("[HopePlayer consent] __uspapi okuma hatası:", t);
|
|
199
160
|
}
|
|
200
161
|
try {
|
|
201
162
|
typeof window.__tcfapi == "function" && window.__tcfapi("getTCData", 2, (t, i) => {
|
|
202
|
-
var o,
|
|
163
|
+
var a, o, l, c;
|
|
203
164
|
if (!i || !t || t.gdprApplies !== !0) return;
|
|
204
|
-
const s = (
|
|
205
|
-
(s === !1 ||
|
|
165
|
+
const s = (o = (a = t.vendor) == null ? void 0 : a.consents) == null ? void 0 : o[755], n = (c = (l = t.purpose) == null ? void 0 : l.consents) == null ? void 0 : c[1];
|
|
166
|
+
(s === !1 || n === !1) && T(e, "TCF yetersiz onay");
|
|
206
167
|
});
|
|
207
168
|
} catch (t) {
|
|
208
169
|
console.warn("[HopePlayer consent] __tcfapi okuma hatası:", t);
|
|
209
170
|
}
|
|
210
171
|
}
|
|
211
172
|
}
|
|
212
|
-
function
|
|
173
|
+
function w(d) {
|
|
213
174
|
try {
|
|
214
175
|
const e = atob(d), t = new Uint8Array(e.length);
|
|
215
|
-
for (let
|
|
176
|
+
for (let h = 0; h < e.length; h++) t[h] = e.charCodeAt(h);
|
|
216
177
|
if (t[0] !== 252 || t[13] !== 5) return null;
|
|
217
178
|
const s = (t[14] << 24 | t[15] << 16 | t[16] << 8 | t[17]) >>> 0;
|
|
218
179
|
if (t[18] >> 7 & 1) return { type: "cancel", spliceEventId: s };
|
|
219
|
-
const
|
|
220
|
-
let
|
|
221
|
-
if (
|
|
222
|
-
let
|
|
223
|
-
const u = t[
|
|
224
|
-
if (
|
|
225
|
-
const p = t[
|
|
226
|
-
|
|
180
|
+
const a = t[19] >> 7 & 1, o = t[19] >> 6 & 1, l = t[19] >> 5 & 1;
|
|
181
|
+
let c = null;
|
|
182
|
+
if (o) {
|
|
183
|
+
let h = 20;
|
|
184
|
+
const u = t[h] >> 7 & 1;
|
|
185
|
+
if (h += u ? 5 : 1, l) {
|
|
186
|
+
const p = t[h] >> 7 & 1, f = (t[h] & 1) * Math.pow(2, 32) + t[h + 1] * Math.pow(2, 24) + t[h + 2] * Math.pow(2, 16) + t[h + 3] * Math.pow(2, 8) + t[h + 4];
|
|
187
|
+
c = { autoReturn: p, seconds: f / 9e4 };
|
|
227
188
|
}
|
|
228
189
|
}
|
|
229
|
-
return { type:
|
|
190
|
+
return { type: a ? "out" : "in", spliceEventId: s, breakDuration: c, programSplice: !!o };
|
|
230
191
|
} catch {
|
|
231
192
|
return null;
|
|
232
193
|
}
|
|
233
194
|
}
|
|
234
|
-
function
|
|
195
|
+
function I(d, e) {
|
|
235
196
|
if (d === "EXT-X-CUE-OUT")
|
|
236
197
|
return { type: "out", duration: parseFloat(e) || null };
|
|
237
198
|
if (d === "EXT-X-CUE-IN")
|
|
238
199
|
return { type: "in" };
|
|
239
200
|
if (d === "EXT-X-DATERANGE") {
|
|
240
|
-
const t = e.match(/SCTE35-OUT=0x([0-9A-Fa-f]+)/), i = e.match(/SCTE35-IN=0x([0-9A-Fa-f]+)/), s = e.match(/PLANNED-DURATION=([\d.]+)/),
|
|
201
|
+
const t = e.match(/SCTE35-OUT=0x([0-9A-Fa-f]+)/), i = e.match(/SCTE35-IN=0x([0-9A-Fa-f]+)/), s = e.match(/PLANNED-DURATION=([\d.]+)/), n = e.match(/CLASS="([^"]+)"/);
|
|
241
202
|
if (t)
|
|
242
|
-
return { type: "out", duration: s ? parseFloat(s[1]) : null, class:
|
|
203
|
+
return { type: "out", duration: s ? parseFloat(s[1]) : null, class: n ? n[1] : null, raw: t[1] };
|
|
243
204
|
if (i) return { type: "in", raw: i[1] };
|
|
244
205
|
}
|
|
245
|
-
return d === "EXT-OATCLS-SCTE35" ?
|
|
206
|
+
return d === "EXT-OATCLS-SCTE35" ? w(e) : null;
|
|
246
207
|
}
|
|
247
|
-
class
|
|
208
|
+
class O {
|
|
248
209
|
constructor(e, t) {
|
|
249
210
|
r(this, "inAdBreak", !1);
|
|
250
211
|
r(this, "adBreakTimer", null);
|
|
@@ -281,12 +242,12 @@ class B {
|
|
|
281
242
|
if (t.value && typeof t.value == "object")
|
|
282
243
|
i = t.value.key ?? null, s = t.value.data ?? t.value.value ?? "";
|
|
283
244
|
else if (typeof t.text == "string") {
|
|
284
|
-
const
|
|
285
|
-
|
|
245
|
+
const a = t.text.match(/^(EXT[^:]+):?(.*)$/);
|
|
246
|
+
a && (i = a[1], s = a[2] ?? "");
|
|
286
247
|
}
|
|
287
248
|
if (!i) return;
|
|
288
|
-
const
|
|
289
|
-
|
|
249
|
+
const n = I(i, s);
|
|
250
|
+
n && this.handleSignal(n);
|
|
290
251
|
}
|
|
291
252
|
handleSignal(e) {
|
|
292
253
|
var t;
|
|
@@ -309,11 +270,11 @@ class B {
|
|
|
309
270
|
this.inAdBreak && (this.inAdBreak = !1, this.adBreakTimer && (clearTimeout(this.adBreakTimer), this.adBreakTimer = null), this.callbacks.onAdBreakEnd());
|
|
310
271
|
}
|
|
311
272
|
}
|
|
312
|
-
const
|
|
313
|
-
function
|
|
273
|
+
const q = 250, D = 300 * 1e3, V = "100% 0px 100% 0px";
|
|
274
|
+
function F(d, e) {
|
|
314
275
|
return e === "Preroll" ? d.adTagPreroll : e === "Midroll" ? d.adTagMidroll : d.adTagPostroll;
|
|
315
276
|
}
|
|
316
|
-
class
|
|
277
|
+
class _ {
|
|
317
278
|
constructor(e, t) {
|
|
318
279
|
r(this, "ima", null);
|
|
319
280
|
r(this, "adDisplayContainer", null);
|
|
@@ -351,6 +312,8 @@ class U {
|
|
|
351
312
|
r(this, "visibilityObserver", null);
|
|
352
313
|
/** Bir lineer reklam arası başladı ve henüz bitmedi (CONTENT_PAUSE_REQUESTED → CONTENT_RESUME_REQUESTED). */
|
|
353
314
|
r(this, "linearBreakActive", !1);
|
|
315
|
+
/** İçerik Chromecast'te oynuyor — reklamları TV (receiver) oynatır; yerel istek / VMAP takibi yok. */
|
|
316
|
+
r(this, "remote", !1);
|
|
354
317
|
/** Ekranda bir overlay (non-linear) reklam var — reklam katmanı içerikle birlikte görünür. */
|
|
355
318
|
r(this, "nonLinearActive", !1);
|
|
356
319
|
/** Son IMA hatası — vazgeçilince hp:aderror bununla gönderilir. */
|
|
@@ -382,13 +345,13 @@ class U {
|
|
|
382
345
|
r(this, "onTimeUpdateForMidroll", () => {
|
|
383
346
|
var i;
|
|
384
347
|
const e = this.options.midrollIntervalSeconds ?? 0;
|
|
385
|
-
if (e <= 0 || !this.options.adTagMidroll || this.options.iosFullscreen === "defer" && ((i = this.surfaceGuard) != null && i.current())) return;
|
|
348
|
+
if (e <= 0 || !this.options.adTagMidroll || this.remote || this.options.iosFullscreen === "defer" && ((i = this.surfaceGuard) != null && i.current())) return;
|
|
386
349
|
const t = this.ctx.videoEl.currentTime;
|
|
387
350
|
t > 60 && t - this.lastMidrollTime >= e && (this.lastMidrollTime = t, this.requestAd("Midroll", this.options.adTagMidroll));
|
|
388
351
|
});
|
|
389
352
|
r(this, "onContentEnded", () => {
|
|
390
353
|
var e;
|
|
391
|
-
if (!this.postrollShown) {
|
|
354
|
+
if (!(this.postrollShown || this.remote)) {
|
|
392
355
|
if (this.options.adTagVmap) {
|
|
393
356
|
this.postrollShown = !0, (e = this.adsLoader) == null || e.contentComplete();
|
|
394
357
|
return;
|
|
@@ -397,7 +360,7 @@ class U {
|
|
|
397
360
|
}
|
|
398
361
|
});
|
|
399
362
|
r(this, "onAdsManagerLoaded", (e) => {
|
|
400
|
-
var
|
|
363
|
+
var n, a;
|
|
401
364
|
if (!this.ima) return;
|
|
402
365
|
const t = this.currentBreakType === "Preroll";
|
|
403
366
|
if (t && this.prerollAbandoned) {
|
|
@@ -419,8 +382,8 @@ class U {
|
|
|
419
382
|
this.adsManager.addEventListener(i.Type.CONTENT_PAUSE_REQUESTED, this.onContentPauseRequested), this.adsManager.addEventListener(i.Type.CONTENT_RESUME_REQUESTED, this.onContentResumeRequested), this.adsManager.addEventListener(i.Type.ALL_ADS_COMPLETED, this.onAllAdsCompleted), this.adsManager.addEventListener(i.Type.LOADED, this.onAdLoaded), this.adsManager.addEventListener(i.Type.STARTED, this.onAdStarted), this.adsManager.addEventListener(i.Type.COMPLETE, this.stopAdProgress), this.adsManager.addEventListener(i.Type.SKIPPED, this.stopAdProgress), i.Type.USER_CLOSE && this.adsManager.addEventListener(i.Type.USER_CLOSE, this.endNonLinear), this.adsManager.addEventListener(this.ima.AdErrorEvent.Type.AD_ERROR, this.onAdsManagerError), this.adsManager.addEventListener(i.Type.PAUSED, this.onAdPaused), this.adsManager.addEventListener(i.Type.RESUMED, this.onAdResumed);
|
|
420
383
|
const s = this.ctx.prerollGate;
|
|
421
384
|
if (t && (s != null && s.isArmed)) {
|
|
422
|
-
const
|
|
423
|
-
if (
|
|
385
|
+
const o = ((a = (n = this.adsManager).getCuePoints) == null ? void 0 : a.call(n)) ?? [];
|
|
386
|
+
if (o.length > 0 && !o.includes(0)) {
|
|
424
387
|
s.release(!0), this.startAdsManager();
|
|
425
388
|
return;
|
|
426
389
|
}
|
|
@@ -439,7 +402,7 @@ class U {
|
|
|
439
402
|
return;
|
|
440
403
|
}
|
|
441
404
|
if (this.prerollStartPending) {
|
|
442
|
-
if (this.prerollStartPending = !1, Date.now() - this.prerollRequestedAt >
|
|
405
|
+
if (this.prerollStartPending = !1, Date.now() - this.prerollRequestedAt > D) {
|
|
443
406
|
(e = this.adsManager) == null || e.destroy(), this.adsManager = null, this.initialRequestFired = !1, this.vmapRequested = !1, this.fireInitialRequest();
|
|
444
407
|
return;
|
|
445
408
|
}
|
|
@@ -482,12 +445,12 @@ class U {
|
|
|
482
445
|
* reklam katmanı içerikle birlikte görünür, kontrol çubuğunun üstünde durur ve yalnızca overlay tıklanabilir.
|
|
483
446
|
*/
|
|
484
447
|
r(this, "onAdLoaded", (e) => {
|
|
485
|
-
var s,
|
|
448
|
+
var s, n, a;
|
|
486
449
|
const t = (s = e == null ? void 0 : e.getAd) == null ? void 0 : s.call(e);
|
|
487
450
|
if (!t || typeof t.isLinear != "function" || t.isLinear()) return;
|
|
488
451
|
this.nonLinearActive = !0;
|
|
489
452
|
const i = this.ctx.adLayerEl;
|
|
490
|
-
this.nonLinearCreativeHeight = ((
|
|
453
|
+
this.nonLinearCreativeHeight = ((n = t.getHeight) == null ? void 0 : n.call(t)) || 0, i.setAttribute("data-nonlinear", ""), i.classList.remove("hp:hidden"), i.classList.add("hp:block"), this.resizeAd(), this.currentBreakType === "Preroll" && ((a = this.ctx.prerollGate) == null || a.release(!0)), this.ctx.hostEl.dispatchEvent(new CustomEvent("hp:adstart", { detail: { type: this.breakTypeOf(e), linear: !1 } }));
|
|
491
454
|
});
|
|
492
455
|
/** Boyut değişimleri (ResizeObserver) kare başına bire indirilir — pencere sürüklenirken IMA'yı boğmasın. */
|
|
493
456
|
r(this, "scheduleResize", () => {
|
|
@@ -515,19 +478,19 @@ class U {
|
|
|
515
478
|
});
|
|
516
479
|
/** Lineer reklam başladı: pod bilgisi + kalan süre toolbar'a (geri sayım). */
|
|
517
480
|
r(this, "onAdStarted", (e) => {
|
|
518
|
-
var s,
|
|
481
|
+
var s, n;
|
|
519
482
|
const t = (s = e == null ? void 0 : e.getAd) == null ? void 0 : s.call(e);
|
|
520
483
|
if (!t || typeof t.isLinear == "function" && !t.isLinear()) return;
|
|
521
484
|
try {
|
|
522
|
-
const
|
|
523
|
-
this.podPosition =
|
|
485
|
+
const a = t.getAdPodInfo();
|
|
486
|
+
this.podPosition = a.getAdPosition() || 1, this.podTotal = a.getTotalAds() || 1;
|
|
524
487
|
} catch {
|
|
525
488
|
this.podPosition = 1, this.podTotal = 1;
|
|
526
489
|
}
|
|
527
|
-
this.stopAdProgress(), this.reportAdProgress(), this.progressTimer = setInterval(this.reportAdProgress,
|
|
490
|
+
this.stopAdProgress(), this.reportAdProgress(), this.progressTimer = setInterval(this.reportAdProgress, q);
|
|
528
491
|
let i = "";
|
|
529
492
|
try {
|
|
530
|
-
i = ((
|
|
493
|
+
i = ((n = t.getContentType) == null ? void 0 : n.call(t)) ?? "";
|
|
531
494
|
} catch {
|
|
532
495
|
}
|
|
533
496
|
this.ctx.adLayerEl.toggleAttribute("data-audio-ad", i.startsWith("audio/"));
|
|
@@ -541,17 +504,17 @@ class U {
|
|
|
541
504
|
var e, t;
|
|
542
505
|
this.progressTimer && clearInterval(this.progressTimer), this.progressTimer = null, (t = (e = this.ctx).onAdProgress) == null || t.call(e, null);
|
|
543
506
|
});
|
|
544
|
-
this.ctx = e, this.options = t, this.retry = new
|
|
507
|
+
this.ctx = e, this.options = t, this.retry = new R(t.retry ?? {}), this.prebidIdSuffix = e.hostEl.id || Math.random().toString(36).slice(2, 8), this.surfaceGuard = e.surface ? new C(e.surface) : null;
|
|
545
508
|
}
|
|
546
509
|
async install() {
|
|
547
|
-
var s, a, o,
|
|
510
|
+
var s, n, a, o, l, c;
|
|
548
511
|
let e;
|
|
549
512
|
const t = this.ctx.prerollGate;
|
|
550
513
|
t && (t.onPlayIntent = this.onPrerollPlayIntent, t.onTimeout = this.onPrerollTimeout);
|
|
551
514
|
try {
|
|
552
|
-
e = await
|
|
553
|
-
} catch (
|
|
554
|
-
t == null || t.release(!0), (
|
|
515
|
+
e = await S();
|
|
516
|
+
} catch (h) {
|
|
517
|
+
t == null || t.release(!0), (n = (s = this.ctx).log) == null || n.call(s, { message: `IMA SDK failed to load: ${String(h)}`, details: { hint: "ad blocker / network" } }), this.ctx.hostEl.dispatchEvent(new CustomEvent("hp:aderror", { detail: { message: String(h), errorType: "sdkLoadError" } }));
|
|
555
518
|
return;
|
|
556
519
|
}
|
|
557
520
|
this.ima = e;
|
|
@@ -568,18 +531,18 @@ class U {
|
|
|
568
531
|
} catch {
|
|
569
532
|
}
|
|
570
533
|
try {
|
|
571
|
-
(
|
|
534
|
+
(a = e.ImaSdkSettings) != null && a.VpaidMode && e.settings.setVpaidMode(e.ImaSdkSettings.VpaidMode.INSECURE);
|
|
572
535
|
} catch {
|
|
573
536
|
}
|
|
574
|
-
if (
|
|
537
|
+
if (B(this.options, this.ima), this.ctx.audioPoster)
|
|
575
538
|
try {
|
|
576
|
-
(
|
|
539
|
+
(l = (o = e.settings).setFeatureFlags) == null || l.call(o, { audioPosterImageEnabled: !0, audioPosterImageDefaultUrl: this.ctx.audioPoster });
|
|
577
540
|
} catch {
|
|
578
541
|
}
|
|
579
542
|
this.adDisplayContainer = new e.AdDisplayContainer(this.ctx.adLayerEl, this.ctx.videoEl), typeof ResizeObserver < "u" && (this.resizeObserver = new ResizeObserver(this.scheduleResize), this.resizeObserver.observe(this.ctx.videoEl)), this.adsLoader = new e.AdsLoader(this.adDisplayContainer), this.adsLoader.addEventListener(e.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdsManagerLoaded), this.adsLoader.addEventListener(e.AdErrorEvent.Type.AD_ERROR, this.onAdsLoaderError), this.ctx.videoEl.addEventListener("play", this.initializeDisplayContainerOnce);
|
|
580
543
|
const i = typeof navigator < "u" && "userActivation" in navigator && navigator.userActivation.hasBeenActive;
|
|
581
|
-
(!this.ctx.videoEl.paused || i || t != null && t.hasPlayIntent) && this.initializeDisplayContainerOnce(), this.ctx.videoEl.addEventListener("ended", this.onContentEnded), this.options.adTagMidroll && !this.options.adTagVmap && this.options.midrollIntervalSeconds && this.ctx.videoEl.addEventListener("timeupdate", this.onTimeUpdateForMidroll), this.requestInitialPrerollOrVmap(), (
|
|
582
|
-
onAdBreakStart: (
|
|
544
|
+
(!this.ctx.videoEl.paused || i || t != null && t.hasPlayIntent) && this.initializeDisplayContainerOnce(), this.ctx.videoEl.addEventListener("ended", this.onContentEnded), this.options.adTagMidroll && !this.options.adTagVmap && this.options.midrollIntervalSeconds && this.ctx.videoEl.addEventListener("timeupdate", this.onTimeUpdateForMidroll), this.requestInitialPrerollOrVmap(), (c = this.options.live) != null && c.scte35 && this.options.live.adTagLive && (this.scte35Manager = new O(this.ctx.videoEl, {
|
|
545
|
+
onAdBreakStart: (h) => this.onScte35AdBreakStart(h),
|
|
583
546
|
onAdBreakEnd: () => this.onScte35AdBreakEnd()
|
|
584
547
|
}));
|
|
585
548
|
}
|
|
@@ -603,7 +566,7 @@ class U {
|
|
|
603
566
|
(t) => {
|
|
604
567
|
t.some((i) => i.isIntersecting) && this.fireInitialRequest();
|
|
605
568
|
},
|
|
606
|
-
{ rootMargin:
|
|
569
|
+
{ rootMargin: V }
|
|
607
570
|
), this.visibilityObserver.observe(this.ctx.hostEl);
|
|
608
571
|
return;
|
|
609
572
|
}
|
|
@@ -622,8 +585,8 @@ class U {
|
|
|
622
585
|
this.retry.reset(), this.vmapRequested = !1, this.postrollShown = !1, this.postrollPending = !1, this.lastMidrollTime = 0, this.prerollAbandoned = !1, this.prerollStartPending = !1, e !== void 0 && (this.options.adTagPreroll = e), this.initialRequestFired = !0, this.prerollRequestedAt = Date.now(), this.options.adTagPreroll ? this.requestAd("Preroll", this.options.adTagPreroll) : this.options.adTagVmap && (this.vmapRequested = !0, this.requestAd("Preroll", this.options.adTagVmap, 0, !0));
|
|
623
586
|
}
|
|
624
587
|
destroy() {
|
|
625
|
-
var e, t, i, s, a, o
|
|
626
|
-
this.ctx.prerollGate && (this.ctx.prerollGate.onPlayIntent = null, this.ctx.prerollGate.onTimeout = null, this.ctx.prerollGate.release(!1)), (e = this.visibilityObserver) == null || e.disconnect(), this.visibilityObserver = null, this.stopAdProgress(), this.ctx.videoEl.removeEventListener("play", this.initializeDisplayContainerOnce), this.ctx.videoEl.removeEventListener("ended", this.onContentEnded), this.ctx.videoEl.removeEventListener("timeupdate", this.onTimeUpdateForMidroll), (t = this.surfaceGuard) == null || t.destroy(), (i = this.resizeObserver) == null || i.disconnect(), this.resizeObserver = null, cancelAnimationFrame(this.resizeFrame), this.retry.cancelPending(), (s = this.adsManager) == null || s.destroy(), (
|
|
588
|
+
var e, t, i, s, n, a, o;
|
|
589
|
+
this.ctx.prerollGate && (this.ctx.prerollGate.onPlayIntent = null, this.ctx.prerollGate.onTimeout = null, this.ctx.prerollGate.release(!1)), (e = this.visibilityObserver) == null || e.disconnect(), this.visibilityObserver = null, this.stopAdProgress(), this.ctx.videoEl.removeEventListener("play", this.initializeDisplayContainerOnce), this.ctx.videoEl.removeEventListener("ended", this.onContentEnded), this.ctx.videoEl.removeEventListener("timeupdate", this.onTimeUpdateForMidroll), (t = this.surfaceGuard) == null || t.destroy(), (i = this.resizeObserver) == null || i.disconnect(), this.resizeObserver = null, cancelAnimationFrame(this.resizeFrame), this.retry.cancelPending(), (s = this.adsManager) == null || s.destroy(), (n = this.adsLoader) == null || n.destroy(), (a = this.adDisplayContainer) == null || a.destroy(), (o = this.scte35Manager) == null || o.destroy(), this.scte35BreakTimeout && clearTimeout(this.scte35BreakTimeout);
|
|
627
590
|
}
|
|
628
591
|
/** SCTE-35 OUT sinyali: IMA'ya reklam iste (normal midroll gibi) + IMA cevap vermezse N ms sonra vazgeç. */
|
|
629
592
|
onScte35AdBreakStart(e) {
|
|
@@ -647,43 +610,48 @@ class U {
|
|
|
647
610
|
getPrebidConfigFor(e) {
|
|
648
611
|
var i;
|
|
649
612
|
const t = this.options.prebid;
|
|
650
|
-
|
|
613
|
+
if (!t) return null;
|
|
614
|
+
if (e === "Preroll") return t.enabled ? t : null;
|
|
615
|
+
if (e === "Midroll") {
|
|
616
|
+
if (!((i = t.midroll) != null && i.enabled)) return null;
|
|
617
|
+
const s = { ...E(t.custParams), ...E(t.midroll.custParams) };
|
|
618
|
+
return { ...t, ...t.midroll, custParams: s };
|
|
619
|
+
}
|
|
620
|
+
return null;
|
|
651
621
|
}
|
|
652
622
|
async getOrCreatePrebidInstance(e, t) {
|
|
653
|
-
var
|
|
623
|
+
var o;
|
|
654
624
|
const i = this.prebidInstances[e];
|
|
655
625
|
if (i) return i;
|
|
656
|
-
const { VideoPrebid: s } = await import("./
|
|
626
|
+
const { VideoPrebid: s } = await import("./prebid-CRY3i2OT.js"), n = e === "Midroll" ? "hope-video-midroll" : "hope-video-preroll", a = new s({
|
|
657
627
|
...t,
|
|
658
|
-
adUnitCode: `${t.adUnitCode ||
|
|
659
|
-
consentManagement: (
|
|
628
|
+
adUnitCode: `${t.adUnitCode || n}-${this.prebidIdSuffix}`,
|
|
629
|
+
consentManagement: (o = this.options.prebid) == null ? void 0 : o.consentManagement
|
|
660
630
|
});
|
|
661
|
-
return this.prebidInstances[e] =
|
|
631
|
+
return this.prebidInstances[e] = a, a;
|
|
662
632
|
}
|
|
663
633
|
async requestAd(e, t, i = 0, s = !1) {
|
|
664
|
-
var h,
|
|
665
|
-
if (!this.adsLoader || !this.ima) return;
|
|
634
|
+
var h, u, p, y, f, A, v;
|
|
635
|
+
if (!this.adsLoader || !this.ima || this.remote) return;
|
|
666
636
|
this.currentBreakType = e, this.lastRequestIsVmap = s;
|
|
667
|
-
const
|
|
668
|
-
let
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
v.isAvailable() && (o = await v.runAuction(o));
|
|
674
|
-
}
|
|
637
|
+
const n = Array.isArray(t) ? t[0] : t;
|
|
638
|
+
let a = s ? n : M(n, { includeRefreshCount: !!((h = this.options.retry) != null && h.enabled), adRefreshCount: i });
|
|
639
|
+
const o = s ? null : this.getPrebidConfigFor(e);
|
|
640
|
+
if (o != null && o.custParams && (a = L(a, o.custParams)), !s && i === 0 && o) {
|
|
641
|
+
const m = await this.getOrCreatePrebidInstance(e, o);
|
|
642
|
+
m.isAvailable() && (a = await m.runAuction(a));
|
|
675
643
|
}
|
|
676
644
|
if (!this.adsLoader || !this.ima) return;
|
|
677
|
-
const
|
|
678
|
-
|
|
645
|
+
const l = new this.ima.AdsRequest();
|
|
646
|
+
l.adTagUrl = a, l.linearAdSlotWidth = this.ctx.videoEl.clientWidth || 640, l.linearAdSlotHeight = this.ctx.videoEl.clientHeight || 360, l.nonLinearAdSlotWidth = this.ctx.videoEl.clientWidth || 640, l.nonLinearAdSlotHeight = Math.round((this.ctx.videoEl.clientHeight || 360) / 3), l.vastLoadTimeout = this.options.vastLoadTimeoutMs ?? 1e4;
|
|
679
647
|
try {
|
|
680
|
-
(
|
|
648
|
+
(p = l.setAdWillAutoPlay) == null || p.call(l, this.ctx.videoEl.autoplay || !!((u = this.ctx.prerollGate) != null && u.hasPlayIntent) || !this.ctx.videoEl.paused), (y = l.setAdWillPlayMuted) == null || y.call(l, this.ctx.videoEl.muted), (v = l.setContinuousPlayback) == null || v.call(l, !!((A = (f = this.ctx).isContinuousPlayback) != null && A.call(f)));
|
|
681
649
|
} catch {
|
|
682
650
|
}
|
|
683
651
|
const c = this.omidRules();
|
|
684
|
-
c && (
|
|
652
|
+
c && (l.omidAccessModeRules = c);
|
|
685
653
|
try {
|
|
686
|
-
this.adsLoader.requestAds(
|
|
654
|
+
this.adsLoader.requestAds(l);
|
|
687
655
|
} catch (m) {
|
|
688
656
|
this.giveUpOrRetry(e, String(m));
|
|
689
657
|
}
|
|
@@ -693,13 +661,13 @@ class U {
|
|
|
693
661
|
* IMA'nın enum'ları yoksa (eski SDK) hiçbir şey ayarlanmaz — IMA kendi varsayılanını kullanır.
|
|
694
662
|
*/
|
|
695
663
|
omidRules() {
|
|
696
|
-
var
|
|
697
|
-
const e = (
|
|
664
|
+
var l, c;
|
|
665
|
+
const e = (l = this.ima) == null ? void 0 : l.OmidVerificationVendor, t = (c = this.ima) == null ? void 0 : c.OmidAccessMode;
|
|
698
666
|
if (!e || !t) return null;
|
|
699
|
-
const i = this.options.omidAccessMode ?? "full", s = (
|
|
700
|
-
for (const [
|
|
701
|
-
typeof u == "number" && (
|
|
702
|
-
return
|
|
667
|
+
const i = this.options.omidAccessMode ?? "full", s = (h) => h === "full" ? t.FULL : h === "domain" ? t.DOMAIN : h === "limited" ? t.LIMITED : void 0, n = typeof i == "string" ? {} : i, a = s(typeof i == "string" ? i : i.default ?? "full") ?? t.FULL, o = {};
|
|
668
|
+
for (const [h, u] of Object.entries(e))
|
|
669
|
+
typeof u == "number" && (o[u] = s(n[h]) ?? a);
|
|
670
|
+
return o;
|
|
703
671
|
}
|
|
704
672
|
startAdsManager() {
|
|
705
673
|
if (!(!this.adsManager || !this.ima))
|
|
@@ -756,14 +724,14 @@ class U {
|
|
|
756
724
|
}
|
|
757
725
|
/** IMA hatasının kodlarını çıkarır, hata kaydına yazar (yeniden denenecek olsa da) ve mesajı döndürür. */
|
|
758
726
|
recordAdError(e) {
|
|
759
|
-
var s, a, o,
|
|
727
|
+
var s, n, a, o, l, c, h;
|
|
760
728
|
const t = (s = e.getError) == null ? void 0 : s.call(e), i = {
|
|
761
|
-
message: ((
|
|
762
|
-
code: (
|
|
763
|
-
vastCode: (
|
|
764
|
-
errorType: (
|
|
729
|
+
message: ((n = t == null ? void 0 : t.getMessage) == null ? void 0 : n.call(t)) ?? "ad-error",
|
|
730
|
+
code: (a = t == null ? void 0 : t.getErrorCode) == null ? void 0 : a.call(t),
|
|
731
|
+
vastCode: (o = t == null ? void 0 : t.getVastErrorCode) == null ? void 0 : o.call(t),
|
|
732
|
+
errorType: (l = t == null ? void 0 : t.getType) == null ? void 0 : l.call(t)
|
|
765
733
|
};
|
|
766
|
-
return i.vastCode !== void 0 && i.vastCode <= 0 && (i.vastCode = void 0), this.lastAdError = i, (
|
|
734
|
+
return i.vastCode !== void 0 && i.vastCode <= 0 && (i.vastCode = void 0), this.lastAdError = i, (h = (c = this.ctx).log) == null || h.call(c, {
|
|
767
735
|
message: i.message,
|
|
768
736
|
details: { code: i.code, vastCode: i.vastCode, errorType: i.errorType, break: this.breakTypeLower() }
|
|
769
737
|
}), i.message;
|
|
@@ -774,7 +742,7 @@ class U {
|
|
|
774
742
|
this.endScte35Break();
|
|
775
743
|
return;
|
|
776
744
|
}
|
|
777
|
-
const i =
|
|
745
|
+
const i = F(this.options, e);
|
|
778
746
|
if (!i) {
|
|
779
747
|
this.resumeContentAfterGiveUp(e, t);
|
|
780
748
|
return;
|
|
@@ -782,7 +750,7 @@ class U {
|
|
|
782
750
|
this.retry.retry(
|
|
783
751
|
e,
|
|
784
752
|
i,
|
|
785
|
-
(s,
|
|
753
|
+
(s, n) => this.requestAd(e, s, n),
|
|
786
754
|
() => this.resumeContentAfterGiveUp(e, t)
|
|
787
755
|
);
|
|
788
756
|
}
|
|
@@ -812,6 +780,15 @@ class U {
|
|
|
812
780
|
maybeRequestVmapAfterPreroll() {
|
|
813
781
|
this.vmapRequested || !this.options.adTagVmap || (this.vmapRequested = !0, this.requestAd("Midroll", this.options.adTagVmap, 0, !0));
|
|
814
782
|
}
|
|
783
|
+
/**
|
|
784
|
+
* Chromecast oturumu başladı / bitti. Başlayınca yerel IMA askıya alınır: süren reklam arası kapanır, VMAP takibi
|
|
785
|
+
* (adsManager) bırakılır — aralar TV'de oynar. Dönüşte VMAP yeniden istenmez (aralar TV'de oynandı); aralıklı
|
|
786
|
+
* midroll ve postroll yerelde kaldığı yerden devam eder.
|
|
787
|
+
*/
|
|
788
|
+
setRemote(e) {
|
|
789
|
+
var t, i, s;
|
|
790
|
+
this.remote !== e && (this.remote = e, e && (this.stopAdProgress(), this.endNonLinear(), (t = this.adsManager) == null || t.destroy(), this.adsManager = null, (i = this.ctx.prerollGate) == null || i.release(!1), this.initialRequestFired = !0, this.vmapRequested = !0, this.postrollPending = !1, this.hideAdLayer(), this.linearBreakActive && (this.linearBreakActive = !1, (s = this.surfaceGuard) == null || s.onBreakEnd(!1), this.ctx.hostEl.dispatchEvent(new CustomEvent("hp:adend", { detail: { type: this.activeBreak } })))));
|
|
791
|
+
}
|
|
815
792
|
hideAdLayer() {
|
|
816
793
|
this.ctx.adLayerEl.removeAttribute("data-audio-ad"), this.nonLinearActive || (this.ctx.adLayerEl.classList.add("hp:hidden"), this.ctx.adLayerEl.classList.remove("hp:block")), this.ctx.showChrome();
|
|
817
794
|
}
|
|
@@ -821,11 +798,11 @@ class U {
|
|
|
821
798
|
* başlıyordu. IMA reklamın arasındaki konumu verir: 0 preroll, -1 postroll, diğerleri midroll.
|
|
822
799
|
*/
|
|
823
800
|
breakTypeOf(e) {
|
|
824
|
-
var t, i, s,
|
|
801
|
+
var t, i, s, n, a;
|
|
825
802
|
if (!this.lastRequestIsVmap) return this.breakTypeLower();
|
|
826
803
|
try {
|
|
827
|
-
const
|
|
828
|
-
if (typeof
|
|
804
|
+
const o = (a = (n = (s = (i = (t = e == null ? void 0 : e.getAd) == null ? void 0 : t.call(e)) == null ? void 0 : i.getAdPodInfo) == null ? void 0 : s.call(i)) == null ? void 0 : n.getTimeOffset) == null ? void 0 : a.call(n);
|
|
805
|
+
if (typeof o == "number") return o === 0 ? "preroll" : o < 0 ? "postroll" : "midroll";
|
|
829
806
|
} catch {
|
|
830
807
|
}
|
|
831
808
|
return this.breakTypeLower();
|
|
@@ -834,12 +811,12 @@ class U {
|
|
|
834
811
|
return this.currentBreakType.toLowerCase();
|
|
835
812
|
}
|
|
836
813
|
}
|
|
837
|
-
async function
|
|
838
|
-
const t = new
|
|
814
|
+
async function G(d, e) {
|
|
815
|
+
const t = new _(d, e);
|
|
839
816
|
return await t.install(), t;
|
|
840
817
|
}
|
|
841
818
|
export {
|
|
842
|
-
|
|
843
|
-
|
|
819
|
+
_ as AdsController,
|
|
820
|
+
G as installAds
|
|
844
821
|
};
|
|
845
|
-
//# sourceMappingURL=
|
|
822
|
+
//# sourceMappingURL=ads-DPL7m9PV.js.map
|