stormcloud-video-player 0.8.31 → 0.8.33
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 +16 -0
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +16 -0
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +16 -0
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +16 -0
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +16 -0
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/pal.cjs +16 -0
- package/lib/sdk/pal.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +16 -0
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
package/lib/sdk/pal.cjs
CHANGED
|
@@ -280,6 +280,22 @@ function createPalNonceManager() {
|
|
|
280
280
|
request.videoHeight = options.videoHeight || 480;
|
|
281
281
|
if (options.ppid) request.ppid = options.ppid;
|
|
282
282
|
if (options.sessionId) request.sessionId = options.sessionId;
|
|
283
|
+
console.log("[PAL] NonceRequest before generateNonce:", JSON.stringify({
|
|
284
|
+
adWillAutoPlay: request.adWillAutoPlay,
|
|
285
|
+
adWillPlayMuted: request.adWillPlayMuted,
|
|
286
|
+
playerVolume: request.playerVolume,
|
|
287
|
+
continuousPlayback: request.continuousPlayback,
|
|
288
|
+
descriptionUrl: request.descriptionUrl,
|
|
289
|
+
iconsSupported: request.iconsSupported,
|
|
290
|
+
playerType: request.playerType,
|
|
291
|
+
playerVersion: request.playerVersion,
|
|
292
|
+
supportedApiFrameworks: request.supportedApiFrameworks,
|
|
293
|
+
url: request.url,
|
|
294
|
+
videoWidth: request.videoWidth,
|
|
295
|
+
videoHeight: request.videoHeight,
|
|
296
|
+
ppid: request.ppid,
|
|
297
|
+
sessionId: request.sessionId
|
|
298
|
+
}, null, 2));
|
|
283
299
|
return [
|
|
284
300
|
4,
|
|
285
301
|
loader.loadNonceManager(request)
|
package/lib/sdk/pal.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/sdk/pal.cjs"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","
|
|
1
|
+
{"version":3,"sources":["/home/ubuntu24-new/Dev/stormcloud-vp/lib/sdk/pal.cjs"],"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YACIA,IAAAA,CAAAA,KAAYC,OAAOC,IAAAA,CAAAA,SAAc,GAAA,OAAA;YACjCC,IAAAA,aAAmBF,OAAOG,wBAAwB;gBAClDC,IAAAA,MAAAA,IAAoBJ,IAAAA,GAAOK,mBAAmB;gBAC9CC,IAAAA,OAAeN,KAAAA,CAAAA,CAAOO,KAAAA,CAAAA,GAAS,CAACC,cAAc;gBAC9CC,IAAAA,GAAW,SAAA,CAAA,GAAA,CAAA,IAACC,IAAAA,IAAQC;gBACjB,IAAIC,GAAAA,IAAAA,CAAQD,IACfZ,GAAAA,OAAUW,QAAQE,MAAM;cAAEC,KAAKF,UAAAA,EAAG,CAACC,KAAK;gBAAEE,IAAAA,OAAAA,CAAY,UAAA,OAAA,CAAA,qBAAA,IAAA,OAAA,CAAA,SAAA;gBAAK,IAAA,MAAA,KAAA,QAAA,CAAA,OAAA,MAAA;gBAC/D,OAAA,GAAA,OAAA,MAAA,OAAA,KAAA,SAAA,OAAA,mBAAA;YACIC,YAAc,qBAACC,IAAIC,MAAMC,QAAQC;QACnC,IAAIF,QAAQ,CAAA,OAAOA,qCAAP,SAAOA,KAAG,MAAM,YAAY,OAAOA,SAAS,YAAY;4CAC7D,kCAAA,2BAAA;;;+BAAA,IAAIG,KACP,CADG,GACC,CAACd,aAAae,IAAI,CAACL,IAAII,QAAQA,QAAQF,QACzCnB,UAAUiB,IAAII,KAAK;wBAAEP,KAAK,SAALA;mCAAWI,IAAI,CAACG,IAAI;;sGAAEN,QAAAA,GAAY,CAAEK,CAAAA,OAAOjB,GAAAA,cAAiBe,MAAMG,IAAG,KAAMD,KAAKL,UAAU;+BAAC;gBAFpH,QAAK,YAAWV,kBAAkBa,0BAA7B,SAAA,6BAAA,QAAA,yBAAA;;kBAAA;8FAAA,gBAAA,WAAA;;yBAAA,6BAAA;8CAAA,CAAA;;;mCAAA,eAAA;;;;YAGP,sBAAA,KAAA;QACA,OAAOD;IACT;AACA,IAAIM,eAAe,sBAACC;WAAQR,YAAYhB,UAAU,CAAC,GAAG,cAAc,UAAA;QAAEyB,KAAAA,EAAO,KAAA,GAAA;6BAAK,IAAID","sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/sdk/pal.ts\nvar pal_exports = {};\n__export(pal_exports, {\n createPalNonceManager: () => createPalNonceManager\n});\nmodule.exports = __toCommonJS(pal_exports);\nvar PAL_SDK_URL = \"https://imasdk.googleapis.com/pal/sdkloader/pal.js\";\nvar _nonceLoader;\nvar _palLoadPromise;\nfunction loadPalSdk() {\n if (typeof window !== \"undefined\" && window.goog?.pal) {\n return Promise.resolve();\n }\n if (_palLoadPromise) return _palLoadPromise;\n _palLoadPromise = new Promise((resolve, reject) => {\n const existing = document.querySelector(\n 'script[data-pal=\"true\"]'\n );\n if (existing) {\n if (window.goog?.pal) {\n resolve();\n return;\n }\n const timeout = setTimeout(\n () => reject(new Error(\"PAL SDK load timeout\")),\n 1e4\n );\n existing.addEventListener(\"load\", () => {\n clearTimeout(timeout);\n resolve();\n });\n existing.addEventListener(\"error\", () => {\n clearTimeout(timeout);\n reject(new Error(\"PAL SDK load failed\"));\n });\n return;\n }\n const script = document.createElement(\"script\");\n script.src = PAL_SDK_URL;\n script.async = true;\n script.setAttribute(\"data-pal\", \"true\");\n script.onload = () => resolve();\n script.onerror = () => reject(new Error(\"PAL SDK load failed\"));\n document.head.appendChild(script);\n });\n return _palLoadPromise;\n}\nfunction getOrCreateNonceLoader() {\n if (_nonceLoader) return _nonceLoader;\n const goog = window.goog;\n const consentSettings = new goog.pal.ConsentSettings();\n consentSettings.allowStorage = true;\n _nonceLoader = new goog.pal.NonceLoader(consentSettings);\n return _nonceLoader;\n}\nfunction createPalNonceManager() {\n let currentNonce = \"\";\n let currentNonceManager;\n return {\n async generateNonce(options = {}) {\n try {\n await loadPalSdk();\n const loader = getOrCreateNonceLoader();\n const goog = window.goog;\n const request = new goog.pal.NonceRequest();\n request.adWillAutoPlay = options.adWillAutoPlay ?? true;\n request.adWillPlayMuted = options.adWillPlayMuted ?? false;\n request.playerVolume = options.playerVolume ?? (request.adWillPlayMuted ? 0 : 1);\n request.continuousPlayback = options.continuousPlayback ?? true;\n request.descriptionUrl = options.descriptionUrl || (typeof window !== \"undefined\" ? window.location.href : \"\");\n request.iconsSupported = true;\n request.playerType = \"StormcloudVideoPlayer\";\n request.playerVersion = \"1.0\";\n request.supportedApiFrameworks = \"2,7,9\";\n request.url = options.descriptionUrl || (typeof window !== \"undefined\" ? window.location.href : \"\");\n request.videoWidth = options.videoWidth || 640;\n request.videoHeight = options.videoHeight || 480;\n if (options.ppid) request.ppid = options.ppid;\n if (options.sessionId) request.sessionId = options.sessionId;\n console.log(\n \"[PAL] NonceRequest before generateNonce:\",\n JSON.stringify({\n adWillAutoPlay: request.adWillAutoPlay,\n adWillPlayMuted: request.adWillPlayMuted,\n playerVolume: request.playerVolume,\n continuousPlayback: request.continuousPlayback,\n descriptionUrl: request.descriptionUrl,\n iconsSupported: request.iconsSupported,\n playerType: request.playerType,\n playerVersion: request.playerVersion,\n supportedApiFrameworks: request.supportedApiFrameworks,\n url: request.url,\n videoWidth: request.videoWidth,\n videoHeight: request.videoHeight,\n ppid: request.ppid,\n sessionId: request.sessionId\n }, null, 2)\n );\n const manager = await loader.loadNonceManager(request);\n currentNonceManager = manager;\n currentNonce = manager.getNonce();\n console.log(\"[PAL] Nonce generated successfully\");\n return currentNonce;\n } catch (error) {\n console.warn(\"[PAL] Failed to generate nonce:\", error);\n currentNonce = \"\";\n currentNonceManager = void 0;\n return \"\";\n }\n },\n getCurrentNonce() {\n return currentNonce;\n },\n injectNonce(vastTagUrl) {\n if (!currentNonce || !vastTagUrl) return vastTagUrl;\n try {\n const url = new URL(vastTagUrl);\n url.searchParams.delete(\"paln\");\n url.searchParams.set(\"givn\", currentNonce);\n return url.toString();\n } catch {\n let base = vastTagUrl.replace(/([?&])paln=[^&]*/g, \"\").replace(/[?&]$/, \"\");\n const sep = base.includes(\"?\") ? \"&\" : \"?\";\n return `${base}${sep}givn=${encodeURIComponent(currentNonce)}`;\n }\n },\n sendPlaybackStart() {\n try {\n currentNonceManager?.sendPlaybackStart();\n } catch {\n }\n },\n sendPlaybackEnd() {\n try {\n currentNonceManager?.sendPlaybackEnd();\n } catch {\n }\n },\n sendAdClick() {\n try {\n currentNonceManager?.sendAdClick();\n } catch {\n }\n },\n sendAdTouch(event) {\n try {\n currentNonceManager?.sendAdTouch(event);\n } catch {\n }\n },\n reset() {\n currentNonce = \"\";\n currentNonceManager = void 0;\n }\n };\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n createPalNonceManager\n});\n"]}
|
|
@@ -1695,6 +1695,22 @@ function createPalNonceManager() {
|
|
|
1695
1695
|
request.videoHeight = options.videoHeight || 480;
|
|
1696
1696
|
if (options.ppid) request.ppid = options.ppid;
|
|
1697
1697
|
if (options.sessionId) request.sessionId = options.sessionId;
|
|
1698
|
+
console.log("[PAL] NonceRequest before generateNonce:", JSON.stringify({
|
|
1699
|
+
adWillAutoPlay: request.adWillAutoPlay,
|
|
1700
|
+
adWillPlayMuted: request.adWillPlayMuted,
|
|
1701
|
+
playerVolume: request.playerVolume,
|
|
1702
|
+
continuousPlayback: request.continuousPlayback,
|
|
1703
|
+
descriptionUrl: request.descriptionUrl,
|
|
1704
|
+
iconsSupported: request.iconsSupported,
|
|
1705
|
+
playerType: request.playerType,
|
|
1706
|
+
playerVersion: request.playerVersion,
|
|
1707
|
+
supportedApiFrameworks: request.supportedApiFrameworks,
|
|
1708
|
+
url: request.url,
|
|
1709
|
+
videoWidth: request.videoWidth,
|
|
1710
|
+
videoHeight: request.videoHeight,
|
|
1711
|
+
ppid: request.ppid,
|
|
1712
|
+
sessionId: request.sessionId
|
|
1713
|
+
}, null, 2));
|
|
1698
1714
|
return [
|
|
1699
1715
|
4,
|
|
1700
1716
|
loader.loadNonceManager(request)
|