diff --git a/src/modules/stream/stream-ui.ts b/src/modules/stream/stream-ui.ts index 3fca5b7..bf94531 100644 --- a/src/modules/stream/stream-ui.ts +++ b/src/modules/stream/stream-ui.ts @@ -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); } diff --git a/src/types/index.d.ts b/src/types/index.d.ts index bc94f5f..ea1e741 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -27,7 +27,9 @@ type BxStates = { isPlaying: boolean; appContext: any | null; serverRegions: any; + hasTouchSupport: boolean; + browserHasTouchSupport: boolean; currentStream: Partial<{ titleId: string; diff --git a/src/utils/global.ts b/src/utils/global.ts index de7cc04..82d5cc3 100644 --- a/src/utils/global.ts +++ b/src/utils/global.ts @@ -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: {},