Fix duplicate badging

This commit is contained in:
Eric Bailey
2026-06-25 16:34:19 -05:00
parent c4f79fbf6b
commit 3c1735fea0
2 changed files with 21 additions and 18 deletions
@@ -99,22 +99,24 @@ export function VideoEmbedInnerNative({
altText={embed.alt}
/>
) : (
<VideoPresentationControls
enterFullscreen={() => {
videoRef.current?.enterFullscreen(true)
}}
toggleMuted={() => {
videoRef.current?.toggleMuted()
}}
togglePlayback={() => {
videoRef.current?.togglePlayback()
}}
isPlaying={isPlaying}
timeRemaining={timeRemaining}
/>
)}
{!isGif && embed.alt && (
<AltBadgeWithDialog text={embed.alt} position="top-right" />
<>
<VideoPresentationControls
enterFullscreen={() => {
videoRef.current?.enterFullscreen(true)
}}
toggleMuted={() => {
videoRef.current?.toggleMuted()
}}
togglePlayback={() => {
videoRef.current?.togglePlayback()
}}
isPlaying={isPlaying}
timeRemaining={timeRemaining}
/>
{embed.alt && (
<AltBadgeWithDialog text={embed.alt} position="top-right" />
)}
</>
)}
<MediaInsetBorder />
<KeepAwake enabled={isPlaying} />
@@ -33,6 +33,7 @@ export function VideoEmbedInnerWeb({
const figId = useId()
const {_} = useLingui()
const [isFullscreen] = useFullscreen(containerRef)
const isGif = embed.presentation === 'gif'
// send error up to error boundary
const [error, setError] = useState<Error | null>(null)
@@ -80,7 +81,7 @@ export function VideoEmbedInnerWeb({
</figcaption>
)}
</figure>
{!isFullscreen && embed.alt && (
{!isFullscreen && !isGif && embed.alt && (
<AltBadgeWithDialog text={embed.alt} position="top-right" />
)}
<Controls
@@ -94,7 +95,7 @@ export function VideoEmbedInnerWeb({
onScreen={onScreen}
fullscreenRef={containerRef}
hasSubtitleTrack={hasSubtitleTrack}
isGif={embed.presentation === 'gif'}
isGif={isGif}
altText={embed.alt}
updateCuePositions={updateCuePositions}
/>