Fix unexpected behavior with Stream bar when using Quest VR profile

This commit is contained in:
redphx 2024-05-11 10:47:29 +07:00
parent 6b88f73e34
commit b3033089ed
3 changed files with 6 additions and 2 deletions

View File

@ -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);
}

View File

@ -27,7 +27,9 @@ type BxStates = {
isPlaying: boolean;
appContext: any | null;
serverRegions: any;
hasTouchSupport: boolean;
browserHasTouchSupport: boolean;
currentStream: Partial<{
titleId: string;

View File

@ -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: {},