Skip to content

Commit 9133cb7

Browse files
author
lijiahao
committed
v1.6.2
1 parent 757a5cb commit 9133cb7

File tree

14 files changed

+100
-73
lines changed

14 files changed

+100
-73
lines changed

app/background.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15992,7 +15992,7 @@ module.exports = path.URL;
1599215992
/***/ ((module) => {
1599315993

1599415994
"use strict";
15995-
module.exports = /*#__PURE__*/JSON.parse('{"private":true,"name":"xstreaming","description":"xstreaming","version":"1.6.1","author":"Geocld <lijiahao5372@gmail.com>","main":"app/background.js","scripts":{"dev":"DEBUG=xstreaming:authenticationV2 nextron","build":"nextron build","lint":"eslint . --ext .ts && eslint renderer/ --ext .tsx","lint:fix":"eslint . --ext .ts --fix && eslint renderer/ --ext .tsx --fix","postinstall":"electron-builder install-app-deps","publish":"electron-builder -p onTag","flatpak-build":"nextron build --no-pack && electron-builder --dir"},"dependencies":{"@nextui-org/react":"^2.4.6","axios":"^1.7.7","compare-versions":"^6.1.0","debounce":"^2.1.1","debug":"^4.3.4","electron-serve":"^1.3.0","electron-store":"^8.0.1","express":"^4.18.3","express-http-proxy":"^2.0.0","express-ws":"^5.0.2","framer-motion":"^11.5.4","github-url-to-object":"^4.0.6","i18next":"23.14.0","ip-address":"^9.0.5","jose":"^5.1.0","moment":"^2.30.1","next-i18next":"^15.3.1","next-themes":"^0.3.0","react-i18next":"^15.0.1","react-query":"^3.39.3","semver":"^7.6.3","uplot":"^1.6.30","uuid-1345":"^1.0.2","xbox-webapi":"^1.4.1","xstreaming-player":"0.2.9","xvfb-maybe":"^0.2.1"},"devDependencies":{"@babel/core":"^7.24.4","@fortawesome/fontawesome-free":"^6.5.1","@next/eslint-plugin-next":"^14.2.2","@types/node":"^20.12.7","@types/react":"^18.2.47","@typescript-eslint/eslint-plugin":"^8.6.0","@typescript-eslint/parser":"^8.6.0","autoprefixer":"^10.4.20","babel-loader":"^9.1.3","electron":"33","electron-builder":"^24.13.3","eslint":"^8.57.0","eslint-plugin-react-hooks":"^4.6.2","eslint-plugin-react-refresh":"^0.4.12","next":"^13.5.6","nextron":"^8.13.0","node-loader":"^2.0.0","postcss":"^8.4.45","react":"^18.1.0","react-dom":"^18.1.0","sass":"^1.78.0","tailwindcss":"^3.4.10","typescript":"^5.3.3"},"packageManager":"yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"}');
15995+
module.exports = /*#__PURE__*/JSON.parse('{"private":true,"name":"xstreaming","description":"xstreaming","version":"1.6.1","author":"Geocld <lijiahao5372@gmail.com>","main":"app/background.js","scripts":{"dev":"DEBUG=xstreaming:authenticationV2 nextron","build":"nextron build","lint":"eslint . --ext .ts && eslint renderer/ --ext .tsx","lint:fix":"eslint . --ext .ts --fix && eslint renderer/ --ext .tsx --fix","postinstall":"electron-builder install-app-deps","publish":"electron-builder -p onTag","flatpak-build":"nextron build --no-pack && electron-builder --dir"},"dependencies":{"@nextui-org/react":"^2.4.6","axios":"^1.7.7","compare-versions":"^6.1.0","debounce":"^2.1.1","debug":"^4.3.4","electron-serve":"^1.3.0","electron-store":"^8.0.1","express":"^4.18.3","express-http-proxy":"^2.0.0","express-ws":"^5.0.2","framer-motion":"^11.5.4","github-url-to-object":"^4.0.6","i18next":"23.14.0","ip-address":"^9.0.5","jose":"^5.1.0","moment":"^2.30.1","next-i18next":"^15.3.1","next-themes":"^0.3.0","react-i18next":"^15.0.1","react-query":"^3.39.3","semver":"^7.6.3","uplot":"^1.6.30","uuid-1345":"^1.0.2","xbox-webapi":"^1.4.1","xstreaming-player":"0.2.12","xvfb-maybe":"^0.2.1"},"devDependencies":{"@babel/core":"^7.24.4","@fortawesome/fontawesome-free":"^6.5.1","@next/eslint-plugin-next":"^14.2.2","@types/node":"^20.12.7","@types/react":"^18.2.47","@typescript-eslint/eslint-plugin":"^8.6.0","@typescript-eslint/parser":"^8.6.0","autoprefixer":"^10.4.20","babel-loader":"^9.1.3","electron":"33","electron-builder":"^24.13.3","eslint":"^8.57.0","eslint-plugin-react-hooks":"^4.6.2","eslint-plugin-react-refresh":"^0.4.12","next":"^13.5.6","nextron":"^8.13.0","node-loader":"^2.0.0","postcss":"^8.4.45","react":"^18.1.0","react-dom":"^18.1.0","sass":"^1.78.0","tailwindcss":"^3.4.10","typescript":"^5.3.3"},"packageManager":"yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"}');
1599615996

1599715997
/***/ })
1599815998

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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828
</screenshot>
2929
</screenshots>
3030
<releases>
31+
<release version="1.6.2" date="2025-04-15">
32+
<description>
33+
<ul>
34+
<li>Fixed:</li>
35+
<li>Keyboard not working</li>
36+
<li>Optimize action bar</li>
37+
</ul>
38+
</description>
39+
</release>
3140
<release version="1.6.1" date="2025-04-02">
3241
<description>
3342
<ul>

package.json

Lines changed: 2 additions & 2 deletions
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.1",
5+
"version": "1.6.2",
66
"author": "Geocld <lijiahao5372@gmail.com>",
77
"main": "app/background.js",
88
"scripts": {
@@ -39,7 +39,7 @@
3939
"uplot": "^1.6.30",
4040
"uuid-1345": "^1.0.2",
4141
"xbox-webapi": "^1.4.1",
42-
"xstreaming-player": "0.2.11",
42+
"xstreaming-player": "0.2.12",
4343
"xvfb-maybe": "^0.2.1"
4444
},
4545
"devDependencies": {

renderer/components/ActionBar.tsx

Lines changed: 12 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useEffect } from "react";
21
import { useTranslation } from "next-i18next";
32
import {
43
Button,
@@ -17,47 +16,6 @@ function ActionBar(props) {
1716

1817
const { settings } = useSettings();
1918

20-
useEffect(() => {
21-
let lastMovement = 0;
22-
const mouseEvent = () => {
23-
lastMovement = Date.now();
24-
};
25-
window.addEventListener("mousemove", mouseEvent);
26-
window.addEventListener("mousedown", mouseEvent);
27-
28-
const escEvent = (event) => {
29-
if (event.key === 'Escape') {
30-
Ipc.send('app', 'exitFullscreen')
31-
}
32-
}
33-
window.addEventListener('keydown', escEvent)
34-
35-
const mouseInterval = setInterval(() => {
36-
const gamebarElement = document.getElementById("actionBar");
37-
if (gamebarElement === null) {
38-
return;
39-
}
40-
41-
if (Date.now() - lastMovement >= 2000) {
42-
if (!gamebarElement.className.includes("hidden")) {
43-
gamebarElement.className = "hidden";
44-
}
45-
} else {
46-
if (gamebarElement.className.includes("hidden")) {
47-
gamebarElement.className = "";
48-
}
49-
}
50-
}, 100);
51-
52-
return () => {
53-
if (mouseInterval) clearInterval(mouseInterval);
54-
55-
window.removeEventListener("mousemove", mouseEvent);
56-
window.removeEventListener("mousedown", mouseEvent);
57-
window.removeEventListener('keydown', escEvent)
58-
};
59-
}, []);
60-
6119
const handleDisconnect = () => {
6220
props.onDisconnect && props.onDisconnect();
6321
};
@@ -78,6 +36,10 @@ function ActionBar(props) {
7836
props.onAudio && props.onAudio();
7937
};
8038

39+
const handleMic = () => {
40+
props.onMic && props.onMic();
41+
};
42+
8143
const handleText = () => {
8244
props.onText && props.onText();
8345
};
@@ -127,6 +89,14 @@ function ActionBar(props) {
12789
)
12890
}
12991

92+
{/* {
93+
props.connectState === CONNECTED && (
94+
<DropdownItem key="mic" onClick={handleMic}>
95+
{t("Toggle mic")}
96+
</DropdownItem>
97+
)
98+
} */}
99+
130100
{
131101
(props.connectState === CONNECTED && props.type !== 'cloud') && (
132102
<DropdownItem key="text" onClick={handleText}>

renderer/pages/[locale]/stream.tsx

Lines changed: 60 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function Stream() {
4040
const [showDisplay, setShowDisplay] = useState(false);
4141
const [showAudio, setShowAudio] = useState(false);
4242
const [showTextModal, setShowTextModal] = useState(false);
43+
const [showActionbar, setShowActionbar] = useState(false);
4344
const [volume, setVolume] = useState(1);
4445
const [streamingType, setStreamingType] = useState('');
4546
const [consoleId, setConsoleId] = useState('');
@@ -65,6 +66,28 @@ function Stream() {
6566

6667
setStreamingType(streamType)
6768

69+
let lastMovement = 0;
70+
const mouseEvent = () => {
71+
lastMovement = Date.now();
72+
};
73+
window.addEventListener("mousemove", mouseEvent);
74+
window.addEventListener("mousedown", mouseEvent);
75+
76+
const escEvent = (event) => {
77+
if (event.key === 'Escape') {
78+
Ipc.send('app', 'exitFullscreen')
79+
}
80+
}
81+
window.addEventListener('keydown', escEvent)
82+
83+
const mouseInterval = setInterval(() => {
84+
if (Date.now() - lastMovement >= 2000) {
85+
setShowActionbar(false)
86+
} else {
87+
setShowActionbar(true)
88+
}
89+
}, 100);
90+
6891
if (xPlayer !== undefined) {
6992
xPlayer.bind();
7093

@@ -390,6 +413,12 @@ function Stream() {
390413
if (streamStateInterval.current) {
391414
clearInterval(streamStateInterval.current);
392415
}
416+
417+
if (mouseInterval) clearInterval(mouseInterval);
418+
419+
window.removeEventListener("mousemove", mouseEvent);
420+
window.removeEventListener("mousedown", mouseEvent);
421+
window.removeEventListener('keydown', escEvent)
393422
};
394423
}, [xPlayer, sessionId, t, router.query.serverid, settings]);
395424

@@ -548,6 +577,15 @@ function Stream() {
548577
}
549578
};
550579

580+
const handleToggleMic = () => {
581+
if (!xPlayer) return
582+
if(xPlayer.getChannelProcessor('chat').isPaused === true){
583+
xPlayer.getChannelProcessor('chat').startMic()
584+
} else {
585+
xPlayer.getChannelProcessor('chat').stopMic()
586+
}
587+
};
588+
551589
let videoHolderStyle = {}
552590

553591
if (settings.video_format) {
@@ -562,23 +600,28 @@ function Stream() {
562600

563601
return (
564602
<>
565-
<ActionBar
566-
connectState={connectState}
567-
type={streamingType}
568-
onDisconnect={onDisconnect}
569-
onDisconnectPowerOff={onDisconnectPowerOff}
570-
onTogglePerformance={() => {
571-
setShowPerformance(!showPerformance);
572-
}}
573-
onDisplay={() => setShowDisplay(true)}
574-
onAudio={() => setShowAudio(true)}
575-
onText={() => {
576-
xPlayer.setKeyboardInput(false)
577-
setShowTextModal(true)
578-
}}
579-
onPressNexus={handlePressNexus}
580-
onLongPressNexus={handleLongPressNexus}
581-
/>
603+
{
604+
showActionbar && (
605+
<ActionBar
606+
connectState={connectState}
607+
type={streamingType}
608+
onDisconnect={onDisconnect}
609+
onDisconnectPowerOff={onDisconnectPowerOff}
610+
onTogglePerformance={() => {
611+
setShowPerformance(!showPerformance);
612+
}}
613+
onDisplay={() => setShowDisplay(true)}
614+
onAudio={() => setShowAudio(true)}
615+
onMic={handleToggleMic}
616+
onText={() => {
617+
xPlayer.setKeyboardInput(false)
618+
setShowTextModal(true)
619+
}}
620+
onPressNexus={handlePressNexus}
621+
onLongPressNexus={handleLongPressNexus}
622+
/>
623+
)
624+
}
582625

583626
<FailedModal
584627
show={showFailed}

renderer/pages/[locale]/test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ function GamepadTester() {
194194
</div>
195195
<div>
196196
<Button
197+
style={{marginRight: 10}}
197198
color="secondary"
198199
onClick={() => {
199200
const gamepads = navigator.getGamepads();

renderer/public/locales/en/cloud.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@
4040
"Audio": "Audio",
4141
"Volume": "Volume",
4242
"Audio settings": "Audio settings",
43-
"Send text": "Send text"
43+
"Send text": "Send text",
44+
"Toggle mic": "Toggle mic"
4445
}

renderer/public/locales/jp/cloud.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@
4040
"Audio": "Audio",
4141
"Volume": "Volume",
4242
"Audio settings": "Audio settings",
43-
"Send text": "Send text"
43+
"Send text": "Send text",
44+
"Toggle mic": "Toggle mic"
4445
}

renderer/public/locales/pt/cloud.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@
4949
"Audio": "Audio",
5050
"Volume": "Volume",
5151
"Audio settings": "Audio settings",
52-
"Send text": "Send text"
52+
"Send text": "Send text",
53+
"Toggle mic": "Toggle mic"
5354
}

0 commit comments

Comments
 (0)