Ensure there is a thumbnail for videos on web

This commit is contained in:
Samuel Newman
2025-09-10 15:24:13 +03:00
parent c7591ef058
commit 43b5481dd2
2 changed files with 14 additions and 6 deletions
@@ -3,7 +3,9 @@ import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Button, ButtonText} from '#/components/Button' import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as ArrowRotateIcon} from '#/components/icons/ArrowRotateCounterClockwise'
import {MediaInsetBorder} from '#/components/MediaInsetBorder'
import {Text as TypoText} from '#/components/Typography' import {Text as TypoText} from '#/components/Typography'
export function Container({children}: {children: React.ReactNode}) { export function Container({children}: {children: React.ReactNode}) {
@@ -16,12 +18,12 @@ export function Container({children}: {children: React.ReactNode}) {
a.justify_center, a.justify_center,
a.align_center, a.align_center,
a.px_lg, a.px_lg,
a.border, a.rounded_md,
t.atoms.border_contrast_low, a.overflow_hidden,
a.rounded_sm,
a.gap_lg, a.gap_lg,
]}> ]}>
{children} {children}
<MediaInsetBorder />
</View> </View>
) )
} }
@@ -50,8 +52,8 @@ export function RetryButton({onPress}: {onPress: () => void}) {
onPress={onPress} onPress={onPress}
size="small" size="small"
color="secondary_inverted" color="secondary_inverted"
variant="solid"
label={_(msg`Retry`)}> label={_(msg`Retry`)}>
<ButtonIcon icon={ArrowRotateIcon} />
<ButtonText> <ButtonText>
<Trans>Retry</Trans> <Trans>Retry</Trans>
</ButtonText> </ButtonText>
@@ -86,7 +86,13 @@ export function VideoEmbed({
const contents = ( const contents = (
<div <div
ref={ref} ref={ref}
style={{display: 'flex', flex: 1, cursor: 'default'}} style={{
display: 'flex',
flex: 1,
cursor: 'default',
backgroundImage: `url(${embed.thumbnail})`,
backgroundSize: 'cover',
}}
onClick={evt => evt.stopPropagation()}> onClick={evt => evt.stopPropagation()}>
<ErrorBoundary renderError={renderError} key={key}> <ErrorBoundary renderError={renderError} key={key}>
<OnlyNearScreen> <OnlyNearScreen>