diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-09-11 16:20:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-11 16:20:32 +0100 |
commit | 580b67ba3751f74545ae0c36e0c4a91ae8f42b20 (patch) | |
tree | 0b1b9ca2c1948c503f41609d1e321e77d62f7fc5 /src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx | |
parent | b04ecbe54d2cb0581b8b33a46dc07d5d5e978c13 (diff) | |
download | voidsky-580b67ba3751f74545ae0c36e0c4a91ae8f42b20.tar.zst |
disable autoplay within messages and trim feelers (#5260)
Diffstat (limited to 'src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx')
-rw-r--r-- | src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx index 138791e48..bb15db083 100644 --- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx +++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoWebControls.tsx @@ -15,6 +15,7 @@ import { } from '#/state/preferences' import {atoms as a, useTheme, web} from '#/alf' import {Button} from '#/components/Button' +import {useIsWithinMessage} from '#/components/dms/MessageContext' import {useFullscreen} from '#/components/hooks/useFullscreen' import {useInteractionState} from '#/components/hooks/useInteractionState' import { @@ -113,7 +114,8 @@ export function Controls({ }, [active, pause, setFocused]) // autoplay/pause based on visibility - const autoplayDisabled = useAutoplayDisabled() + const isWithinMessage = useIsWithinMessage() + const autoplayDisabled = useAutoplayDisabled() || isWithinMessage useEffect(() => { if (active) { if (onScreen) { |