@arcware-cloud/pixelstreaming-websdk 1.2.16 → 1.2.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 +9 -0
- package/index.cjs.js +147 -78
- package/index.esm.js +170 -99
- package/index.umd.js +147 -78
- package/package.json +2 -2
- package/types/index.d.ts +3 -0
- package/types/lib/ApplyUrlHack.d.ts +2 -0
- package/types/lib/ArcwareApplication.d.ts +48 -0
- package/types/lib/ArcwareConfig.d.ts +35 -0
- package/types/lib/ArcwareInit.d.ts +15 -0
- package/types/lib/ArcwarePixelStreaming.d.ts +98 -0
- package/types/lib/DiagnosticsCollector.d.ts +181 -0
- package/types/lib/MessageTypes.d.ts +4 -0
- package/types/lib/domain/ArcwareSettingsSchema.d.ts +209 -0
- package/types/lib/domain/ConnectionIdentifier.d.ts +27 -0
- package/types/lib/domain/EventHandler.d.ts +11 -0
- package/types/lib/domain/Session.d.ts +29 -0
- package/types/lib/domain/Stats.d.ts +36 -0
- package/types/lib/domain/debounce.d.ts +1 -0
- package/types/lib/index.d.ts +6 -0
- package/types/lib/styles/ArcwarePixelStreamingApplicationStyles.d.ts +478 -0
- package/types/lib/ui/ArcwareLogoLoader/index.d.ts +6 -0
- package/types/lib/ui/AudioButton/AudioIcon.d.ts +7 -0
- package/types/lib/ui/AudioButton/index.d.ts +15 -0
- package/types/lib/ui/LoveLetters/index.d.ts +6 -0
- package/types/lib/ui/MicButton/index.d.ts +14 -0
- package/types/lib/ui/MicIcon/index.d.ts +7 -0
- package/types/lib/ui/MicrophoneOverlay/index.d.ts +11 -0
- package/types/lib/ui/PlayIcon/index.d.ts +5 -0
- package/types/lib/ui/StopButton/index.d.ts +16 -0
- package/types/lib/ui/StopIcon/index.d.ts +5 -0
- package/types/shared/index.d.ts +1 -0
- package/types/shared/lib/Messages/ErrorMessage.d.ts +18 -0
- package/types/shared/lib/Messages/LoveLetter.d.ts +18 -0
- package/types/shared/lib/Messages/Ping.d.ts +15 -0
- package/types/shared/lib/Messages/Queue.d.ts +58 -0
- package/types/shared/lib/Messages/SessionId.d.ts +12 -0
- package/types/shared/lib/Messages/Stats.d.ts +182 -0
- package/types/shared/lib/Messages/StreamInfo.d.ts +338 -0
- package/types/shared/lib/Messages/Version.d.ts +12 -0
- package/types/shared/lib/Messages/WebSdkSettings.d.ts +96 -0
- package/types/shared/lib/Messages/index.d.ts +192 -0
- package/types/shared/lib/index.d.ts +1 -0
- package/.npmiognore +0 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DiagnosticsCollector.ts
|
|
3
|
+
* Lightweight, privacy-aware client diagnostics for troubleshooting + analytics.
|
|
4
|
+
* WebRTC collection intentionally omitted (to add later).
|
|
5
|
+
*
|
|
6
|
+
* Notes:
|
|
7
|
+
* - Some fields are best-effort due to browser restrictions; they're nullable.
|
|
8
|
+
* - Bandwidth probe requires a small binary served with:
|
|
9
|
+
* Content-Type: application/octet-stream
|
|
10
|
+
* Content-Encoding: identity
|
|
11
|
+
* Cache-Control: no-store
|
|
12
|
+
* Default location: /diag/probe.bin
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* These interfaces need to be copied manually from ITicket.ts for now if the interface changes there
|
|
16
|
+
* The way how webpack, rollup and this whole mono repo is setup up, I cannot just import it......
|
|
17
|
+
*/
|
|
18
|
+
export interface IDiagnostics {
|
|
19
|
+
device?: Device;
|
|
20
|
+
network?: Network;
|
|
21
|
+
powerHints?: PowerHints;
|
|
22
|
+
runtime?: Runtime;
|
|
23
|
+
timestamps?: Timestamps;
|
|
24
|
+
webrtc?: Webrtc;
|
|
25
|
+
}
|
|
26
|
+
export interface Device {
|
|
27
|
+
architecture?: null | string;
|
|
28
|
+
bitness?: null | string;
|
|
29
|
+
codecs?: Codecs;
|
|
30
|
+
deviceMemory?: number | null;
|
|
31
|
+
hardwareConcurrency?: number | null;
|
|
32
|
+
model?: null | string;
|
|
33
|
+
orientation?: Orientation | null;
|
|
34
|
+
touchSupport?: boolean;
|
|
35
|
+
type?: Type;
|
|
36
|
+
vendor?: null | string;
|
|
37
|
+
webgl?: boolean | null;
|
|
38
|
+
}
|
|
39
|
+
export interface Codecs {
|
|
40
|
+
h264?: boolean;
|
|
41
|
+
hevc?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare enum Orientation {
|
|
44
|
+
Landscape = "landscape",
|
|
45
|
+
Portrait = "portrait"
|
|
46
|
+
}
|
|
47
|
+
export declare enum Type {
|
|
48
|
+
Desktop = "desktop",
|
|
49
|
+
Mobile = "mobile",
|
|
50
|
+
Tablet = "tablet"
|
|
51
|
+
}
|
|
52
|
+
export interface Network {
|
|
53
|
+
downlinkMbps?: number | null;
|
|
54
|
+
effectiveType?: null | string;
|
|
55
|
+
measuredDownlinkMbps?: number | null;
|
|
56
|
+
rttMs?: number | null;
|
|
57
|
+
type?: null | string;
|
|
58
|
+
}
|
|
59
|
+
export interface PowerHints {
|
|
60
|
+
prefersReducedData?: boolean | null;
|
|
61
|
+
prefersReducedMotion?: boolean | null;
|
|
62
|
+
saveData?: boolean | null;
|
|
63
|
+
}
|
|
64
|
+
export interface Runtime {
|
|
65
|
+
browser?: Browser;
|
|
66
|
+
os?: OS;
|
|
67
|
+
}
|
|
68
|
+
export interface Browser {
|
|
69
|
+
family?: string;
|
|
70
|
+
version?: null | string;
|
|
71
|
+
}
|
|
72
|
+
export interface OS {
|
|
73
|
+
family?: string;
|
|
74
|
+
version?: null | string;
|
|
75
|
+
}
|
|
76
|
+
export interface Timestamps {
|
|
77
|
+
collectedAt?: number;
|
|
78
|
+
}
|
|
79
|
+
export interface Webrtc {
|
|
80
|
+
candidatePairId?: null | string;
|
|
81
|
+
dtlsCipher?: null | string;
|
|
82
|
+
localCandidateType?: null | string;
|
|
83
|
+
networkType?: null | string;
|
|
84
|
+
protocol?: null | string;
|
|
85
|
+
remoteCandidateType?: null | string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Options that control how the DiagnosticsCollector behaves.
|
|
89
|
+
*
|
|
90
|
+
* You don’t *need* to set these for a basic Pixel Streaming website — the defaults
|
|
91
|
+
* are good enough. But in production, these knobs let you control cost, UX impact,
|
|
92
|
+
* and flexibility without changing the code.
|
|
93
|
+
*/
|
|
94
|
+
export interface DiagnosticsCollectorOptions {
|
|
95
|
+
/**
|
|
96
|
+
* Run a synthetic bandwidth probe? (default: true)
|
|
97
|
+
*
|
|
98
|
+
* - When true: the collector fetches a small binary file (see `probeUrl`)
|
|
99
|
+
* and measures download speed to estimate available bandwidth.
|
|
100
|
+
* - Why it matters: gives you a ground-truth Mbps measurement that the
|
|
101
|
+
* browser doesn’t always expose.
|
|
102
|
+
* - Downsides: adds one extra network request per session.
|
|
103
|
+
* - When to disable: if you want *zero* extra traffic (e.g. privacy-sensitive
|
|
104
|
+
* deployments, embedded use cases).
|
|
105
|
+
*/
|
|
106
|
+
enableBandwidthProbe?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* URL of the probe file used for bandwidth measurement. (default: "/diag/probe.bin")
|
|
109
|
+
*
|
|
110
|
+
* - Must be served as raw binary with headers:
|
|
111
|
+
* Content-Type: application/octet-stream
|
|
112
|
+
* Content-Encoding: identity
|
|
113
|
+
* Cache-Control: no-store
|
|
114
|
+
* - Size: keep small (200–500 KB) for quick, accurate tests.
|
|
115
|
+
* - Why you’d override: if you host assets on a CDN or want different probe
|
|
116
|
+
* files per region/environment.
|
|
117
|
+
*/
|
|
118
|
+
probeUrl?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Respect the user’s "Data Saver" mode? (default: true)
|
|
121
|
+
*
|
|
122
|
+
* - The browser exposes `navigator.connection.saveData`.
|
|
123
|
+
* - When true: if saveData === true, the collector skips the bandwidth probe
|
|
124
|
+
* (to avoid wasting data).
|
|
125
|
+
* - Why it matters: good UX and respectful to users on metered/limited data.
|
|
126
|
+
* - When to disable: if accurate bandwidth numbers are critical even for
|
|
127
|
+
* Data Saver users (rare).
|
|
128
|
+
*/
|
|
129
|
+
respectSaveData?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Sampling rate for diagnostics collection. (range: 0.0–1.0, default: 1.0)
|
|
132
|
+
*
|
|
133
|
+
* - 1.0 (100%): collect diagnostics for every session (ideal in dev/beta).
|
|
134
|
+
* - 0.1 (10%): collect for ~10% of sessions (reduces storage & processing costs).
|
|
135
|
+
* - Why it matters: in production, detailed telemetry from *every* session
|
|
136
|
+
* may be too costly or noisy. Sampling still gives you trends.
|
|
137
|
+
* - How it works: collector rolls a random number per session; only collects
|
|
138
|
+
* if value < sampleRate.
|
|
139
|
+
*/
|
|
140
|
+
sampleRate?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* DiagnosticsCollector
|
|
144
|
+
*/
|
|
145
|
+
export declare class DiagnosticsCollector {
|
|
146
|
+
private opts;
|
|
147
|
+
constructor(opts?: DiagnosticsCollectorOptions);
|
|
148
|
+
/**
|
|
149
|
+
* Collect the diagnostics payload.
|
|
150
|
+
*/
|
|
151
|
+
collect(): Promise<IDiagnostics>;
|
|
152
|
+
/**
|
|
153
|
+
* Collect a safe subset of WebRTC stats once PC is connected.
|
|
154
|
+
*/
|
|
155
|
+
collectWebRTC(pc: RTCPeerConnection): Promise<IDiagnostics["webrtc"]>;
|
|
156
|
+
/**
|
|
157
|
+
* Helper to embed diagnostics in a hello envelope.
|
|
158
|
+
*/
|
|
159
|
+
buildHelloEnvelope(base: Record<string, any>, pc?: RTCPeerConnection): Promise<{
|
|
160
|
+
ext: {
|
|
161
|
+
diag: IDiagnostics;
|
|
162
|
+
};
|
|
163
|
+
}>;
|
|
164
|
+
private shouldSample;
|
|
165
|
+
private hasTouch;
|
|
166
|
+
private getOrientation;
|
|
167
|
+
private hasWebGL;
|
|
168
|
+
/**
|
|
169
|
+
* Heuristic device type: best-effort only.
|
|
170
|
+
* Tries UA-CH, then UA fallback, then touch + screen size heuristics.
|
|
171
|
+
*/
|
|
172
|
+
private inferDeviceType;
|
|
173
|
+
private getPowerHints;
|
|
174
|
+
private getNetworkInfo;
|
|
175
|
+
private maybeMeasureBandwidth;
|
|
176
|
+
private withCacheBuster;
|
|
177
|
+
private getCodecSupport;
|
|
178
|
+
private supportsCodec;
|
|
179
|
+
private uaInfoCache;
|
|
180
|
+
private getUAInfo;
|
|
181
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Arcware Settings. */
|
|
3
|
+
export declare const ArcwareSettingsSchema: z.ZodObject<{
|
|
4
|
+
/** Overwrites the Session-Tool and uses the provided session instead. */
|
|
5
|
+
session: z.ZodOptional<z.ZodString>;
|
|
6
|
+
/** Can be used to be added to the request in order to verify access to private projects.
|
|
7
|
+
* For internal use only. => Preview page.
|
|
8
|
+
*/
|
|
9
|
+
token: z.ZodOptional<z.ZodString>;
|
|
10
|
+
/** @deprecated in there for legacy use. Can only be used when token is provided. */
|
|
11
|
+
bypass: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
/** Handler for server side error messages. */
|
|
13
|
+
errorHandler: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"error">;
|
|
15
|
+
code: z.ZodNumber;
|
|
16
|
+
reason: z.ZodString;
|
|
17
|
+
verbosity: z.ZodNumber;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type?: "error";
|
|
20
|
+
code?: number;
|
|
21
|
+
reason?: string;
|
|
22
|
+
verbosity?: number;
|
|
23
|
+
}, {
|
|
24
|
+
type?: "error";
|
|
25
|
+
code?: number;
|
|
26
|
+
reason?: string;
|
|
27
|
+
verbosity?: number;
|
|
28
|
+
}>], z.ZodUnknown>, z.ZodVoid>>;
|
|
29
|
+
/** Handler for queue events. */
|
|
30
|
+
queueHandler: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"queue">;
|
|
32
|
+
queue: z.ZodObject<{
|
|
33
|
+
index: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
/** Can be used to be added to the request in order to verify access to private projects.
|
|
35
|
+
* For internal use only. => Preview page.
|
|
36
|
+
*/
|
|
37
|
+
queueLength: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
waited: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
estimatedWaitTime: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
40
|
+
averageWaitTime: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
41
|
+
valueType: z.ZodEnum<["milliseconds", "seconds", "minutes", "hours", "days"]>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
index?: number;
|
|
44
|
+
queueLength?: number;
|
|
45
|
+
waited?: number;
|
|
46
|
+
estimatedWaitTime?: number;
|
|
47
|
+
averageWaitTime?: number;
|
|
48
|
+
valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
|
|
49
|
+
}, {
|
|
50
|
+
index?: number;
|
|
51
|
+
queueLength?: number;
|
|
52
|
+
waited?: number;
|
|
53
|
+
estimatedWaitTime?: number;
|
|
54
|
+
averageWaitTime?: number;
|
|
55
|
+
valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
|
|
56
|
+
}>;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
type?: "queue";
|
|
59
|
+
queue?: {
|
|
60
|
+
index?: number;
|
|
61
|
+
queueLength?: number;
|
|
62
|
+
waited?: number;
|
|
63
|
+
estimatedWaitTime?: number;
|
|
64
|
+
averageWaitTime?: number;
|
|
65
|
+
valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
|
|
66
|
+
};
|
|
67
|
+
}, {
|
|
68
|
+
type?: "queue";
|
|
69
|
+
queue?: {
|
|
70
|
+
index?: number;
|
|
71
|
+
queueLength?: number;
|
|
72
|
+
waited?: number;
|
|
73
|
+
estimatedWaitTime?: number;
|
|
74
|
+
averageWaitTime?: number;
|
|
75
|
+
valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
|
|
76
|
+
};
|
|
77
|
+
}>], z.ZodUnknown>, z.ZodVoid>>;
|
|
78
|
+
/** Handler for sessionId message. */
|
|
79
|
+
sessionIdHandler: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodString], z.ZodUnknown>, z.ZodVoid>>;
|
|
80
|
+
/** Handler for love letters.
|
|
81
|
+
* "LoveLetters" are send from backend to the SDK to state what phase the connection currently is in. */
|
|
82
|
+
loveLetterHandler: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"letter">;
|
|
84
|
+
reason: z.ZodString;
|
|
85
|
+
code: z.ZodNumber;
|
|
86
|
+
verbosity: z.ZodNumber;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
type?: "letter";
|
|
89
|
+
reason?: string;
|
|
90
|
+
code?: number;
|
|
91
|
+
verbosity?: number;
|
|
92
|
+
}, {
|
|
93
|
+
type?: "letter";
|
|
94
|
+
reason?: string;
|
|
95
|
+
code?: number;
|
|
96
|
+
verbosity?: number;
|
|
97
|
+
}>], z.ZodUnknown>, z.ZodVoid>>;
|
|
98
|
+
/** Show or hide the fullscreen button. */
|
|
99
|
+
fullscreenButton: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
/** Show or hide the settings button. */
|
|
101
|
+
settingsButton: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
/** Show or hide the info button. */
|
|
103
|
+
infoButton: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
/** Show or hide the audio button. */
|
|
105
|
+
audioButton: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
/** Show or hide the microphone button. */
|
|
107
|
+
micButton: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
/** Show or hide the microphone button. */
|
|
109
|
+
stopButton: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
+
/** Show or hide the connectionStrengthIcon button. */
|
|
111
|
+
connectionStrengthIcon: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
/** ShareId, used for sharing your project.
|
|
113
|
+
* Using ArcwareInit will set this required property for you. */
|
|
114
|
+
shareId: z.ZodOptional<z.ZodString>;
|
|
115
|
+
/** Id of your project, only required if your shareId refers to multiple projects.
|
|
116
|
+
* Using ArcwareInit will set this required property for you. */
|
|
117
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
118
|
+
/** Enable/Disable LoveLetter logging to the console. */
|
|
119
|
+
loveLetterLogging: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
/** Enable/Disable Connection Identifier logging to the console. */
|
|
121
|
+
connectionIdentifierLoggingDisabled: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
/** Width with which instance should be started */
|
|
123
|
+
startWidth: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
/** Height with which instance should be started */
|
|
125
|
+
startHeight: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
}, "strip", z.ZodTypeAny, {
|
|
127
|
+
session?: string;
|
|
128
|
+
token?: string;
|
|
129
|
+
bypass?: boolean;
|
|
130
|
+
errorHandler?: (args_0: {
|
|
131
|
+
type?: "error";
|
|
132
|
+
code?: number;
|
|
133
|
+
reason?: string;
|
|
134
|
+
verbosity?: number;
|
|
135
|
+
}, ...args_1: unknown[]) => void;
|
|
136
|
+
queueHandler?: (args_0: {
|
|
137
|
+
type?: "queue";
|
|
138
|
+
queue?: {
|
|
139
|
+
index?: number;
|
|
140
|
+
queueLength?: number;
|
|
141
|
+
waited?: number;
|
|
142
|
+
estimatedWaitTime?: number;
|
|
143
|
+
averageWaitTime?: number;
|
|
144
|
+
valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
|
|
145
|
+
};
|
|
146
|
+
}, ...args_1: unknown[]) => void;
|
|
147
|
+
sessionIdHandler?: (args_0: string, ...args_1: unknown[]) => void;
|
|
148
|
+
loveLetterHandler?: (args_0: {
|
|
149
|
+
type?: "letter";
|
|
150
|
+
reason?: string;
|
|
151
|
+
code?: number;
|
|
152
|
+
verbosity?: number;
|
|
153
|
+
}, ...args_1: unknown[]) => void;
|
|
154
|
+
fullscreenButton?: boolean;
|
|
155
|
+
settingsButton?: boolean;
|
|
156
|
+
infoButton?: boolean;
|
|
157
|
+
audioButton?: boolean;
|
|
158
|
+
micButton?: boolean;
|
|
159
|
+
stopButton?: boolean;
|
|
160
|
+
connectionStrengthIcon?: boolean;
|
|
161
|
+
shareId?: string;
|
|
162
|
+
projectId?: string;
|
|
163
|
+
loveLetterLogging?: boolean;
|
|
164
|
+
connectionIdentifierLoggingDisabled?: boolean;
|
|
165
|
+
startWidth?: number;
|
|
166
|
+
startHeight?: number;
|
|
167
|
+
}, {
|
|
168
|
+
session?: string;
|
|
169
|
+
token?: string;
|
|
170
|
+
bypass?: boolean;
|
|
171
|
+
errorHandler?: (args_0: {
|
|
172
|
+
type?: "error";
|
|
173
|
+
code?: number;
|
|
174
|
+
reason?: string;
|
|
175
|
+
verbosity?: number;
|
|
176
|
+
}, ...args_1: unknown[]) => void;
|
|
177
|
+
queueHandler?: (args_0: {
|
|
178
|
+
type?: "queue";
|
|
179
|
+
queue?: {
|
|
180
|
+
index?: number;
|
|
181
|
+
queueLength?: number;
|
|
182
|
+
waited?: number;
|
|
183
|
+
estimatedWaitTime?: number;
|
|
184
|
+
averageWaitTime?: number;
|
|
185
|
+
valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
|
|
186
|
+
};
|
|
187
|
+
}, ...args_1: unknown[]) => void;
|
|
188
|
+
sessionIdHandler?: (args_0: string, ...args_1: unknown[]) => void;
|
|
189
|
+
loveLetterHandler?: (args_0: {
|
|
190
|
+
type?: "letter";
|
|
191
|
+
reason?: string;
|
|
192
|
+
code?: number;
|
|
193
|
+
verbosity?: number;
|
|
194
|
+
}, ...args_1: unknown[]) => void;
|
|
195
|
+
fullscreenButton?: boolean;
|
|
196
|
+
settingsButton?: boolean;
|
|
197
|
+
infoButton?: boolean;
|
|
198
|
+
audioButton?: boolean;
|
|
199
|
+
micButton?: boolean;
|
|
200
|
+
stopButton?: boolean;
|
|
201
|
+
connectionStrengthIcon?: boolean;
|
|
202
|
+
shareId?: string;
|
|
203
|
+
projectId?: string;
|
|
204
|
+
loveLetterLogging?: boolean;
|
|
205
|
+
connectionIdentifierLoggingDisabled?: boolean;
|
|
206
|
+
startWidth?: number;
|
|
207
|
+
startHeight?: number;
|
|
208
|
+
}>;
|
|
209
|
+
export type Settings = z.infer<typeof ArcwareSettingsSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ArcwarePixelStreaming } from "../ArcwarePixelStreaming";
|
|
2
|
+
export declare enum WebsocketState {
|
|
3
|
+
CONNECTING = 0,
|
|
4
|
+
OPEN = 1,
|
|
5
|
+
CLOSING = 2,
|
|
6
|
+
CLOSED = 3
|
|
7
|
+
}
|
|
8
|
+
export declare class ConnectionIdentifier {
|
|
9
|
+
private static instance;
|
|
10
|
+
static get Instance(): ConnectionIdentifier;
|
|
11
|
+
private interval;
|
|
12
|
+
private aps;
|
|
13
|
+
get WebsocketStates(): WebsocketState[];
|
|
14
|
+
private constructor();
|
|
15
|
+
register(ps: ArcwarePixelStreaming): void;
|
|
16
|
+
GetWebSocketStates(): WebsocketState[];
|
|
17
|
+
ActiveInstances(): number;
|
|
18
|
+
private enabled;
|
|
19
|
+
disable(): void;
|
|
20
|
+
/**
|
|
21
|
+
* The purpose of this method is to periodically tell the developer the amount of connected instances.
|
|
22
|
+
* This way the developer can figure out, when they messed up the implementation and there's shadow instances still running.
|
|
23
|
+
* Or when they accidentally set up multiple connections!
|
|
24
|
+
* Things like that can happen, for example if the React.useEffect was not setup perfectly!
|
|
25
|
+
*/
|
|
26
|
+
private connectionWatcher;
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A helper class to spread the event to additional event handlers added from external sources. */
|
|
2
|
+
export declare class EventHandler<Type> {
|
|
3
|
+
private callbacks;
|
|
4
|
+
/** Returns the added callback on success or null, if something went wrong. */
|
|
5
|
+
add<Callback extends (arg: Type) => void>(callback: Callback): Callback | null;
|
|
6
|
+
/** Returns true if the input callback has been found and removed and false if not. */
|
|
7
|
+
remove<Callback extends (arg: Type) => void>(callback: Callback): boolean;
|
|
8
|
+
constructor();
|
|
9
|
+
/** Emits the event-data for each of the existing handlers. */
|
|
10
|
+
static Emit<Type>(handler: EventHandler<Type>, event: Type): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const ZOptions: z.ZodObject<{
|
|
3
|
+
localStorageKey: z.ZodDefault<z.ZodString>;
|
|
4
|
+
keepSession: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
localStorageKey?: string;
|
|
7
|
+
keepSession?: number;
|
|
8
|
+
}, {
|
|
9
|
+
localStorageKey?: string;
|
|
10
|
+
keepSession?: number;
|
|
11
|
+
}>;
|
|
12
|
+
type Options = z.infer<typeof ZOptions>;
|
|
13
|
+
/** The sessionId is stored in the localStorage to allow for reconnection and
|
|
14
|
+
* to prevent spamming start requests of instances, when smashing F5.
|
|
15
|
+
*/
|
|
16
|
+
export declare class Session {
|
|
17
|
+
private _current?;
|
|
18
|
+
get current(): string;
|
|
19
|
+
get noSession(): boolean;
|
|
20
|
+
get id(): string | null;
|
|
21
|
+
private options;
|
|
22
|
+
private get localStorageKey();
|
|
23
|
+
constructor(options?: Options);
|
|
24
|
+
/** Set's the session with creation date for the given storage key to the localStorage. */
|
|
25
|
+
set(sessionId: string): void;
|
|
26
|
+
/** Removes a session from the localStorage. */
|
|
27
|
+
unset(): void;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AggregatedStats, CandidatePairStats } from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
|
|
2
|
+
export declare function Stats(stats: AggregatedStats): import("zod").objectOutputType<{
|
|
3
|
+
codecs: import("zod").ZodOptional<import("zod").ZodType<Map<string, import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5/dist/types/PeerConnectionController/CodecStats").CodecStats>, import("zod").ZodTypeDef, Map<string, import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5/dist/types/PeerConnectionController/CodecStats").CodecStats>>>;
|
|
4
|
+
candidatePair: import("zod").ZodOptional<import("zod").ZodType<CandidatePairStats[], import("zod").ZodTypeDef, CandidatePairStats[]>>;
|
|
5
|
+
localCandidates: import("zod").ZodOptional<import("zod").ZodType<import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5").CandidateStat[], import("zod").ZodTypeDef, import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5").CandidateStat[]>>;
|
|
6
|
+
remoteCandidates: import("zod").ZodOptional<import("zod").ZodType<import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5").CandidateStat[], import("zod").ZodTypeDef, import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5").CandidateStat[]>>;
|
|
7
|
+
DataChannelStats: import("zod").ZodOptional<import("zod").ZodType<import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5").DataChannelStats, import("zod").ZodTypeDef, import("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5").DataChannelStats>>;
|
|
8
|
+
bytesReceived: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
9
|
+
packetsLost: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
10
|
+
frameWidth: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
11
|
+
frameHeight: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
12
|
+
framesDecoded: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
13
|
+
framesPerSecond: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
14
|
+
framesDropped: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
15
|
+
videoCodec: import("zod").ZodOptional<import("zod").ZodString>;
|
|
16
|
+
audioCodec: import("zod").ZodOptional<import("zod").ZodString>;
|
|
17
|
+
browserInfo: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
18
|
+
userAgent: import("zod").ZodOptional<import("zod").ZodString>;
|
|
19
|
+
platform: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
20
|
+
language: import("zod").ZodOptional<import("zod").ZodString>;
|
|
21
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
22
|
+
userAgent: import("zod").ZodOptional<import("zod").ZodString>;
|
|
23
|
+
platform: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
24
|
+
language: import("zod").ZodOptional<import("zod").ZodString>;
|
|
25
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
26
|
+
userAgent: import("zod").ZodOptional<import("zod").ZodString>;
|
|
27
|
+
platform: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
28
|
+
language: import("zod").ZodOptional<import("zod").ZodString>;
|
|
29
|
+
}, import("zod").ZodTypeAny, "passthrough">>>;
|
|
30
|
+
currentRTT: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
31
|
+
sessionRunTime: import("zod").ZodOptional<import("zod").ZodString>;
|
|
32
|
+
controlsStreamInput: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, string, string>>;
|
|
33
|
+
videoEncoderAvgQP: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
34
|
+
videoBitrate: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
35
|
+
audioBitrate: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
36
|
+
}, import("zod").ZodTypeAny, "passthrough">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function debounce<T extends (...args: any[]) => void>(func: T, wait: number): (...args: Parameters<T>) => void;
|