@arcware-cloud/pixelstreaming-websdk 1.3.16 → 1.3.18

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,10 @@ For more detailed examples and advanced usage, please refer to our documentation
80
80
 
81
81
  # Changelog
82
82
 
83
+ ### 1.3.17
84
+
85
+ - added support for videos in white labelling
86
+
83
87
  ### 1.3.16
84
88
 
85
89
  - added white labeling options for loader icon and screen
package/index.cjs.js CHANGED
@@ -23432,7 +23432,7 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23432
23432
  if (!config.initialSettings.ss)
23433
23433
  config.initialSettings.ss = exports.DefaultUrl;
23434
23434
  super(config);
23435
- this.VERSION = "1.3.16";
23435
+ this.VERSION = "1.3.18";
23436
23436
  this.whiteLabellingChanged = new EventHandler_1.EventHandler();
23437
23437
  this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23438
23438
  console.log(config);
@@ -24051,34 +24051,38 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24051
24051
  }
24052
24052
  }
24053
24053
  runPostInitSideEffectsOnce() {
24054
- var _a, _b, _c, _d, _e, _f, _g;
24054
+ var _a, _b, _c, _d, _e, _f, _g, _h;
24055
24055
  if (this._postInitSideEffectsDone)
24056
24056
  return;
24057
24057
  this._postInitSideEffectsDone = true;
24058
24058
  try {
24059
24059
  (_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
24060
24060
  }
24061
- catch (_h) { }
24061
+ catch (_j) { }
24062
24062
  try {
24063
24063
  (_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
24064
24064
  }
24065
- catch (_j) { }
24065
+ catch (_k) { }
24066
24066
  try {
24067
24067
  (_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
24068
24068
  }
24069
- catch (_k) { }
24069
+ catch (_l) { }
24070
24070
  try {
24071
24071
  (_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
24072
24072
  }
24073
- catch (_l) { }
24073
+ catch (_m) { }
24074
24074
  try {
24075
24075
  (_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
24076
24076
  }
24077
- catch (_m) { }
24077
+ catch (_o) { }
24078
24078
  try {
24079
24079
  (_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
24080
24080
  }
24081
- catch (_o) { }
24081
+ catch (_p) { }
24082
+ try {
24083
+ (_h = this.hideSplashVideo) === null || _h === void 0 ? void 0 : _h.call(this);
24084
+ }
24085
+ catch (_q) { } // ← hide splash video when streaming
24082
24086
  }
24083
24087
  onVideoInitialized() {
24084
24088
  if (this.videoInitializedSent) {
@@ -24458,7 +24462,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24458
24462
  applyBrandingFromSettings() {
24459
24463
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24460
24464
  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
24465
+ // Loader
24462
24466
  try {
24463
24467
  if (this.logoLoader) {
24464
24468
  (_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
@@ -24466,68 +24470,149 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24466
24470
  }
24467
24471
  }
24468
24472
  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}")`;
24473
+ 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;
24474
+ if (!host)
24475
+ return;
24476
+ const s = host.style;
24477
+ // Reset background longhands (never use shorthand to avoid nuking color)
24478
+ s.removeProperty("background-image");
24479
+ s.removeProperty("background-size");
24480
+ s.removeProperty("background-repeat");
24481
+ s.removeProperty("background-position");
24482
+ s.removeProperty("background-color");
24483
+ s.setProperty("background", "initial");
24484
+ host.classList.remove("aw-splash");
24485
+ // Clear any previous splash video unless re-used below
24486
+ this.destroySplashVideo();
24487
+ const haveUrl = !!cfg.splashScreenUrl;
24488
+ const haveColor = !!cfg.splashScreenBgColor;
24489
+ // Nothing to apply?
24490
+ if (!haveUrl && !haveColor)
24491
+ return;
24492
+ host.classList.add("aw-splash");
24493
+ // Always apply color (visible behind image/video / letterboxing)
24494
+ const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24495
+ s.setProperty("background-color", bgColor, "important");
24496
+ // Decide: video or image from the same URL
24497
+ const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
24498
+ if (haveUrl && isVideo) {
24499
+ // map splashScreenMode to object-fit
24500
+ const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
24501
+ const pos = cfg.splashScreenPosition || "center center";
24502
+ this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
24503
+ // keep background image cleared to avoid layering
24504
+ s.backgroundImage = "none";
24505
+ s.backgroundRepeat = "no-repeat";
24506
+ s.backgroundPosition = "center center";
24507
+ s.backgroundSize = "auto";
24508
+ }
24509
+ else if (haveUrl) {
24510
+ // IMAGE path
24511
+ const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24512
+ switch (mode) {
24513
+ case "contain":
24514
+ s.backgroundSize = "contain";
24515
+ s.backgroundRepeat = "no-repeat";
24516
+ break;
24517
+ case "cover":
24518
+ s.backgroundSize = "cover";
24519
+ s.backgroundRepeat = "no-repeat";
24520
+ break;
24521
+ case "stretch":
24522
+ s.backgroundSize = "100% 100%";
24523
+ s.backgroundRepeat = "no-repeat";
24524
+ break;
24525
+ case "repeat":
24526
+ s.backgroundSize = "auto";
24527
+ s.backgroundRepeat = "repeat";
24528
+ break;
24521
24529
  }
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";
24530
+ s.backgroundPosition = cfg.splashScreenPosition || "center center";
24531
+ s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24532
+ }
24533
+ else {
24534
+ // COLOR only
24535
+ s.backgroundImage = "none";
24536
+ s.backgroundRepeat = "no-repeat";
24537
+ s.backgroundPosition = "center center";
24538
+ s.backgroundSize = "auto";
24539
+ }
24540
+ }
24541
+ ensureSplashHost() {
24542
+ var _a, _b, _c, _d, _e, _f;
24543
+ 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;
24544
+ if (!el)
24545
+ return null;
24546
+ this._splashHost = el;
24547
+ // ensure stacking works
24548
+ if (getComputedStyle(this._splashHost).position === "static")
24549
+ this._splashHost.style.position = "relative";
24550
+ return this._splashHost;
24551
+ }
24552
+ destroySplashVideo() {
24553
+ if (this._splashVideo) {
24554
+ try {
24555
+ this._splashVideo.pause();
24556
+ }
24557
+ catch (_a) { }
24558
+ try {
24559
+ this._splashVideo.remove();
24560
+ }
24561
+ catch (_b) { }
24562
+ this._splashVideo = undefined;
24563
+ }
24564
+ }
24565
+ upsertSplashVideo(url, opts) {
24566
+ var _a, _b;
24567
+ const host = this.ensureSplashHost();
24568
+ if (!host)
24569
+ return;
24570
+ let v = this._splashVideo;
24571
+ if (!v) {
24572
+ v = document.createElement("video");
24573
+ v.playsInline = true;
24574
+ v.setAttribute("webkit-playsinline", "true");
24575
+ v.muted = true; // for autoplay
24576
+ v.autoplay = true;
24577
+ v.loop = true;
24578
+ v.style.position = "absolute";
24579
+ v.style.inset = "0";
24580
+ v.style.width = "100%";
24581
+ v.style.height = "100%";
24582
+ v.style.objectFit = "contain";
24583
+ v.style.objectPosition = "center center";
24584
+ v.style.pointerEvents = "none";
24585
+ v.style.zIndex = "0";
24586
+ host.appendChild(v);
24587
+ this._splashVideo = v;
24588
+ }
24589
+ v.src = url;
24590
+ v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
24591
+ v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
24592
+ if (opts.bgColor)
24593
+ host.style.setProperty("background-color", opts.bgColor, "important");
24594
+ v.style.display = "";
24595
+ v.play().catch(() => { });
24596
+ }
24597
+ hideSplashVideo() {
24598
+ if (this._splashVideo) {
24599
+ try {
24600
+ this._splashVideo.pause();
24528
24601
  }
24602
+ catch (_a) { }
24603
+ this._splashVideo.style.display = "none";
24529
24604
  }
24530
- catch (_r) { }
24605
+ }
24606
+ isVideoUrl(u) {
24607
+ if (!u)
24608
+ return false;
24609
+ const s = u.split("?")[0].toLowerCase();
24610
+ return (s.startsWith("blob:") ||
24611
+ s.endsWith(".mp4") ||
24612
+ s.endsWith(".webm") ||
24613
+ s.endsWith(".ogg") ||
24614
+ s.endsWith(".ogv") ||
24615
+ s.endsWith(".m3u8"));
24531
24616
  }
24532
24617
  }
24533
24618
  exports.ArcwarePixelStreaming = ArcwarePixelStreaming;
package/index.esm.js CHANGED
@@ -23444,7 +23444,7 @@ class ArcwareConfig extends _epicgames_ps_lib_pixelstreamingfrontend_ue5_5__WEBP
23444
23444
  if (!config.initialSettings.ss)
23445
23445
  config.initialSettings.ss = DefaultUrl;
23446
23446
  super(config);
23447
- this.VERSION = "1.3.16";
23447
+ this.VERSION = "1.3.18";
23448
23448
  this.whiteLabellingChanged = new _domain_EventHandler__WEBPACK_IMPORTED_MODULE_7__.EventHandler();
23449
23449
  this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23450
23450
  console.log(config);
@@ -24081,34 +24081,38 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24081
24081
  }
24082
24082
  }
24083
24083
  runPostInitSideEffectsOnce() {
24084
- var _a, _b, _c, _d, _e, _f, _g;
24084
+ var _a, _b, _c, _d, _e, _f, _g, _h;
24085
24085
  if (this._postInitSideEffectsDone)
24086
24086
  return;
24087
24087
  this._postInitSideEffectsDone = true;
24088
24088
  try {
24089
24089
  (_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
24090
24090
  }
24091
- catch (_h) { }
24091
+ catch (_j) { }
24092
24092
  try {
24093
24093
  (_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
24094
24094
  }
24095
- catch (_j) { }
24095
+ catch (_k) { }
24096
24096
  try {
24097
24097
  (_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
24098
24098
  }
24099
- catch (_k) { }
24099
+ catch (_l) { }
24100
24100
  try {
24101
24101
  (_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
24102
24102
  }
24103
- catch (_l) { }
24103
+ catch (_m) { }
24104
24104
  try {
24105
24105
  (_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
24106
24106
  }
24107
- catch (_m) { }
24107
+ catch (_o) { }
24108
24108
  try {
24109
24109
  (_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
24110
24110
  }
24111
- catch (_o) { }
24111
+ catch (_p) { }
24112
+ try {
24113
+ (_h = this.hideSplashVideo) === null || _h === void 0 ? void 0 : _h.call(this);
24114
+ }
24115
+ catch (_q) { } // ← hide splash video when streaming
24112
24116
  }
24113
24117
  onVideoInitialized() {
24114
24118
  if (this.videoInitializedSent) {
@@ -24488,7 +24492,7 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24488
24492
  applyBrandingFromSettings() {
24489
24493
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24490
24494
  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
24495
+ // Loader
24492
24496
  try {
24493
24497
  if (this.logoLoader) {
24494
24498
  (_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
@@ -24496,68 +24500,149 @@ class ArcwarePixelStreaming extends _epicgames_ps_lib_pixelstreamingfrontend_ue5
24496
24500
  }
24497
24501
  }
24498
24502
  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}")`;
24503
+ 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;
24504
+ if (!host)
24505
+ return;
24506
+ const s = host.style;
24507
+ // Reset background longhands (never use shorthand to avoid nuking color)
24508
+ s.removeProperty("background-image");
24509
+ s.removeProperty("background-size");
24510
+ s.removeProperty("background-repeat");
24511
+ s.removeProperty("background-position");
24512
+ s.removeProperty("background-color");
24513
+ s.setProperty("background", "initial");
24514
+ host.classList.remove("aw-splash");
24515
+ // Clear any previous splash video unless re-used below
24516
+ this.destroySplashVideo();
24517
+ const haveUrl = !!cfg.splashScreenUrl;
24518
+ const haveColor = !!cfg.splashScreenBgColor;
24519
+ // Nothing to apply?
24520
+ if (!haveUrl && !haveColor)
24521
+ return;
24522
+ host.classList.add("aw-splash");
24523
+ // Always apply color (visible behind image/video / letterboxing)
24524
+ const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24525
+ s.setProperty("background-color", bgColor, "important");
24526
+ // Decide: video or image from the same URL
24527
+ const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
24528
+ if (haveUrl && isVideo) {
24529
+ // map splashScreenMode to object-fit
24530
+ const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
24531
+ const pos = cfg.splashScreenPosition || "center center";
24532
+ this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
24533
+ // keep background image cleared to avoid layering
24534
+ s.backgroundImage = "none";
24535
+ s.backgroundRepeat = "no-repeat";
24536
+ s.backgroundPosition = "center center";
24537
+ s.backgroundSize = "auto";
24538
+ }
24539
+ else if (haveUrl) {
24540
+ // IMAGE path
24541
+ const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24542
+ switch (mode) {
24543
+ case "contain":
24544
+ s.backgroundSize = "contain";
24545
+ s.backgroundRepeat = "no-repeat";
24546
+ break;
24547
+ case "cover":
24548
+ s.backgroundSize = "cover";
24549
+ s.backgroundRepeat = "no-repeat";
24550
+ break;
24551
+ case "stretch":
24552
+ s.backgroundSize = "100% 100%";
24553
+ s.backgroundRepeat = "no-repeat";
24554
+ break;
24555
+ case "repeat":
24556
+ s.backgroundSize = "auto";
24557
+ s.backgroundRepeat = "repeat";
24558
+ break;
24551
24559
  }
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";
24560
+ s.backgroundPosition = cfg.splashScreenPosition || "center center";
24561
+ s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24562
+ }
24563
+ else {
24564
+ // COLOR only
24565
+ s.backgroundImage = "none";
24566
+ s.backgroundRepeat = "no-repeat";
24567
+ s.backgroundPosition = "center center";
24568
+ s.backgroundSize = "auto";
24569
+ }
24570
+ }
24571
+ ensureSplashHost() {
24572
+ var _a, _b, _c, _d, _e, _f;
24573
+ 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;
24574
+ if (!el)
24575
+ return null;
24576
+ this._splashHost = el;
24577
+ // ensure stacking works
24578
+ if (getComputedStyle(this._splashHost).position === "static")
24579
+ this._splashHost.style.position = "relative";
24580
+ return this._splashHost;
24581
+ }
24582
+ destroySplashVideo() {
24583
+ if (this._splashVideo) {
24584
+ try {
24585
+ this._splashVideo.pause();
24586
+ }
24587
+ catch (_a) { }
24588
+ try {
24589
+ this._splashVideo.remove();
24590
+ }
24591
+ catch (_b) { }
24592
+ this._splashVideo = undefined;
24593
+ }
24594
+ }
24595
+ upsertSplashVideo(url, opts) {
24596
+ var _a, _b;
24597
+ const host = this.ensureSplashHost();
24598
+ if (!host)
24599
+ return;
24600
+ let v = this._splashVideo;
24601
+ if (!v) {
24602
+ v = document.createElement("video");
24603
+ v.playsInline = true;
24604
+ v.setAttribute("webkit-playsinline", "true");
24605
+ v.muted = true; // for autoplay
24606
+ v.autoplay = true;
24607
+ v.loop = true;
24608
+ v.style.position = "absolute";
24609
+ v.style.inset = "0";
24610
+ v.style.width = "100%";
24611
+ v.style.height = "100%";
24612
+ v.style.objectFit = "contain";
24613
+ v.style.objectPosition = "center center";
24614
+ v.style.pointerEvents = "none";
24615
+ v.style.zIndex = "0";
24616
+ host.appendChild(v);
24617
+ this._splashVideo = v;
24618
+ }
24619
+ v.src = url;
24620
+ v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
24621
+ v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
24622
+ if (opts.bgColor)
24623
+ host.style.setProperty("background-color", opts.bgColor, "important");
24624
+ v.style.display = "";
24625
+ v.play().catch(() => { });
24626
+ }
24627
+ hideSplashVideo() {
24628
+ if (this._splashVideo) {
24629
+ try {
24630
+ this._splashVideo.pause();
24558
24631
  }
24632
+ catch (_a) { }
24633
+ this._splashVideo.style.display = "none";
24559
24634
  }
24560
- catch (_r) { }
24635
+ }
24636
+ isVideoUrl(u) {
24637
+ if (!u)
24638
+ return false;
24639
+ const s = u.split("?")[0].toLowerCase();
24640
+ return (s.startsWith("blob:") ||
24641
+ s.endsWith(".mp4") ||
24642
+ s.endsWith(".webm") ||
24643
+ s.endsWith(".ogg") ||
24644
+ s.endsWith(".ogv") ||
24645
+ s.endsWith(".m3u8"));
24561
24646
  }
24562
24647
  }
24563
24648
 
package/index.umd.js CHANGED
@@ -23442,7 +23442,7 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23442
23442
  if (!config.initialSettings.ss)
23443
23443
  config.initialSettings.ss = exports.DefaultUrl;
23444
23444
  super(config);
23445
- this.VERSION = "1.3.16";
23445
+ this.VERSION = "1.3.18";
23446
23446
  this.whiteLabellingChanged = new EventHandler_1.EventHandler();
23447
23447
  this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
23448
23448
  console.log(config);
@@ -24061,34 +24061,38 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24061
24061
  }
24062
24062
  }
24063
24063
  runPostInitSideEffectsOnce() {
24064
- var _a, _b, _c, _d, _e, _f, _g;
24064
+ var _a, _b, _c, _d, _e, _f, _g, _h;
24065
24065
  if (this._postInitSideEffectsDone)
24066
24066
  return;
24067
24067
  this._postInitSideEffectsDone = true;
24068
24068
  try {
24069
24069
  (_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
24070
24070
  }
24071
- catch (_h) { }
24071
+ catch (_j) { }
24072
24072
  try {
24073
24073
  (_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
24074
24074
  }
24075
- catch (_j) { }
24075
+ catch (_k) { }
24076
24076
  try {
24077
24077
  (_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
24078
24078
  }
24079
- catch (_k) { }
24079
+ catch (_l) { }
24080
24080
  try {
24081
24081
  (_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
24082
24082
  }
24083
- catch (_l) { }
24083
+ catch (_m) { }
24084
24084
  try {
24085
24085
  (_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
24086
24086
  }
24087
- catch (_m) { }
24087
+ catch (_o) { }
24088
24088
  try {
24089
24089
  (_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
24090
24090
  }
24091
- catch (_o) { }
24091
+ catch (_p) { }
24092
+ try {
24093
+ (_h = this.hideSplashVideo) === null || _h === void 0 ? void 0 : _h.call(this);
24094
+ }
24095
+ catch (_q) { } // ← hide splash video when streaming
24092
24096
  }
24093
24097
  onVideoInitialized() {
24094
24098
  if (this.videoInitializedSent) {
@@ -24468,7 +24472,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24468
24472
  applyBrandingFromSettings() {
24469
24473
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
24470
24474
  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 : {});
24471
- // Loader image + fade
24475
+ // Loader
24472
24476
  try {
24473
24477
  if (this.logoLoader) {
24474
24478
  (_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
@@ -24476,68 +24480,149 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
24476
24480
  }
24477
24481
  }
24478
24482
  catch (_q) { }
24479
- // Pick splash host: loveLettersContainer (preferred) or player parent
24480
- try {
24481
- 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;
24482
- if (!el)
24483
- return;
24484
- const s = el.style;
24485
- // Nuke previous inline styles (longhands only; never touch 'background' shorthand here)
24486
- s.removeProperty("background-image");
24487
- s.removeProperty("background-size");
24488
- s.removeProperty("background-repeat");
24489
- s.removeProperty("background-position");
24490
- s.removeProperty("background-color");
24491
- // Also clear any earlier 'background' inline shorthand that might have been set elsewhere
24492
- // (we set to 'initial' first, then re-apply longhands)
24493
- s.setProperty("background", "initial");
24494
- el.classList.remove("aw-splash");
24495
- // If neither color nor image is provided, nothing to do
24496
- const haveColor = !!cfg.splashScreenBgColor;
24497
- const haveImage = !!cfg.splashScreenUrl;
24498
- if (!haveColor && !haveImage)
24499
- return;
24500
- // Always ensure our class is present when we brand
24501
- el.classList.add("aw-splash");
24502
- // Apply color with !important so external 'background: ... !important' can't wipe it
24503
- const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24504
- s.setProperty("background-color", bgColor, "important");
24505
- if (haveImage) {
24506
- // Mode size/repeat mapping
24507
- const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24508
- switch (mode) {
24509
- case "contain":
24510
- s.backgroundSize = "contain";
24511
- s.backgroundRepeat = "no-repeat";
24512
- break;
24513
- case "cover":
24514
- s.backgroundSize = "cover";
24515
- s.backgroundRepeat = "no-repeat";
24516
- break;
24517
- case "stretch":
24518
- s.backgroundSize = "100% 100%";
24519
- s.backgroundRepeat = "no-repeat";
24520
- break;
24521
- case "repeat":
24522
- s.backgroundSize = "auto"; // intrinsic
24523
- s.backgroundRepeat = "repeat";
24524
- break;
24525
- }
24526
- // Position
24527
- s.backgroundPosition = cfg.splashScreenPosition || "center center";
24528
- // Image last (longhand so it won't reset color)
24529
- // Use quotes to be safe with URLs containing parentheses/spaces
24530
- s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24483
+ 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;
24484
+ if (!host)
24485
+ return;
24486
+ const s = host.style;
24487
+ // Reset background longhands (never use shorthand to avoid nuking color)
24488
+ s.removeProperty("background-image");
24489
+ s.removeProperty("background-size");
24490
+ s.removeProperty("background-repeat");
24491
+ s.removeProperty("background-position");
24492
+ s.removeProperty("background-color");
24493
+ s.setProperty("background", "initial");
24494
+ host.classList.remove("aw-splash");
24495
+ // Clear any previous splash video unless re-used below
24496
+ this.destroySplashVideo();
24497
+ const haveUrl = !!cfg.splashScreenUrl;
24498
+ const haveColor = !!cfg.splashScreenBgColor;
24499
+ // Nothing to apply?
24500
+ if (!haveUrl && !haveColor)
24501
+ return;
24502
+ host.classList.add("aw-splash");
24503
+ // Always apply color (visible behind image/video / letterboxing)
24504
+ const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
24505
+ s.setProperty("background-color", bgColor, "important");
24506
+ // Decide: video or image from the same URL
24507
+ const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
24508
+ if (haveUrl && isVideo) {
24509
+ // map splashScreenMode to object-fit
24510
+ const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
24511
+ const pos = cfg.splashScreenPosition || "center center";
24512
+ this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
24513
+ // keep background image cleared to avoid layering
24514
+ s.backgroundImage = "none";
24515
+ s.backgroundRepeat = "no-repeat";
24516
+ s.backgroundPosition = "center center";
24517
+ s.backgroundSize = "auto";
24518
+ }
24519
+ else if (haveUrl) {
24520
+ // IMAGE path
24521
+ const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
24522
+ switch (mode) {
24523
+ case "contain":
24524
+ s.backgroundSize = "contain";
24525
+ s.backgroundRepeat = "no-repeat";
24526
+ break;
24527
+ case "cover":
24528
+ s.backgroundSize = "cover";
24529
+ s.backgroundRepeat = "no-repeat";
24530
+ break;
24531
+ case "stretch":
24532
+ s.backgroundSize = "100% 100%";
24533
+ s.backgroundRepeat = "no-repeat";
24534
+ break;
24535
+ case "repeat":
24536
+ s.backgroundSize = "auto";
24537
+ s.backgroundRepeat = "repeat";
24538
+ break;
24531
24539
  }
24532
- else {
24533
- // No image → ensure any previous image is cleared
24534
- s.backgroundImage = "none";
24535
- s.backgroundRepeat = "no-repeat";
24536
- s.backgroundPosition = "center center";
24537
- s.backgroundSize = "auto";
24540
+ s.backgroundPosition = cfg.splashScreenPosition || "center center";
24541
+ s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
24542
+ }
24543
+ else {
24544
+ // COLOR only
24545
+ s.backgroundImage = "none";
24546
+ s.backgroundRepeat = "no-repeat";
24547
+ s.backgroundPosition = "center center";
24548
+ s.backgroundSize = "auto";
24549
+ }
24550
+ }
24551
+ ensureSplashHost() {
24552
+ var _a, _b, _c, _d, _e, _f;
24553
+ 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;
24554
+ if (!el)
24555
+ return null;
24556
+ this._splashHost = el;
24557
+ // ensure stacking works
24558
+ if (getComputedStyle(this._splashHost).position === "static")
24559
+ this._splashHost.style.position = "relative";
24560
+ return this._splashHost;
24561
+ }
24562
+ destroySplashVideo() {
24563
+ if (this._splashVideo) {
24564
+ try {
24565
+ this._splashVideo.pause();
24566
+ }
24567
+ catch (_a) { }
24568
+ try {
24569
+ this._splashVideo.remove();
24570
+ }
24571
+ catch (_b) { }
24572
+ this._splashVideo = undefined;
24573
+ }
24574
+ }
24575
+ upsertSplashVideo(url, opts) {
24576
+ var _a, _b;
24577
+ const host = this.ensureSplashHost();
24578
+ if (!host)
24579
+ return;
24580
+ let v = this._splashVideo;
24581
+ if (!v) {
24582
+ v = document.createElement("video");
24583
+ v.playsInline = true;
24584
+ v.setAttribute("webkit-playsinline", "true");
24585
+ v.muted = true; // for autoplay
24586
+ v.autoplay = true;
24587
+ v.loop = true;
24588
+ v.style.position = "absolute";
24589
+ v.style.inset = "0";
24590
+ v.style.width = "100%";
24591
+ v.style.height = "100%";
24592
+ v.style.objectFit = "contain";
24593
+ v.style.objectPosition = "center center";
24594
+ v.style.pointerEvents = "none";
24595
+ v.style.zIndex = "0";
24596
+ host.appendChild(v);
24597
+ this._splashVideo = v;
24598
+ }
24599
+ v.src = url;
24600
+ v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
24601
+ v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
24602
+ if (opts.bgColor)
24603
+ host.style.setProperty("background-color", opts.bgColor, "important");
24604
+ v.style.display = "";
24605
+ v.play().catch(() => { });
24606
+ }
24607
+ hideSplashVideo() {
24608
+ if (this._splashVideo) {
24609
+ try {
24610
+ this._splashVideo.pause();
24538
24611
  }
24612
+ catch (_a) { }
24613
+ this._splashVideo.style.display = "none";
24539
24614
  }
24540
- catch (_r) { }
24615
+ }
24616
+ isVideoUrl(u) {
24617
+ if (!u)
24618
+ return false;
24619
+ const s = u.split("?")[0].toLowerCase();
24620
+ return (s.startsWith("blob:") ||
24621
+ s.endsWith(".mp4") ||
24622
+ s.endsWith(".webm") ||
24623
+ s.endsWith(".ogg") ||
24624
+ s.endsWith(".ogv") ||
24625
+ s.endsWith(".m3u8"));
24541
24626
  }
24542
24627
  }
24543
24628
  exports.ArcwarePixelStreaming = ArcwarePixelStreaming;
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.16",
4
+ "version": "1.3.18",
5
5
  "type": "commonjs",
6
6
  "main": "./index.umd.js",
7
7
  "module": "./index.umd.js",
@@ -29,7 +29,7 @@ export declare class ArcwareConfig extends Config {
29
29
  readonly session: Session;
30
30
  readonly settings: Settings;
31
31
  private _initialSettings;
32
- readonly VERSION = "1.3.16";
32
+ readonly VERSION = "1.3.18";
33
33
  readonly whiteLabellingChanged: EventHandler<{
34
34
  loadingIconUrl?: string;
35
35
  loadingIconFadeMs?: number;
@@ -18,6 +18,8 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
18
18
  private isProcessingQueue;
19
19
  private microphoneOverlay;
20
20
  private diagnosticsCollector;
21
+ private _splashHost?;
22
+ private _splashVideo?;
21
23
  private outbox;
22
24
  private videoInitializedSent;
23
25
  private _boundTransport?;
@@ -128,5 +130,10 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
128
130
  private removeXRIconIfDisabled;
129
131
  private injectCustomUI;
130
132
  private applyBrandingFromSettings;
133
+ private ensureSplashHost;
134
+ private destroySplashVideo;
135
+ private upsertSplashVideo;
136
+ private hideSplashVideo;
137
+ private isVideoUrl;
131
138
  }
132
139
  export {};