@arcware-cloud/pixelstreaming-websdk 1.2.18 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1184 -727
- package/index.esm.js +1226 -762
- package/index.umd.js +1184 -727
- package/package.json +1 -1
- package/types/lib/ArcwareApplication.d.ts +4 -0
- package/types/lib/ArcwareConfig.d.ts +1 -1
- package/types/lib/ArcwarePixelStreaming.d.ts +30 -1
- package/types/lib/features/ArcwareEventUtil.d.ts +28 -0
- package/types/lib/features/ArcwareFileTransferUtil.d.ts +13 -0
- package/types/lib/features/common.d.ts +13 -0
- /package/types/lib/{DiagnosticsCollector.d.ts → features/DiagnosticsCollector.d.ts} +0 -0
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.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./index.umd.js",
|
|
7
7
|
"module": "./index.umd.js",
|
|
@@ -9,6 +9,8 @@ export declare class ArcwareApplication extends Application {
|
|
|
9
9
|
private videoElementParent;
|
|
10
10
|
private parentElement;
|
|
11
11
|
private responseCallback;
|
|
12
|
+
private analyticsEventCallback;
|
|
13
|
+
private fileDownloadCallback;
|
|
12
14
|
private webRtcController;
|
|
13
15
|
get rootElement(): HTMLElement;
|
|
14
16
|
private ArcwareSection;
|
|
@@ -45,4 +47,6 @@ export declare class ArcwareApplication extends Application {
|
|
|
45
47
|
*/
|
|
46
48
|
emitUIInteraction(descriptor: object | string): void;
|
|
47
49
|
private addTextToConnectOverlay;
|
|
50
|
+
analyticsEvent(response: unknown): void;
|
|
51
|
+
private fileDownload;
|
|
48
52
|
}
|
|
@@ -26,7 +26,7 @@ export declare class ArcwareConfig extends Config {
|
|
|
26
26
|
readonly session: Session;
|
|
27
27
|
readonly settings: Settings;
|
|
28
28
|
private _initialSettings;
|
|
29
|
-
readonly VERSION = "1.
|
|
29
|
+
readonly VERSION = "1.3.1";
|
|
30
30
|
constructor(config: ArcwareConfigParams);
|
|
31
31
|
/** Setup connection string. */
|
|
32
32
|
get urlFlags(): string;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Messages } from "@arcware-cloud/shared-pixelstreaming-websdk";
|
|
2
2
|
import { PixelStreaming, PixelStreamingOverrides } from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
|
|
3
|
+
import { z } from "zod";
|
|
3
4
|
import { ArcwareConfig } from "./ArcwareConfig";
|
|
4
5
|
import { EventHandler } from "./domain/EventHandler";
|
|
5
6
|
import { Session } from "./domain/Session";
|
|
6
7
|
import { WebsocketState } from "./domain/ConnectionIdentifier";
|
|
8
|
+
type OutboundByKey<K extends keyof typeof Messages.Send> = z.input<(typeof Messages.Send)[K]> & {
|
|
9
|
+
type: K;
|
|
10
|
+
};
|
|
7
11
|
export declare class ArcwarePixelStreaming extends PixelStreaming {
|
|
8
12
|
/** Override default config with ArcwareConfig. */
|
|
9
13
|
config: ArcwareConfig;
|
|
@@ -14,6 +18,22 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
|
|
|
14
18
|
private isProcessingQueue;
|
|
15
19
|
private microphoneOverlay;
|
|
16
20
|
private diagnosticsCollector;
|
|
21
|
+
private outbox;
|
|
22
|
+
private retryTimers;
|
|
23
|
+
private videoInitializedSent;
|
|
24
|
+
private versionReplyInFlight;
|
|
25
|
+
private nextMsgId;
|
|
26
|
+
private _boundTransport?;
|
|
27
|
+
private _onWsOpen?;
|
|
28
|
+
private _onWsClose?;
|
|
29
|
+
private _transportWatchTimer?;
|
|
30
|
+
private _boundVideoEl?;
|
|
31
|
+
private _onVideoPlaying?;
|
|
32
|
+
private bindTransportEvents;
|
|
33
|
+
private startTransportWatcher;
|
|
34
|
+
private stopTransportWatcher;
|
|
35
|
+
private bindVideoElPlayingOnce;
|
|
36
|
+
private get isWsOpen();
|
|
17
37
|
/** Returns a list of WebSocketStates of all PixelStreaming Instances generated. */
|
|
18
38
|
get WebsocketStates(): WebsocketState[];
|
|
19
39
|
/** Counts all active PixelStreaming Instances generated. (CONNECTING & CONNECTED) */
|
|
@@ -66,6 +86,8 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
|
|
|
66
86
|
/** SessionId */
|
|
67
87
|
readonly sessionIdHandler: EventHandler<string>;
|
|
68
88
|
private onSessionId;
|
|
89
|
+
private sendVideoInitializedOnce;
|
|
90
|
+
private setupVideoInitFallbacks;
|
|
69
91
|
/** VideoInitialized */
|
|
70
92
|
readonly videoInitializedHandler: EventHandler<never>;
|
|
71
93
|
private onVideoInitialized;
|
|
@@ -79,7 +101,13 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
|
|
|
79
101
|
* * * * * *
|
|
80
102
|
*/
|
|
81
103
|
private sendStats;
|
|
82
|
-
|
|
104
|
+
send<K extends keyof typeof Messages.Send>(message: OutboundByKey<K>): void;
|
|
105
|
+
send(type: string, payload?: Record<string, unknown>): void;
|
|
106
|
+
send(message: {
|
|
107
|
+
type: string;
|
|
108
|
+
} & Record<string, unknown>): void;
|
|
109
|
+
private _dispatchOrBuffer;
|
|
110
|
+
private flushOutbox;
|
|
83
111
|
private handleResolutionChange;
|
|
84
112
|
private applyResolutionIfPlaying;
|
|
85
113
|
removePlayer(): void;
|
|
@@ -96,3 +124,4 @@ export declare class ArcwarePixelStreaming extends PixelStreaming {
|
|
|
96
124
|
private removeXRIconIfDisabled;
|
|
97
125
|
private injectCustomUI;
|
|
98
126
|
}
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type AnalyticsEvent = {
|
|
2
|
+
type: string;
|
|
3
|
+
customName: string;
|
|
4
|
+
payload?: string;
|
|
5
|
+
};
|
|
6
|
+
type Ok<T> = {
|
|
7
|
+
ok: true;
|
|
8
|
+
value: T;
|
|
9
|
+
};
|
|
10
|
+
type Err = {
|
|
11
|
+
ok: false;
|
|
12
|
+
error: string;
|
|
13
|
+
};
|
|
14
|
+
export type Result<T> = Ok<T> | Err;
|
|
15
|
+
/**
|
|
16
|
+
* Build an AnalyticsEvent from unknown input.
|
|
17
|
+
* - accepts object or JSON/JSON-ish string
|
|
18
|
+
* - drops extra fields
|
|
19
|
+
* - requires non-empty string `type` and `customName`
|
|
20
|
+
* - accepts `payload` only if it's a string; truncates by **bytes**
|
|
21
|
+
*/
|
|
22
|
+
export declare function toAnalyticsEvent(input: unknown, opts?: {
|
|
23
|
+
maxPayloadBytes?: number;
|
|
24
|
+
allowJsonish?: boolean;
|
|
25
|
+
}): Result<AnalyticsEvent>;
|
|
26
|
+
/** Type guard */
|
|
27
|
+
export declare function isAnalyticsEvent(x: unknown): x is AnalyticsEvent;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ZFileTransfer: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"fileTransfer">;
|
|
4
|
+
filename: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
type?: "fileTransfer";
|
|
7
|
+
filename?: string;
|
|
8
|
+
}, {
|
|
9
|
+
type?: "fileTransfer";
|
|
10
|
+
filename?: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type FileTransferMsg = z.infer<typeof ZFileTransfer>;
|
|
13
|
+
export declare function parseControl<T extends z.ZodTypeAny>(input: unknown, schema: T): z.infer<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Conservative normalizer: accepts object, strict JSON string, or JSON-ish like {foo: "bar"} */
|
|
2
|
+
export declare function parseUnknownToObject(input: unknown, opts?: {
|
|
3
|
+
allowJsonish?: boolean;
|
|
4
|
+
}): Record<string, unknown>;
|
|
5
|
+
/** Byte-safe string truncation (no broken unicode) */
|
|
6
|
+
export declare function truncateByBytes(input: string, maxBytes: number): string;
|
|
7
|
+
/** Cross-platform safe filename */
|
|
8
|
+
export declare function sanitizeFilename(input: string): string;
|
|
9
|
+
/** MIME -> extension */
|
|
10
|
+
export declare function extFromMime(mime: string): string;
|
|
11
|
+
/** Short random fallback */
|
|
12
|
+
export declare function randomHash(): string;
|
|
13
|
+
export declare function normalizeType(v: unknown): string;
|
|
File without changes
|