mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-29 02:41:44 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
b3b7a51979 | |||
831ccb31c1 | |||
d87ac78e57 | |||
67b419c37d | |||
a7b796362a | |||
889ee890f1 | |||
71a48f8afb | |||
354ecac97e | |||
45a7c28d3f |
77
README.md
77
README.md
@ -6,7 +6,8 @@ Give this project a 🌟 if you like it. Thank you 🙏.
|
||||
|
||||
## Features
|
||||
|
||||
<img width="475" alt="Settings UI" src="https://github.com/redphx/better-xcloud/assets/96280/ad687344-214d-4822-affe-21f1b1e105c8">
|
||||
<img width="475" alt="Settings UI" src="https://github.com/redphx/better-xcloud/assets/96280/20aca05d-ff20-4adb-ac21-08b4b1cfd07f">
|
||||
|
||||
<img width="475" alt="Stream HUD UI" src="https://github.com/redphx/better-xcloud/assets/96280/ff695d3a-b077-4b21-b778-beb0a1fdd6be">
|
||||
|
||||
|
||||
@ -23,13 +24,13 @@ Give this project a 🌟 if you like it. Thank you 🙏.
|
||||
- **Force high quality codec (if possible)<sup>(\*)</sup>**
|
||||
> Force xCloud to use the best streaming codec profile (same as desktop & TV) if possible. You don't have to change User-Agent anymore.
|
||||
> You should enable this feature even if you're on desktop.
|
||||
> Not available for some browsers (Firefox, Safari...).
|
||||
> Not available for some browsers (Firefox, Safari...). Use the [changing User-Agent method](https://github.com/redphx/better-xcloud/wiki/User‐Agent) instead.
|
||||
> Use more bandwidth & battery.
|
||||
> Comparison video with the setting ON & OFF: https://youtu.be/-9PuBJJSgR4
|
||||
- **Prefer IPv6 streaming server**
|
||||
> Might reduce latency.
|
||||
- **Disable bandwidth checking**
|
||||
> xCloud won't reduce quality when the internet speed is slow
|
||||
- **Disable bandwidth checking**
|
||||
> xCloud won't warn about slow connection speed.
|
||||
- **🔥 Capture screenshot**
|
||||
> Exclusive to **Better xCloud**. Check the [**Capture screenshot** section](#capture-screenshot) for more info.
|
||||
- **Skip Xbox splash video**
|
||||
@ -48,7 +49,7 @@ Give this project a 🌟 if you like it. Thank you 🙏.
|
||||
> Features like friends, chat... Disable these will make the page load faster.
|
||||
> Not working in Hermit ([#5](https://github.com/redphx/better-xcloud/issues/5)).
|
||||
- **Disable xCloud analytics**
|
||||
> The analytics contains statistics of your streaming session, so I'd recommend to allow analytics to help Xbox improve xCloud's experence in the future.
|
||||
> The analytics contains statistics of your streaming session, so I'd recommend allowing analytics to help Xbox improve xCloud's experience in the future.
|
||||
> Not working in Hermit ([#5](https://github.com/redphx/better-xcloud/issues/5)).
|
||||
- **Hide footer and other UI elements**
|
||||
- **🔥 Show stream stats**
|
||||
@ -89,7 +90,7 @@ Don't see your browser in the table? If it supports Tampermonkey/Userscript then
|
||||
|
||||
---
|
||||
- **Kiwi Browser** is the best choice on Android. All features work, it means you can get 1080p stream + high quality codec profile (the best possible quality).
|
||||
- **Better xCloud** also works on Android TV, but you'll have to sideload the browser APK and need a bluetooth mouse if you want to interact with the Settings.
|
||||
- **Better xCloud** also works on Android TV, but you'll have to sideload the browser APK and need a Bluetooth mouse if you want to interact with the Settings.
|
||||
|
||||
## Stream stats
|
||||

|
||||
@ -97,80 +98,64 @@ Don't see your browser in the table? If it supports Tampermonkey/Userscript then
|
||||
- While playing > `...` > `Stream Stats`.
|
||||
- This bar is updated every second.
|
||||
|
||||
| Abbr. | Full name | Explain |
|
||||
|------:|:-------------------|:------------------------------------------------------------------------------------------------------------------|
|
||||
| FPS | Frames per Seconds | The number of decoded frames in the last second |
|
||||
| RTT | Round Trip Time | The number of seconds it takes for data to be sent from your device to the server and back over (lower is better) |
|
||||
| BR | Bitrate | The amount of data server send to your device in the last second |
|
||||
| PL | Packets Lost | Total number of packets lost |
|
||||
| FL | Frames Lost | The total number of frames dropped prior to decode or dropped because the frame missed its display deadline |
|
||||
| Abbr. | Full name | Explain |
|
||||
|------:|:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| FPS | Frames per Seconds | The number of decoded frames in the last second |
|
||||
| RTT | Round Trip Time | The number of seconds it takes for data to be sent from your device to the server and back over (similar to ping, lower is better) |
|
||||
| BR | Bitrate | The amount of data the server sent to your device in the last second |
|
||||
| PL | Packets Lost | The total number of packets lost |
|
||||
| FL | Frames Lost | The total number of frames dropped prior to decode or dropped because the frame missed its display deadline |
|
||||
|
||||
These info are provied by WebRTC API. You can use browser's built-in tool to see more info:
|
||||
This info is provided by WebRTC API. You can use browser's built-in tool to see more info:
|
||||
- Chrome/Edge/Chromium variants: `chrome://webrtc-internals`
|
||||
- Firefox: `about:webrtc`
|
||||
|
||||
📝 Having this info on all the time might reduce your enjoyment, so I'd recommend only using it when having network problems.
|
||||
|
||||
|
||||
## Capture screenshot
|
||||
- This feature is only available in **Better xCloud**.
|
||||
- Works on both desktop & mobile, but it's designed for mobile users.
|
||||
- Works on both desktop & mobile, but it was designed for mobile users.
|
||||
- It's client-side only.
|
||||
- It captures the current frame of the stream and save to a file. That means you won't get the raw quality like when you play on console, but it's still better than using the built-in screenshot feature on your phone.
|
||||
- It captures the current frame of the stream and saves it to a file. That means you won't get the raw quality like when you play on a console, but it's still better than using the built-in screenshot feature on your phone.
|
||||
- Screenshot's resolution & quality depend on the quality of the stream at the moment.
|
||||
- Screenshot doesn't include touch UI, notification bar... only the gameplay.
|
||||
- There might be a slight delay.
|
||||
- ⚠️ It's not possible to map the Share/Screenshot button on your controller to this feature.
|
||||
|
||||
### How to capture screenshot
|
||||
1. Enable this feature in setting.
|
||||
1. Enable this feature in the Settings.
|
||||
2. Play a game.
|
||||
3. Tap once at the bottom left/right (depend on your setting) to show the Screenshot button.
|
||||
3. Tap once at the bottom left/right (depending on your setting) to show the Screenshot button.
|
||||
4. Tap on that button to capture screenshot.
|
||||
5. Screenshot will be saved by browser.
|
||||
6. You can double tap that corner to capture screenshot.
|
||||
5. Screenshot will be saved by the browser.
|
||||
6. You can double-tap that corner to capture screenshot.
|
||||
|
||||
<img width="600" alt="Screenshot button" src="https://github.com/redphx/better-xcloud/assets/96280/a911b141-5dc0-450a-aeac-30d9cf202b44">
|
||||
|
||||
## FAQ
|
||||
1. **Will I get banned for using this?**
|
||||
I think it's very unlikely that you'll get banned for using this. Most of the features only affect client-side, except for switching region of streaming server (you'll connect to another server instead of the default one). If you want to be safe just avoid using that. As always, use as your own risk.
|
||||
I think it's very unlikely that you'll get banned for using this. Most of the features only affect client-side, except for switching region of streaming server (you'll connect to another server instead of the default one). If you want to be safe just avoid using that. As always, use it as your own risk.
|
||||
|
||||
2. **Why is it an Userscript and not extension?**
|
||||
2. **Why is it an Userscript and not an extension?**
|
||||
It's because not many browsers on Android support installing extensions (and not all extensions can be installed).
|
||||
|
||||
3. **I see "???" button instead of server's name**
|
||||
3. **I see "???" button instead of the server's name**
|
||||
That means Tampermonkey is not working properly. Please make sure you're using the latest version or switch to a well-known browser.
|
||||
|
||||
4. **Can I use this with the Xbox Android app?**
|
||||
No you can't. You'll have to modify the app.
|
||||
No, you can't. You'll have to modify the app.
|
||||
|
||||
5. **Will you able to enable "Clarity Boost" feature on non-Edge browsers?**
|
||||
No. "Clarity Boost" feature uses an exclusive API (`Video.msVideoProcessing`) that's only available on Edge browser for desktop at the moment.
|
||||
5. **Will you be able to enable the "Clarity Boost" feature on non-Edge browsers?**
|
||||
No. The "Clarity Boost" feature uses an exclusive API (`Video.msVideoProcessing`) that's only available on Edge browser for desktop at the moment.
|
||||
|
||||
## User-Agent
|
||||
You're no longer needed to change User-Agent since you can just use the **Force high quality stream** setting.
|
||||
If your browser doesn't support **Force high quality stream** setting, try changing User-Agent to:
|
||||
```
|
||||
Mozilla/5.0 (SMART-TV; LINUX; Tizen 7.0) AppleWebKit/537.36 (KHTML, like Gecko) 94.0.4606.31/7.0 TV Safari/537.36
|
||||
```
|
||||
This will change your device to a Samsung TV running Tizen OS. It will improve the stream quality.
|
||||
|
||||
---
|
||||
Change User-Agent to:
|
||||
```
|
||||
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67
|
||||
```
|
||||
This will trick xCloud into thinking you're using Edge browser on desktop.
|
||||
|
||||
Other options (only do one of these):
|
||||
- Add ` smarttv` to switch to Smart TV layout.
|
||||
- Add ` Xbox;` to become an Xbox console.
|
||||
- Add ` 36102dd3-6953-45f6-8b48-031fb95e0e0d` to become a Logitech G Cloud device.
|
||||
- Add ` 0ed22b6f-b61d-41eb-810a-a1ed586a550b` to become a Razer Edge device.
|
||||
Moved to [wiki](https://github.com/redphx/better-xcloud/wiki/User‐Agent).
|
||||
|
||||
## Acknowledgements
|
||||
- [n-thumann/xbox-cloud-server-selector](https://github.com/n-thumann/xbox-cloud-server-selector) for the idea of IPv6 feature
|
||||
- Icons by [Adam Design](https://www.iconfinder.com/iconsets/user-interface-outline-27)
|
||||
|
||||
## Disclaimers
|
||||
- Use as your own risk.
|
||||
- Use as it your own risk.
|
||||
- This project is not affiliated with Xbox in any way. All Xbox logos/icons/trademarks are copyright of their respective owners.
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name Better xCloud
|
||||
// @namespace https://github.com/redphx
|
||||
// @version 1.6
|
||||
// @version 1.6.1
|
||||
// @description Improve Xbox Cloud Gaming (xCloud) experience
|
||||
// @author redphx
|
||||
// @license MIT
|
||||
@ -13,7 +13,7 @@
|
||||
// ==/UserScript==
|
||||
'use strict';
|
||||
|
||||
const SCRIPT_VERSION = '1.6';
|
||||
const SCRIPT_VERSION = '1.6.1';
|
||||
const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
|
||||
|
||||
const SERVER_REGIONS = {};
|
||||
@ -173,6 +173,9 @@ class StreamStats {
|
||||
|
||||
|
||||
class Preferences {
|
||||
static get LAST_UPDATE_CHECK() { return 'last_update_check'; }
|
||||
static get LATEST_VERSION() { return 'latest_version'; }
|
||||
|
||||
static get SERVER_REGION() { return 'server_region'; }
|
||||
static get PREFER_IPV6_SERVER() { return 'prefer_ipv6_server'; }
|
||||
static get FORCE_1080P_STREAM() { return 'force_1080p_stream'; }
|
||||
@ -325,6 +328,26 @@ class Preferences {
|
||||
const PREFS = new Preferences();
|
||||
|
||||
|
||||
function checkForUpdate() {
|
||||
const CHECK_INTERVAL_SECONDS = 4 * 3600 * 1000; // check every 4 hours
|
||||
const lastCheck = PREFS.get(Preferences.LAST_UPDATE_CHECK, 0);
|
||||
const now = +new Date;
|
||||
|
||||
if (now - lastCheck < CHECK_INTERVAL_SECONDS) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Start checking
|
||||
PREFS.set(Preferences.LAST_UPDATE_CHECK, now);
|
||||
fetch('https://api.github.com/repos/redphx/better-xcloud/releases/latest')
|
||||
.then(response => response.json())
|
||||
.then(json => {
|
||||
// Store the latest version
|
||||
PREFS.set(Preferences.LATEST_VERSION, json.tag_name.substring(1));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function addCss() {
|
||||
let css = `
|
||||
.better_xcloud_settings_button {
|
||||
@ -341,6 +364,10 @@ function addCss() {
|
||||
background-color: #515863;
|
||||
}
|
||||
|
||||
.better_xcloud_settings_button[data-update-available]::after {
|
||||
content: ' 🌟';
|
||||
}
|
||||
|
||||
.better_xcloud_settings {
|
||||
background-color: #151515;
|
||||
user-select: none;
|
||||
@ -362,7 +389,11 @@ function addCss() {
|
||||
outline: none !important;
|
||||
}
|
||||
|
||||
.better_xcloud_settings_wrapper a {
|
||||
.better_xcloud_settings_wrapper .better_xcloud_settings_title_wrapper {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.better_xcloud_settings_wrapper a.better_xcloud_settings_title {
|
||||
font-family: Bahnschrift, Arial, Helvetica, sans-serif;
|
||||
font-size: 20px;
|
||||
text-decoration: none;
|
||||
@ -370,18 +401,37 @@ function addCss() {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
color: #5dc21e;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
.better_xcloud_settings_wrapper a:hover {
|
||||
.better_xcloud_settings_wrapper a.better_xcloud_settings_title:hover {
|
||||
color: #83f73a;
|
||||
}
|
||||
}
|
||||
|
||||
.better_xcloud_settings_wrapper a:focus {
|
||||
.better_xcloud_settings_wrapper a.better_xcloud_settings_title:focus {
|
||||
color: #83f73a;
|
||||
}
|
||||
|
||||
.better_xcloud_settings_wrapper a.better_xcloud_settings_update {
|
||||
display: none;
|
||||
color: #ff834b;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
.better_xcloud_settings_wrapper a.better_xcloud_settings_update:hover {
|
||||
color: #ff9869;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.better_xcloud_settings_wrapper a.better_xcloud_settings_update:focus {
|
||||
color: #ff9869;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.better_xcloud_settings_wrapper .setting_row {
|
||||
display: flex;
|
||||
margin-bottom: 8px;
|
||||
@ -507,7 +557,6 @@ div[class*=StreamMenu-module__menuContainer] > div[class*=Menu-module] {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
opacity: 0.8;
|
||||
background-color: #000;
|
||||
color: #fff;
|
||||
@ -841,30 +890,47 @@ function injectSettingsButton($parent) {
|
||||
}
|
||||
|
||||
const CE = createElement;
|
||||
const preferredRegion = getPreferredServerRegion();
|
||||
const PREF_PREFERRED_REGION = getPreferredServerRegion();
|
||||
const PREF_LATEST_VERSION = PREFS.get(Preferences.LATEST_VERSION, null);
|
||||
|
||||
const $button = CE('button', {'class': 'better_xcloud_settings_button'}, preferredRegion);
|
||||
const $button = CE('button', {'class': 'better_xcloud_settings_button'}, PREF_PREFERRED_REGION);
|
||||
$button.addEventListener('click', e => {
|
||||
const $settings = document.querySelector('.better_xcloud_settings');
|
||||
$settings.classList.toggle('better_xcloud_settings_gone');
|
||||
$settings.scrollIntoView();
|
||||
});
|
||||
|
||||
if (PREF_LATEST_VERSION && PREF_LATEST_VERSION !== SCRIPT_VERSION) {
|
||||
$button.setAttribute('data-update-available', true);
|
||||
}
|
||||
|
||||
$parent.appendChild($button);
|
||||
|
||||
const $container = CE('div', {
|
||||
'class': 'better_xcloud_settings better_xcloud_settings_gone',
|
||||
});
|
||||
|
||||
const $wrapper = CE('div', {
|
||||
'class': 'better_xcloud_settings_wrapper',
|
||||
});
|
||||
let $updateAvailable;
|
||||
const $wrapper = CE('div', {'class': 'better_xcloud_settings_wrapper'},
|
||||
CE('div', {'class': 'better_xcloud_settings_title_wrapper'},
|
||||
CE('a', {
|
||||
'class': 'better_xcloud_settings_title',
|
||||
'href': SCRIPT_HOME,
|
||||
'target': '_blank',
|
||||
}, 'Better xCloud ' + SCRIPT_VERSION),
|
||||
$updateAvailable = CE('a', {
|
||||
'class': 'better_xcloud_settings_update',
|
||||
'href': 'https://github.com/redphx/better-xcloud/releases',
|
||||
'target': '_blank',
|
||||
})
|
||||
)
|
||||
);
|
||||
$container.appendChild($wrapper);
|
||||
|
||||
const $title = CE('a', {
|
||||
href: SCRIPT_HOME,
|
||||
target: '_blank',
|
||||
}, 'Better xCloud ' + SCRIPT_VERSION);
|
||||
$wrapper.appendChild($title);
|
||||
if (PREF_LATEST_VERSION && PREF_LATEST_VERSION != SCRIPT_VERSION) {
|
||||
$updateAvailable.textContent = `🌟 Version ${PREF_LATEST_VERSION} available`;
|
||||
$updateAvailable.style.display = 'block';
|
||||
}
|
||||
|
||||
for (let setting of Preferences.SETTINGS) {
|
||||
if (setting.hidden) {
|
||||
@ -882,7 +948,7 @@ function injectSettingsButton($parent) {
|
||||
});
|
||||
|
||||
if (setting.id === Preferences.SERVER_REGION) {
|
||||
selectedValue = preferredRegion;
|
||||
selectedValue = PREF_PREFERRED_REGION;
|
||||
setting.options = {};
|
||||
for (let regionName in SERVER_REGIONS) {
|
||||
const region = SERVER_REGIONS[regionName];
|
||||
@ -1543,6 +1609,10 @@ if (PREFS.get(Preferences.DISABLE_BANDWIDTH_CHECKING)) {
|
||||
});
|
||||
}
|
||||
|
||||
// Check for Update
|
||||
checkForUpdate();
|
||||
|
||||
// Monkey patches
|
||||
patchRtcCodecs();
|
||||
interceptHttpRequests();
|
||||
patchVideoApi();
|
||||
|
Reference in New Issue
Block a user