@arcware-cloud/pixelstreaming-websdk 1.3.16 → 1.3.19

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/index.esm.js CHANGED
@@ -22964,6 +22964,13 @@ class ArcwareApplication extends _epicgames_ps_lib_pixelstreamingfrontend_ui_ue5
22964
22964
  this.fileDownloadCallback = null;
22965
22965
  this.ArcwareSection = this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement, "Arcware Cloud");
22966
22966
  this.stream = options === null || options === void 0 ? void 0 : options.stream;
22967
+ this.baseShowAfkOverlay = this.showAfkOverlay.bind(this); // capture original
22968
+ this.stream.config.whiteLabellingChanged.add(() => {
22969
+ try {
22970
+ this.syncAfkOverlayFromWhiteLabelling();
22971
+ }
22972
+ catch (_a) { }
22973
+ });
22967
22974
  this.emitUIInteraction = this.emitUIInteraction.bind(this);
22968
22975
  this.adjustSettingsPanel();
22969
22976
  this.createAudioToggleButton();
@@ -23005,6 +23012,7 @@ class ArcwareApplication extends _epicgames_ps_lib_pixelstreamingfrontend_ui_ue5
23005
23012
  this.preventDefaultKeyboardEvents();
23006
23013
  this.analyticsEventCallback = this.analyticsEvent;
23007
23014
  this.fileDownloadCallback = this.fileDownload;
23015
+ this.syncAfkOverlayFromWhiteLabelling();
23008
23016
  }
23009
23017
  addLoveLetterhandler() {
23010
23018
  var _a, _b;
@@ -23337,6 +23345,18 @@ class ArcwareApplication extends _epicgames_ps_lib_pixelstreamingfrontend_ui_ue5
23337
23345
  console.error("Download failed:", err);
23338
23346
  }
23339
23347
  }
23348
+ syncAfkOverlayFromWhiteLabelling() {
23349
+ var _a;
23350
+ const hide = (_a = this.stream.config.settings.whiteLabelling) === null || _a === void 0 ? void 0 : _a.hideAfkOverlay;
23351
+ if (hide) {
23352
+ // override with noop
23353
+ this.showAfkOverlay = (_countDown, _dismissAfk) => { };
23354
+ }
23355
+ else {
23356
+ // restore original behavior
23357
+ this.showAfkOverlay = this.baseShowAfkOverlay;
23358
+ }
23359
+ }
23340
23360
  }
23341
23361
  ArcwareApplication.Flags = (_a = class {
23342
23362
  },
@@ -23444,10 +23464,9 @@ class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBP
23444
23464
  if (!config.initialSettings.ss)
23445
23465
  config.initialSettings.ss = DefaultUrl;
23446
23466
  super(config);
23447
- this.VERSION = "1.3.16";
23467
+ this.VERSION = "1.3.19";
23448
23468
  this.whiteLabellingChanged = new _domain_EventHandler__WEBPACK_IMPORTED_MODULE_7__.EventHandler();
23449
23469
  this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23450
- console.log(config);
23451
23470
  if (config.envName) {
23452
23471
  this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
23453
23472
  }
@@ -23508,10 +23527,8 @@ class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBP
23508
23527
  // Only apply & emit if it actually changed
23509
23528
  const prev = this.settings.whiteLabelling;
23510
23529
  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);
23514
- }
23530
+ this.settings.whiteLabelling = next;
23531
+ _domain_EventHandler__WEBPACK_IMPORTED_MODULE_7__.EventHandler.Emit(this.whiteLabellingChanged, { next, changed: !deepEqual(prev, next) });
23515
23532
  return parsed.data;
23516
23533
  }
23517
23534
  catch (_b) {
@@ -23638,8 +23655,10 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
23638
23655
  loadingIconUrl: undefined,
23639
23656
  splashScreenMode: undefined,
23640
23657
  splashScreenPosition: undefined,
23641
- splashScreenBgColor: undefined
23642
- } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23658
+ splashScreenBgColor: undefined,
23659
+ hideLoveLetters: undefined,
23660
+ hideAfkOverlay: undefined
23661
+ }, fetchRemoteWhiteLabelling: undefined }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23643
23662
  envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
23644
23663
  });
23645
23664
  const PixelStreaming = new _ArcwarePixelStreaming__WEBPACK_IMPORTED_MODULE_1__.ArcwarePixelStreaming(Config);
@@ -23722,23 +23741,20 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23722
23741
  return true;
23723
23742
  }
23724
23743
  bindTransportEvents() {
23725
- var _a, _b, _c, _d, _e, _f, _g;
23744
+ var _a, _b, _c, _d;
23726
23745
  const current = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.transport;
23727
23746
  if (!current || current === this._boundTransport)
23728
23747
  return;
23729
- // Unbind from previous
23748
+ // Unbind previous
23730
23749
  if (this._boundTransport) {
23731
23750
  if (this._onWsOpen)
23732
23751
  (_c = (_b = this._boundTransport).removeEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "open", this._onWsOpen);
23733
- if (this._onWsClose)
23734
- (_e = (_d = this._boundTransport).removeEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "close", this._onWsClose);
23752
+ // ⚠️ this was the synthetic "close" before, we'll stop relying on it
23735
23753
  }
23736
- // Define (or reuse) callbacks
23737
23754
  if (!this._onWsOpen) {
23738
23755
  this._onWsOpen = () => {
23739
23756
  this.flushOutbox();
23740
23757
  this.attachFirstRenderedFrameOnce();
23741
- // no watchdog anymore
23742
23758
  setTimeout(() => {
23743
23759
  var _a, _b, _c;
23744
23760
  if (!this.videoInitializedSent) {
@@ -23751,15 +23767,15 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23751
23767
  }, 1200);
23752
23768
  };
23753
23769
  }
23754
- if (!this._onWsClose) {
23770
+ (_d = current.addEventListener) === null || _d === void 0 ? void 0 : _d.call(current, "open", this._onWsOpen);
23771
+ // Real CloseEvent from underlying WebSocket
23772
+ const ws = current.webSocket;
23773
+ if (ws && !this._onWsClose) {
23755
23774
  this._onWsClose = (evt) => {
23756
- // Bubble to your public close handler
23757
23775
  _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23758
23776
  };
23777
+ ws.addEventListener("close", this._onWsClose);
23759
23778
  }
23760
- // Bind to current
23761
- (_f = current.addEventListener) === null || _f === void 0 ? void 0 : _f.call(current, "open", this._onWsOpen);
23762
- (_g = current.addEventListener) === null || _g === void 0 ? void 0 : _g.call(current, "close", this._onWsClose);
23763
23779
  this._boundTransport = current;
23764
23780
  }
23765
23781
  get isWsOpen() {
@@ -23782,7 +23798,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23782
23798
  return state !== undefined ? state : WebSocket.CLOSED;
23783
23799
  }
23784
23800
  constructor(config, overrides) {
23785
- var _a, _b, _c;
23801
+ var _a, _b;
23786
23802
  /** As soon as upstream is fixed, we got to adjust the url building process. */
23787
23803
  (0,_ApplyUrlHack__WEBPACK_IMPORTED_MODULE_6__.ApplyUrlHack)();
23788
23804
  super(config, overrides);
@@ -23816,39 +23832,44 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23816
23832
  this.flushOutbox();
23817
23833
  // no polling watchdog
23818
23834
  });
23819
- (_c = transport === null || transport === void 0 ? void 0 : transport.addEventListener) === null || _c === void 0 ? void 0 : _c.call(transport, "close", (evt) => {
23820
- if (this.websocketOnCloseHandler) {
23821
- _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23822
- }
23823
- });
23824
23835
  // Set override config.
23825
23836
  this.config = config;
23826
23837
  // Re-apply branding whenever config's WL changes
23827
- this.config.whiteLabellingChanged.add(() => {
23838
+ this.config.whiteLabellingChanged.add((result) => {
23839
+ var _a;
23828
23840
  try {
23829
- this.applyBrandingFromSettings();
23841
+ if (result.changed)
23842
+ this.applyBrandingFromSettings();
23843
+ this.config.settings.fetchRemoteWhiteLabelling = false;
23844
+ if (!((_a = this.config.settings.whiteLabelling) === null || _a === void 0 ? void 0 : _a.hideLoveLetters)) {
23845
+ if (!this.isProcessingQueue) {
23846
+ this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
23847
+ }
23848
+ }
23830
23849
  }
23831
- catch (_a) { }
23850
+ catch (_b) { }
23832
23851
  });
23833
23852
  // 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
23853
+ if (this.config.settings.fetchRemoteWhiteLabelling) {
23854
+ (() => (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__awaiter)(this, void 0, void 0, function* () {
23846
23855
  try {
23847
- this.applyBrandingFromSettings();
23856
+ const sid = this.config.settings.shareId;
23857
+ if (sid) {
23858
+ yield this.config.getWhiteLabelling(sid); // will emit if it changes
23859
+ }
23848
23860
  }
23849
- catch (_e) { }
23850
- }
23851
- }))();
23861
+ catch (_c) {
23862
+ // ignore
23863
+ }
23864
+ finally {
23865
+ // Make sure we paint with whatever we have initially
23866
+ try {
23867
+ this.applyBrandingFromSettings();
23868
+ }
23869
+ catch (_d) { }
23870
+ }
23871
+ }))();
23872
+ }
23852
23873
  this.loveLettersList = [];
23853
23874
  this.microphoneOverlay = new _ui_MicrophoneOverlay__WEBPACK_IMPORTED_MODULE_8__.MicrophoneOverlay(this);
23854
23875
  this.diagnosticsCollector = new _features_DiagnosticsCollector__WEBPACK_IMPORTED_MODULE_3__.DiagnosticsCollector({
@@ -23860,7 +23881,6 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
23860
23881
  // Arm first-frame detector & watch for element swaps
23861
23882
  this.attachFirstRenderedFrameOnce();
23862
23883
  this.watchVideoElementReplacement();
23863
- this.wrapWebSocketOnCloseHandler();
23864
23884
  // Bind the event listener function to the class instance
23865
23885
  this.handleResolutionChange = this.handleResolutionChange.bind(this);
23866
23886
  // Register message handlers.
@@ -24081,34 +24101,38 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24081
24101
  }
24082
24102
  }
24083
24103
  runPostInitSideEffectsOnce() {
24084
- var _a, _b, _c, _d, _e, _f, _g;
24104
+ var _a, _b, _c, _d, _e, _f, _g, _h;
24085
24105
  if (this._postInitSideEffectsDone)
24086
24106
  return;
24087
24107
  this._postInitSideEffectsDone = true;
24088
24108
  try {
24089
24109
  (_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
24090
24110
  }
24091
- catch (_h) { }
24111
+ catch (_j) { }
24092
24112
  try {
24093
24113
  (_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
24094
24114
  }
24095
- catch (_j) { }
24115
+ catch (_k) { }
24096
24116
  try {
24097
24117
  (_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
24098
24118
  }
24099
- catch (_k) { }
24119
+ catch (_l) { }
24100
24120
  try {
24101
24121
  (_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
24102
24122
  }
24103
- catch (_l) { }
24123
+ catch (_m) { }
24104
24124
  try {
24105
24125
  (_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
24106
24126
  }
24107
- catch (_m) { }
24127
+ catch (_o) { }
24108
24128
  try {
24109
24129
  (_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
24110
24130
  }
24111
- catch (_o) { }
24131
+ catch (_p) { }
24132
+ try {
24133
+ (_h = this.hideSplashVideo) === null || _h === void 0 ? void 0 : _h.call(this);
24134
+ }
24135
+ catch (_q) { } // ← hide splash video when streaming
24112
24136
  }
24113
24137
  onVideoInitialized() {
24114
24138
  if (this.videoInitializedSent) {
@@ -24375,10 +24399,12 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24375
24399
  }
24376
24400
  }
24377
24401
  pushLetter(letter) {
24378
- var _a;
24402
+ var _a, _b;
24379
24403
  (_a = this === null || this === void 0 ? void 0 : this.loveLettersQueue) === null || _a === void 0 ? void 0 : _a.push(letter);
24380
- if (!this.isProcessingQueue) {
24381
- this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
24404
+ if (!((_b = this.config.settings.whiteLabelling) === null || _b === void 0 ? void 0 : _b.hideLoveLetters) && !this.config.settings.fetchRemoteWhiteLabelling) {
24405
+ if (!this.isProcessingQueue) {
24406
+ this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
24407
+ }
24382
24408
  }
24383
24409
  }
24384
24410
  processLoveLetterQueue() {
@@ -24444,13 +24470,6 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24444
24470
  }, 1000);
24445
24471
  }
24446
24472
  }
24447
- wrapWebSocketOnCloseHandler() {
24448
- var _a, _b;
24449
- let self = this;
24450
- (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.transport) === null || _b === void 0 ? void 0 : _b.addEventListener("close", (event) => {
24451
- _domain_EventHandler__WEBPACK_IMPORTED_MODULE_5__.EventHandler.Emit(self.websocketOnCloseHandler, event);
24452
- });
24453
- }
24454
24473
  onStreamingStateChange(callback) {
24455
24474
  var _a, _b, _c, _d;
24456
24475
  const videoElement = (_b = (_a = this === null || this === void 0 ? void 0 : this.webRtcController) === null || _a === void 0 ? void 0 : _a.videoPlayer) === null || _b === void 0 ? void 0 : _b.getVideoElement();
@@ -24488,7 +24507,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24488
24507
  applyBrandingFromSettings() {
24489
24508
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24490
24509
  const cfg = ((_b = (_a = this === null || this === void 0 ? void 0 : this.config) === null || _a === void 0 ? void 0 : _a.settings.whiteLabelling) !== null && _b !== void 0 ? _b : {});
24491
- // Loader image + fade
24510
+ // Loader
24492
24511
  try {
24493
24512
  if (this.logoLoader) {
24494
24513
  (_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
@@ -24496,68 +24515,152 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24496
24515
  }
24497
24516
  }
24498
24517
  catch (_q) { }
24499
- // Pick splash host: loveLettersContainer (preferred) or player parent
24500
- try {
24501
- const el = (_m = (_g = this.loveLettersContainer) !== null && _g !== void 0 ? _g : (_l = (_k = (_j = (_h = this.webRtcController) === null || _h === void 0 ? void 0 : _h.videoPlayer) === null || _j === void 0 ? void 0 : _j.getVideoParentElement) === null || _k === void 0 ? void 0 : _k.call(_j)) === null || _l === void 0 ? void 0 : _l.parentElement) !== null && _m !== void 0 ? _m : null;
24502
- if (!el)
24503
- return;
24504
- const s = el.style;
24505
- // Nuke previous inline styles (longhands only; never touch 'background' shorthand here)
24506
- s.removeProperty("background-image");
24507
- s.removeProperty("background-size");
24508
- s.removeProperty("background-repeat");
24509
- s.removeProperty("background-position");
24510
- s.removeProperty("background-color");
24511
- // Also clear any earlier 'background' inline shorthand that might have been set elsewhere
24512
- // (we set to 'initial' first, then re-apply longhands)
24513
- s.setProperty("background", "initial");
24514
- el.classList.remove("aw-splash");
24515
- // If neither color nor image is provided, nothing to do
24516
- const haveColor = !!cfg.splashScreenBgColor;
24517
- const haveImage = !!cfg.splashScreenUrl;
24518
- if (!haveColor && !haveImage)
24519
- return;
24520
- // Always ensure our class is present when we brand
24521
- el.classList.add("aw-splash");
24522
- // Apply color with !important so external 'background: ... !important' can't wipe it
24523
- const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24524
- s.setProperty("background-color", bgColor, "important");
24525
- if (haveImage) {
24526
- // Mode size/repeat mapping
24527
- const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24528
- switch (mode) {
24529
- case "contain":
24530
- s.backgroundSize = "contain";
24531
- s.backgroundRepeat = "no-repeat";
24532
- break;
24533
- case "cover":
24534
- s.backgroundSize = "cover";
24535
- s.backgroundRepeat = "no-repeat";
24536
- break;
24537
- case "stretch":
24538
- s.backgroundSize = "100% 100%";
24539
- s.backgroundRepeat = "no-repeat";
24540
- break;
24541
- case "repeat":
24542
- s.backgroundSize = "auto"; // intrinsic
24543
- s.backgroundRepeat = "repeat";
24544
- break;
24545
- }
24546
- // Position
24547
- s.backgroundPosition = cfg.splashScreenPosition || "center center";
24548
- // Image last (longhand so it won't reset color)
24549
- // Use quotes to be safe with URLs containing parentheses/spaces
24550
- s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24518
+ const host = (_m = (_g = this.loveLettersContainer) !== null && _g !== void 0 ? _g : (_l = (_k = (_j = (_h = this.webRtcController) === null || _h === void 0 ? void 0 : _h.videoPlayer) === null || _j === void 0 ? void 0 : _j.getVideoParentElement) === null || _k === void 0 ? void 0 : _k.call(_j)) === null || _l === void 0 ? void 0 : _l.parentElement) !== null && _m !== void 0 ? _m : null;
24519
+ if (!host)
24520
+ return;
24521
+ const s = host.style;
24522
+ // Reset background longhands (never use shorthand to avoid nuking color)
24523
+ s.removeProperty("background-image");
24524
+ s.removeProperty("background-size");
24525
+ s.removeProperty("background-repeat");
24526
+ s.removeProperty("background-position");
24527
+ s.removeProperty("background-color");
24528
+ s.setProperty("background", "initial");
24529
+ host.classList.remove("aw-splash");
24530
+ // Clear any previous splash video unless re-used below
24531
+ this.destroySplashVideo();
24532
+ const haveUrl = !!cfg.splashScreenUrl;
24533
+ const haveColor = !!cfg.splashScreenBgColor;
24534
+ // Nothing to apply?
24535
+ if (!haveUrl && !haveColor)
24536
+ return;
24537
+ host.classList.add("aw-splash");
24538
+ // Always apply color (visible behind image/video / letterboxing)
24539
+ const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24540
+ s.setProperty("background-color", bgColor, "important");
24541
+ // Decide: video or image from the same URL
24542
+ const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
24543
+ if (haveUrl && isVideo) {
24544
+ // map splashScreenMode to object-fit
24545
+ const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
24546
+ const pos = cfg.splashScreenPosition || "center center";
24547
+ this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
24548
+ // keep background image cleared to avoid layering
24549
+ s.backgroundImage = "none";
24550
+ s.backgroundRepeat = "no-repeat";
24551
+ s.backgroundPosition = "center center";
24552
+ s.backgroundSize = "auto";
24553
+ }
24554
+ else if (haveUrl) {
24555
+ // IMAGE path
24556
+ const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24557
+ switch (mode) {
24558
+ case "contain":
24559
+ s.backgroundSize = "contain";
24560
+ s.backgroundRepeat = "no-repeat";
24561
+ break;
24562
+ case "cover":
24563
+ s.backgroundSize = "cover";
24564
+ s.backgroundRepeat = "no-repeat";
24565
+ break;
24566
+ case "stretch":
24567
+ s.backgroundSize = "100% 100%";
24568
+ s.backgroundRepeat = "no-repeat";
24569
+ break;
24570
+ case "repeat":
24571
+ s.backgroundSize = "auto";
24572
+ s.backgroundRepeat = "repeat";
24573
+ break;
24551
24574
  }
24552
- else {
24553
- // No image → ensure any previous image is cleared
24554
- s.backgroundImage = "none";
24555
- s.backgroundRepeat = "no-repeat";
24556
- s.backgroundPosition = "center center";
24557
- s.backgroundSize = "auto";
24575
+ s.backgroundPosition = cfg.splashScreenPosition || "center center";
24576
+ s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24577
+ }
24578
+ else {
24579
+ // COLOR only
24580
+ s.backgroundImage = "none";
24581
+ s.backgroundRepeat = "no-repeat";
24582
+ s.backgroundPosition = "center center";
24583
+ s.backgroundSize = "auto";
24584
+ }
24585
+ }
24586
+ ensureSplashHost() {
24587
+ var _a, _b, _c, _d, _e, _f;
24588
+ const el = (_f = (_a = this.loveLettersContainer) !== null && _a !== void 0 ? _a : (_e = (_d = (_c = (_b = this.webRtcController) === null || _b === void 0 ? void 0 : _b.videoPlayer) === null || _c === void 0 ? void 0 : _c.getVideoParentElement) === null || _d === void 0 ? void 0 : _d.call(_c)) === null || _e === void 0 ? void 0 : _e.parentElement) !== null && _f !== void 0 ? _f : null;
24589
+ if (!el)
24590
+ return null;
24591
+ this._splashHost = el;
24592
+ // ensure stacking works
24593
+ if (getComputedStyle(this._splashHost).position === "static")
24594
+ this._splashHost.style.position = "relative";
24595
+ return this._splashHost;
24596
+ }
24597
+ destroySplashVideo() {
24598
+ if (this._splashVideo) {
24599
+ try {
24600
+ this._splashVideo.pause();
24601
+ }
24602
+ catch (_a) { }
24603
+ try {
24604
+ this._splashVideo.remove();
24558
24605
  }
24606
+ catch (_b) { }
24607
+ this._splashVideo = undefined;
24559
24608
  }
24560
- catch (_r) { }
24609
+ }
24610
+ upsertSplashVideo(url, opts) {
24611
+ var _a, _b;
24612
+ const host = this.ensureSplashHost();
24613
+ if (!host)
24614
+ return;
24615
+ let v = this._splashVideo;
24616
+ if (!v) {
24617
+ v = document.createElement("video");
24618
+ v.playsInline = true;
24619
+ v.setAttribute("webkit-playsinline", "true");
24620
+ v.muted = true; // for autoplay
24621
+ v.autoplay = true;
24622
+ v.loop = true;
24623
+ v.style.position = "absolute";
24624
+ v.style.inset = "0";
24625
+ v.style.width = "100%";
24626
+ v.style.height = "100%";
24627
+ v.style.objectFit = "contain";
24628
+ v.style.objectPosition = "center center";
24629
+ v.style.pointerEvents = "none";
24630
+ v.style.zIndex = "0";
24631
+ host.appendChild(v);
24632
+ this._splashVideo = v;
24633
+ }
24634
+ v.src = url;
24635
+ v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
24636
+ v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
24637
+ if (opts.bgColor)
24638
+ host.style.setProperty("background-color", opts.bgColor, "important");
24639
+ v.style.display = "";
24640
+ v.play().catch(() => { });
24641
+ }
24642
+ hideSplashVideo() {
24643
+ if (this._splashVideo) {
24644
+ try {
24645
+ this._splashVideo.pause();
24646
+ }
24647
+ catch (_a) { }
24648
+ this._splashVideo.style.display = "none";
24649
+ }
24650
+ }
24651
+ isVideoUrl(u) {
24652
+ if (!u)
24653
+ return false;
24654
+ const s = u.split("?")[0].toLowerCase();
24655
+ return (s.startsWith("blob:") ||
24656
+ s.endsWith(".mp4") ||
24657
+ s.endsWith(".webm") ||
24658
+ s.endsWith(".ogg") ||
24659
+ s.endsWith(".ogv") ||
24660
+ s.endsWith(".m3u8"));
24661
+ }
24662
+ static clearSessionId() {
24663
+ window.localStorage.removeItem("pxss"); // or your actual key
24561
24664
  }
24562
24665
  }
24563
24666
 
@@ -24634,7 +24737,8 @@ const ArcwareSettingsSchema = zod__WEBPACK_IMPORTED_MODULE_2__.z.object({
24634
24737
  .strict()
24635
24738
  .optional(),
24636
24739
  /** Loader customization */
24637
- whiteLabelling: _features_ZWhiteLabel__WEBPACK_IMPORTED_MODULE_1__.ZWhiteLabel.optional()
24740
+ whiteLabelling: _features_ZWhiteLabel__WEBPACK_IMPORTED_MODULE_1__.ZWhiteLabel.optional(),
24741
+ fetchRemoteWhiteLabelling: zod__WEBPACK_IMPORTED_MODULE_2__.z.boolean().optional()
24638
24742
  });
24639
24743
 
24640
24744
 
@@ -25463,7 +25567,9 @@ const ZWhiteLabel = zod__WEBPACK_IMPORTED_MODULE_0__.z.object({
25463
25567
  splashScreenUrl: ImageUrl.optional(),
25464
25568
  splashScreenMode: zod__WEBPACK_IMPORTED_MODULE_0__.z["enum"](["contain", "cover", "stretch", "repeat"]).optional(),
25465
25569
  splashScreenPosition: zod__WEBPACK_IMPORTED_MODULE_0__.z.string().optional(),
25466
- splashScreenBgColor: zod__WEBPACK_IMPORTED_MODULE_0__.z.string().optional()
25570
+ splashScreenBgColor: zod__WEBPACK_IMPORTED_MODULE_0__.z.string().optional(),
25571
+ hideLoveLetters: zod__WEBPACK_IMPORTED_MODULE_0__.z.boolean().optional(),
25572
+ hideAfkOverlay: zod__WEBPACK_IMPORTED_MODULE_0__.z.boolean().optional()
25467
25573
  })
25468
25574
  .strict();
25469
25575