@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/README.md CHANGED
@@ -80,6 +80,16 @@ For more detailed examples and advanced usage, please refer to our documentation
80
80
 
81
81
  # Changelog
82
82
 
83
+ ### 1.3.19
84
+
85
+ - added new configuration parameters to optionally hide AfkOverlay and to hide love letters box
86
+ - exposing a function to clear session ID which can be called before connecting to stream to force a fresh instance
87
+ - fixed a bug that was causing onWebsocketClosedEventHandler to fire three times. Also it now returns proper CloseEvent
88
+
89
+ ### 1.3.17
90
+
91
+ - added support for videos in white labelling
92
+
83
93
  ### 1.3.16
84
94
 
85
95
  - added white labeling options for loader icon and screen
package/index.cjs.js CHANGED
@@ -22963,6 +22963,13 @@ class ArcwareApplication extends lib_pixelstreamingfrontend_ui_ue5_5_1.Applicati
22963
22963
  this.fileDownloadCallback = null;
22964
22964
  this.ArcwareSection = this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement, "Arcware Cloud");
22965
22965
  this.stream = options === null || options === void 0 ? void 0 : options.stream;
22966
+ this.baseShowAfkOverlay = this.showAfkOverlay.bind(this); // capture original
22967
+ this.stream.config.whiteLabellingChanged.add(() => {
22968
+ try {
22969
+ this.syncAfkOverlayFromWhiteLabelling();
22970
+ }
22971
+ catch (_a) { }
22972
+ });
22966
22973
  this.emitUIInteraction = this.emitUIInteraction.bind(this);
22967
22974
  this.adjustSettingsPanel();
22968
22975
  this.createAudioToggleButton();
@@ -23004,6 +23011,7 @@ class ArcwareApplication extends lib_pixelstreamingfrontend_ui_ue5_5_1.Applicati
23004
23011
  this.preventDefaultKeyboardEvents();
23005
23012
  this.analyticsEventCallback = this.analyticsEvent;
23006
23013
  this.fileDownloadCallback = this.fileDownload;
23014
+ this.syncAfkOverlayFromWhiteLabelling();
23007
23015
  }
23008
23016
  addLoveLetterhandler() {
23009
23017
  var _a, _b;
@@ -23336,6 +23344,18 @@ class ArcwareApplication extends lib_pixelstreamingfrontend_ui_ue5_5_1.Applicati
23336
23344
  console.error("Download failed:", err);
23337
23345
  }
23338
23346
  }
23347
+ syncAfkOverlayFromWhiteLabelling() {
23348
+ var _a;
23349
+ const hide = (_a = this.stream.config.settings.whiteLabelling) === null || _a === void 0 ? void 0 : _a.hideAfkOverlay;
23350
+ if (hide) {
23351
+ // override with noop
23352
+ this.showAfkOverlay = (_countDown, _dismissAfk) => { };
23353
+ }
23354
+ else {
23355
+ // restore original behavior
23356
+ this.showAfkOverlay = this.baseShowAfkOverlay;
23357
+ }
23358
+ }
23339
23359
  }
23340
23360
  ArcwareApplication.Flags = (_a = class {
23341
23361
  },
@@ -23432,10 +23452,9 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23432
23452
  if (!config.initialSettings.ss)
23433
23453
  config.initialSettings.ss = exports.DefaultUrl;
23434
23454
  super(config);
23435
- this.VERSION = "1.3.16";
23455
+ this.VERSION = "1.3.19";
23436
23456
  this.whiteLabellingChanged = new EventHandler_1.EventHandler();
23437
23457
  this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23438
- console.log(config);
23439
23458
  if (config.envName) {
23440
23459
  this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
23441
23460
  }
@@ -23496,10 +23515,8 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23496
23515
  // Only apply & emit if it actually changed
23497
23516
  const prev = this.settings.whiteLabelling;
23498
23517
  const next = parsed.data;
23499
- if (!deepEqual(prev, next)) {
23500
- this.settings.whiteLabelling = next;
23501
- EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, next);
23502
- }
23518
+ this.settings.whiteLabelling = next;
23519
+ EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, { next, changed: !deepEqual(prev, next) });
23503
23520
  return parsed.data;
23504
23521
  }
23505
23522
  catch (_b) {
@@ -23623,8 +23640,10 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
23623
23640
  loadingIconUrl: undefined,
23624
23641
  splashScreenMode: undefined,
23625
23642
  splashScreenPosition: undefined,
23626
- splashScreenBgColor: undefined
23627
- } }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23643
+ splashScreenBgColor: undefined,
23644
+ hideLoveLetters: undefined,
23645
+ hideAfkOverlay: undefined
23646
+ }, fetchRemoteWhiteLabelling: undefined }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
23628
23647
  envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
23629
23648
  });
23630
23649
  const PixelStreaming = new ArcwarePixelStreaming_1.ArcwarePixelStreaming(Config);
@@ -23692,23 +23711,20 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23692
23711
  return true;
23693
23712
  }
23694
23713
  bindTransportEvents() {
23695
- var _a, _b, _c, _d, _e, _f, _g;
23714
+ var _a, _b, _c, _d;
23696
23715
  const current = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.transport;
23697
23716
  if (!current || current === this._boundTransport)
23698
23717
  return;
23699
- // Unbind from previous
23718
+ // Unbind previous
23700
23719
  if (this._boundTransport) {
23701
23720
  if (this._onWsOpen)
23702
23721
  (_c = (_b = this._boundTransport).removeEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "open", this._onWsOpen);
23703
- if (this._onWsClose)
23704
- (_e = (_d = this._boundTransport).removeEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "close", this._onWsClose);
23722
+ // ⚠️ this was the synthetic "close" before, we'll stop relying on it
23705
23723
  }
23706
- // Define (or reuse) callbacks
23707
23724
  if (!this._onWsOpen) {
23708
23725
  this._onWsOpen = () => {
23709
23726
  this.flushOutbox();
23710
23727
  this.attachFirstRenderedFrameOnce();
23711
- // no watchdog anymore
23712
23728
  setTimeout(() => {
23713
23729
  var _a, _b, _c;
23714
23730
  if (!this.videoInitializedSent) {
@@ -23721,15 +23737,15 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23721
23737
  }, 1200);
23722
23738
  };
23723
23739
  }
23724
- if (!this._onWsClose) {
23740
+ (_d = current.addEventListener) === null || _d === void 0 ? void 0 : _d.call(current, "open", this._onWsOpen);
23741
+ // Real CloseEvent from underlying WebSocket
23742
+ const ws = current.webSocket;
23743
+ if (ws && !this._onWsClose) {
23725
23744
  this._onWsClose = (evt) => {
23726
- // Bubble to your public close handler
23727
23745
  EventHandler_1.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23728
23746
  };
23747
+ ws.addEventListener("close", this._onWsClose);
23729
23748
  }
23730
- // Bind to current
23731
- (_f = current.addEventListener) === null || _f === void 0 ? void 0 : _f.call(current, "open", this._onWsOpen);
23732
- (_g = current.addEventListener) === null || _g === void 0 ? void 0 : _g.call(current, "close", this._onWsClose);
23733
23749
  this._boundTransport = current;
23734
23750
  }
23735
23751
  get isWsOpen() {
@@ -23752,7 +23768,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23752
23768
  return state !== undefined ? state : WebSocket.CLOSED;
23753
23769
  }
23754
23770
  constructor(config, overrides) {
23755
- var _a, _b, _c;
23771
+ var _a, _b;
23756
23772
  /** As soon as upstream is fixed, we got to adjust the url building process. */
23757
23773
  (0, ApplyUrlHack_1.ApplyUrlHack)();
23758
23774
  super(config, overrides);
@@ -23786,39 +23802,44 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23786
23802
  this.flushOutbox();
23787
23803
  // no polling watchdog
23788
23804
  });
23789
- (_c = transport === null || transport === void 0 ? void 0 : transport.addEventListener) === null || _c === void 0 ? void 0 : _c.call(transport, "close", (evt) => {
23790
- if (this.websocketOnCloseHandler) {
23791
- EventHandler_1.EventHandler.Emit(this.websocketOnCloseHandler, evt);
23792
- }
23793
- });
23794
23805
  // Set override config.
23795
23806
  this.config = config;
23796
23807
  // Re-apply branding whenever config's WL changes
23797
- this.config.whiteLabellingChanged.add(() => {
23808
+ this.config.whiteLabellingChanged.add((result) => {
23809
+ var _a;
23798
23810
  try {
23799
- this.applyBrandingFromSettings();
23811
+ if (result.changed)
23812
+ this.applyBrandingFromSettings();
23813
+ this.config.settings.fetchRemoteWhiteLabelling = false;
23814
+ if (!((_a = this.config.settings.whiteLabelling) === null || _a === void 0 ? void 0 : _a.hideLoveLetters)) {
23815
+ if (!this.isProcessingQueue) {
23816
+ this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
23817
+ }
23818
+ }
23800
23819
  }
23801
- catch (_a) { }
23820
+ catch (_b) { }
23802
23821
  });
23803
23822
  // 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
23823
+ if (this.config.settings.fetchRemoteWhiteLabelling) {
23824
+ (() => tslib_1.__awaiter(this, void 0, void 0, function* () {
23816
23825
  try {
23817
- this.applyBrandingFromSettings();
23826
+ const sid = this.config.settings.shareId;
23827
+ if (sid) {
23828
+ yield this.config.getWhiteLabelling(sid); // will emit if it changes
23829
+ }
23818
23830
  }
23819
- catch (_e) { }
23820
- }
23821
- }))();
23831
+ catch (_c) {
23832
+ // ignore
23833
+ }
23834
+ finally {
23835
+ // Make sure we paint with whatever we have initially
23836
+ try {
23837
+ this.applyBrandingFromSettings();
23838
+ }
23839
+ catch (_d) { }
23840
+ }
23841
+ }))();
23842
+ }
23822
23843
  this.loveLettersList = [];
23823
23844
  this.microphoneOverlay = new MicrophoneOverlay_1.MicrophoneOverlay(this);
23824
23845
  this.diagnosticsCollector = new DiagnosticsCollector_1.DiagnosticsCollector({
@@ -23830,7 +23851,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
23830
23851
  // Arm first-frame detector & watch for element swaps
23831
23852
  this.attachFirstRenderedFrameOnce();
23832
23853
  this.watchVideoElementReplacement();
23833
- this.wrapWebSocketOnCloseHandler();
23834
23854
  // Bind the event listener function to the class instance
23835
23855
  this.handleResolutionChange = this.handleResolutionChange.bind(this);
23836
23856
  // Register message handlers.
@@ -24051,34 +24071,38 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24051
24071
  }
24052
24072
  }
24053
24073
  runPostInitSideEffectsOnce() {
24054
- var _a, _b, _c, _d, _e, _f, _g;
24074
+ var _a, _b, _c, _d, _e, _f, _g, _h;
24055
24075
  if (this._postInitSideEffectsDone)
24056
24076
  return;
24057
24077
  this._postInitSideEffectsDone = true;
24058
24078
  try {
24059
24079
  (_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
24060
24080
  }
24061
- catch (_h) { }
24081
+ catch (_j) { }
24062
24082
  try {
24063
24083
  (_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
24064
24084
  }
24065
- catch (_j) { }
24085
+ catch (_k) { }
24066
24086
  try {
24067
24087
  (_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
24068
24088
  }
24069
- catch (_k) { }
24089
+ catch (_l) { }
24070
24090
  try {
24071
24091
  (_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
24072
24092
  }
24073
- catch (_l) { }
24093
+ catch (_m) { }
24074
24094
  try {
24075
24095
  (_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
24076
24096
  }
24077
- catch (_m) { }
24097
+ catch (_o) { }
24078
24098
  try {
24079
24099
  (_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
24080
24100
  }
24081
- catch (_o) { }
24101
+ catch (_p) { }
24102
+ try {
24103
+ (_h = this.hideSplashVideo) === null || _h === void 0 ? void 0 : _h.call(this);
24104
+ }
24105
+ catch (_q) { } // ← hide splash video when streaming
24082
24106
  }
24083
24107
  onVideoInitialized() {
24084
24108
  if (this.videoInitializedSent) {
@@ -24345,10 +24369,12 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24345
24369
  }
24346
24370
  }
24347
24371
  pushLetter(letter) {
24348
- var _a;
24372
+ var _a, _b;
24349
24373
  (_a = this === null || this === void 0 ? void 0 : this.loveLettersQueue) === null || _a === void 0 ? void 0 : _a.push(letter);
24350
- if (!this.isProcessingQueue) {
24351
- this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
24374
+ if (!((_b = this.config.settings.whiteLabelling) === null || _b === void 0 ? void 0 : _b.hideLoveLetters) && !this.config.settings.fetchRemoteWhiteLabelling) {
24375
+ if (!this.isProcessingQueue) {
24376
+ this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
24377
+ }
24352
24378
  }
24353
24379
  }
24354
24380
  processLoveLetterQueue() {
@@ -24414,13 +24440,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24414
24440
  }, 1000);
24415
24441
  }
24416
24442
  }
24417
- wrapWebSocketOnCloseHandler() {
24418
- var _a, _b;
24419
- let self = this;
24420
- (_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.transport) === null || _b === void 0 ? void 0 : _b.addEventListener("close", (event) => {
24421
- EventHandler_1.EventHandler.Emit(self.websocketOnCloseHandler, event);
24422
- });
24423
- }
24424
24443
  onStreamingStateChange(callback) {
24425
24444
  var _a, _b, _c, _d;
24426
24445
  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();
@@ -24458,7 +24477,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24458
24477
  applyBrandingFromSettings() {
24459
24478
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24460
24479
  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 : {});
24461
- // Loader image + fade
24480
+ // Loader
24462
24481
  try {
24463
24482
  if (this.logoLoader) {
24464
24483
  (_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
@@ -24466,68 +24485,152 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24466
24485
  }
24467
24486
  }
24468
24487
  catch (_q) { }
24469
- // Pick splash host: loveLettersContainer (preferred) or player parent
24470
- try {
24471
- 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;
24472
- if (!el)
24473
- return;
24474
- const s = el.style;
24475
- // Nuke previous inline styles (longhands only; never touch 'background' shorthand here)
24476
- s.removeProperty("background-image");
24477
- s.removeProperty("background-size");
24478
- s.removeProperty("background-repeat");
24479
- s.removeProperty("background-position");
24480
- s.removeProperty("background-color");
24481
- // Also clear any earlier 'background' inline shorthand that might have been set elsewhere
24482
- // (we set to 'initial' first, then re-apply longhands)
24483
- s.setProperty("background", "initial");
24484
- el.classList.remove("aw-splash");
24485
- // If neither color nor image is provided, nothing to do
24486
- const haveColor = !!cfg.splashScreenBgColor;
24487
- const haveImage = !!cfg.splashScreenUrl;
24488
- if (!haveColor && !haveImage)
24489
- return;
24490
- // Always ensure our class is present when we brand
24491
- el.classList.add("aw-splash");
24492
- // Apply color with !important so external 'background: ... !important' can't wipe it
24493
- const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24494
- s.setProperty("background-color", bgColor, "important");
24495
- if (haveImage) {
24496
- // Mode size/repeat mapping
24497
- const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24498
- switch (mode) {
24499
- case "contain":
24500
- s.backgroundSize = "contain";
24501
- s.backgroundRepeat = "no-repeat";
24502
- break;
24503
- case "cover":
24504
- s.backgroundSize = "cover";
24505
- s.backgroundRepeat = "no-repeat";
24506
- break;
24507
- case "stretch":
24508
- s.backgroundSize = "100% 100%";
24509
- s.backgroundRepeat = "no-repeat";
24510
- break;
24511
- case "repeat":
24512
- s.backgroundSize = "auto"; // intrinsic
24513
- s.backgroundRepeat = "repeat";
24514
- break;
24515
- }
24516
- // Position
24517
- s.backgroundPosition = cfg.splashScreenPosition || "center center";
24518
- // Image last (longhand so it won't reset color)
24519
- // Use quotes to be safe with URLs containing parentheses/spaces
24520
- s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24488
+ 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;
24489
+ if (!host)
24490
+ return;
24491
+ const s = host.style;
24492
+ // Reset background longhands (never use shorthand to avoid nuking color)
24493
+ s.removeProperty("background-image");
24494
+ s.removeProperty("background-size");
24495
+ s.removeProperty("background-repeat");
24496
+ s.removeProperty("background-position");
24497
+ s.removeProperty("background-color");
24498
+ s.setProperty("background", "initial");
24499
+ host.classList.remove("aw-splash");
24500
+ // Clear any previous splash video unless re-used below
24501
+ this.destroySplashVideo();
24502
+ const haveUrl = !!cfg.splashScreenUrl;
24503
+ const haveColor = !!cfg.splashScreenBgColor;
24504
+ // Nothing to apply?
24505
+ if (!haveUrl && !haveColor)
24506
+ return;
24507
+ host.classList.add("aw-splash");
24508
+ // Always apply color (visible behind image/video / letterboxing)
24509
+ const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24510
+ s.setProperty("background-color", bgColor, "important");
24511
+ // Decide: video or image from the same URL
24512
+ const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
24513
+ if (haveUrl && isVideo) {
24514
+ // map splashScreenMode to object-fit
24515
+ const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
24516
+ const pos = cfg.splashScreenPosition || "center center";
24517
+ this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
24518
+ // keep background image cleared to avoid layering
24519
+ s.backgroundImage = "none";
24520
+ s.backgroundRepeat = "no-repeat";
24521
+ s.backgroundPosition = "center center";
24522
+ s.backgroundSize = "auto";
24523
+ }
24524
+ else if (haveUrl) {
24525
+ // IMAGE path
24526
+ const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24527
+ switch (mode) {
24528
+ case "contain":
24529
+ s.backgroundSize = "contain";
24530
+ s.backgroundRepeat = "no-repeat";
24531
+ break;
24532
+ case "cover":
24533
+ s.backgroundSize = "cover";
24534
+ s.backgroundRepeat = "no-repeat";
24535
+ break;
24536
+ case "stretch":
24537
+ s.backgroundSize = "100% 100%";
24538
+ s.backgroundRepeat = "no-repeat";
24539
+ break;
24540
+ case "repeat":
24541
+ s.backgroundSize = "auto";
24542
+ s.backgroundRepeat = "repeat";
24543
+ break;
24521
24544
  }
24522
- else {
24523
- // No image → ensure any previous image is cleared
24524
- s.backgroundImage = "none";
24525
- s.backgroundRepeat = "no-repeat";
24526
- s.backgroundPosition = "center center";
24527
- s.backgroundSize = "auto";
24545
+ s.backgroundPosition = cfg.splashScreenPosition || "center center";
24546
+ s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24547
+ }
24548
+ else {
24549
+ // COLOR only
24550
+ s.backgroundImage = "none";
24551
+ s.backgroundRepeat = "no-repeat";
24552
+ s.backgroundPosition = "center center";
24553
+ s.backgroundSize = "auto";
24554
+ }
24555
+ }
24556
+ ensureSplashHost() {
24557
+ var _a, _b, _c, _d, _e, _f;
24558
+ 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;
24559
+ if (!el)
24560
+ return null;
24561
+ this._splashHost = el;
24562
+ // ensure stacking works
24563
+ if (getComputedStyle(this._splashHost).position === "static")
24564
+ this._splashHost.style.position = "relative";
24565
+ return this._splashHost;
24566
+ }
24567
+ destroySplashVideo() {
24568
+ if (this._splashVideo) {
24569
+ try {
24570
+ this._splashVideo.pause();
24571
+ }
24572
+ catch (_a) { }
24573
+ try {
24574
+ this._splashVideo.remove();
24528
24575
  }
24576
+ catch (_b) { }
24577
+ this._splashVideo = undefined;
24529
24578
  }
24530
- catch (_r) { }
24579
+ }
24580
+ upsertSplashVideo(url, opts) {
24581
+ var _a, _b;
24582
+ const host = this.ensureSplashHost();
24583
+ if (!host)
24584
+ return;
24585
+ let v = this._splashVideo;
24586
+ if (!v) {
24587
+ v = document.createElement("video");
24588
+ v.playsInline = true;
24589
+ v.setAttribute("webkit-playsinline", "true");
24590
+ v.muted = true; // for autoplay
24591
+ v.autoplay = true;
24592
+ v.loop = true;
24593
+ v.style.position = "absolute";
24594
+ v.style.inset = "0";
24595
+ v.style.width = "100%";
24596
+ v.style.height = "100%";
24597
+ v.style.objectFit = "contain";
24598
+ v.style.objectPosition = "center center";
24599
+ v.style.pointerEvents = "none";
24600
+ v.style.zIndex = "0";
24601
+ host.appendChild(v);
24602
+ this._splashVideo = v;
24603
+ }
24604
+ v.src = url;
24605
+ v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
24606
+ v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
24607
+ if (opts.bgColor)
24608
+ host.style.setProperty("background-color", opts.bgColor, "important");
24609
+ v.style.display = "";
24610
+ v.play().catch(() => { });
24611
+ }
24612
+ hideSplashVideo() {
24613
+ if (this._splashVideo) {
24614
+ try {
24615
+ this._splashVideo.pause();
24616
+ }
24617
+ catch (_a) { }
24618
+ this._splashVideo.style.display = "none";
24619
+ }
24620
+ }
24621
+ isVideoUrl(u) {
24622
+ if (!u)
24623
+ return false;
24624
+ const s = u.split("?")[0].toLowerCase();
24625
+ return (s.startsWith("blob:") ||
24626
+ s.endsWith(".mp4") ||
24627
+ s.endsWith(".webm") ||
24628
+ s.endsWith(".ogg") ||
24629
+ s.endsWith(".ogv") ||
24630
+ s.endsWith(".m3u8"));
24631
+ }
24632
+ static clearSessionId() {
24633
+ window.localStorage.removeItem("pxss"); // or your actual key
24531
24634
  }
24532
24635
  }
24533
24636
  exports.ArcwarePixelStreaming = ArcwarePixelStreaming;
@@ -24602,7 +24705,8 @@ exports.ArcwareSettingsSchema = zod_1.z.object({
24602
24705
  .strict()
24603
24706
  .optional(),
24604
24707
  /** Loader customization */
24605
- whiteLabelling: ZWhiteLabel_1.ZWhiteLabel.optional()
24708
+ whiteLabelling: ZWhiteLabel_1.ZWhiteLabel.optional(),
24709
+ fetchRemoteWhiteLabelling: zod_1.z.boolean().optional()
24606
24710
  });
24607
24711
 
24608
24712
 
@@ -25422,7 +25526,9 @@ exports.ZWhiteLabel = zod_1.z
25422
25526
  splashScreenUrl: ImageUrl.optional(),
25423
25527
  splashScreenMode: zod_1.z.enum(["contain", "cover", "stretch", "repeat"]).optional(),
25424
25528
  splashScreenPosition: zod_1.z.string().optional(),
25425
- splashScreenBgColor: zod_1.z.string().optional()
25529
+ splashScreenBgColor: zod_1.z.string().optional(),
25530
+ hideLoveLetters: zod_1.z.boolean().optional(),
25531
+ hideAfkOverlay: zod_1.z.boolean().optional()
25426
25532
  })
25427
25533
  .strict();
25428
25534