mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 23:57: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('transitionstart', onTransitionStart);
|
||||||
$container.addEventListener('transitionend', onTransitionEnd);
|
$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;
|
isPlaying: boolean;
|
||||||
appContext: any | null;
|
appContext: any | null;
|
||||||
serverRegions: any;
|
serverRegions: any;
|
||||||
|
|
||||||
hasTouchSupport: boolean;
|
hasTouchSupport: boolean;
|
||||||
|
browserHasTouchSupport: boolean;
|
||||||
|
|
||||||
currentStream: Partial<{
|
currentStream: Partial<{
|
||||||
titleId: string;
|
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 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 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 = {
|
export const STATES: BxStates = {
|
||||||
isPlaying: false,
|
isPlaying: false,
|
||||||
appContext: {},
|
appContext: {},
|
||||||
serverRegions: {},
|
serverRegions: {},
|
||||||
hasTouchSupport: hasTouchSupport,
|
hasTouchSupport: hasTouchSupport,
|
||||||
|
browserHasTouchSupport: browserHasTouchSupport,
|
||||||
|
|
||||||
currentStream: {},
|
currentStream: {},
|
||||||
remotePlay: {},
|
remotePlay: {},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user