Skip to content

Commit

Permalink
fix: renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed Mar 19, 2024
1 parent 9e90382 commit 6f86326
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Box, Flex } from '../../../Layout';
import { Text } from '../../../Text';
import { config } from '../../../Theme';
import { PlayPauseButton } from './PlayPauseButton';
import { SeekControls } from './SeekControls';
import { SeekControl } from './SeekControl';
import { useIsLandscape } from '../../common/hooks';

// desktop buttons
Expand All @@ -18,37 +18,37 @@ export const PlayPauseSeekControls = ({
}) => {
return (
<>
<SeekControls
<SeekControl
onClick={e => {
e.stopPropagation();
onSeekTo(-10);
}}
title="backward"
>
<BackwardArrowIcon width={20} height={20} />
</SeekControls>
</SeekControl>
<PlayPauseButton isPaused={isPaused} />
<SeekControls
<SeekControl
onClick={e => {
e.stopPropagation();
onSeekTo(10);
}}
title="forward"
>
<ForwardArrowIcon width={20} height={20} />
</SeekControls>
</SeekControl>
</>
);
};

// overlay handlers
export const PlayPauseSeekOverlayControls = ({
isPaused,
controlsVisible,
showControls,
hoverControlsVisible,
}: {
isPaused: boolean;
controlsVisible: boolean;
showControls: boolean;
hoverControlsVisible: {
seekBackward: boolean;
seekForward: boolean;
Expand All @@ -73,9 +73,9 @@ export const PlayPauseSeekOverlayControls = ({
direction="column"
align="center"
>
<SeekControls title="backward">
<SeekControl title="backward">
<BackwardArrowIcon width={52} height={52} />
</SeekControls>
</SeekControl>
<Text variant="body2" css={{ fontWeight: '$regular' }}>
10 secs
</Text>
Expand All @@ -101,9 +101,9 @@ export const PlayPauseSeekOverlayControls = ({
direction="column"
align="center"
>
<SeekControls title="forward">
<SeekControl title="forward">
<ForwardArrowIcon width={52} height={52} />
</SeekControls>
</SeekControl>
<Text variant="body2" css={{ fontWeight: '$regular' }}>
10 secs
</Text>
Expand All @@ -123,19 +123,19 @@ export const PlayPauseSeekOverlayControls = ({
gap: '$2',
zIndex: 1,
size: '100%',
visibility: controlsVisible ? `` : `hidden`,
opacity: controlsVisible ? `1` : '0',
visibility: showControls ? `` : `hidden`,
opacity: showControls ? `1` : '0',
}}
>
<SeekControls
<SeekControl
title="backward"
css={{
visibility: hoverControlsVisible.seekBackward ? `` : `hidden`,
opacity: hoverControlsVisible.seekBackward ? `1` : '0',
}}
>
<BackwardArrowIcon width={32} height={32} />
</SeekControls>
</SeekControl>
<Box
css={{
bg: 'rgba(0, 0, 0, 0.6)',
Expand All @@ -144,15 +144,15 @@ export const PlayPauseSeekOverlayControls = ({
>
<PlayPauseButton isPaused={isPaused} width={48} height={48} />
</Box>
<SeekControls
<SeekControl
title="forward"
css={{
visibility: hoverControlsVisible.seekForward ? `` : `hidden`,
opacity: hoverControlsVisible.seekForward ? `1` : '0',
}}
>
<ForwardArrowIcon width={32} height={32} />
</SeekControls>
</SeekControl>
</Flex>
);
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { MouseEventHandler } from 'react';
import { IconButton, Tooltip } from '../../..';

export const SeekControls = ({
export const SeekControl = ({
title,
onClick,
children,
Expand Down
4 changes: 2 additions & 2 deletions packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ const HLSView = () => {
{!showLoader && hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR && (
<HMSVideoPlayer.PlayPauseSeekControls.Overlay
isPaused={isPaused}
controlsVisible={controlsVisible}
showControls={controlsVisible}
hoverControlsVisible={hoverControlsVisible}
/>
)}
Expand All @@ -570,7 +570,7 @@ const HLSView = () => {
{!showLoader && hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR && (
<HMSVideoPlayer.PlayPauseSeekControls.Overlay
isPaused={isPaused}
controlsVisible={controlsVisible}
showControls={controlsVisible}
hoverControlsVisible={hoverControlsVisible}
/>
)}
Expand Down

0 comments on commit 6f86326

Please sign in to comment.