@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.
Files changed (44) hide show
  1. package/README.md +9 -0
  2. package/index.cjs.js +147 -78
  3. package/index.esm.js +170 -99
  4. package/index.umd.js +147 -78
  5. package/package.json +2 -2
  6. package/types/index.d.ts +3 -0
  7. package/types/lib/ApplyUrlHack.d.ts +2 -0
  8. package/types/lib/ArcwareApplication.d.ts +48 -0
  9. package/types/lib/ArcwareConfig.d.ts +35 -0
  10. package/types/lib/ArcwareInit.d.ts +15 -0
  11. package/types/lib/ArcwarePixelStreaming.d.ts +98 -0
  12. package/types/lib/DiagnosticsCollector.d.ts +181 -0
  13. package/types/lib/MessageTypes.d.ts +4 -0
  14. package/types/lib/domain/ArcwareSettingsSchema.d.ts +209 -0
  15. package/types/lib/domain/ConnectionIdentifier.d.ts +27 -0
  16. package/types/lib/domain/EventHandler.d.ts +11 -0
  17. package/types/lib/domain/Session.d.ts +29 -0
  18. package/types/lib/domain/Stats.d.ts +36 -0
  19. package/types/lib/domain/debounce.d.ts +1 -0
  20. package/types/lib/index.d.ts +6 -0
  21. package/types/lib/styles/ArcwarePixelStreamingApplicationStyles.d.ts +478 -0
  22. package/types/lib/ui/ArcwareLogoLoader/index.d.ts +6 -0
  23. package/types/lib/ui/AudioButton/AudioIcon.d.ts +7 -0
  24. package/types/lib/ui/AudioButton/index.d.ts +15 -0
  25. package/types/lib/ui/LoveLetters/index.d.ts +6 -0
  26. package/types/lib/ui/MicButton/index.d.ts +14 -0
  27. package/types/lib/ui/MicIcon/index.d.ts +7 -0
  28. package/types/lib/ui/MicrophoneOverlay/index.d.ts +11 -0
  29. package/types/lib/ui/PlayIcon/index.d.ts +5 -0
  30. package/types/lib/ui/StopButton/index.d.ts +16 -0
  31. package/types/lib/ui/StopIcon/index.d.ts +5 -0
  32. package/types/shared/index.d.ts +1 -0
  33. package/types/shared/lib/Messages/ErrorMessage.d.ts +18 -0
  34. package/types/shared/lib/Messages/LoveLetter.d.ts +18 -0
  35. package/types/shared/lib/Messages/Ping.d.ts +15 -0
  36. package/types/shared/lib/Messages/Queue.d.ts +58 -0
  37. package/types/shared/lib/Messages/SessionId.d.ts +12 -0
  38. package/types/shared/lib/Messages/Stats.d.ts +182 -0
  39. package/types/shared/lib/Messages/StreamInfo.d.ts +338 -0
  40. package/types/shared/lib/Messages/Version.d.ts +12 -0
  41. package/types/shared/lib/Messages/WebSdkSettings.d.ts +96 -0
  42. package/types/shared/lib/Messages/index.d.ts +192 -0
  43. package/types/shared/lib/index.d.ts +1 -0
  44. package/.npmiognore +0 -1
package/index.umd.js CHANGED
@@ -23361,7 +23361,7 @@ class ArcwareConfig extends lib_pixelstreamingfrontend_ue5_5_1.Config {
23361
23361
  if (!config.initialSettings.ss)
23362
23362
  config.initialSettings.ss = exports.DefaultUrl;
23363
23363
  super(config);
23364
- this.VERSION = "1.2.16";
23364
+ this.VERSION = "1.2.18";
23365
23365
  this.settings = settings;
23366
23366
  this.session = new Session_1.Session();
23367
23367
  this._initialSettings = config.initialSettings;
@@ -23977,17 +23977,29 @@ exports.ArcwarePixelStreaming = ArcwarePixelStreaming;
23977
23977
  * Default location: /diag/probe.bin
23978
23978
  */
23979
23979
  Object.defineProperty(exports, "__esModule", ({ value: true }));
23980
- exports.DiagnosticsCollector = void 0;
23980
+ exports.DiagnosticsCollector = exports.Type = exports.Orientation = void 0;
23981
23981
  const tslib_1 = __webpack_require__(655);
23982
+ var Orientation;
23983
+ (function (Orientation) {
23984
+ Orientation["Landscape"] = "landscape";
23985
+ Orientation["Portrait"] = "portrait";
23986
+ })(Orientation = exports.Orientation || (exports.Orientation = {}));
23987
+ var Type;
23988
+ (function (Type) {
23989
+ Type["Desktop"] = "desktop";
23990
+ Type["Mobile"] = "mobile";
23991
+ Type["Tablet"] = "tablet";
23992
+ })(Type = exports.Type || (exports.Type = {}));
23982
23993
  /**
23983
23994
  * DiagnosticsCollector
23984
23995
  */
23985
23996
  class DiagnosticsCollector {
23986
23997
  constructor(opts = {}) {
23987
23998
  var _a, _b, _c, _d;
23999
+ this.uaInfoCache = null;
23988
24000
  this.opts = {
23989
24001
  enableBandwidthProbe: (_a = opts.enableBandwidthProbe) !== null && _a !== void 0 ? _a : true,
23990
- probeUrl: (_b = opts.probeUrl) !== null && _b !== void 0 ? _b : '/diag/probe.bin',
24002
+ probeUrl: (_b = opts.probeUrl) !== null && _b !== void 0 ? _b : "/diag/probe.bin",
23991
24003
  respectSaveData: (_c = opts.respectSaveData) !== null && _c !== void 0 ? _c : true,
23992
24004
  sampleRate: Math.max(0, Math.min(1, (_d = opts.sampleRate) !== null && _d !== void 0 ? _d : 1))
23993
24005
  };
@@ -24000,8 +24012,8 @@ class DiagnosticsCollector {
24000
24012
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
24001
24013
  if (!this.shouldSample()) {
24002
24014
  return {
24003
- device: { type: 'desktop', touchSupport: false },
24004
- runtime: { browser: { family: 'Unknown', version: null }, os: { family: 'Unknown', version: null } },
24015
+ device: { type: Type.Desktop, touchSupport: false },
24016
+ runtime: { browser: { family: "Unknown", version: null }, os: { family: "Unknown", version: null } },
24005
24017
  powerHints: { saveData: null, prefersReducedData: null, prefersReducedMotion: null },
24006
24018
  network: { type: null, effectiveType: null, downlinkMbps: null, rttMs: null, measuredDownlinkMbps: null },
24007
24019
  timestamps: { collectedAt: Date.now() }
@@ -24047,9 +24059,9 @@ class DiagnosticsCollector {
24047
24059
  const stats = yield pc.getStats();
24048
24060
  let selected, transport, local, remote;
24049
24061
  stats.forEach((r) => {
24050
- if (r.type === 'transport' && r.selectedCandidatePairId)
24062
+ if (r.type === "transport" && r.selectedCandidatePairId)
24051
24063
  transport = r;
24052
- if (r.type === 'candidate-pair' && (r.selected || r.nominated))
24064
+ if (r.type === "candidate-pair" && (r.selected || r.nominated))
24053
24065
  selected = r;
24054
24066
  });
24055
24067
  if (selected) {
@@ -24090,16 +24102,16 @@ class DiagnosticsCollector {
24090
24102
  hasTouch() {
24091
24103
  var _a;
24092
24104
  const nav = navigator;
24093
- return 'ontouchstart' in window || ((_a = nav.maxTouchPoints) !== null && _a !== void 0 ? _a : 0) > 0;
24105
+ return "ontouchstart" in window || ((_a = nav.maxTouchPoints) !== null && _a !== void 0 ? _a : 0) > 0;
24094
24106
  }
24095
24107
  getOrientation() {
24096
24108
  var _a;
24097
24109
  try {
24098
24110
  if ((_a = screen.orientation) === null || _a === void 0 ? void 0 : _a.type) {
24099
- return screen.orientation.type.startsWith('portrait') ? 'portrait' : 'landscape';
24111
+ return screen.orientation.type.startsWith("portrait") ? Orientation.Portrait : Orientation.Landscape;
24100
24112
  }
24101
24113
  if (window.matchMedia) {
24102
- return window.matchMedia('(orientation: portrait)').matches ? 'portrait' : 'landscape';
24114
+ return window.matchMedia("(orientation: portrait)").matches ? Orientation.Portrait : Orientation.Landscape;
24103
24115
  }
24104
24116
  }
24105
24117
  catch (_b) { }
@@ -24107,8 +24119,8 @@ class DiagnosticsCollector {
24107
24119
  }
24108
24120
  hasWebGL() {
24109
24121
  try {
24110
- const canvas = document.createElement('canvas');
24111
- return !!(canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
24122
+ const canvas = document.createElement("canvas");
24123
+ return !!(canvas.getContext("webgl") || canvas.getContext("experimental-webgl"));
24112
24124
  }
24113
24125
  catch (_a) {
24114
24126
  return false;
@@ -24116,37 +24128,50 @@ class DiagnosticsCollector {
24116
24128
  }
24117
24129
  /**
24118
24130
  * Heuristic device type: best-effort only.
24131
+ * Tries UA-CH, then UA fallback, then touch + screen size heuristics.
24119
24132
  */
24120
24133
  inferDeviceType() {
24121
24134
  const uaData = navigator.userAgentData;
24135
+ const ua = navigator.userAgent || "";
24122
24136
  const isMobileCH = (uaData === null || uaData === void 0 ? void 0 : uaData.mobile) === true;
24123
24137
  const minDim = Math.min(screen.width, screen.height);
24124
- if (isMobileCH && minDim >= 600)
24125
- return 'tablet';
24126
- if (isMobileCH)
24127
- return 'mobile';
24128
- if (/\b(iPad|Tablet)\b/i.test(navigator.userAgent))
24129
- return 'tablet';
24130
- if (('ontouchstart' in window) && minDim >= 600 && minDim <= 1100)
24131
- return 'tablet';
24132
- return 'desktop';
24138
+ // 1. Explicit iPad / tablet detection via UA (iOS often lies in CH)
24139
+ if (/\b(iPad|Tablet)\b/i.test(ua)) {
24140
+ return Type.Tablet;
24141
+ }
24142
+ // 2. UA-CH mobile hint (Chromium only, often accurate for Android)
24143
+ if (isMobileCH) {
24144
+ if (minDim >= 600)
24145
+ return Type.Tablet;
24146
+ return Type.Mobile;
24147
+ }
24148
+ // 3. UA sniffing fallback for mobile
24149
+ if (/\b(iPhone|Android.*Mobile|Windows Phone)\b/i.test(ua)) {
24150
+ return Type.Mobile;
24151
+ }
24152
+ // 4. Touch-capable with "tablet-like" dimensions
24153
+ if (("ontouchstart" in window || navigator.maxTouchPoints > 0) && minDim >= 600 && minDim <= 1100) {
24154
+ return Type.Tablet;
24155
+ }
24156
+ // 5. Default fallback
24157
+ return Type.Desktop;
24133
24158
  }
24134
24159
  getPowerHints() {
24135
24160
  const conn = navigator.connection;
24136
- const saveData = typeof (conn === null || conn === void 0 ? void 0 : conn.saveData) === 'boolean' ? conn.saveData : null;
24161
+ const saveData = typeof (conn === null || conn === void 0 ? void 0 : conn.saveData) === "boolean" ? conn.saveData : null;
24137
24162
  let prefersReducedData = null;
24138
24163
  let prefersReducedMotion = null;
24139
- if (typeof window.matchMedia === 'function') {
24164
+ if (typeof window.matchMedia === "function") {
24140
24165
  try {
24141
- const mqData = window.matchMedia('(prefers-reduced-data: reduce)');
24142
- if (typeof mqData.matches === 'boolean') {
24166
+ const mqData = window.matchMedia("(prefers-reduced-data: reduce)");
24167
+ if (typeof mqData.matches === "boolean") {
24143
24168
  prefersReducedData = mqData.matches;
24144
24169
  }
24145
24170
  }
24146
24171
  catch (_a) { }
24147
24172
  try {
24148
- const mqMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
24149
- if (typeof mqMotion.matches === 'boolean') {
24173
+ const mqMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
24174
+ if (typeof mqMotion.matches === "boolean") {
24150
24175
  prefersReducedMotion = mqMotion.matches;
24151
24176
  }
24152
24177
  }
@@ -24157,10 +24182,10 @@ class DiagnosticsCollector {
24157
24182
  getNetworkInfo(measuredDownlinkMbps) {
24158
24183
  const conn = navigator.connection;
24159
24184
  return {
24160
- type: (typeof (conn === null || conn === void 0 ? void 0 : conn.type) === 'string') ? conn.type : null,
24161
- effectiveType: (typeof (conn === null || conn === void 0 ? void 0 : conn.effectiveType) === 'string') ? conn.effectiveType : null,
24162
- downlinkMbps: (typeof (conn === null || conn === void 0 ? void 0 : conn.downlink) === 'number') ? conn.downlink : null,
24163
- rttMs: (typeof (conn === null || conn === void 0 ? void 0 : conn.rtt) === 'number') ? conn.rtt : null,
24185
+ type: typeof (conn === null || conn === void 0 ? void 0 : conn.type) === "string" ? conn.type : null,
24186
+ effectiveType: typeof (conn === null || conn === void 0 ? void 0 : conn.effectiveType) === "string" ? conn.effectiveType : null,
24187
+ downlinkMbps: typeof (conn === null || conn === void 0 ? void 0 : conn.downlink) === "number" ? conn.downlink : null,
24188
+ rttMs: typeof (conn === null || conn === void 0 ? void 0 : conn.rtt) === "number" ? conn.rtt : null,
24164
24189
  measuredDownlinkMbps
24165
24190
  };
24166
24191
  }
@@ -24175,8 +24200,8 @@ class DiagnosticsCollector {
24175
24200
  try {
24176
24201
  const t0 = performance.now();
24177
24202
  const res = yield fetch(this.withCacheBuster(this.opts.probeUrl), {
24178
- cache: 'no-store',
24179
- credentials: 'omit'
24203
+ cache: "no-store",
24204
+ credentials: "omit"
24180
24205
  });
24181
24206
  const buf = yield res.arrayBuffer();
24182
24207
  const t1 = performance.now();
@@ -24184,7 +24209,7 @@ class DiagnosticsCollector {
24184
24209
  const seconds = (t1 - t0) / 1000;
24185
24210
  if (seconds <= 0.05)
24186
24211
  return null; // ignore unstable samples
24187
- return +((bits / seconds) / 1000000).toFixed(2);
24212
+ return +(bits / seconds / 1000000).toFixed(2);
24188
24213
  }
24189
24214
  catch (_a) {
24190
24215
  return null;
@@ -24195,7 +24220,7 @@ class DiagnosticsCollector {
24195
24220
  var _a, _b;
24196
24221
  const u = new URL(url, location.origin);
24197
24222
  const token = (_b = (_a = crypto === null || crypto === void 0 ? void 0 : crypto.randomUUID) === null || _a === void 0 ? void 0 : _a.call(crypto)) !== null && _b !== void 0 ? _b : String(Date.now());
24198
- u.searchParams.set('cb', token);
24223
+ u.searchParams.set("cb", token);
24199
24224
  return u.toString();
24200
24225
  }
24201
24226
  getCodecSupport() {
@@ -24210,10 +24235,10 @@ class DiagnosticsCollector {
24210
24235
  supportsCodec(mime) {
24211
24236
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
24212
24237
  try {
24213
- if ('mediaCapabilities' in navigator) {
24238
+ if ("mediaCapabilities" in navigator) {
24214
24239
  // @ts-ignore
24215
24240
  const res = yield navigator.mediaCapabilities.decodingInfo({
24216
- type: 'file',
24241
+ type: "file",
24217
24242
  video: { contentType: mime, width: 1920, height: 1080, bitrate: 5000000, framerate: 30 }
24218
24243
  });
24219
24244
  return !!(res === null || res === void 0 ? void 0 : res.supported);
@@ -24221,8 +24246,8 @@ class DiagnosticsCollector {
24221
24246
  }
24222
24247
  catch (_a) { }
24223
24248
  try {
24224
- const v = document.createElement('video');
24225
- return v.canPlayType(mime) !== '';
24249
+ const v = document.createElement("video");
24250
+ return v.canPlayType(mime) !== "";
24226
24251
  }
24227
24252
  catch (_b) {
24228
24253
  return false;
@@ -24230,60 +24255,104 @@ class DiagnosticsCollector {
24230
24255
  });
24231
24256
  }
24232
24257
  getUAInfo() {
24233
- var _a, _b;
24234
24258
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
24259
+ if (this.uaInfoCache)
24260
+ return this.uaInfoCache;
24235
24261
  const nav = navigator;
24236
24262
  const uaData = nav.userAgentData;
24237
- let browserFamily = 'Unknown', browserVersion = null;
24238
- let osFamily = 'Unknown', osVersion = null;
24239
- let model = null, architecture = null, bitness = null;
24263
+ const ua = navigator.userAgent;
24264
+ let browserFamily = "Unknown";
24265
+ let browserVersion = null;
24266
+ let osFamily = "Unknown";
24267
+ let osVersion = null;
24268
+ let model = null;
24269
+ let architecture = null;
24270
+ let bitness = null;
24271
+ // --- UA-CH (modern browsers) ---
24240
24272
  if (uaData === null || uaData === void 0 ? void 0 : uaData.getHighEntropyValues) {
24241
24273
  try {
24242
24274
  const high = yield uaData.getHighEntropyValues([
24243
- 'platform', 'platformVersion', 'model', 'architecture', 'bitness', 'fullVersionList'
24275
+ "platform",
24276
+ "platformVersion",
24277
+ "model",
24278
+ "architecture",
24279
+ "bitness",
24280
+ "fullVersionList"
24244
24281
  ]);
24245
- osFamily = high.platform || 'Unknown';
24282
+ osFamily = high.platform || "Unknown";
24246
24283
  osVersion = high.platformVersion || null;
24247
24284
  model = high.model || null;
24248
24285
  architecture = high.architecture || null;
24249
24286
  bitness = high.bitness || null;
24250
24287
  const brands = high.fullVersionList || uaData.brands || [];
24251
- const real = brands.find(b => b.brand && !/Chromium|Not:?A-?Brand/i.test(b.brand));
24252
- browserFamily = (real === null || real === void 0 ? void 0 : real.brand) || ((_a = brands[0]) === null || _a === void 0 ? void 0 : _a.brand) || 'Unknown';
24253
- browserVersion = (real === null || real === void 0 ? void 0 : real.version) || ((_b = brands[0]) === null || _b === void 0 ? void 0 : _b.version) || null;
24254
- }
24255
- catch (_c) { }
24256
- }
24257
- if (browserFamily === 'Unknown') {
24258
- const ua = navigator.userAgent;
24259
- if (/Firefox\/(\S+)/.test(ua)) {
24260
- browserFamily = 'Firefox';
24261
- browserVersion = RegExp.$1;
24262
- }
24263
- else if (/Edg\/(\S+)/.test(ua)) {
24264
- browserFamily = 'Edge';
24265
- browserVersion = RegExp.$1;
24288
+ const realBrand = brands.find((b) => {
24289
+ if (!b.brand)
24290
+ return false;
24291
+ const normalized = b.brand.replace(/[^a-zA-Z]/g, "").toLowerCase();
24292
+ return !normalized.includes("chromium") && !normalized.includes("notabrand");
24293
+ });
24294
+ if (realBrand) {
24295
+ browserFamily = realBrand.brand;
24296
+ browserVersion = realBrand.version;
24297
+ }
24266
24298
  }
24267
- else if (/Chrome\/(\S+)/.test(ua)) {
24268
- browserFamily = 'Chrome';
24269
- browserVersion = RegExp.$1;
24299
+ catch (_a) {
24300
+ // silently fail
24270
24301
  }
24271
- else if (/Version\/(\S+).*Safari/.test(ua)) {
24272
- browserFamily = 'Safari';
24273
- browserVersion = RegExp.$1;
24302
+ }
24303
+ // --- Fallback to classic UA parsing if browser unknown ---
24304
+ if (!browserFamily || browserFamily === "Unknown") {
24305
+ const browserRegexes = [
24306
+ [/Edg\/(\S+)/, "Edge"],
24307
+ [/OPR\/(\S+)/, "Opera"],
24308
+ [/SamsungBrowser\/(\S+)/, "Samsung Internet"],
24309
+ [/Firefox\/(\S+)/, "Firefox"],
24310
+ [/Chrome\/(\S+)/, "Chrome"],
24311
+ [/Version\/(\S+).*Safari/, "Safari"]
24312
+ ];
24313
+ for (const [regex, name] of browserRegexes) {
24314
+ const match = ua.match(regex);
24315
+ if (match) {
24316
+ browserFamily = name;
24317
+ browserVersion = match[1];
24318
+ break;
24319
+ }
24274
24320
  }
24275
- if (/Windows/.test(ua))
24276
- osFamily = 'Windows';
24277
- else if (/Mac OS X/.test(ua))
24278
- osFamily = 'macOS';
24279
- else if (/Android/.test(ua))
24280
- osFamily = 'Android';
24281
- else if (/iPhone|iPad|iPod/.test(ua))
24282
- osFamily = 'iOS';
24283
- else if (/Linux/.test(ua))
24284
- osFamily = 'Linux';
24285
- }
24286
- return { browserFamily, browserVersion, osFamily, osVersion, model, architecture, bitness };
24321
+ }
24322
+ // --- OS detection (always run, iOS first) ---
24323
+ if (/iPhone|iPad|iPod/.test(ua)) {
24324
+ osFamily = "iOS";
24325
+ const match = ua.match(/OS (\d+[_\d]*)/);
24326
+ if (match)
24327
+ osVersion = match[1].replace(/_/g, ".");
24328
+ }
24329
+ else if (uaData === null || uaData === void 0 ? void 0 : uaData.platform) {
24330
+ osFamily = uaData.platform;
24331
+ }
24332
+ else if (/Windows/.test(ua)) {
24333
+ osFamily = "Windows";
24334
+ const match = ua.match(/Windows NT (\d+\.\d+)/);
24335
+ if (match)
24336
+ osVersion = match[1];
24337
+ }
24338
+ else if (/Mac OS X/.test(ua)) {
24339
+ osFamily = "macOS";
24340
+ const match = ua.match(/Mac OS X (\d+[_\d]*)/);
24341
+ if (match)
24342
+ osVersion = match[1].replace(/_/g, ".");
24343
+ }
24344
+ else if (/Android/.test(ua)) {
24345
+ osFamily = "Android";
24346
+ const match = ua.match(/Android (\d+(\.\d+)?)/);
24347
+ if (match)
24348
+ osVersion = match[1];
24349
+ }
24350
+ else if (/Linux/.test(ua)) {
24351
+ osFamily = "Linux";
24352
+ }
24353
+ const result = { browserFamily, browserVersion, osFamily, osVersion, model, architecture, bitness };
24354
+ this.uaInfoCache = result;
24355
+ return result;
24287
24356
  });
24288
24357
  }
24289
24358
  }
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.2.16",
4
+ "version": "1.2.18",
5
5
  "type": "commonjs",
6
6
  "main": "./index.umd.js",
7
7
  "module": "./index.umd.js",
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "author": {
17
17
  "name": "Arcware GmbH",
18
- "email": "info@arcware.com",
18
+ "email": "sales@arcware.com",
19
19
  "url": "https://www.arcware.com"
20
20
  },
21
21
  "license": "MIT",
@@ -0,0 +1,3 @@
1
+ export * from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
2
+ export * from "@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.5";
3
+ export * from "./lib";
@@ -0,0 +1,2 @@
1
+ export declare function UrlBuilder(input: () => string, urlFlags?: string): string;
2
+ export declare function ApplyUrlHack(): void;
@@ -0,0 +1,48 @@
1
+ import { Application, UIOptions } from "@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.5";
2
+ import { ArcwarePixelStreaming } from "./ArcwarePixelStreaming";
3
+ export declare class ArcwareApplication extends Application {
4
+ static Flags: {
5
+ new (): {};
6
+ noSession: "noSession";
7
+ };
8
+ stream: ArcwarePixelStreaming;
9
+ private videoElementParent;
10
+ private parentElement;
11
+ private responseCallback;
12
+ private webRtcController;
13
+ get rootElement(): HTMLElement;
14
+ private ArcwareSection;
15
+ constructor(options: UIOptions & {
16
+ stream: ArcwarePixelStreaming;
17
+ });
18
+ addLoveLetterhandler(): void;
19
+ /** Set's and resets hidden state of "additional" UI Elements.
20
+ * For example buttons or connection icon.
21
+ * These will fade in through css animation upon the videoInitialized event.
22
+ * At this point in time the streamInfo is already processed.
23
+ */
24
+ private uiElementsVisibility;
25
+ private adjustSettingsPanel;
26
+ private createAudioToggleButton;
27
+ private createMicToggleButton;
28
+ private createStopButton;
29
+ private uiDefaultButtonVisibilty;
30
+ private preventDefaultKeyboardEvents;
31
+ private autoPlayHandler;
32
+ /** Request a response from you UE Application.
33
+ * The returned response depends on the implementation of your UE Application.
34
+ * It can be used to request information from the application, such as:
35
+ * - a state to update your custom ui
36
+ * - get the url to the pdf it uploaded to some remote service of yours
37
+ * - the id of the save-game
38
+ * .. anything else you could imagine.
39
+ */
40
+ getApplicationResponse(callback: (response: string) => void): void;
41
+ applicationResponse(response: string): void;
42
+ private applyArcwareStyles;
43
+ /** Emit an event towards the UE Application.
44
+ * Mainly used to bubble events like a button press or other command inputs towards the UE Application.
45
+ */
46
+ emitUIInteraction(descriptor: object | string): void;
47
+ private addTextToConnectOverlay;
48
+ }
@@ -0,0 +1,35 @@
1
+ import { Config, ConfigParams } from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
2
+ import { Session } from "./domain/Session";
3
+ import { Settings } from "./domain/ArcwareSettingsSchema";
4
+ /** Default arcware signalling endpoint. */
5
+ export declare const DefaultUrl: "wss://signalling-client.ragnarok.arcware.cloud";
6
+ export interface ArcwareConfigParams extends ConfigParams {
7
+ settings: Settings;
8
+ }
9
+ export declare class ArcwareConfig extends Config {
10
+ /**
11
+ * Can be used to fetch projectId and shareId from the current url.
12
+ * Example:
13
+ * /something/:projectId/:shareId/something?something => { projectId, shareId }
14
+ * /:projectId => { projectId }
15
+ * /:shareId => { shareId }
16
+ * /:shareId/:projectId => { projectId, shareId }
17
+ *
18
+ * The projectId must be uuidv4.
19
+ * The shareId must be "shareId-" prefixed.
20
+ *
21
+ * Usage:
22
+ * // This will spread the projectId and the shareId into the settings. Define anything you want to override after the spread operation.
23
+ * new ArcwareConfig({ settings: { ...ArcwareConfig.PickIdsOfUrl() } });
24
+ */
25
+ static PickIdsOfUrl(): Pick<Settings, "shareId" | "projectId">;
26
+ readonly session: Session;
27
+ readonly settings: Settings;
28
+ private _initialSettings;
29
+ readonly VERSION = "1.2.18";
30
+ constructor(config: ArcwareConfigParams);
31
+ /** Setup connection string. */
32
+ get urlFlags(): string;
33
+ get initialSettings(): any;
34
+ modifyInitialSettings(mouseLock: boolean): void;
35
+ }
@@ -0,0 +1,15 @@
1
+ import { ArcwareConfig, ArcwareConfigParams } from "./ArcwareConfig";
2
+ import { ArcwarePixelStreaming } from "./ArcwarePixelStreaming";
3
+ import { ArcwareApplication } from "./ArcwareApplication";
4
+ type DeepPartial<T> = T extends Function ? T : T extends object ? {
5
+ [P in keyof T]?: DeepPartial<T[P]>;
6
+ } : T;
7
+ export declare function ArcwareInit({ shareId, projectId }: {
8
+ shareId?: string;
9
+ projectId?: string;
10
+ }, configuration?: DeepPartial<ArcwareConfigParams>, forceRefresh?: boolean): {
11
+ Config: ArcwareConfig;
12
+ PixelStreaming: ArcwarePixelStreaming;
13
+ Application: ArcwareApplication;
14
+ };
15
+ export {};
@@ -0,0 +1,98 @@
1
+ import { Messages } from "@arcware-cloud/shared-pixelstreaming-websdk";
2
+ import { PixelStreaming, PixelStreamingOverrides } from "@epicgames-ps/lib-pixelstreamingfrontend-ue5.5";
3
+ import { ArcwareConfig } from "./ArcwareConfig";
4
+ import { EventHandler } from "./domain/EventHandler";
5
+ import { Session } from "./domain/Session";
6
+ import { WebsocketState } from "./domain/ConnectionIdentifier";
7
+ export declare class ArcwarePixelStreaming extends PixelStreaming {
8
+ /** Override default config with ArcwareConfig. */
9
+ config: ArcwareConfig;
10
+ streamInfo?: Messages.StreamInfo;
11
+ loveLettersContainer: HTMLDivElement | undefined;
12
+ private loveLettersList;
13
+ private loveLettersQueue;
14
+ private isProcessingQueue;
15
+ private microphoneOverlay;
16
+ private diagnosticsCollector;
17
+ /** Returns a list of WebSocketStates of all PixelStreaming Instances generated. */
18
+ get WebsocketStates(): WebsocketState[];
19
+ /** Counts all active PixelStreaming Instances generated. (CONNECTING & CONNECTED) */
20
+ get ActiveInstances(): () => number;
21
+ /** Returns this PixelStreaming Instances websocket state. */
22
+ get websocketState(): WebsocketState;
23
+ constructor(config: ArcwareConfig, overrides?: PixelStreamingOverrides);
24
+ /** Getter for the session object. */
25
+ get session(): Session;
26
+ /**
27
+ * * * * * * *
28
+ * Listen *
29
+ * * * * * * *
30
+ */
31
+ /** On version requested, the version of the WebSDK would be returned. */
32
+ private onVersion;
33
+ /** On ping the session creation timestamp will be updated. */
34
+ private onPing;
35
+ /** Handle incoming configurations. */
36
+ private onStreamInfo;
37
+ /** On ping the session creation timestamp will be updated. */
38
+ readonly queueHandler: EventHandler<{
39
+ type?: "queue";
40
+ queue?: {
41
+ index?: number;
42
+ queueLength?: number;
43
+ waited?: number;
44
+ estimatedWaitTime?: number;
45
+ averageWaitTime?: number;
46
+ valueType?: "milliseconds" | "seconds" | "minutes" | "hours" | "days";
47
+ };
48
+ }>;
49
+ private onQueue;
50
+ /** Error receiver. */
51
+ readonly errorHandler: EventHandler<{
52
+ type?: "error";
53
+ code?: number;
54
+ reason?: string;
55
+ verbosity?: number;
56
+ }>;
57
+ private onError;
58
+ /** LoveLetter */
59
+ readonly loveLetterHandler: EventHandler<{
60
+ type?: "letter";
61
+ reason?: string;
62
+ code?: number;
63
+ verbosity?: number;
64
+ }>;
65
+ private onLoveLetter;
66
+ /** SessionId */
67
+ readonly sessionIdHandler: EventHandler<string>;
68
+ private onSessionId;
69
+ /** VideoInitialized */
70
+ readonly videoInitializedHandler: EventHandler<never>;
71
+ private onVideoInitialized;
72
+ /** WebSocket Close */
73
+ readonly websocketOnCloseHandler: EventHandler<CloseEvent>;
74
+ /** Adding a zod-safe handler. */
75
+ private addMessageHandler;
76
+ /**
77
+ * * * * * *
78
+ * Send *
79
+ * * * * * *
80
+ */
81
+ private sendStats;
82
+ private send;
83
+ private handleResolutionChange;
84
+ private applyResolutionIfPlaying;
85
+ removePlayer(): void;
86
+ private handleMouseLock;
87
+ initLoveLettersContainer(): void;
88
+ private pushLetter;
89
+ private processLoveLetterQueue;
90
+ private handleRemoveLoveLetters;
91
+ toggleAudio(videoElement: HTMLVideoElement, enabled: boolean): void;
92
+ private createMicrophoneOverlay;
93
+ toggleMic(enable: boolean, isDefault: boolean): void;
94
+ private wrapWebSocketOnCloseHandler;
95
+ onStreamingStateChange(callback: (isStreaming: boolean) => void): void;
96
+ private removeXRIconIfDisabled;
97
+ private injectCustomUI;
98
+ }