@arcware-cloud/pixelstreaming-websdk 1.3.15 → 1.3.16

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 CHANGED
@@ -80,9 +80,10 @@ For more detailed examples and advanced usage, please refer to our documentation
80
80
 
81
81
  # Changelog
82
82
 
83
- ### 1.3.14
83
+ ### 1.3.16
84
84
 
85
85
  - added white labeling options for loader icon and screen
86
+ - options can be loaded via base64 encoded string in URL, fetched via API (configured on platform) or set as properties on the SDK
86
87
 
87
88
  ### 1.3.12
88
89
 
package/index.cjs.js CHANGED
@@ -23360,6 +23360,7 @@ const Session_1 = __webpack_require__(2469);
23360
23360
  const ArcwareSettingsSchema_1 = __webpack_require__(5602);
23361
23361
  const whiteLabelling_1 = __webpack_require__(3545);
23362
23362
  const ZWhiteLabel_1 = __webpack_require__(467);
23363
+ const EventHandler_1 = __webpack_require__(3379);
23363
23364
  /** Default arcware signalling endpoint. */
23364
23365
  exports.DefaultUrl = `wss://signalling-client.ragnarok.arcware.cloud`;
23365
23366
  // The below Logger overrides can likely be removed as PSInfra 5.5 logger supports setting log verbosity
@@ -23375,6 +23376,14 @@ Logger.Error = (message: string) => {
23375
23376
  console.error(message);
23376
23377
  };*/
23377
23378
  lib_pixelstreamingfrontend_ue5_5_1.Logger.InitLogging(2, false);
23379
+ function deepEqual(a, b) {
23380
+ try {
23381
+ return JSON.stringify(a) === JSON.stringify(b);
23382
+ }
23383
+ catch (_a) {
23384
+ return false;
23385
+ }
23386
+ }
23378
23387
  class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23379
23388
  /**
23380
23389
  * Can be used to fetch projectId and shareId from the current url.
@@ -23423,7 +23432,13 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23423
23432
  if (!config.initialSettings.ss)
23424
23433
  config.initialSettings.ss = exports.DefaultUrl;
23425
23434
  super(config);
23426
- this.VERSION = "1.3.15";
23435
+ this.VERSION = "1.3.16";
23436
+ this.whiteLabellingChanged = new EventHandler_1.EventHandler();
23437
+ this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23438
+ console.log(config);
23439
+ if (config.envName) {
23440
+ this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
23441
+ }
23427
23442
  this.settings = settings;
23428
23443
  this.session = new Session_1.Session();
23429
23444
  this._initialSettings = config.initialSettings;
@@ -23445,58 +23460,54 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23445
23460
  this.settings.infoButton = qs.has("i") || qs.has("info");
23446
23461
  }
23447
23462
  }
23448
- static getWhiteLabelling(ShareId, URL = "https://signalling-client.arcware.cloud/whiteLabel/") {
23463
+ getWhiteLabelling(ShareId) {
23449
23464
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
23450
23465
  const qs = new URLSearchParams(window.location.search);
23451
- if (qs.has("wl") && qs.get("wl") === "") {
23452
- // Build final URL safely (trim trailing slashes, encode ShareId)
23453
- const base = URL.replace(/\/+$/, "");
23454
- const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
23455
- const controller = new AbortController();
23456
- const timeoutId = setTimeout(() => controller.abort(), 1000);
23466
+ // Only fetch when wl param is present and empty (as before)
23467
+ if (!(qs.has("wl") && qs.get("wl") === ""))
23468
+ return undefined;
23469
+ // Build final URL safely (trim trailing slashes, encode ShareId)
23470
+ const base = this.signallingWlURL.replace(/\/+$/, "");
23471
+ const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
23472
+ const controller = new AbortController();
23473
+ const timeoutId = setTimeout(() => controller.abort(), 1000);
23474
+ try {
23475
+ const res = yield fetch(requestUrl, {
23476
+ method: "GET",
23477
+ signal: controller.signal,
23478
+ headers: { Accept: "application/json, text/plain" },
23479
+ credentials: "omit"
23480
+ });
23481
+ if (!res.ok)
23482
+ return undefined;
23483
+ const text = yield res.text();
23484
+ if (!text || text.trim() === "")
23485
+ return undefined;
23486
+ let json;
23457
23487
  try {
23458
- const res = yield fetch(requestUrl, {
23459
- method: "GET",
23460
- signal: controller.signal,
23461
- headers: { Accept: "application/json, text/plain" },
23462
- credentials: "omit"
23463
- });
23464
- if (!res.ok) {
23465
- // Non-2xx: treat as “no white label”
23466
- return undefined;
23467
- }
23468
- // We read as text first to detect empty-string payloads
23469
- const text = yield res.text();
23470
- if (!text || text.trim() === "") {
23471
- return undefined;
23472
- }
23473
- // If there is content, try to parse JSON
23474
- let json;
23475
- try {
23476
- json = JSON.parse(text);
23477
- }
23478
- catch (_a) {
23479
- // Not valid JSON → ignore
23480
- return undefined;
23481
- }
23482
- // Validate against the allowlisted schema
23483
- const parsed = ZWhiteLabel_1.ZWhiteLabel.safeParse(json);
23484
- if (!parsed.success) {
23485
- // Optionally log parsed.error for diagnostics
23486
- return undefined;
23487
- }
23488
- return parsed.data;
23488
+ json = JSON.parse(text);
23489
23489
  }
23490
- catch (err) {
23491
- // Abort or network error → treat as “no white label”
23492
- // if (err?.name !== "AbortError") console.warn("getWhiteLabelling failed", err);
23490
+ catch (_a) {
23493
23491
  return undefined;
23494
23492
  }
23495
- finally {
23496
- clearTimeout(timeoutId);
23493
+ const parsed = ZWhiteLabel_1.ZWhiteLabel.safeParse(json);
23494
+ if (!parsed.success)
23495
+ return undefined;
23496
+ // Only apply & emit if it actually changed
23497
+ const prev = this.settings.whiteLabelling;
23498
+ const next = parsed.data;
23499
+ if (!deepEqual(prev, next)) {
23500
+ this.settings.whiteLabelling = next;
23501
+ EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, next);
23497
23502
  }
23503
+ return parsed.data;
23504
+ }
23505
+ catch (_b) {
23506
+ return undefined;
23507
+ }
23508
+ finally {
23509
+ clearTimeout(timeoutId);
23498
23510
  }
23499
- return undefined;
23500
23511
  });
23501
23512
  }
23502
23513
  /** Setup connection string. */
@@ -23573,6 +23584,7 @@ let globalApplication = null;
23573
23584
  let previousShareId = null;
23574
23585
  let previousProjectId = null;
23575
23586
  function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false) {
23587
+ var _a;
23576
23588
  if (shareId && !shareId.startsWith("share-"))
23577
23589
  throw new Error(`Unexpected shareId-format: '${shareId}'.`);
23578
23590
  if (shareId && previousShareId !== shareId) {
@@ -23612,7 +23624,8 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
23612
23624
  splashScreenMode: undefined,
23613
23625
  splashScreenPosition: undefined,
23614
23626
  splashScreenBgColor: undefined
23615
- } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings)
23627
+ } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23628
+ envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
23616
23629
  });
23617
23630
  const PixelStreaming = new ArcwarePixelStreaming_1.ArcwarePixelStreaming(Config);
23618
23631
  const Application = new ArcwareApplication_1.ArcwareApplication({ stream: PixelStreaming });
@@ -23780,6 +23793,32 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23780
23793
  });
23781
23794
  // Set override config.
23782
23795
  this.config = config;
23796
+ // Re-apply branding whenever config's WL changes
23797
+ this.config.whiteLabellingChanged.add(() => {
23798
+ try {
23799
+ this.applyBrandingFromSettings();
23800
+ }
23801
+ catch (_a) { }
23802
+ });
23803
+ // Kick off WL fetch once (if we have a shareId); on success it will emit and re-apply
23804
+ (() => tslib_1.__awaiter(this, void 0, void 0, function* () {
23805
+ try {
23806
+ const sid = this.config.settings.shareId;
23807
+ if (sid) {
23808
+ yield this.config.getWhiteLabelling(sid); // will emit if it changes
23809
+ }
23810
+ }
23811
+ catch (_d) {
23812
+ // ignore
23813
+ }
23814
+ finally {
23815
+ // Make sure we paint with whatever we have initially
23816
+ try {
23817
+ this.applyBrandingFromSettings();
23818
+ }
23819
+ catch (_e) { }
23820
+ }
23821
+ }))();
23783
23822
  this.loveLettersList = [];
23784
23823
  this.microphoneOverlay = new MicrophoneOverlay_1.MicrophoneOverlay(this);
23785
23824
  this.diagnosticsCollector = new DiagnosticsCollector_1.DiagnosticsCollector({
@@ -23961,7 +24000,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23961
24000
  });
23962
24001
  }
23963
24002
  }
23964
- this.applyBrandingFromSettings();
24003
+ //this.applyBrandingFromSettings();
23965
24004
  this.handleMouseLock();
23966
24005
  this.injectCustomUI();
23967
24006
  }
@@ -24303,8 +24342,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24303
24342
  (_a = logoLoader.setHostElement) === null || _a === void 0 ? void 0 : _a.call(logoLoader, loaderRoot);
24304
24343
  loveLettersContainer.appendChild(lettersBlock);
24305
24344
  lettersBlock.appendChild(lettersWrapper);
24306
- // apply current (local) settings immediately
24307
- this.applyBrandingFromSettings();
24308
24345
  }
24309
24346
  }
24310
24347
  pushLetter(letter) {
package/index.esm.js CHANGED
@@ -23356,7 +23356,7 @@ __webpack_require__.r(__webpack_exports__);
23356
23356
  /* harmony export */ "ArcwareConfig": () => (/* binding */ ArcwareConfig),
23357
23357
  /* harmony export */ "DefaultUrl": () => (/* binding */ DefaultUrl)
23358
23358
  /* harmony export */ });
23359
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(655);
23359
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(655);
23360
23360
  /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1604);
23361
23361
  /* harmony import */ var _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7800);
23362
23362
  /* harmony import */ var _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7463);
@@ -23364,6 +23364,8 @@ __webpack_require__.r(__webpack_exports__);
23364
23364
  /* harmony import */ var _domain_ArcwareSettingsSchema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5602);
23365
23365
  /* harmony import */ var _features_whiteLabelling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3545);
23366
23366
  /* harmony import */ var _features_ZWhiteLabel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(467);
23367
+ /* harmony import */ var _domain_EventHandler__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3379);
23368
+
23367
23369
 
23368
23370
 
23369
23371
 
@@ -23386,6 +23388,14 @@ Logger.Error = (message: string) => {
23386
23388
  console.error(message);
23387
23389
  };*/
23388
23390
  _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_4__.Logger.InitLogging(2, false);
23391
+ function deepEqual(a, b) {
23392
+ try {
23393
+ return JSON.stringify(a) === JSON.stringify(b);
23394
+ }
23395
+ catch (_a) {
23396
+ return false;
23397
+ }
23398
+ }
23389
23399
  class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_5__.Config {
23390
23400
  /**
23391
23401
  * Can be used to fetch projectId and shareId from the current url.
@@ -23434,7 +23444,13 @@ class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBP
23434
23444
  if (!config.initialSettings.ss)
23435
23445
  config.initialSettings.ss = DefaultUrl;
23436
23446
  super(config);
23437
- this.VERSION = "1.3.15";
23447
+ this.VERSION = "1.3.16";
23448
+ this.whiteLabellingChanged = new _domain_EventHandler__WEBPACK_IMPORTED_MODULE_7__.EventHandler();
23449
+ this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23450
+ console.log(config);
23451
+ if (config.envName) {
23452
+ this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
23453
+ }
23438
23454
  this.settings = settings;
23439
23455
  this.session = new _domain_Session__WEBPACK_IMPORTED_MODULE_0__.Session();
23440
23456
  this._initialSettings = config.initialSettings;
@@ -23456,58 +23472,54 @@ class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBP
23456
23472
  this.settings.infoButton = qs.has("i") || qs.has("info");
23457
23473
  }
23458
23474
  }
23459
- static getWhiteLabelling(ShareId, URL = "https://signalling-client.arcware.cloud/whiteLabel/") {
23460
- return (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__awaiter)(this, void 0, void 0, function* () {
23475
+ getWhiteLabelling(ShareId) {
23476
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_8__.__awaiter)(this, void 0, void 0, function* () {
23461
23477
  const qs = new URLSearchParams(window.location.search);
23462
- if (qs.has("wl") && qs.get("wl") === "") {
23463
- // Build final URL safely (trim trailing slashes, encode ShareId)
23464
- const base = URL.replace(/\/+$/, "");
23465
- const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
23466
- const controller = new AbortController();
23467
- const timeoutId = setTimeout(() => controller.abort(), 1000);
23478
+ // Only fetch when wl param is present and empty (as before)
23479
+ if (!(qs.has("wl") && qs.get("wl") === ""))
23480
+ return undefined;
23481
+ // Build final URL safely (trim trailing slashes, encode ShareId)
23482
+ const base = this.signallingWlURL.replace(/\/+$/, "");
23483
+ const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
23484
+ const controller = new AbortController();
23485
+ const timeoutId = setTimeout(() => controller.abort(), 1000);
23486
+ try {
23487
+ const res = yield fetch(requestUrl, {
23488
+ method: "GET",
23489
+ signal: controller.signal,
23490
+ headers: { Accept: "application/json, text/plain" },
23491
+ credentials: "omit"
23492
+ });
23493
+ if (!res.ok)
23494
+ return undefined;
23495
+ const text = yield res.text();
23496
+ if (!text || text.trim() === "")
23497
+ return undefined;
23498
+ let json;
23468
23499
  try {
23469
- const res = yield fetch(requestUrl, {
23470
- method: "GET",
23471
- signal: controller.signal,
23472
- headers: { Accept: "application/json, text/plain" },
23473
- credentials: "omit"
23474
- });
23475
- if (!res.ok) {
23476
- // Non-2xx: treat as “no white label”
23477
- return undefined;
23478
- }
23479
- // We read as text first to detect empty-string payloads
23480
- const text = yield res.text();
23481
- if (!text || text.trim() === "") {
23482
- return undefined;
23483
- }
23484
- // If there is content, try to parse JSON
23485
- let json;
23486
- try {
23487
- json = JSON.parse(text);
23488
- }
23489
- catch (_a) {
23490
- // Not valid JSON → ignore
23491
- return undefined;
23492
- }
23493
- // Validate against the allowlisted schema
23494
- const parsed = _features_ZWhiteLabel__WEBPACK_IMPORTED_MODULE_3__.ZWhiteLabel.safeParse(json);
23495
- if (!parsed.success) {
23496
- // Optionally log parsed.error for diagnostics
23497
- return undefined;
23498
- }
23499
- return parsed.data;
23500
+ json = JSON.parse(text);
23500
23501
  }
23501
- catch (err) {
23502
- // Abort or network error → treat as “no white label”
23503
- // if (err?.name !== "AbortError") console.warn("getWhiteLabelling failed", err);
23502
+ catch (_a) {
23504
23503
  return undefined;
23505
23504
  }
23506
- finally {
23507
- clearTimeout(timeoutId);
23505
+ const parsed = _features_ZWhiteLabel__WEBPACK_IMPORTED_MODULE_3__.ZWhiteLabel.safeParse(json);
23506
+ if (!parsed.success)
23507
+ return undefined;
23508
+ // Only apply & emit if it actually changed
23509
+ const prev = this.settings.whiteLabelling;
23510
+ const next = parsed.data;
23511
+ if (!deepEqual(prev, next)) {
23512
+ this.settings.whiteLabelling = next;
23513
+ _domain_EventHandler__WEBPACK_IMPORTED_MODULE_7__.EventHandler.Emit(this.whiteLabellingChanged, next);
23508
23514
  }
23515
+ return parsed.data;
23516
+ }
23517
+ catch (_b) {
23518
+ return undefined;
23519
+ }
23520
+ finally {
23521
+ clearTimeout(timeoutId);
23509
23522
  }
23510
- return undefined;
23511
23523
  });
23512
23524
  }
23513
23525
  /** Setup connection string. */
@@ -23587,6 +23599,7 @@ let globalApplication = null;
23587
23599
  let previousShareId = null;
23588
23600
  let previousProjectId = null;
23589
23601
  function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false) {
23602
+ var _a;
23590
23603
  if (shareId && !shareId.startsWith("share-"))
23591
23604
  throw new Error(`Unexpected shareId-format: '${shareId}'.`);
23592
23605
  if (shareId && previousShareId !== shareId) {
@@ -23626,7 +23639,8 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
23626
23639
  splashScreenMode: undefined,
23627
23640
  splashScreenPosition: undefined,
23628
23641
  splashScreenBgColor: undefined
23629
- } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings)
23642
+ } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23643
+ envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
23630
23644
  });
23631
23645
  const PixelStreaming = new _ArcwarePixelStreaming__WEBPACK_IMPORTED_MODULE_1__.ArcwarePixelStreaming(Config);
23632
23646
  const Application = new _ArcwareApplication__WEBPACK_IMPORTED_MODULE_2__.ArcwareApplication({ stream: PixelStreaming });
@@ -23651,7 +23665,7 @@ __webpack_require__.r(__webpack_exports__);
23651
23665
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23652
23666
  /* harmony export */ "ArcwarePixelStreaming": () => (/* binding */ ArcwarePixelStreaming)
23653
23667
  /* harmony export */ });
23654
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(655);
23668
+ /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(655);
23655
23669
  /* harmony import */ var _arcware_cloud_shared_pixelstreaming_websdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7910);
23656
23670
  /* harmony import */ var _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(516);
23657
23671
  /* harmony import */ var _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7800);
@@ -23659,10 +23673,10 @@ __webpack_require__.r(__webpack_exports__);
23659
23673
  /* harmony import */ var _ApplyUrlHack__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4790);
23660
23674
  /* harmony import */ var _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3379);
23661
23675
  /* harmony import */ var _domain_Stats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9764);
23662
- /* harmony import */ var _domain_debounce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9580);
23676
+ /* harmony import */ var _domain_debounce__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(9580);
23663
23677
  /* harmony import */ var _ui_LoveLetters__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4572);
23664
23678
  /* harmony import */ var _ui_ArcwareLogoLoader__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6469);
23665
- /* harmony import */ var _ui_MicrophoneOverlay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3613);
23679
+ /* harmony import */ var _ui_MicrophoneOverlay__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(3613);
23666
23680
  /* harmony import */ var _domain_ConnectionIdentifier__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5999);
23667
23681
  /* harmony import */ var _features_DiagnosticsCollector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8429);
23668
23682
  /* harmony import */ var _features_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2483);
@@ -23809,8 +23823,34 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23809
23823
  });
23810
23824
  // Set override config.
23811
23825
  this.config = config;
23826
+ // Re-apply branding whenever config's WL changes
23827
+ this.config.whiteLabellingChanged.add(() => {
23828
+ try {
23829
+ this.applyBrandingFromSettings();
23830
+ }
23831
+ catch (_a) { }
23832
+ });
23833
+ // Kick off WL fetch once (if we have a shareId); on success it will emit and re-apply
23834
+ (() => (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__awaiter)(this, void 0, void 0, function* () {
23835
+ try {
23836
+ const sid = this.config.settings.shareId;
23837
+ if (sid) {
23838
+ yield this.config.getWhiteLabelling(sid); // will emit if it changes
23839
+ }
23840
+ }
23841
+ catch (_d) {
23842
+ // ignore
23843
+ }
23844
+ finally {
23845
+ // Make sure we paint with whatever we have initially
23846
+ try {
23847
+ this.applyBrandingFromSettings();
23848
+ }
23849
+ catch (_e) { }
23850
+ }
23851
+ }))();
23812
23852
  this.loveLettersList = [];
23813
- this.microphoneOverlay = new _ui_MicrophoneOverlay__WEBPACK_IMPORTED_MODULE_7__.MicrophoneOverlay(this);
23853
+ this.microphoneOverlay = new _ui_MicrophoneOverlay__WEBPACK_IMPORTED_MODULE_8__.MicrophoneOverlay(this);
23814
23854
  this.diagnosticsCollector = new _features_DiagnosticsCollector__WEBPACK_IMPORTED_MODULE_3__.DiagnosticsCollector({
23815
23855
  enableBandwidthProbe: false
23816
23856
  });
@@ -23833,7 +23873,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23833
23873
  this.addMessageHandler("version", _arcware_cloud_shared_pixelstreaming_websdk__WEBPACK_IMPORTED_MODULE_0__.Messages.ZVersion, this.onVersion);
23834
23874
  this.addMessageHandler("render", _arcware_cloud_shared_pixelstreaming_websdk__WEBPACK_IMPORTED_MODULE_0__.Messages.ZRender, this.onRender);
23835
23875
  // Create a debounced version of the handleResolutionChange function
23836
- const debouncedResolutionChange = (0,_domain_debounce__WEBPACK_IMPORTED_MODULE_8__["default"])(() => {
23876
+ const debouncedResolutionChange = (0,_domain_debounce__WEBPACK_IMPORTED_MODULE_9__["default"])(() => {
23837
23877
  this.handleResolutionChange();
23838
23878
  }, 0);
23839
23879
  // Register event listeners.
@@ -23879,7 +23919,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23879
23919
  /** On version requested, the version of the WebSDK would be returned. */
23880
23920
  onVersion(_msg) {
23881
23921
  var _a, _b;
23882
- return (0,tslib__WEBPACK_IMPORTED_MODULE_9__.__awaiter)(this, void 0, void 0, function* () {
23922
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__awaiter)(this, void 0, void 0, function* () {
23883
23923
  let diagnostics;
23884
23924
  try {
23885
23925
  diagnostics = yield this.diagnosticsCollector.collect();
@@ -23909,7 +23949,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23909
23949
  }
23910
23950
  waitForFirstFrameWithTimeout(ms = 2000) {
23911
23951
  var _a, _b, _c;
23912
- return (0,tslib__WEBPACK_IMPORTED_MODULE_9__.__awaiter)(this, void 0, void 0, function* () {
23952
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__awaiter)(this, void 0, void 0, function* () {
23913
23953
  const video = (_c = (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.videoPlayer) === null || _b === void 0 ? void 0 : _b.getVideoElement) === null || _c === void 0 ? void 0 : _c.call(_b);
23914
23954
  if (this.isVideoRenderingNow(video))
23915
23955
  return true;
@@ -23947,7 +23987,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23947
23987
  });
23948
23988
  }
23949
23989
  onRender(_msg) {
23950
- return (0,tslib__WEBPACK_IMPORTED_MODULE_9__.__awaiter)(this, void 0, void 0, function* () {
23990
+ return (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__awaiter)(this, void 0, void 0, function* () {
23951
23991
  const isRendering = yield this.waitForFirstFrameWithTimeout();
23952
23992
  const payload = {
23953
23993
  type: "render",
@@ -23990,7 +24030,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23990
24030
  });
23991
24031
  }
23992
24032
  }
23993
- this.applyBrandingFromSettings();
24033
+ //this.applyBrandingFromSettings();
23994
24034
  this.handleMouseLock();
23995
24035
  this.injectCustomUI();
23996
24036
  }
@@ -24332,8 +24372,6 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24332
24372
  (_a = logoLoader.setHostElement) === null || _a === void 0 ? void 0 : _a.call(logoLoader, loaderRoot);
24333
24373
  loveLettersContainer.appendChild(lettersBlock);
24334
24374
  lettersBlock.appendChild(lettersWrapper);
24335
- // apply current (local) settings immediately
24336
- this.applyBrandingFromSettings();
24337
24375
  }
24338
24376
  }
24339
24377
  pushLetter(letter) {
package/index.umd.js CHANGED
@@ -23370,6 +23370,7 @@ const Session_1 = __webpack_require__(2469);
23370
23370
  const ArcwareSettingsSchema_1 = __webpack_require__(5602);
23371
23371
  const whiteLabelling_1 = __webpack_require__(3545);
23372
23372
  const ZWhiteLabel_1 = __webpack_require__(467);
23373
+ const EventHandler_1 = __webpack_require__(3379);
23373
23374
  /** Default arcware signalling endpoint. */
23374
23375
  exports.DefaultUrl = `wss://signalling-client.ragnarok.arcware.cloud`;
23375
23376
  // The below Logger overrides can likely be removed as PSInfra 5.5 logger supports setting log verbosity
@@ -23385,6 +23386,14 @@ Logger.Error = (message: string) => {
23385
23386
  console.error(message);
23386
23387
  };*/
23387
23388
  lib_pixelstreamingfrontend_ue5_5_1.Logger.InitLogging(2, false);
23389
+ function deepEqual(a, b) {
23390
+ try {
23391
+ return JSON.stringify(a) === JSON.stringify(b);
23392
+ }
23393
+ catch (_a) {
23394
+ return false;
23395
+ }
23396
+ }
23388
23397
  class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23389
23398
  /**
23390
23399
  * Can be used to fetch projectId and shareId from the current url.
@@ -23433,7 +23442,13 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23433
23442
  if (!config.initialSettings.ss)
23434
23443
  config.initialSettings.ss = exports.DefaultUrl;
23435
23444
  super(config);
23436
- this.VERSION = "1.3.15";
23445
+ this.VERSION = "1.3.16";
23446
+ this.whiteLabellingChanged = new EventHandler_1.EventHandler();
23447
+ this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23448
+ console.log(config);
23449
+ if (config.envName) {
23450
+ this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
23451
+ }
23437
23452
  this.settings = settings;
23438
23453
  this.session = new Session_1.Session();
23439
23454
  this._initialSettings = config.initialSettings;
@@ -23455,58 +23470,54 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23455
23470
  this.settings.infoButton = qs.has("i") || qs.has("info");
23456
23471
  }
23457
23472
  }
23458
- static getWhiteLabelling(ShareId, URL = "https://signalling-client.arcware.cloud/whiteLabel/") {
23473
+ getWhiteLabelling(ShareId) {
23459
23474
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
23460
23475
  const qs = new URLSearchParams(window.location.search);
23461
- if (qs.has("wl") && qs.get("wl") === "") {
23462
- // Build final URL safely (trim trailing slashes, encode ShareId)
23463
- const base = URL.replace(/\/+$/, "");
23464
- const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
23465
- const controller = new AbortController();
23466
- const timeoutId = setTimeout(() => controller.abort(), 1000);
23476
+ // Only fetch when wl param is present and empty (as before)
23477
+ if (!(qs.has("wl") && qs.get("wl") === ""))
23478
+ return undefined;
23479
+ // Build final URL safely (trim trailing slashes, encode ShareId)
23480
+ const base = this.signallingWlURL.replace(/\/+$/, "");
23481
+ const requestUrl = `${base}/${encodeURIComponent(ShareId)}`;
23482
+ const controller = new AbortController();
23483
+ const timeoutId = setTimeout(() => controller.abort(), 1000);
23484
+ try {
23485
+ const res = yield fetch(requestUrl, {
23486
+ method: "GET",
23487
+ signal: controller.signal,
23488
+ headers: { Accept: "application/json, text/plain" },
23489
+ credentials: "omit"
23490
+ });
23491
+ if (!res.ok)
23492
+ return undefined;
23493
+ const text = yield res.text();
23494
+ if (!text || text.trim() === "")
23495
+ return undefined;
23496
+ let json;
23467
23497
  try {
23468
- const res = yield fetch(requestUrl, {
23469
- method: "GET",
23470
- signal: controller.signal,
23471
- headers: { Accept: "application/json, text/plain" },
23472
- credentials: "omit"
23473
- });
23474
- if (!res.ok) {
23475
- // Non-2xx: treat as “no white label”
23476
- return undefined;
23477
- }
23478
- // We read as text first to detect empty-string payloads
23479
- const text = yield res.text();
23480
- if (!text || text.trim() === "") {
23481
- return undefined;
23482
- }
23483
- // If there is content, try to parse JSON
23484
- let json;
23485
- try {
23486
- json = JSON.parse(text);
23487
- }
23488
- catch (_a) {
23489
- // Not valid JSON → ignore
23490
- return undefined;
23491
- }
23492
- // Validate against the allowlisted schema
23493
- const parsed = ZWhiteLabel_1.ZWhiteLabel.safeParse(json);
23494
- if (!parsed.success) {
23495
- // Optionally log parsed.error for diagnostics
23496
- return undefined;
23497
- }
23498
- return parsed.data;
23498
+ json = JSON.parse(text);
23499
23499
  }
23500
- catch (err) {
23501
- // Abort or network error → treat as “no white label”
23502
- // if (err?.name !== "AbortError") console.warn("getWhiteLabelling failed", err);
23500
+ catch (_a) {
23503
23501
  return undefined;
23504
23502
  }
23505
- finally {
23506
- clearTimeout(timeoutId);
23503
+ const parsed = ZWhiteLabel_1.ZWhiteLabel.safeParse(json);
23504
+ if (!parsed.success)
23505
+ return undefined;
23506
+ // Only apply & emit if it actually changed
23507
+ const prev = this.settings.whiteLabelling;
23508
+ const next = parsed.data;
23509
+ if (!deepEqual(prev, next)) {
23510
+ this.settings.whiteLabelling = next;
23511
+ EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, next);
23507
23512
  }
23513
+ return parsed.data;
23514
+ }
23515
+ catch (_b) {
23516
+ return undefined;
23517
+ }
23518
+ finally {
23519
+ clearTimeout(timeoutId);
23508
23520
  }
23509
- return undefined;
23510
23521
  });
23511
23522
  }
23512
23523
  /** Setup connection string. */
@@ -23583,6 +23594,7 @@ let globalApplication = null;
23583
23594
  let previousShareId = null;
23584
23595
  let previousProjectId = null;
23585
23596
  function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false) {
23597
+ var _a;
23586
23598
  if (shareId && !shareId.startsWith("share-"))
23587
23599
  throw new Error(`Unexpected shareId-format: '${shareId}'.`);
23588
23600
  if (shareId && previousShareId !== shareId) {
@@ -23622,7 +23634,8 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
23622
23634
  splashScreenMode: undefined,
23623
23635
  splashScreenPosition: undefined,
23624
23636
  splashScreenBgColor: undefined
23625
- } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings)
23637
+ } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23638
+ envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
23626
23639
  });
23627
23640
  const PixelStreaming = new ArcwarePixelStreaming_1.ArcwarePixelStreaming(Config);
23628
23641
  const Application = new ArcwareApplication_1.ArcwareApplication({ stream: PixelStreaming });
@@ -23790,6 +23803,32 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23790
23803
  });
23791
23804
  // Set override config.
23792
23805
  this.config = config;
23806
+ // Re-apply branding whenever config's WL changes
23807
+ this.config.whiteLabellingChanged.add(() => {
23808
+ try {
23809
+ this.applyBrandingFromSettings();
23810
+ }
23811
+ catch (_a) { }
23812
+ });
23813
+ // Kick off WL fetch once (if we have a shareId); on success it will emit and re-apply
23814
+ (() => tslib_1.__awaiter(this, void 0, void 0, function* () {
23815
+ try {
23816
+ const sid = this.config.settings.shareId;
23817
+ if (sid) {
23818
+ yield this.config.getWhiteLabelling(sid); // will emit if it changes
23819
+ }
23820
+ }
23821
+ catch (_d) {
23822
+ // ignore
23823
+ }
23824
+ finally {
23825
+ // Make sure we paint with whatever we have initially
23826
+ try {
23827
+ this.applyBrandingFromSettings();
23828
+ }
23829
+ catch (_e) { }
23830
+ }
23831
+ }))();
23793
23832
  this.loveLettersList = [];
23794
23833
  this.microphoneOverlay = new MicrophoneOverlay_1.MicrophoneOverlay(this);
23795
23834
  this.diagnosticsCollector = new DiagnosticsCollector_1.DiagnosticsCollector({
@@ -23971,7 +24010,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23971
24010
  });
23972
24011
  }
23973
24012
  }
23974
- this.applyBrandingFromSettings();
24013
+ //this.applyBrandingFromSettings();
23975
24014
  this.handleMouseLock();
23976
24015
  this.injectCustomUI();
23977
24016
  }
@@ -24313,8 +24352,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24313
24352
  (_a = logoLoader.setHostElement) === null || _a === void 0 ? void 0 : _a.call(logoLoader, loaderRoot);
24314
24353
  loveLettersContainer.appendChild(lettersBlock);
24315
24354
  lettersBlock.appendChild(lettersWrapper);
24316
- // apply current (local) settings immediately
24317
- this.applyBrandingFromSettings();
24318
24355
  }
24319
24356
  }
24320
24357
  pushLetter(letter) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arcware-cloud/pixelstreaming-websdk",
3
3
  "description": "WebSDK for easy implementation of pixel streaming with Arcware Cloud Services. Heavily based on the '@epicgames-ps' library.",
4
- "version": "1.3.15",
4
+ "version": "1.3.16",
5
5
  "type": "commonjs",
6
6
  "main": "./index.umd.js",
7
7
  "module": "./index.umd.js",
@@ -2,10 +2,12 @@ import { Config, ConfigParams } from "@epicgames-ps/lib-pixelstreamingfrontend-u
2
2
  import { Session } from "./domain/Session";
3
3
  import { Settings } from "./domain/ArcwareSettingsSchema";
4
4
  import { WhiteLabel } from "./features/ZWhiteLabel";
5
+ import { EventHandler } from "./domain/EventHandler";
5
6
  /** Default arcware signalling endpoint. */
6
7
  export declare const DefaultUrl: "wss://signalling-client.ragnarok.arcware.cloud";
7
8
  export interface ArcwareConfigParams extends ConfigParams {
8
9
  settings: Settings;
10
+ envName?: string;
9
11
  }
10
12
  export declare class ArcwareConfig extends Config {
11
13
  /**
@@ -27,9 +29,18 @@ export declare class ArcwareConfig extends Config {
27
29
  readonly session: Session;
28
30
  readonly settings: Settings;
29
31
  private _initialSettings;
30
- readonly VERSION = "1.3.15";
32
+ readonly VERSION = "1.3.16";
33
+ readonly whiteLabellingChanged: EventHandler<{
34
+ loadingIconUrl?: string;
35
+ loadingIconFadeMs?: number;
36
+ splashScreenUrl?: string;
37
+ splashScreenMode?: "repeat" | "contain" | "cover" | "stretch";
38
+ splashScreenPosition?: string;
39
+ splashScreenBgColor?: string;
40
+ }>;
41
+ private signallingWlURL;
31
42
  constructor(config: ArcwareConfigParams);
32
- static getWhiteLabelling(ShareId: string, URL?: string): Promise<WhiteLabel | undefined>;
43
+ getWhiteLabelling(ShareId: string): Promise<WhiteLabel | undefined>;
33
44
  /** Setup connection string. */
34
45
  get urlFlags(): string;
35
46
  get initialSettings(): any;