@arcware-cloud/pixelstreaming-websdk 1.3.41 → 1.4.4

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.
Files changed (74) hide show
  1. package/LICENSE.md +0 -2
  2. package/README.md +0 -2
  3. package/core.cjs +19343 -0
  4. package/core.mjs +1 -0
  5. package/core.umd.cjs +19352 -0
  6. package/index.cjs +3710 -7812
  7. package/index.mjs +1 -32858
  8. package/index.umd.cjs +3710 -7812
  9. package/package.json +13 -5
  10. package/report.html +39 -0
  11. package/stats.json +118354 -0
  12. package/types/{lib → core}/ArcwareConfig.d.ts +10 -4
  13. package/types/core/ArcwarePixelStreaming.d.ts +268 -0
  14. package/types/core/CoreSetup.d.ts +10 -0
  15. package/types/core/Messages/ErrorMessage.d.ts +11 -0
  16. package/types/core/Messages/LoveLetter.d.ts +11 -0
  17. package/types/core/Messages/Ping.d.ts +10 -0
  18. package/types/core/Messages/Queue.d.ts +23 -0
  19. package/types/core/Messages/Render.d.ts +8 -0
  20. package/types/core/Messages/SessionId.d.ts +9 -0
  21. package/types/core/Messages/Stats.d.ts +34 -0
  22. package/types/core/Messages/StreamInfo.d.ts +30 -0
  23. package/types/core/Messages/Version.d.ts +9 -0
  24. package/types/core/Messages/WebSdkSettings.d.ts +31 -0
  25. package/types/core/Messages/index.d.ts +17 -0
  26. package/types/core/domain/ArcwareSettingsSchema.d.ts +61 -0
  27. package/types/core/domain/CustomizationSchema.d.ts +15 -0
  28. package/types/core/domain/Session.d.ts +31 -0
  29. package/types/core/domain/Stats.d.ts +7 -0
  30. package/types/core/features/ArcwareFileTransferUtil.d.ts +8 -0
  31. package/types/{lib → core}/features/DiagnosticsCollector.d.ts +1 -1
  32. package/types/core/features/IWhiteLabel.d.ts +16 -0
  33. package/types/{lib → core}/features/whiteLabelling.d.ts +2 -3
  34. package/types/core.d.ts +5 -0
  35. package/types/index.d.ts +7 -3
  36. package/types/{lib → ui}/ArcwareApplication.d.ts +41 -8
  37. package/types/{lib → ui}/ArcwareInit.d.ts +3 -3
  38. package/types/{lib/ui → ui/components}/AudioButton/index.d.ts +1 -1
  39. package/types/{lib/ui → ui/components}/MicButton/index.d.ts +1 -1
  40. package/types/{lib/ui → ui/components}/MicrophoneOverlay/index.d.ts +1 -1
  41. package/types/{lib/ui → ui/components}/StopButton/index.d.ts +1 -1
  42. package/types/{lib → ui}/styles/ArcwarePixelStreamingApplicationStyles.d.ts +45 -46
  43. package/types/lib/ArcwarePixelStreaming.d.ts +0 -140
  44. package/types/lib/MessageTypes.d.ts +0 -4
  45. package/types/lib/domain/ArcwareSettingsSchema.d.ts +0 -273
  46. package/types/lib/domain/Session.d.ts +0 -29
  47. package/types/lib/domain/Stats.d.ts +0 -36
  48. package/types/lib/features/ArcwareFileTransferUtil.d.ts +0 -13
  49. package/types/lib/features/ZWhiteLabel.d.ts +0 -31
  50. package/types/lib/index.d.ts +0 -6
  51. package/types/shared/index.d.ts +0 -1
  52. package/types/shared/lib/Messages/ErrorMessage.d.ts +0 -18
  53. package/types/shared/lib/Messages/LoveLetter.d.ts +0 -18
  54. package/types/shared/lib/Messages/Ping.d.ts +0 -15
  55. package/types/shared/lib/Messages/Queue.d.ts +0 -58
  56. package/types/shared/lib/Messages/Render.d.ts +0 -9
  57. package/types/shared/lib/Messages/SessionId.d.ts +0 -12
  58. package/types/shared/lib/Messages/Stats.d.ts +0 -174
  59. package/types/shared/lib/Messages/StreamInfo.d.ts +0 -338
  60. package/types/shared/lib/Messages/Version.d.ts +0 -12
  61. package/types/shared/lib/Messages/WebSdkSettings.d.ts +0 -96
  62. package/types/shared/lib/Messages/index.d.ts +0 -185
  63. package/types/shared/lib/index.d.ts +0 -1
  64. /package/types/{lib → core}/ApplyUrlHack.d.ts +0 -0
  65. /package/types/{lib → core}/domain/EventHandler.d.ts +0 -0
  66. /package/types/{lib → core}/domain/debounce.d.ts +0 -0
  67. /package/types/{lib → core}/features/ArcwareEventUtil.d.ts +0 -0
  68. /package/types/{lib → core}/features/common.d.ts +0 -0
  69. /package/types/{lib/ui → ui/components}/ArcwareLogoLoader/index.d.ts +0 -0
  70. /package/types/{lib/ui → ui/components}/AudioButton/AudioIcon.d.ts +0 -0
  71. /package/types/{lib/ui → ui/components}/LoveLetters/index.d.ts +0 -0
  72. /package/types/{lib/ui → ui/components}/MicIcon/index.d.ts +0 -0
  73. /package/types/{lib/ui → ui/components}/PlayIcon/index.d.ts +0 -0
  74. /package/types/{lib/ui → ui/components}/StopIcon/index.d.ts +0 -0
@@ -0,0 +1,16 @@
1
+ /** White-label settings allowed via URL */
2
+ export interface WhiteLabel {
3
+ loadingIconUrl?: string;
4
+ loadingIconFadeMs?: number;
5
+ splashScreenUrl?: string;
6
+ splashScreenMode?: "contain" | "cover" | "stretch" | "repeat";
7
+ splashScreenPosition?: string;
8
+ splashScreenBgColor?: string;
9
+ hideLoveLetters?: boolean;
10
+ hideAfkOverlay?: boolean;
11
+ }
12
+ /**
13
+ * Strictly validate and coerce a white-label payload.
14
+ * Mirrors ZWhiteLabel.strict().safeParse(...)
15
+ */
16
+ export declare function coerceWhiteLabel(input: unknown): Partial<WhiteLabel> | undefined;
@@ -1,4 +1,3 @@
1
- import { ZWhiteLabel } from "./ZWhiteLabel";
2
- import { z } from "zod";
1
+ import { WhiteLabel } from "./IWhiteLabel";
3
2
  /** Parse ?wl=... (or ?whitelabel=...) → validated partial settings */
4
- export declare function readWhiteLabelFromQuery(qs: URLSearchParams): Partial<z.infer<typeof ZWhiteLabel>> | undefined;
3
+ export declare function readWhiteLabelFromQuery(qs: URLSearchParams): Partial<WhiteLabel> | undefined;
@@ -0,0 +1,5 @@
1
+ export { ArcwarePixelStreaming } from "./core/ArcwarePixelStreaming";
2
+ export { ArcwareConfig } from "./core/ArcwareConfig";
3
+ export { CoreSetup } from "./core/CoreSetup";
4
+ export { WebsocketState } from "./core/ArcwarePixelStreaming";
5
+ export * from "./core/Messages";
package/types/index.d.ts CHANGED
@@ -1,3 +1,7 @@
1
- export * from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
2
- export * from "@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.5";
3
- export * from "./lib";
1
+ export { ArcwareInit } from "./ui/ArcwareInit";
2
+ export { ArcwareApplication } from "./ui/ArcwareApplication";
3
+ export { ArcwarePixelStreaming } from "./core/ArcwarePixelStreaming";
4
+ export { ArcwareConfig } from "./core/ArcwareConfig";
5
+ export { CoreSetup } from "./core/CoreSetup";
6
+ export { WebsocketState } from "./core/ArcwarePixelStreaming";
7
+ export * from "./core/Messages";
@@ -1,5 +1,17 @@
1
1
  import { Application, UIOptions } from "@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.5";
2
- import { ArcwarePixelStreaming } from "./ArcwarePixelStreaming";
2
+ import { ArcwarePixelStreaming } from "../core/ArcwarePixelStreaming";
3
+ /**
4
+ * Default UI layer built on top of ArcwarePixelStreaming.
5
+ *
6
+ * Provides:
7
+ * - Branded controls
8
+ * - Audio/Mic/Stop buttons
9
+ * - Love letter overlay
10
+ * - Splash screen support
11
+ * - Automatic file download handling
12
+ *
13
+ * Can be replaced with a fully custom UI.
14
+ */
3
15
  export declare class ArcwareApplication extends Application {
4
16
  static Flags: {
5
17
  new (): {};
@@ -9,16 +21,35 @@ export declare class ArcwareApplication extends Application {
9
21
  stream: ArcwarePixelStreaming;
10
22
  private videoElementParent;
11
23
  private parentElement;
12
- private responseCallback;
13
- private analyticsEventCallback;
14
- private fileDownloadCallback;
15
24
  private webRtcController;
25
+ loveLettersContainer: HTMLDivElement | undefined;
26
+ private loveLettersList;
27
+ private loveLettersQueue;
28
+ private isProcessingQueue;
29
+ private microphoneOverlay?;
30
+ private _splashHost?;
31
+ private _splashVideo?;
32
+ private logoLoader?;
16
33
  get rootElement(): HTMLElement;
17
34
  private ArcwareSection;
18
35
  constructor(options: UIOptions & {
19
36
  stream: ArcwarePixelStreaming;
20
37
  });
21
38
  addLoveLetterhandler(): void;
39
+ initLoveLettersContainer(): void;
40
+ private _loveLettersAttachTimer?;
41
+ private tryAttachLoveLettersContainer;
42
+ private pushLetter;
43
+ private processLoveLetterQueue;
44
+ private handleRemoveLoveLetters;
45
+ private createMicrophoneOverlay;
46
+ private removeXRIconIfDisabled;
47
+ private applyBrandingFromSettings;
48
+ private ensureSplashHost;
49
+ private destroySplashVideo;
50
+ private upsertSplashVideo;
51
+ private hideSplashVideo;
52
+ private isVideoUrl;
22
53
  /** Set's and resets hidden state of "additional" UI Elements.
23
54
  * For example buttons or connection icon.
24
55
  * These will fade in through css animation upon the videoInitialized event.
@@ -33,6 +64,11 @@ export declare class ArcwareApplication extends Application {
33
64
  private uiDefaultButtonVisibilty;
34
65
  private preventDefaultKeyboardEvents;
35
66
  private autoPlayHandler;
67
+ /**
68
+ * @deprecated Use onApplicationResponse instead.
69
+ * Registers a persistent listener for UE responses.
70
+ */
71
+ getApplicationResponse(callback: (response: string) => void): void;
36
72
  /** Request a response from you UE Application.
37
73
  * The returned response depends on the implementation of your UE Application.
38
74
  * It can be used to request information from the application, such as:
@@ -41,15 +77,12 @@ export declare class ArcwareApplication extends Application {
41
77
  * - the id of the save-game
42
78
  * .. anything else you could imagine.
43
79
  */
44
- getApplicationResponse(callback: (response: string) => void): void;
45
- applicationResponse(response: string): void;
80
+ onApplicationResponse(callback: (response: string) => void): () => void;
46
81
  private applyArcwareStyles;
47
82
  /** Emit an event towards the UE Application.
48
83
  * Mainly used to bubble events like a button press or other command inputs towards the UE Application.
49
84
  */
50
85
  emitUIInteraction(descriptor: object | string): void;
51
86
  private addTextToConnectOverlay;
52
- analyticsEvent(response: unknown): void;
53
- private fileDownload;
54
87
  private syncAfkOverlayFromWhiteLabelling;
55
88
  }
@@ -1,5 +1,5 @@
1
- import { ArcwareConfig, ArcwareConfigParams } from "./ArcwareConfig";
2
- import { ArcwarePixelStreaming } from "./ArcwarePixelStreaming";
1
+ import { ArcwareConfig, ArcwareConfigParams } from "../core/ArcwareConfig";
2
+ import { ArcwarePixelStreaming } from "../core/ArcwarePixelStreaming";
3
3
  import { ArcwareApplication } from "./ArcwareApplication";
4
4
  type ArcwareSettings = ArcwareConfigParams["settings"];
5
5
  export type ArcwareInitConfiguration = Partial<Omit<ArcwareConfigParams, "settings">> & {
@@ -15,5 +15,5 @@ export interface ArcwareInitResult {
15
15
  PixelStreaming: ArcwarePixelStreaming;
16
16
  Application: ArcwareApplication;
17
17
  }
18
- export declare function ArcwareInit(ids: ConnectionInfo, configuration?: ArcwareInitConfiguration, forceRefresh?: boolean): ArcwareInitResult;
18
+ export declare function ArcwareInit(ids: ConnectionInfo, configuration?: ArcwareInitConfiguration, forceRefresh?: boolean, allowMultipleInstances?: boolean): ArcwareInitResult;
19
19
  export {};
@@ -1,4 +1,4 @@
1
- import { ArcwarePixelStreaming } from "../../ArcwarePixelStreaming";
1
+ import { ArcwarePixelStreaming } from "../../../core/ArcwarePixelStreaming";
2
2
  export declare class AudioButton {
3
3
  private button;
4
4
  private stream;
@@ -1,4 +1,4 @@
1
- import { ArcwarePixelStreaming } from "../../ArcwarePixelStreaming";
1
+ import { ArcwarePixelStreaming } from "../../../core/ArcwarePixelStreaming";
2
2
  export declare class MicButton {
3
3
  private button;
4
4
  private stream;
@@ -1,4 +1,4 @@
1
- import { ArcwarePixelStreaming } from "../../ArcwarePixelStreaming";
1
+ import { ArcwarePixelStreaming } from "../../../core/ArcwarePixelStreaming";
2
2
  export declare class MicrophoneOverlay {
3
3
  private overlay;
4
4
  private parentElement;
@@ -1,4 +1,4 @@
1
- import { ArcwarePixelStreaming } from "../../ArcwarePixelStreaming";
1
+ import { ArcwarePixelStreaming } from "../../../core/ArcwarePixelStreaming";
2
2
  export declare class StopButton {
3
3
  private button;
4
4
  private stream;
@@ -1,7 +1,7 @@
1
1
  export declare const CONTROLS_CLASSES: {
2
2
  uiFeatures: {
3
- buttons_position: Record<'Top-Left' | 'Top-Right' | 'Bottom-Left' | 'Bottom-Right', string>;
4
- buttons_orientation: Record<'Horizontal' | 'Vertical', string>;
3
+ buttons_position: Record<"Top-Left" | "Top-Right" | "Bottom-Left" | "Bottom-Right", string>;
4
+ buttons_orientation: Record<"Horizontal" | "Vertical", string>;
5
5
  buttons_reverse: string;
6
6
  };
7
7
  };
@@ -38,6 +38,17 @@ export declare const ArcwareStyles: {
38
38
  opacity: number;
39
39
  };
40
40
  };
41
+ "#uiFeatures #controls": {
42
+ display: string;
43
+ flexDirection: string;
44
+ position: string;
45
+ pointerEvents: string;
46
+ zIndex: number;
47
+ gap: string;
48
+ };
49
+ "#uiFeatures #controls > *": {
50
+ marginBottom: string;
51
+ };
41
52
  "#playerUI *": {
42
53
  fontFamily: string;
43
54
  };
@@ -91,53 +102,41 @@ export declare const ArcwareStyles: {
91
102
  boxSizing: string;
92
103
  background: string;
93
104
  };
94
- "#uiFeatures #controls": {
95
- display: string;
105
+ "#uiFeatures.controls__position_tl #controls": {
106
+ top: string;
107
+ left: string;
108
+ bottom: string;
109
+ right: string;
110
+ };
111
+ "#uiFeatures.controls__position_tr #controls": {
112
+ top: string;
113
+ right: string;
114
+ bottom: string;
115
+ left: string;
116
+ };
117
+ "#uiFeatures.controls__position_bl #controls": {
118
+ bottom: string;
119
+ left: string;
120
+ top: string;
121
+ right: string;
122
+ };
123
+ "#uiFeatures.controls__position_br #controls": {
124
+ bottom: string;
125
+ right: string;
126
+ top: string;
127
+ left: string;
128
+ };
129
+ "#uiFeatures.controls__orientation_h #controls": {
96
130
  flexDirection: string;
97
131
  };
98
- "#controls": {
99
- gap: string;
100
- "& > *": {
101
- marginBottom: string;
102
- };
132
+ "#uiFeatures.controls__orientation_h.controls__order_reverse #controls": {
133
+ flexDirection: string;
103
134
  };
104
- "#uiFeatures": {
105
- "&.controls__position_tl #controls": {
106
- top: string;
107
- left: string;
108
- bottom: string;
109
- right: string;
110
- };
111
- "&.controls__position_tr #controls": {
112
- top: string;
113
- right: string;
114
- bottom: string;
115
- left: string;
116
- };
117
- "&.controls__position_bl #controls": {
118
- bottom: string;
119
- left: string;
120
- top: string;
121
- right: string;
122
- };
123
- "&.controls__position_br #controls": {
124
- bottom: string;
125
- right: string;
126
- top: string;
127
- left: string;
128
- };
129
- "&.controls__orientation_h #controls": {
130
- flexDirection: string;
131
- };
132
- "&.controls__orientation_h.controls__order_reverse #controls": {
133
- flexDirection: string;
134
- };
135
- "&.controls__orientation_v #controls": {
136
- flexDirection: string;
137
- };
138
- "&.controls__orientation_v.controls__order_reverse #controls": {
139
- flexDirection: string;
140
- };
135
+ "#uiFeatures.controls__orientation_v #controls": {
136
+ flexDirection: string;
137
+ };
138
+ "#uiFeatures.controls__orientation_v.controls__order_reverse #controls": {
139
+ flexDirection: string;
141
140
  };
142
141
  "#uiFeatures #connection": {
143
142
  bottom: string;
@@ -1,140 +0,0 @@
1
- import { Messages } from "../shared/index";
2
- import { PixelStreaming, PixelStreamingOverrides } from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
3
- import { z } from "zod";
4
- import { ArcwareConfig } from "./ArcwareConfig";
5
- import { EventHandler } from "./domain/EventHandler";
6
- import { Session } from "./domain/Session";
7
- type OutboundByKey<K extends keyof typeof Messages.Send> = z.input<(typeof Messages.Send)[K]> & {
8
- type: K;
9
- };
10
- export declare enum WebsocketState {
11
- CONNECTING = 0,
12
- OPEN = 1,
13
- CLOSING = 2,
14
- CLOSED = 3
15
- }
16
- export declare class ArcwarePixelStreaming extends PixelStreaming {
17
- /** Override default config with ArcwareConfig. */
18
- config: ArcwareConfig;
19
- streamInfo?: Messages.StreamInfo;
20
- loveLettersContainer: HTMLDivElement | undefined;
21
- private loveLettersList;
22
- private loveLettersQueue;
23
- private isProcessingQueue;
24
- private microphoneOverlay;
25
- private diagnosticsCollector;
26
- private _splashHost?;
27
- private _splashVideo?;
28
- private outbox;
29
- private videoInitializedSent;
30
- private _boundTransport?;
31
- private _onWsOpen?;
32
- private _onWsClose?;
33
- private _transportWatchTimer?;
34
- private _rVFCsupported;
35
- private _rvfcHandle?;
36
- private _rVFCArmedForElement?;
37
- private _mo?;
38
- private _postInitSideEffectsDone;
39
- private logoLoader?;
40
- private resetInitGuardsAndHooks;
41
- reconnect(): void;
42
- private isRetryableClose;
43
- private bindTransportEvents;
44
- private get isWsOpen();
45
- /** Returns this PixelStreaming Instances websocket state. */
46
- get websocketState(): WebsocketState;
47
- constructor(config: ArcwareConfig, overrides?: PixelStreamingOverrides);
48
- /** Getter for the session object. */
49
- get session(): Session;
50
- /**
51
- * * * * * * *
52
- * Listen *
53
- * * * * * * *
54
- */
55
- /** On version requested, the version of the WebSDK would be returned. */
56
- private onVersion;
57
- private isVideoRenderingNow;
58
- private waitForFirstFrameWithTimeout;
59
- private onRender;
60
- /** On ping the session creation timestamp will be updated. */
61
- private onPing;
62
- /** Handle incoming configurations. */
63
- private onStreamInfo;
64
- readonly queueHandler: EventHandler<{
65
- type?: "queue";
66
- queue?: {
67
- index?: number;
68
- queueLength?: number;
69
- waited?: number;
70
- estimatedWaitTime?: number;
71
- averageWaitTime?: number;
72
- valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
73
- };
74
- }>;
75
- private onQueue;
76
- readonly errorHandler: EventHandler<{
77
- type?: "error";
78
- code?: number;
79
- reason?: string;
80
- verbosity?: number;
81
- }>;
82
- private onError;
83
- readonly loveLetterHandler: EventHandler<{
84
- type?: "letter";
85
- code?: number;
86
- reason?: string;
87
- verbosity?: number;
88
- }>;
89
- private onLoveLetter;
90
- readonly sessionIdHandler: EventHandler<string>;
91
- private onSessionId;
92
- private sendVideoInitializedOnce;
93
- /** VideoInitialized (native Epic event) */
94
- readonly videoInitializedHandler: EventHandler<never>;
95
- private runPostInitSideEffectsOnce;
96
- private onVideoInitialized;
97
- private attachFirstRenderedFrameOnce;
98
- private cancelFirstRenderedFrameHook;
99
- private watchVideoElementReplacement;
100
- readonly websocketOnCloseHandler: EventHandler<CloseEvent>;
101
- /** Adding a zod-safe handler. */
102
- private addMessageHandler;
103
- /**
104
- * * * * * *
105
- * Send *
106
- * * * * * *
107
- */
108
- private sendStats;
109
- send<K extends keyof typeof Messages.Send>(message: OutboundByKey<K>): void;
110
- send(type: string, payload?: Record<string, unknown>): void;
111
- send(message: {
112
- type: string;
113
- } & Record<string, unknown>): void;
114
- private _dispatchOrBuffer;
115
- private flushOutbox;
116
- private handleResolutionChange;
117
- private applyResolutionIfPlaying;
118
- removePlayer(): void;
119
- private startTransportWatcher;
120
- private stopTransportWatcher;
121
- private handleMouseLock;
122
- initLoveLettersContainer(): void;
123
- private pushLetter;
124
- private processLoveLetterQueue;
125
- private handleRemoveLoveLetters;
126
- toggleAudio(videoElement: HTMLVideoElement, enabled: boolean): void;
127
- private createMicrophoneOverlay;
128
- toggleMic(enable: boolean, isDefault: boolean): void;
129
- onStreamingStateChange(callback: (isStreaming: boolean) => void): void;
130
- private removeXRIconIfDisabled;
131
- private injectCustomUI;
132
- private applyBrandingFromSettings;
133
- private ensureSplashHost;
134
- private destroySplashVideo;
135
- private upsertSplashVideo;
136
- private hideSplashVideo;
137
- private isVideoUrl;
138
- static clearSessionId(): void;
139
- }
140
- export {};
@@ -1,4 +0,0 @@
1
- import { Messages } from "../shared/index";
2
- export type ErrorMessage = Messages.ErrorMessage;
3
- export type Queue = Messages.Queue;
4
- export type LoveLetter = Messages.LoveLetter;