diff options
author | Samuel Newman <mozzius@protonmail.com> | 2024-09-16 21:37:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-16 21:37:33 +0100 |
commit | 8241747fc22bb4363ff6cf48d54013cc72db7624 (patch) | |
tree | e6cd31d82100fb9c99f3443d7b2753672b55373c /src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx | |
parent | 38c8f01594ff515fbe49d00a777d70449e804fd4 (diff) | |
download | voidsky-8241747fc22bb4363ff6cf48d54013cc72db7624.tar.zst |
[Video] Volume controls on web (#5363)
* split up VideoWebControls * add basic slider * logarithmic volume * integrate mute state * fix typo * shared video volume * rm log * animate in/out * disable for touch devices * remove flicker on touch devices * more detailed comment * move into correct context provider * add minHeight * hack * bettern umber --------- Co-authored-by: Hailey <me@haileyok.com>
Diffstat (limited to 'src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx')
-rw-r--r-- | src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx index afa9aa305..d21ce61e5 100644 --- a/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx +++ b/src/view/com/util/post-embeds/VideoEmbedInner/VideoEmbedInnerNative.tsx @@ -9,7 +9,7 @@ import {useLingui} from '@lingui/react' import {HITSLOP_30} from '#/lib/constants' import {clamp} from '#/lib/numbers' import {useAutoplayDisabled} from '#/state/preferences' -import {useVideoVolumeState} from 'view/com/util/post-embeds/VideoVolumeContext' +import {useVideoMuteState} from 'view/com/util/post-embeds/VideoVolumeContext' import {atoms as a, useTheme} from '#/alf' import {useIsWithinMessage} from '#/components/dms/MessageContext' import {Mute_Stroke2_Corner0_Rounded as MuteIcon} from '#/components/icons/Mute' @@ -38,7 +38,7 @@ export const VideoEmbedInnerNative = React.forwardRef( const videoRef = useRef<BlueskyVideoView>(null) const autoplayDisabled = useAutoplayDisabled() const isWithinMessage = useIsWithinMessage() - const {muted, setMuted} = useVideoVolumeState() + const [muted, setMuted] = useVideoMuteState() const [isPlaying, setIsPlaying] = React.useState(false) const [timeRemaining, setTimeRemaining] = React.useState(0) @@ -128,7 +128,7 @@ function VideoControls({ }) { const {_} = useLingui() const t = useTheme() - const {muted} = useVideoVolumeState() + const [muted] = useVideoMuteState() // show countdown when: // 1. timeRemaining is a number - was seeing NaNs |