disable fullscreen on iPhone

This commit is contained in:
Samuel Newman
2024-08-05 12:07:04 +01:00
parent bca7635ca4
commit 6865382022
2 changed files with 14 additions and 11 deletions
+1
View File
@@ -15,6 +15,7 @@ export const isMobileWeb =
isWeb && isWeb &&
// @ts-ignore we know window exists -prf // @ts-ignore we know window exists -prf
global.window.matchMedia(isMobileWebMediaQuery)?.matches global.window.matchMedia(isMobileWebMediaQuery)?.matches
export const isIPhoneWeb = isWeb && /iPhone/.test(navigator.userAgent)
export const deviceLocales = dedupArray( export const deviceLocales = dedupArray(
getLocales?.() getLocales?.()
@@ -11,6 +11,7 @@ import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import type Hls from 'hls.js' import type Hls from 'hls.js'
import {isIPhoneWeb} from '#/platform/detection'
import { import {
useAutoplayDisabled, useAutoplayDisabled,
useSetSubtitlesEnabled, useSetSubtitlesEnabled,
@@ -259,17 +260,18 @@ export function Controls({
<UnmuteIcon fill={t.palette.white} width={20} /> <UnmuteIcon fill={t.palette.white} width={20} />
)} )}
</Button> </Button>
{/* TODO: find workaround for iOS Safari */} {!isIPhoneWeb && (
<Button <Button
label={_(muted ? msg`Unmute` : msg`Mute`)} label={_(muted ? msg`Unmute` : msg`Mute`)}
onPress={onPressFullscreen} onPress={onPressFullscreen}
{...btnProps}> {...btnProps}>
{isFullscreen ? ( {isFullscreen ? (
<ArrowsInIcon fill={t.palette.white} width={20} /> <ArrowsInIcon fill={t.palette.white} width={20} />
) : ( ) : (
<ArrowsOutIcon fill={t.palette.white} width={20} /> <ArrowsOutIcon fill={t.palette.white} width={20} />
)} )}
</Button> </Button>
)}
</View> </View>
{(showControls || !focused) && ( {(showControls || !focused) && (
<Animated.View <Animated.View