mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 15:47:18 +02:00
Fix the fullscreen bug on Android (#49)
This commit is contained in:
parent
da7ff64471
commit
5a5c65e7a2
@ -2135,7 +2135,7 @@ function injectSettingsButton($parent) {
|
||||
$control.title = 'Your browser doesn\'t support this feature';
|
||||
} else if (settingId === Preferences.STREAM_TOUCH_CONTROLLER) {
|
||||
// Disable this setting for non-touchable devices
|
||||
if (!('ontouchstart'in window) && navigator.maxTouchPoints === 0) {
|
||||
if (!('ontouchstart' in window) && navigator.maxTouchPoints === 0) {
|
||||
$control.disabled = true;
|
||||
$control.title = 'Your device doesn\'t have touch support';
|
||||
}
|
||||
@ -2784,6 +2784,22 @@ function onStreamStarted($video) {
|
||||
}
|
||||
|
||||
|
||||
function disablePwa() {
|
||||
const userAgent = (window.navigator.orgUserAgent || window.navigator.userAgent || '').toLowerCase();
|
||||
if (!userAgent) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if it's Safari on mobile
|
||||
if (userAgent.includes('mobile') && userAgent.includes('safari') && !userAgent.includes('chrom')) {
|
||||
// Disable the PWA prompt
|
||||
Object.defineProperty(window.navigator, 'standalone', {
|
||||
value: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Hide Settings UI when navigate to another page
|
||||
window.addEventListener('xcloud_popstate', onHistoryChanged);
|
||||
window.addEventListener('popstate', onHistoryChanged);
|
||||
@ -2831,7 +2847,4 @@ setupVideoSettingsBar();
|
||||
setupScreenshotButton();
|
||||
StreamStats.render();
|
||||
|
||||
// Disable PWA prompt in Safari on iOS/iPadOS
|
||||
Object.defineProperty(window.navigator, 'standalone', {
|
||||
value: true,
|
||||
});
|
||||
disablePwa();
|
||||
|
Loading…
x
Reference in New Issue
Block a user