diff --git a/main/helpers/xcloudapi.ts b/main/helpers/xcloudapi.ts index a6d2b5c0..b85428d5 100644 --- a/main/helpers/xcloudapi.ts +++ b/main/helpers/xcloudapi.ts @@ -468,7 +468,7 @@ export default class xCloudApi { }, "input":{ "minVersion":1, - "maxVersion":7 + "maxVersion":8 }, "message":{ "minVersion":1, diff --git a/package.json b/package.json index 198919ca..2fd4592f 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "github-url-to-object": "^4.0.6", "uplot": "^1.6.24", "xbox-webapi": "^1.4.1", - "xbox-xcloud-player": "0.2.0-beta7" + "xbox-xcloud-player": "0.2.0-beta10" }, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/renderer/components/ui/button.tsx b/renderer/components/ui/button.tsx index 9289bbda..55e57f05 100644 --- a/renderer/components/ui/button.tsx +++ b/renderer/components/ui/button.tsx @@ -3,14 +3,16 @@ import Link from 'next/link'; interface ButtonProps { label: string; + icon?: string; title?: string; disabled?: boolean; className?: string; - onClick?: () => void; + onClick?: (e) => void; } function Button({ label, + icon, title, disabled, className, @@ -25,7 +27,14 @@ function Button({ return ( - + ); }; diff --git a/renderer/components/ui/streamcomponent.tsx b/renderer/components/ui/streamcomponent.tsx index 31192f1d..658f3faf 100644 --- a/renderer/components/ui/streamcomponent.tsx +++ b/renderer/components/ui/streamcomponent.tsx @@ -1,6 +1,3 @@ -import { ipcRenderer } from 'electron' -import Link from 'next/link' -import Router from 'next/router' import React from 'react' import Button from './button' import xPlayer from 'xbox-xcloud-player' @@ -11,7 +8,7 @@ import uPlot from 'uplot' interface StreamComponentProps { hidden?: boolean; onDisconnect?: () => void; - onMenu?: () => void; + onMenu?: (e) => void; xPlayer: xPlayer; } @@ -28,6 +25,8 @@ function StreamComponent({ let debugElement = document.getElementById('component_streamcomponent_debug') let webRtcStatsInterval + const [micStatus, setMicStatus] = React.useState(false); + let jitterData = [new Float32Array([performance.now()]), new Float32Array([0.0])] let droppedData = [new Float32Array([performance.now()]), new Float32Array([0.0]), new Float32Array([0.0])] let framesDroppedBaseline = 0 @@ -195,6 +194,16 @@ function StreamComponent({ }; }, []); + function toggleMic(){ + if(xPlayer.getChannelProcessor('chat').isPaused === true){ + xPlayer.getChannelProcessor('chat').startMic() + setMicStatus(true) + } else { + xPlayer.getChannelProcessor('chat').stopMic() + setMicStatus(false) + } + } + function streamDisconnect(){ // ipcRenderer.send('stream', { // type: 'stop_stream' @@ -237,14 +246,26 @@ function StreamComponent({
- - +
+ +
+   + +
+ +
- +
diff --git a/renderer/public/images/icons/muted.png b/renderer/public/images/icons/muted.png new file mode 100644 index 00000000..a3704c1a Binary files /dev/null and b/renderer/public/images/icons/muted.png differ diff --git a/renderer/public/images/icons/unmuted.png b/renderer/public/images/icons/unmuted.png new file mode 100644 index 00000000..11944afe Binary files /dev/null and b/renderer/public/images/icons/unmuted.png differ diff --git a/yarn.lock b/yarn.lock index 8054dd6d..705eff49 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11889,10 +11889,10 @@ xbox-webapi@^1.4.1: express "^4.17.1" uuid4 "^2.0.2" -xbox-xcloud-player@0.2.0-beta7: - version "0.2.0-beta7" - resolved "https://registry.yarnpkg.com/xbox-xcloud-player/-/xbox-xcloud-player-0.2.0-beta7.tgz#bbcad4580f5b862503d159952e5dd4b1a5a550d7" - integrity sha512-xqK8boN0MJ8q8NKtItT9E50r2DuUxa1CYFKyu7tdnjKXucoKZHY/83E06Kn8nc1Vyws0nvdLxsuS62PjqfgkTg== +xbox-xcloud-player@0.2.0-beta10: + version "0.2.0-beta10" + resolved "https://registry.yarnpkg.com/xbox-xcloud-player/-/xbox-xcloud-player-0.2.0-beta10.tgz#609b83124a24cb659ceeebad367f77e4e9fb5cc3" + integrity sha512-1YXCa5/qD7Jr7FaozW7nosl1qylyns/VjbekLm3567/erlsBXfFPyB7pv2AQtgJMBMfa4LPmNSZpr2wH1/TtTg== xmlbuilder@>=11.0.1, xmlbuilder@^15.1.1: version "15.1.1"