Compare commits

...

6 Commits

Author SHA1 Message Date
ecf9b414ba Bump version to 1.1.3 2023-07-15 12:27:30 +07:00
f78bd31b58 Fix video not showing then the "Skip splash video" setting is off 2023-07-15 12:27:03 +07:00
da54bd5302 Update README.md 2023-07-15 09:56:59 +07:00
5479eeb66f Bump version to 1.1.2 2023-07-15 09:46:08 +07:00
a9eb70eaae Hide video player until it's ready 2023-07-15 09:40:13 +07:00
0e2066e461 Add Compatibility section 2023-07-15 07:45:54 +07:00
2 changed files with 39 additions and 21 deletions

View File

@ -2,12 +2,12 @@
Improve [Xbox Cloud Gaming (xCloud)](https://www.xbox.com/play/) experience on web browser. 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 Android users, but it should work great on desktop too.
## Features: ## Features
<img width="474" alt="image" src="https://github.com/redphx/better-xcloud/assets/96280/2793d404-3185-4c91-a500-dde362c661dd"> <img width="474" alt="image" src="https://github.com/redphx/better-xcloud/assets/96280/2793d404-3185-4c91-a500-dde362c661dd">
- Switch region of streaming server. - Switch region of streaming server.
- Prefer IPv6 streaming server (might improve latency). - Prefer IPv6 streaming server (might reduce latency).
- Force HD stream by disabling bandwidth checking -> xCloud always tries to use the best possible quality. - Force HD stream by disabling bandwidth checking -> xCloud always tries to use the best possible quality.
- Skip Xbox splash video. - Skip Xbox splash video.
- Make the top-left dots icon invisible while playing. You can still click on it, but it doesn't block the screen anymore. - Make the top-left dots icon invisible while playing. You can still click on it, but it doesn't block the screen anymore.
@ -18,7 +18,7 @@ The main target of this script is Android users, but it should work great on des
- Disable social features (friends, chat...). - Disable social features (friends, chat...).
- 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. - 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.
## How to use: ## How to use
1. Install [Tampermonkey extension](https://www.tampermonkey.net/) on suppported browsers. It's also available for Firefox on Android. 1. Install [Tampermonkey extension](https://www.tampermonkey.net/) on suppported browsers. It's also available for Firefox on Android.
2. Install **Better xCloud**: 2. Install **Better xCloud**:
- [Directly on Github](https://github.com/redphx/better-xcloud/releases/latest/download/better-xcloud.user.js) - [Directly on Github](https://github.com/redphx/better-xcloud/releases/latest/download/better-xcloud.user.js)
@ -42,10 +42,20 @@ Other options (only do one of these):
- Add ` 36102dd3-6953-45f6-8b48-031fb95e0e0d` to become a Logitech G Cloud device. - 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. - Add ` 0ed22b6f-b61d-41eb-810a-a1ed586a550b` to become a Razer Edge device.
## Tested on: ## Compatibility
- Chrome on macOS. ✅ = confirmed to be working
- Firefox for Android with Tampermonkey add-on. ❓ = not yet tested
- *(NOT RECOMMENDED at the moment since its Userscript implementation is not working properly)* [Hermit Browser](https://hermit.chimbori.com) on Android. It supports custom User-Agent and has built-in Userscript support (premium features, only $7.99) so you don't have to install anything else. I built **Better xCloud** just so I could use it with Hermit. ❌ = not supported (mostly because of lacking Userscript/extension support)
⚠️ = see custom notes
| | Desktop | Android | iOS |
|----------------------------------------|----------|------------------|-----|
| Chrome | ✅ | ❌ | ❌ |
| Firefox | ✅ | ✅ | ❌ |
| Edge | ❓ | ❌ | ❌ |
| Safari | ❓ | ❌ | ❓ |
| [Hermit](https://hermit.chimbori.com) | ❌ | ⚠️<sup>(1)</sup> | ❌ |
<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 both custom User-Agent and Userscript (premium features, only $7.99) without having to install anything else. I built **Better xCloud** just so I could use it with Hermit.
## FAQ ## FAQ
1. **Why is it an Userscript and not extension?** 1. **Why is it an Userscript and not extension?**

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name Better xCloud // @name Better xCloud
// @namespace https://github.com/redphx // @namespace https://github.com/redphx
// @version 1.1.1 // @version 1.1.3
// @description Improve Xbox Cloud Gaming (xCloud) experience // @description Improve Xbox Cloud Gaming (xCloud) experience
// @author redphx // @author redphx
// @license MIT // @license MIT
@ -13,7 +13,7 @@
// ==/UserScript== // ==/UserScript==
'use strict'; 'use strict';
const SCRIPT_VERSION = '1.1.1'; const SCRIPT_VERSION = '1.1.3';
const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud'; const SCRIPT_HOME = 'https://github.com/redphx/better-xcloud';
const SERVER_REGIONS = {}; const SERVER_REGIONS = {};
@ -284,6 +284,9 @@ div[class*=NotFocusedDialog] {
height: 0px !important; height: 0px !important;
} }
#game-stream video {
visibility: hidden;
}
`; `;
// Reduce animations // Reduce animations
@ -775,24 +778,29 @@ function watchHeader() {
function patchVideoApi() { function patchVideoApi() {
const PREF_SKIP_SPLASH_VIDEO = PREFS.get(Preferences.SKIP_SPLASH_VIDEO); const PREF_SKIP_SPLASH_VIDEO = PREFS.get(Preferences.SKIP_SPLASH_VIDEO);
// Do nothing if the "Skip splash video" setting is off
if (!PREF_SKIP_SPLASH_VIDEO) { // Show video player when it's ready
return; var showFunc;
showFunc = function() {
this.style.visibility = 'visible';
this.removeEventListener('playing', showFunc);
} }
HTMLMediaElement.prototype.orgPlay = HTMLMediaElement.prototype.play; HTMLMediaElement.prototype.orgPlay = HTMLMediaElement.prototype.play;
HTMLMediaElement.prototype.play = function() { HTMLMediaElement.prototype.play = function() {
if (!this.className.startsWith('XboxSplashVideo')) { if (PREF_SKIP_SPLASH_VIDEO && this.className.startsWith('XboxSplashVideo')) {
return this.orgPlay.apply(this); this.volume = 0;
this.style.display = 'none';
this.dispatchEvent(new Event('ended'));
return {
catch: () => {},
};
} }
this.volume = 0;
this.style.display = 'none'; this.addEventListener('playing', showFunc);
this.dispatchEvent(new Event('ended')); return this.orgPlay.apply(this);
return {
catch: () => {},
};
}; };
} }