From 8241747fc22bb4363ff6cf48d54013cc72db7624 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Mon, 16 Sep 2024 21:37:33 +0100 Subject: [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 --- .../VideoEmbedInner/web-controls/ControlButton.tsx | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/view/com/util/post-embeds/VideoEmbedInner/web-controls/ControlButton.tsx (limited to 'src/view/com/util/post-embeds/VideoEmbedInner/web-controls/ControlButton.tsx') diff --git a/src/view/com/util/post-embeds/VideoEmbedInner/web-controls/ControlButton.tsx b/src/view/com/util/post-embeds/VideoEmbedInner/web-controls/ControlButton.tsx new file mode 100644 index 000000000..36b32a072 --- /dev/null +++ b/src/view/com/util/post-embeds/VideoEmbedInner/web-controls/ControlButton.tsx @@ -0,0 +1,39 @@ +import React from 'react' +import {SvgProps} from 'react-native-svg' + +import {atoms as a, useTheme} from '#/alf' +import {Button} from '#/components/Button' + +export function ControlButton({ + active, + activeLabel, + inactiveLabel, + activeIcon: ActiveIcon, + inactiveIcon: InactiveIcon, + onPress, +}: { + active: boolean + activeLabel: string + inactiveLabel: string + activeIcon: React.ComponentType> + inactiveIcon: React.ComponentType> + onPress: () => void +}) { + const t = useTheme() + return ( + + ) +} -- cgit 1.4.1