@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 +10 -0
- package/index.cjs.js +230 -124
- package/index.esm.js +230 -124
- package/index.umd.js +230 -124
- package/package.json +6 -5
- package/types/lib/ArcwareApplication.d.ts +2 -0
- package/types/lib/ArcwareConfig.d.ts +3 -7
- package/types/lib/ArcwarePixelStreaming.d.ts +8 -1
- package/types/lib/domain/ArcwareSettingsSchema.d.ts +13 -0
- package/types/lib/features/ZWhiteLabel.d.ts +6 -0
package/index.umd.js
CHANGED
|
@@ -22973,6 +22973,13 @@ class ArcwareApplication extends lib_pixelstreamingfrontend_ui_ue5_5_1.Applicati
|
|
|
22973
22973
|
this.fileDownloadCallback = null;
|
|
22974
22974
|
this.ArcwareSection = this.configUI.buildSectionWithHeading(this.settingsPanel.settingsContentElement, "Arcware Cloud");
|
|
22975
22975
|
this.stream = options === null || options === void 0 ? void 0 : options.stream;
|
|
22976
|
+
this.baseShowAfkOverlay = this.showAfkOverlay.bind(this); // capture original
|
|
22977
|
+
this.stream.config.whiteLabellingChanged.add(() => {
|
|
22978
|
+
try {
|
|
22979
|
+
this.syncAfkOverlayFromWhiteLabelling();
|
|
22980
|
+
}
|
|
22981
|
+
catch (_a) { }
|
|
22982
|
+
});
|
|
22976
22983
|
this.emitUIInteraction = this.emitUIInteraction.bind(this);
|
|
22977
22984
|
this.adjustSettingsPanel();
|
|
22978
22985
|
this.createAudioToggleButton();
|
|
@@ -23014,6 +23021,7 @@ class ArcwareApplication extends lib_pixelstreamingfrontend_ui_ue5_5_1.Applicati
|
|
|
23014
23021
|
this.preventDefaultKeyboardEvents();
|
|
23015
23022
|
this.analyticsEventCallback = this.analyticsEvent;
|
|
23016
23023
|
this.fileDownloadCallback = this.fileDownload;
|
|
23024
|
+
this.syncAfkOverlayFromWhiteLabelling();
|
|
23017
23025
|
}
|
|
23018
23026
|
addLoveLetterhandler() {
|
|
23019
23027
|
var _a, _b;
|
|
@@ -23346,6 +23354,18 @@ class ArcwareApplication extends lib_pixelstreamingfrontend_ui_ue5_5_1.Applicati
|
|
|
23346
23354
|
console.error("Download failed:", err);
|
|
23347
23355
|
}
|
|
23348
23356
|
}
|
|
23357
|
+
syncAfkOverlayFromWhiteLabelling() {
|
|
23358
|
+
var _a;
|
|
23359
|
+
const hide = (_a = this.stream.config.settings.whiteLabelling) === null || _a === void 0 ? void 0 : _a.hideAfkOverlay;
|
|
23360
|
+
if (hide) {
|
|
23361
|
+
// override with noop
|
|
23362
|
+
this.showAfkOverlay = (_countDown, _dismissAfk) => { };
|
|
23363
|
+
}
|
|
23364
|
+
else {
|
|
23365
|
+
// restore original behavior
|
|
23366
|
+
this.showAfkOverlay = this.baseShowAfkOverlay;
|
|
23367
|
+
}
|
|
23368
|
+
}
|
|
23349
23369
|
}
|
|
23350
23370
|
ArcwareApplication.Flags = (_a = class {
|
|
23351
23371
|
},
|
|
@@ -23442,10 +23462,9 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
|
|
|
23442
23462
|
if (!config.initialSettings.ss)
|
|
23443
23463
|
config.initialSettings.ss = exports.DefaultUrl;
|
|
23444
23464
|
super(config);
|
|
23445
|
-
this.VERSION = "1.3.
|
|
23465
|
+
this.VERSION = "1.3.19";
|
|
23446
23466
|
this.whiteLabellingChanged = new EventHandler_1.EventHandler();
|
|
23447
23467
|
this.signallingWlURL = "https://signalling-client.arcware.cloud/whiteLabel/";
|
|
23448
|
-
console.log(config);
|
|
23449
23468
|
if (config.envName) {
|
|
23450
23469
|
this.signallingWlURL = `https://signalling-client.${config.envName}.arcware.cloud/whiteLabel/`;
|
|
23451
23470
|
}
|
|
@@ -23506,10 +23525,8 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
|
|
|
23506
23525
|
// Only apply & emit if it actually changed
|
|
23507
23526
|
const prev = this.settings.whiteLabelling;
|
|
23508
23527
|
const next = parsed.data;
|
|
23509
|
-
|
|
23510
|
-
|
|
23511
|
-
EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, next);
|
|
23512
|
-
}
|
|
23528
|
+
this.settings.whiteLabelling = next;
|
|
23529
|
+
EventHandler_1.EventHandler.Emit(this.whiteLabellingChanged, { next, changed: !deepEqual(prev, next) });
|
|
23513
23530
|
return parsed.data;
|
|
23514
23531
|
}
|
|
23515
23532
|
catch (_b) {
|
|
@@ -23633,8 +23650,10 @@ function ArcwareInit({ shareId, projectId }, configuration, forceRefresh = false
|
|
|
23633
23650
|
loadingIconUrl: undefined,
|
|
23634
23651
|
splashScreenMode: undefined,
|
|
23635
23652
|
splashScreenPosition: undefined,
|
|
23636
|
-
splashScreenBgColor: undefined
|
|
23637
|
-
|
|
23653
|
+
splashScreenBgColor: undefined,
|
|
23654
|
+
hideLoveLetters: undefined,
|
|
23655
|
+
hideAfkOverlay: undefined
|
|
23656
|
+
}, fetchRemoteWhiteLabelling: undefined }, configuration === null || configuration === void 0 ? void 0 : configuration.settings),
|
|
23638
23657
|
envName: (_a = configuration === null || configuration === void 0 ? void 0 : configuration.envName) !== null && _a !== void 0 ? _a : undefined
|
|
23639
23658
|
});
|
|
23640
23659
|
const PixelStreaming = new ArcwarePixelStreaming_1.ArcwarePixelStreaming(Config);
|
|
@@ -23702,23 +23721,20 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23702
23721
|
return true;
|
|
23703
23722
|
}
|
|
23704
23723
|
bindTransportEvents() {
|
|
23705
|
-
var _a, _b, _c, _d
|
|
23724
|
+
var _a, _b, _c, _d;
|
|
23706
23725
|
const current = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.transport;
|
|
23707
23726
|
if (!current || current === this._boundTransport)
|
|
23708
23727
|
return;
|
|
23709
|
-
// Unbind
|
|
23728
|
+
// Unbind previous
|
|
23710
23729
|
if (this._boundTransport) {
|
|
23711
23730
|
if (this._onWsOpen)
|
|
23712
23731
|
(_c = (_b = this._boundTransport).removeEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "open", this._onWsOpen);
|
|
23713
|
-
|
|
23714
|
-
(_e = (_d = this._boundTransport).removeEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "close", this._onWsClose);
|
|
23732
|
+
// ⚠️ this was the synthetic "close" before, we'll stop relying on it
|
|
23715
23733
|
}
|
|
23716
|
-
// Define (or reuse) callbacks
|
|
23717
23734
|
if (!this._onWsOpen) {
|
|
23718
23735
|
this._onWsOpen = () => {
|
|
23719
23736
|
this.flushOutbox();
|
|
23720
23737
|
this.attachFirstRenderedFrameOnce();
|
|
23721
|
-
// no watchdog anymore
|
|
23722
23738
|
setTimeout(() => {
|
|
23723
23739
|
var _a, _b, _c;
|
|
23724
23740
|
if (!this.videoInitializedSent) {
|
|
@@ -23731,15 +23747,15 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23731
23747
|
}, 1200);
|
|
23732
23748
|
};
|
|
23733
23749
|
}
|
|
23734
|
-
|
|
23750
|
+
(_d = current.addEventListener) === null || _d === void 0 ? void 0 : _d.call(current, "open", this._onWsOpen);
|
|
23751
|
+
// Real CloseEvent from underlying WebSocket
|
|
23752
|
+
const ws = current.webSocket;
|
|
23753
|
+
if (ws && !this._onWsClose) {
|
|
23735
23754
|
this._onWsClose = (evt) => {
|
|
23736
|
-
// Bubble to your public close handler
|
|
23737
23755
|
EventHandler_1.EventHandler.Emit(this.websocketOnCloseHandler, evt);
|
|
23738
23756
|
};
|
|
23757
|
+
ws.addEventListener("close", this._onWsClose);
|
|
23739
23758
|
}
|
|
23740
|
-
// Bind to current
|
|
23741
|
-
(_f = current.addEventListener) === null || _f === void 0 ? void 0 : _f.call(current, "open", this._onWsOpen);
|
|
23742
|
-
(_g = current.addEventListener) === null || _g === void 0 ? void 0 : _g.call(current, "close", this._onWsClose);
|
|
23743
23759
|
this._boundTransport = current;
|
|
23744
23760
|
}
|
|
23745
23761
|
get isWsOpen() {
|
|
@@ -23762,7 +23778,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23762
23778
|
return state !== undefined ? state : WebSocket.CLOSED;
|
|
23763
23779
|
}
|
|
23764
23780
|
constructor(config, overrides) {
|
|
23765
|
-
var _a, _b
|
|
23781
|
+
var _a, _b;
|
|
23766
23782
|
/** As soon as upstream is fixed, we got to adjust the url building process. */
|
|
23767
23783
|
(0, ApplyUrlHack_1.ApplyUrlHack)();
|
|
23768
23784
|
super(config, overrides);
|
|
@@ -23796,39 +23812,44 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23796
23812
|
this.flushOutbox();
|
|
23797
23813
|
// no polling watchdog
|
|
23798
23814
|
});
|
|
23799
|
-
(_c = transport === null || transport === void 0 ? void 0 : transport.addEventListener) === null || _c === void 0 ? void 0 : _c.call(transport, "close", (evt) => {
|
|
23800
|
-
if (this.websocketOnCloseHandler) {
|
|
23801
|
-
EventHandler_1.EventHandler.Emit(this.websocketOnCloseHandler, evt);
|
|
23802
|
-
}
|
|
23803
|
-
});
|
|
23804
23815
|
// Set override config.
|
|
23805
23816
|
this.config = config;
|
|
23806
23817
|
// Re-apply branding whenever config's WL changes
|
|
23807
|
-
this.config.whiteLabellingChanged.add(() => {
|
|
23818
|
+
this.config.whiteLabellingChanged.add((result) => {
|
|
23819
|
+
var _a;
|
|
23808
23820
|
try {
|
|
23809
|
-
|
|
23821
|
+
if (result.changed)
|
|
23822
|
+
this.applyBrandingFromSettings();
|
|
23823
|
+
this.config.settings.fetchRemoteWhiteLabelling = false;
|
|
23824
|
+
if (!((_a = this.config.settings.whiteLabelling) === null || _a === void 0 ? void 0 : _a.hideLoveLetters)) {
|
|
23825
|
+
if (!this.isProcessingQueue) {
|
|
23826
|
+
this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
|
|
23827
|
+
}
|
|
23828
|
+
}
|
|
23810
23829
|
}
|
|
23811
|
-
catch (
|
|
23830
|
+
catch (_b) { }
|
|
23812
23831
|
});
|
|
23813
23832
|
// Kick off WL fetch once (if we have a shareId); on success it will emit and re-apply
|
|
23814
|
-
|
|
23815
|
-
|
|
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
|
|
23833
|
+
if (this.config.settings.fetchRemoteWhiteLabelling) {
|
|
23834
|
+
(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23826
23835
|
try {
|
|
23827
|
-
this.
|
|
23836
|
+
const sid = this.config.settings.shareId;
|
|
23837
|
+
if (sid) {
|
|
23838
|
+
yield this.config.getWhiteLabelling(sid); // will emit if it changes
|
|
23839
|
+
}
|
|
23828
23840
|
}
|
|
23829
|
-
catch (
|
|
23830
|
-
|
|
23831
|
-
|
|
23841
|
+
catch (_c) {
|
|
23842
|
+
// ignore
|
|
23843
|
+
}
|
|
23844
|
+
finally {
|
|
23845
|
+
// Make sure we paint with whatever we have initially
|
|
23846
|
+
try {
|
|
23847
|
+
this.applyBrandingFromSettings();
|
|
23848
|
+
}
|
|
23849
|
+
catch (_d) { }
|
|
23850
|
+
}
|
|
23851
|
+
}))();
|
|
23852
|
+
}
|
|
23832
23853
|
this.loveLettersList = [];
|
|
23833
23854
|
this.microphoneOverlay = new MicrophoneOverlay_1.MicrophoneOverlay(this);
|
|
23834
23855
|
this.diagnosticsCollector = new DiagnosticsCollector_1.DiagnosticsCollector({
|
|
@@ -23840,7 +23861,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
23840
23861
|
// Arm first-frame detector & watch for element swaps
|
|
23841
23862
|
this.attachFirstRenderedFrameOnce();
|
|
23842
23863
|
this.watchVideoElementReplacement();
|
|
23843
|
-
this.wrapWebSocketOnCloseHandler();
|
|
23844
23864
|
// Bind the event listener function to the class instance
|
|
23845
23865
|
this.handleResolutionChange = this.handleResolutionChange.bind(this);
|
|
23846
23866
|
// Register message handlers.
|
|
@@ -24061,34 +24081,38 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24061
24081
|
}
|
|
24062
24082
|
}
|
|
24063
24083
|
runPostInitSideEffectsOnce() {
|
|
24064
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
24084
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
24065
24085
|
if (this._postInitSideEffectsDone)
|
|
24066
24086
|
return;
|
|
24067
24087
|
this._postInitSideEffectsDone = true;
|
|
24068
24088
|
try {
|
|
24069
24089
|
(_a = this.handleMouseLock) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
24070
24090
|
}
|
|
24071
|
-
catch (
|
|
24091
|
+
catch (_j) { }
|
|
24072
24092
|
try {
|
|
24073
24093
|
(_b = this.handleResolutionChange) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
24074
24094
|
}
|
|
24075
|
-
catch (
|
|
24095
|
+
catch (_k) { }
|
|
24076
24096
|
try {
|
|
24077
24097
|
(_c = this.handleRemoveLoveLetters) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
24078
24098
|
}
|
|
24079
|
-
catch (
|
|
24099
|
+
catch (_l) { }
|
|
24080
24100
|
try {
|
|
24081
24101
|
(_e = (_d = this.microphoneOverlay) === null || _d === void 0 ? void 0 : _d.toggleVisibility) === null || _e === void 0 ? void 0 : _e.call(_d, false);
|
|
24082
24102
|
}
|
|
24083
|
-
catch (
|
|
24103
|
+
catch (_m) { }
|
|
24084
24104
|
try {
|
|
24085
24105
|
(_f = this.applyResolutionIfPlaying) === null || _f === void 0 ? void 0 : _f.call(this);
|
|
24086
24106
|
}
|
|
24087
|
-
catch (
|
|
24107
|
+
catch (_o) { }
|
|
24088
24108
|
try {
|
|
24089
24109
|
(_g = this.removeXRIconIfDisabled) === null || _g === void 0 ? void 0 : _g.call(this);
|
|
24090
24110
|
}
|
|
24091
|
-
catch (
|
|
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
|
|
24092
24116
|
}
|
|
24093
24117
|
onVideoInitialized() {
|
|
24094
24118
|
if (this.videoInitializedSent) {
|
|
@@ -24355,10 +24379,12 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24355
24379
|
}
|
|
24356
24380
|
}
|
|
24357
24381
|
pushLetter(letter) {
|
|
24358
|
-
var _a;
|
|
24382
|
+
var _a, _b;
|
|
24359
24383
|
(_a = this === null || this === void 0 ? void 0 : this.loveLettersQueue) === null || _a === void 0 ? void 0 : _a.push(letter);
|
|
24360
|
-
if (!this.
|
|
24361
|
-
|
|
24384
|
+
if (!((_b = this.config.settings.whiteLabelling) === null || _b === void 0 ? void 0 : _b.hideLoveLetters) && !this.config.settings.fetchRemoteWhiteLabelling) {
|
|
24385
|
+
if (!this.isProcessingQueue) {
|
|
24386
|
+
this === null || this === void 0 ? void 0 : this.processLoveLetterQueue();
|
|
24387
|
+
}
|
|
24362
24388
|
}
|
|
24363
24389
|
}
|
|
24364
24390
|
processLoveLetterQueue() {
|
|
@@ -24424,13 +24450,6 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24424
24450
|
}, 1000);
|
|
24425
24451
|
}
|
|
24426
24452
|
}
|
|
24427
|
-
wrapWebSocketOnCloseHandler() {
|
|
24428
|
-
var _a, _b;
|
|
24429
|
-
let self = this;
|
|
24430
|
-
(_b = (_a = this.webRtcController) === null || _a === void 0 ? void 0 : _a.transport) === null || _b === void 0 ? void 0 : _b.addEventListener("close", (event) => {
|
|
24431
|
-
EventHandler_1.EventHandler.Emit(self.websocketOnCloseHandler, event);
|
|
24432
|
-
});
|
|
24433
|
-
}
|
|
24434
24453
|
onStreamingStateChange(callback) {
|
|
24435
24454
|
var _a, _b, _c, _d;
|
|
24436
24455
|
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();
|
|
@@ -24468,7 +24487,7 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24468
24487
|
applyBrandingFromSettings() {
|
|
24469
24488
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
24470
24489
|
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
|
|
24490
|
+
// Loader
|
|
24472
24491
|
try {
|
|
24473
24492
|
if (this.logoLoader) {
|
|
24474
24493
|
(_d = (_c = this.logoLoader).setImage) === null || _d === void 0 ? void 0 : _d.call(_c, cfg.loadingIconUrl);
|
|
@@ -24476,68 +24495,152 @@ class ArcwarePixelStreaming extends lib_pixelstreamingfrontend_ue5_5_1.PixelStre
|
|
|
24476
24495
|
}
|
|
24477
24496
|
}
|
|
24478
24497
|
catch (_q) { }
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
|
|
24499
|
-
|
|
24500
|
-
|
|
24501
|
-
|
|
24502
|
-
|
|
24503
|
-
|
|
24504
|
-
|
|
24505
|
-
|
|
24506
|
-
|
|
24507
|
-
|
|
24508
|
-
|
|
24509
|
-
|
|
24510
|
-
|
|
24511
|
-
|
|
24512
|
-
|
|
24513
|
-
|
|
24514
|
-
|
|
24515
|
-
|
|
24516
|
-
|
|
24517
|
-
|
|
24518
|
-
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24524
|
-
|
|
24525
|
-
|
|
24526
|
-
|
|
24527
|
-
|
|
24528
|
-
|
|
24529
|
-
|
|
24530
|
-
|
|
24498
|
+
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;
|
|
24499
|
+
if (!host)
|
|
24500
|
+
return;
|
|
24501
|
+
const s = host.style;
|
|
24502
|
+
// Reset background longhands (never use shorthand to avoid nuking color)
|
|
24503
|
+
s.removeProperty("background-image");
|
|
24504
|
+
s.removeProperty("background-size");
|
|
24505
|
+
s.removeProperty("background-repeat");
|
|
24506
|
+
s.removeProperty("background-position");
|
|
24507
|
+
s.removeProperty("background-color");
|
|
24508
|
+
s.setProperty("background", "initial");
|
|
24509
|
+
host.classList.remove("aw-splash");
|
|
24510
|
+
// Clear any previous splash video unless re-used below
|
|
24511
|
+
this.destroySplashVideo();
|
|
24512
|
+
const haveUrl = !!cfg.splashScreenUrl;
|
|
24513
|
+
const haveColor = !!cfg.splashScreenBgColor;
|
|
24514
|
+
// Nothing to apply?
|
|
24515
|
+
if (!haveUrl && !haveColor)
|
|
24516
|
+
return;
|
|
24517
|
+
host.classList.add("aw-splash");
|
|
24518
|
+
// Always apply color (visible behind image/video / letterboxing)
|
|
24519
|
+
const bgColor = (_o = cfg.splashScreenBgColor) !== null && _o !== void 0 ? _o : "var(--color0)";
|
|
24520
|
+
s.setProperty("background-color", bgColor, "important");
|
|
24521
|
+
// Decide: video or image from the same URL
|
|
24522
|
+
const isVideo = this.isVideoUrl(cfg.splashScreenUrl);
|
|
24523
|
+
if (haveUrl && isVideo) {
|
|
24524
|
+
// map splashScreenMode to object-fit
|
|
24525
|
+
const fit = cfg.splashScreenMode === "cover" ? "cover" : cfg.splashScreenMode === "stretch" ? "fill" : "contain";
|
|
24526
|
+
const pos = cfg.splashScreenPosition || "center center";
|
|
24527
|
+
this.upsertSplashVideo(cfg.splashScreenUrl, { fit, position: pos, bgColor });
|
|
24528
|
+
// keep background image cleared to avoid layering
|
|
24529
|
+
s.backgroundImage = "none";
|
|
24530
|
+
s.backgroundRepeat = "no-repeat";
|
|
24531
|
+
s.backgroundPosition = "center center";
|
|
24532
|
+
s.backgroundSize = "auto";
|
|
24533
|
+
}
|
|
24534
|
+
else if (haveUrl) {
|
|
24535
|
+
// IMAGE path
|
|
24536
|
+
const mode = ((_p = cfg.splashScreenMode) !== null && _p !== void 0 ? _p : "contain");
|
|
24537
|
+
switch (mode) {
|
|
24538
|
+
case "contain":
|
|
24539
|
+
s.backgroundSize = "contain";
|
|
24540
|
+
s.backgroundRepeat = "no-repeat";
|
|
24541
|
+
break;
|
|
24542
|
+
case "cover":
|
|
24543
|
+
s.backgroundSize = "cover";
|
|
24544
|
+
s.backgroundRepeat = "no-repeat";
|
|
24545
|
+
break;
|
|
24546
|
+
case "stretch":
|
|
24547
|
+
s.backgroundSize = "100% 100%";
|
|
24548
|
+
s.backgroundRepeat = "no-repeat";
|
|
24549
|
+
break;
|
|
24550
|
+
case "repeat":
|
|
24551
|
+
s.backgroundSize = "auto";
|
|
24552
|
+
s.backgroundRepeat = "repeat";
|
|
24553
|
+
break;
|
|
24531
24554
|
}
|
|
24532
|
-
|
|
24533
|
-
|
|
24534
|
-
|
|
24535
|
-
|
|
24536
|
-
|
|
24537
|
-
|
|
24555
|
+
s.backgroundPosition = cfg.splashScreenPosition || "center center";
|
|
24556
|
+
s.backgroundImage = `url("${cfg.splashScreenUrl}")`;
|
|
24557
|
+
}
|
|
24558
|
+
else {
|
|
24559
|
+
// COLOR only
|
|
24560
|
+
s.backgroundImage = "none";
|
|
24561
|
+
s.backgroundRepeat = "no-repeat";
|
|
24562
|
+
s.backgroundPosition = "center center";
|
|
24563
|
+
s.backgroundSize = "auto";
|
|
24564
|
+
}
|
|
24565
|
+
}
|
|
24566
|
+
ensureSplashHost() {
|
|
24567
|
+
var _a, _b, _c, _d, _e, _f;
|
|
24568
|
+
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;
|
|
24569
|
+
if (!el)
|
|
24570
|
+
return null;
|
|
24571
|
+
this._splashHost = el;
|
|
24572
|
+
// ensure stacking works
|
|
24573
|
+
if (getComputedStyle(this._splashHost).position === "static")
|
|
24574
|
+
this._splashHost.style.position = "relative";
|
|
24575
|
+
return this._splashHost;
|
|
24576
|
+
}
|
|
24577
|
+
destroySplashVideo() {
|
|
24578
|
+
if (this._splashVideo) {
|
|
24579
|
+
try {
|
|
24580
|
+
this._splashVideo.pause();
|
|
24581
|
+
}
|
|
24582
|
+
catch (_a) { }
|
|
24583
|
+
try {
|
|
24584
|
+
this._splashVideo.remove();
|
|
24538
24585
|
}
|
|
24586
|
+
catch (_b) { }
|
|
24587
|
+
this._splashVideo = undefined;
|
|
24539
24588
|
}
|
|
24540
|
-
|
|
24589
|
+
}
|
|
24590
|
+
upsertSplashVideo(url, opts) {
|
|
24591
|
+
var _a, _b;
|
|
24592
|
+
const host = this.ensureSplashHost();
|
|
24593
|
+
if (!host)
|
|
24594
|
+
return;
|
|
24595
|
+
let v = this._splashVideo;
|
|
24596
|
+
if (!v) {
|
|
24597
|
+
v = document.createElement("video");
|
|
24598
|
+
v.playsInline = true;
|
|
24599
|
+
v.setAttribute("webkit-playsinline", "true");
|
|
24600
|
+
v.muted = true; // for autoplay
|
|
24601
|
+
v.autoplay = true;
|
|
24602
|
+
v.loop = true;
|
|
24603
|
+
v.style.position = "absolute";
|
|
24604
|
+
v.style.inset = "0";
|
|
24605
|
+
v.style.width = "100%";
|
|
24606
|
+
v.style.height = "100%";
|
|
24607
|
+
v.style.objectFit = "contain";
|
|
24608
|
+
v.style.objectPosition = "center center";
|
|
24609
|
+
v.style.pointerEvents = "none";
|
|
24610
|
+
v.style.zIndex = "0";
|
|
24611
|
+
host.appendChild(v);
|
|
24612
|
+
this._splashVideo = v;
|
|
24613
|
+
}
|
|
24614
|
+
v.src = url;
|
|
24615
|
+
v.style.objectFit = (_a = opts.fit) !== null && _a !== void 0 ? _a : "contain";
|
|
24616
|
+
v.style.objectPosition = (_b = opts.position) !== null && _b !== void 0 ? _b : "center center";
|
|
24617
|
+
if (opts.bgColor)
|
|
24618
|
+
host.style.setProperty("background-color", opts.bgColor, "important");
|
|
24619
|
+
v.style.display = "";
|
|
24620
|
+
v.play().catch(() => { });
|
|
24621
|
+
}
|
|
24622
|
+
hideSplashVideo() {
|
|
24623
|
+
if (this._splashVideo) {
|
|
24624
|
+
try {
|
|
24625
|
+
this._splashVideo.pause();
|
|
24626
|
+
}
|
|
24627
|
+
catch (_a) { }
|
|
24628
|
+
this._splashVideo.style.display = "none";
|
|
24629
|
+
}
|
|
24630
|
+
}
|
|
24631
|
+
isVideoUrl(u) {
|
|
24632
|
+
if (!u)
|
|
24633
|
+
return false;
|
|
24634
|
+
const s = u.split("?")[0].toLowerCase();
|
|
24635
|
+
return (s.startsWith("blob:") ||
|
|
24636
|
+
s.endsWith(".mp4") ||
|
|
24637
|
+
s.endsWith(".webm") ||
|
|
24638
|
+
s.endsWith(".ogg") ||
|
|
24639
|
+
s.endsWith(".ogv") ||
|
|
24640
|
+
s.endsWith(".m3u8"));
|
|
24641
|
+
}
|
|
24642
|
+
static clearSessionId() {
|
|
24643
|
+
window.localStorage.removeItem("pxss"); // or your actual key
|
|
24541
24644
|
}
|
|
24542
24645
|
}
|
|
24543
24646
|
exports.ArcwarePixelStreaming = ArcwarePixelStreaming;
|
|
@@ -24612,7 +24715,8 @@ exports.ArcwareSettingsSchema = zod_1.z.object({
|
|
|
24612
24715
|
.strict()
|
|
24613
24716
|
.optional(),
|
|
24614
24717
|
/** Loader customization */
|
|
24615
|
-
whiteLabelling: ZWhiteLabel_1.ZWhiteLabel.optional()
|
|
24718
|
+
whiteLabelling: ZWhiteLabel_1.ZWhiteLabel.optional(),
|
|
24719
|
+
fetchRemoteWhiteLabelling: zod_1.z.boolean().optional()
|
|
24616
24720
|
});
|
|
24617
24721
|
|
|
24618
24722
|
|
|
@@ -25432,7 +25536,9 @@ exports.ZWhiteLabel = zod_1.z
|
|
|
25432
25536
|
splashScreenUrl: ImageUrl.optional(),
|
|
25433
25537
|
splashScreenMode: zod_1.z.enum(["contain", "cover", "stretch", "repeat"]).optional(),
|
|
25434
25538
|
splashScreenPosition: zod_1.z.string().optional(),
|
|
25435
|
-
splashScreenBgColor: zod_1.z.string().optional()
|
|
25539
|
+
splashScreenBgColor: zod_1.z.string().optional(),
|
|
25540
|
+
hideLoveLetters: zod_1.z.boolean().optional(),
|
|
25541
|
+
hideAfkOverlay: zod_1.z.boolean().optional()
|
|
25436
25542
|
})
|
|
25437
25543
|
.strict();
|
|
25438
25544
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
4
|
+
"version": "1.3.19",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./index.umd.js",
|
|
7
|
-
"module": "./index.
|
|
7
|
+
"module": "./index.esm.js",
|
|
8
8
|
"types": "./types/index.d.ts",
|
|
9
9
|
"keywords": [
|
|
10
10
|
"arcware",
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@epicgames-ps/lib-pixelstreamingcommon-ue5.5": "^0.3.
|
|
24
|
-
"@epicgames-ps/lib-pixelstreamingfrontend-ue5.5": "^1.2.
|
|
25
|
-
"@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.5": "^1.3.1"
|
|
23
|
+
"@epicgames-ps/lib-pixelstreamingcommon-ue5.5": "^0.3.2",
|
|
24
|
+
"@epicgames-ps/lib-pixelstreamingfrontend-ue5.5": "^1.2.4",
|
|
25
|
+
"@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.5": "^1.3.1",
|
|
26
|
+
"zod": "^3.21.4"
|
|
26
27
|
}
|
|
27
28
|
}
|
|
@@ -5,6 +5,7 @@ export declare class ArcwareApplication extends Application {
|
|
|
5
5
|
new (): {};
|
|
6
6
|
noSession: "noSession";
|
|
7
7
|
};
|
|
8
|
+
private baseShowAfkOverlay;
|
|
8
9
|
stream: ArcwarePixelStreaming;
|
|
9
10
|
private videoElementParent;
|
|
10
11
|
private parentElement;
|
|
@@ -49,4 +50,5 @@ export declare class ArcwareApplication extends Application {
|
|
|
49
50
|
private addTextToConnectOverlay;
|
|
50
51
|
analyticsEvent(response: unknown): void;
|
|
51
52
|
private fileDownload;
|
|
53
|
+
private syncAfkOverlayFromWhiteLabelling;
|
|
52
54
|
}
|
|
@@ -29,14 +29,10 @@ 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.
|
|
32
|
+
readonly VERSION = "1.3.19";
|
|
33
33
|
readonly whiteLabellingChanged: EventHandler<{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
splashScreenUrl?: string;
|
|
37
|
-
splashScreenMode?: "repeat" | "contain" | "cover" | "stretch";
|
|
38
|
-
splashScreenPosition?: string;
|
|
39
|
-
splashScreenBgColor?: string;
|
|
34
|
+
next: WhiteLabel;
|
|
35
|
+
changed: boolean;
|
|
40
36
|
}>;
|
|
41
37
|
private signallingWlURL;
|
|
42
38
|
constructor(config: ArcwareConfigParams);
|
|
@@ -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?;
|
|
@@ -123,10 +125,15 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
|
|
|
123
125
|
toggleAudio(videoElement: HTMLVideoElement, enabled: boolean): void;
|
|
124
126
|
private createMicrophoneOverlay;
|
|
125
127
|
toggleMic(enable: boolean, isDefault: boolean): void;
|
|
126
|
-
private wrapWebSocketOnCloseHandler;
|
|
127
128
|
onStreamingStateChange(callback: (isStreaming: boolean) => void): void;
|
|
128
129
|
private removeXRIconIfDisabled;
|
|
129
130
|
private injectCustomUI;
|
|
130
131
|
private applyBrandingFromSettings;
|
|
132
|
+
private ensureSplashHost;
|
|
133
|
+
private destroySplashVideo;
|
|
134
|
+
private upsertSplashVideo;
|
|
135
|
+
private hideSplashVideo;
|
|
136
|
+
private isVideoUrl;
|
|
137
|
+
static clearSessionId(): void;
|
|
131
138
|
}
|
|
132
139
|
export {};
|