Skip to content

Commit 30b55a9

Browse files
author
lijiahao
committed
update loading and UI
1 parent 6cfdd6d commit 30b55a9

File tree

18 files changed

+226
-38
lines changed

18 files changed

+226
-38
lines changed

app/background.js

Lines changed: 72 additions & 3 deletions
Large diffs are not rendered by default.

app/preload.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flatpak/io.github.Geocld.XStreamingDesktop.metainfo.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
</screenshot>
3535
</screenshots>
3636
<releases>
37+
<release version="1.6.4" date="2025-04-29">
38+
<description>
39+
<ul>
40+
<li>Changes:</li>
41+
<li>Update UI</li>
42+
</ul>
43+
</description>
44+
</release>
3745
<release version="1.6.3" date="2025-04-17">
3846
<description>
3947
<ul>

main/helpers/streammanager.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,16 @@ export default class StreamManager {
243243
})
244244
})
245245
}
246+
247+
inputConfigs(xboxTitleId: string) {
248+
return new Promise((resolve, reject) => {
249+
this.getApi('home').inputConfigs(xboxTitleId).then((res) => {
250+
console.log('inputConfigs res:', res)
251+
252+
resolve('')
253+
}).catch((error) => {
254+
reject(error)
255+
})
256+
})
257+
}
246258
}

main/helpers/xcloudapi.ts

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export default class xCloudApi {
219219
env: {
220220
clientAppId: "www.xbox.com",
221221
clientAppType: "browser",
222-
clientAppVersion: "26.1.91",
222+
clientAppVersion: "26.1.97",
223223
clientSdkVersion: "10.3.7",
224224
httpEnvironment: "prod",
225225
sdkInstallId: "",
@@ -530,4 +530,64 @@ export default class xCloudApi {
530530
getActiveSessions() {
531531
return this.get("/v5/sessions/" + this._type + "/active");
532532
}
533+
534+
inputConfigs(xboxTitleId: string) {
535+
console.log('xboxTitleId:', xboxTitleId)
536+
const settings: any = this._application._store.get(
537+
"settings",
538+
defaultSettings
539+
);
540+
let osName = 'android';
541+
542+
if (settings.resolution == 1080) {
543+
osName = 'windows';
544+
} else if (settings.resolution === 1081) { // 1080 HQ
545+
osName = "tizen";
546+
}
547+
548+
const deviceInfo = JSON.stringify({
549+
appInfo: {
550+
env: {
551+
clientAppId: "www.xbox.com",
552+
clientAppType: "browser",
553+
clientAppVersion: "26.1.97",
554+
clientSdkVersion: "10.3.7",
555+
httpEnvironment: "prod",
556+
sdkInstallId: "",
557+
},
558+
},
559+
dev: {
560+
hw: {
561+
make: "Microsoft",
562+
model: "unknown",
563+
sdktype: "web",
564+
},
565+
os: {
566+
name: osName,
567+
ver: "22631.2715",
568+
platform: "desktop",
569+
},
570+
displayInfo: {
571+
dimensions: {
572+
widthInPixels: 1920,
573+
heightInPixels: 1080,
574+
},
575+
pixelDensity: {
576+
dpiX: 1,
577+
dpiY: 1,
578+
},
579+
},
580+
browser: {
581+
browserName: "chrome",
582+
browserVersion: "130.0",
583+
},
584+
},
585+
});
586+
587+
const postData = { titleIds: [xboxTitleId], titleIdType: "xboxTitleId" };
588+
589+
return this.post("/v2/titles/inputconfigs", postData, {
590+
"X-MS-Device-Info": deviceInfo,
591+
});
592+
}
533593
}

main/ipc/streaming.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,8 @@ export default class IpcStreaming extends IpcBase {
7777
return this._streamManager.getActiveSessions()
7878
}
7979

80+
inputConfigs(args: any) {
81+
return this._streamManager.inputConfigs(args.xboxTitleId)
82+
}
83+
8084
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"name": "xstreaming",
44
"description": "xstreaming",
5-
"version": "1.6.3",
5+
"version": "1.6.4",
66
"author": "Geocld <lijiahao5372@gmail.com>",
77
"main": "app/background.js",
88
"scripts": {

renderer/@types/preload.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Preload } from '../main/preload'
44
declare global {
55
interface Window {
66
XStreaming: typeof Preload;
7+
_xboxTitleId: any;
78
}
89
}
910
/* eslint-enable */

renderer/components/Loading.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@
44
right:0;
55
bottom: 0;
66
top: 0;
7-
z-index: 99;
87
display: flex;
9-
justify-content: center;
8+
flex-direction: column;
9+
justify-content: center;
1010
align-items: center;
11+
}
12+
13+
.loading img {
14+
width: 5rem;
15+
}
16+
.loadingText {
17+
color: #107C10;
18+
font-weight: bold;
1119
}

renderer/components/Loading.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import { Spinner } from "@nextui-org/react";
2-
31
const Loading = ({ loadingText }) => {
42
return (
53
<div className="loading">
6-
<Spinner
7-
color="success"
8-
label={loadingText}
9-
labelColor="success"
10-
size="lg"
11-
/>
4+
<div>
5+
<img src='/images/loading.svg' alt="" />
6+
</div>
7+
<div className="loadingText">{loadingText}</div>
128
</div>
139
);
1410
};

0 commit comments

Comments
 (0)