Compare commits

...

4 Commits
v1.3 ... v1.3.1

Author SHA1 Message Date
a318db4ec2 Update better-xcloud.user.js 2023-07-16 15:56:08 +07:00
aaa8348984 Update README.md 2023-07-16 15:55:44 +07:00
2cea30cf16 Check support of RTCRtpTransceiver.setCodecPreferences() 2023-07-16 15:50:44 +07:00
0fe99f8f2d Update README.md 2023-07-16 15:16:43 +07:00
2 changed files with 32 additions and 14 deletions

View File

@ -1,6 +1,6 @@
# Better xCloud
Improve [Xbox Cloud Gaming (xCloud)](https://www.xbox.com/play/) experience on web browser.
The main target of this script is Android users, but it should work great on desktop too.
The main target of this script is mobile users, but it should work great on desktop too.
Give this project a 🌟 if you like it. Thank you.
@ -10,11 +10,13 @@ Give this project a 🌟 if you like it. Thank you.
<img width="500" alt="Video Settings UI" src="https://github.com/redphx/better-xcloud/assets/96280/130aa870-6938-4604-9e23-45e217b800cc">
- **Switch region of streaming server**
> Connect to another server instead of the default one
> Connect to another server instead of the default one. Check [FAQ section](#faq) for some notes.
- **Prefer IPv6 streaming server**
> Might reduce latency
- **Force high quality stream**
> Force xCloud to use the best streaming codec (same as desktop). You don't have to change User-Agent anymore. Affect battery life.
> Force xCloud to use the best streaming codec profile (same as desktop). You don't have to change User-Agent anymore.
> Some browsers (like Firefox) don't support this feature. Check [the full list](https://caniuse.com/?search=setCodecPreferences).
> If you're on Android and want to use it, try [Hermit](https://hermit.chimbori.com).
- **Disable bandwidth checking**
> xCloud won't reduce quality when the internet speed is slow
- **Skip Xbox splash video**
@ -49,16 +51,17 @@ To update manually, just install the script again (you won't lose your settings)
❓ = not yet tested
❌ = not supported (mostly because of lacking Userscript/extension support)
⚠️ = see custom notes
| | Desktop | Android | iOS |
|----------------------------------------|----------|------------------|-----|
| Chrome/Edge/Chromium variants | ✅ | ❌ | ❌ |
| Firefox | ✅ | ✅ | ❌ |
| Safari | ❓ | ❌ | ❓ |
| [Hermit](https://hermit.chimbori.com) | ❌ | ⚠️<sup>(1)</sup> | ❌ |
| | Desktop | Android | iOS |
|----------------------------------------|------------------|------------------|-----------------|
| Chrome/Edge/Chromium variants | ✅ | ❌ | ❌ |
| Firefox | ✅ | ✅ | ❌ |
| Safari | <sup>(1)</sup> | ❌ | ✅<sup>(2)</sup> |
| [Hermit](https://hermit.chimbori.com) | ❌ | ⚠️<sup>(3)</sup> | ❌ |
Don't see your browser in the table? If it supports Tampermonkey/Userscript then the answer is likely **"YES"**.
<sup>1</sup> NOT RECOMMENDED at the moment since its Userscript implementation is not working properly. Non-network related features (skip splash video, video settings...) still work. It's still my favorite app to play xCloud on because it's lightweight, supports Userscript (premium features, only $1.99) without having to install anything else. I built **Better xCloud** just so I could use it with Hermit.
<sup>1, 2</sup> Requires [Userscripts app](https://apps.apple.com/us/app/userscripts/id1463298887).
<sup>3</sup> NOT RECOMMENDED at the moment since its Userscript implementation is not working properly. Non-network related features (skip splash video, video settings...) still work. It's still my favorite app to play xCloud on because it's lightweight, supports Userscript (premium features, only $1.99) without having to install anything else. I built **Better xCloud** just so I could use it with Hermit.
## FAQ
1. **Will I get banned for using this?**

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Better xCloud
// @namespace https://github.com/redphx
// @version 1.3
// @version 1.3.1
// @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx
// @license MIT
@ -13,7 +13,7 @@
// ==/UserScript==
'use strict';
const SCRIPT_VERSION = '1.3';
const SCRIPT_VERSION = '1.3.1';
const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
const SERVER_REGIONS = {};
@ -607,6 +607,12 @@ function injectSettingsButton($parent) {
setting.value = PREFS.get(setting.id);
$control.checked = setting.value;
if (setting.id === Preferences.USE_DESKTOP_CODEC && !hasRtcSetCodecPreferencesSupport()) {
$control.disabled = true;
$control.checked = false;
$control.title = 'Not supported by this browser';
}
}
const $elm = CE('div', {'class': 'setting_row'},
@ -841,8 +847,17 @@ function patchVideoApi() {
}
function hasRtcSetCodecPreferencesSupport() {
return (typeof RTCRtpTransceiver !== 'undefined' && 'setCodecPreferences' in RTCRtpTransceiver.prototype)
}
function patchRtcCodecs() {
if (typeof RTCRtpTransceiver === 'undefined' || !PREFS.get(Preferences.USE_DESKTOP_CODEC)) {
if (!PREFS.get(Preferences.USE_DESKTOP_CODEC)) {
return;
}
if (!hasRtcSetCodecPreferencesSupport()) {
console.log('[Better xCloud] RTCRtpTransceiver.setCodecPreferences() is not supported');
return;
}