mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Fix unexpected behavior with Stream bar when using Quest VR profile
This commit is contained in:
parent
6b88f73e34
commit
b3033089ed
@ -35,7 +35,7 @@ function cloneStreamHudButton($orgButton: HTMLElement, label: string, svgIcon: t
|
||||
}
|
||||
};
|
||||
|
||||
if (STATES.hasTouchSupport) {
|
||||
if (STATES.browserHasTouchSupport) {
|
||||
$container.addEventListener('transitionstart', onTransitionStart);
|
||||
$container.addEventListener('transitionend', onTransitionEnd);
|
||||
}
|
||||
|
2
src/types/index.d.ts
vendored
2
src/types/index.d.ts
vendored
@ -27,7 +27,9 @@ type BxStates = {
|
||||
isPlaying: boolean;
|
||||
appContext: any | null;
|
||||
serverRegions: any;
|
||||
|
||||
hasTouchSupport: boolean;
|
||||
browserHasTouchSupport: boolean;
|
||||
|
||||
currentStream: Partial<{
|
||||
titleId: string;
|
||||
|
@ -10,13 +10,15 @@ const userAgent = window.navigator.userAgent.toLowerCase();
|
||||
|
||||
const isTv = userAgent.includes('smart-tv') || userAgent.includes('smarttv') || /\baft.*\b/.test(userAgent);
|
||||
const isVr = window.navigator.userAgent.includes('VR') && window.navigator.userAgent.includes('OculusBrowser');
|
||||
const hasTouchSupport = !isTv && !isVr && ('ontouchstart' in window || navigator.maxTouchPoints > 0);
|
||||
const browserHasTouchSupport = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
||||
const hasTouchSupport = !isTv && !isVr && browserHasTouchSupport;
|
||||
|
||||
export const STATES: BxStates = {
|
||||
isPlaying: false,
|
||||
appContext: {},
|
||||
serverRegions: {},
|
||||
hasTouchSupport: hasTouchSupport,
|
||||
browserHasTouchSupport: browserHasTouchSupport,
|
||||
|
||||
currentStream: {},
|
||||
remotePlay: {},
|
||||
|
Loading…
x
Reference in New Issue
Block a user