diff --git a/packages/roomkit-react/src/Prebuilt/components/HMSVideo/HMSVideo.jsx b/packages/roomkit-react/src/Prebuilt/components/HMSVideo/HMSVideo.jsx index 8674fbf545..ec8f619fa1 100644 --- a/packages/roomkit-react/src/Prebuilt/components/HMSVideo/HMSVideo.jsx +++ b/packages/roomkit-react/src/Prebuilt/components/HMSVideo/HMSVideo.jsx @@ -1,17 +1,20 @@ import React, { forwardRef } from 'react'; -import { useMedia } from 'react-use'; -import { config, Flex } from '../../../'; -import { useIsLandscape } from '../../common/hooks'; +import { Flex } from '../../../Layout'; export const HMSVideo = forwardRef(({ children, ...props }, videoRef) => { - const isLandscape = useIsLandscape(); - const isMobile = useMedia(config.media.md); return ( { > ) : null} - - {hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? : null} - - - {!(isMobile || isLandscape) && ( - <> - {hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? ( - <> - { - onSeekTo(-10); + {hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? ( + + ) : null} + + + {!(isMobile || isLandscape) && ( + <> + {hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? ( + <> + { + onSeekTo(-10); + }} + title="backward" + > + + + + { + onSeekTo(10); + }} + title="forward" + > + + + {!isVideoLive ? : null} + + ) : null} + + + )} + { + await hlsPlayer?.seekToLivePosition(); + setIsVideoLive(true); + }} + key="jump-to-live_btn" + data-testid="jump-to-live_btn" + > + + + - - - - { - onSeekTo(10); + /> + - - - {!isVideoLive ? : null} - - ) : null} - - - )} - { - await hlsPlayer?.seekToLivePosition(); - setIsVideoLive(true); - }} - key="jump-to-live_btn" - data-testid="jump-to-live_btn" - > - - - - - {isVideoLive ? 'LIVE' : 'GO LIVE'} - - - - - {(isMobile || isLandscape) && - !isVideoLive && - hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? ( - - ) : null} - + {isVideoLive ? 'LIVE' : 'GO LIVE'} + + + + + {(isMobile || isLandscape) && + !isVideoLive && + hlsState?.variants[0]?.playlist_type === HLSPlaylistType.DVR ? ( + + ) : null} + - - {hasCaptions && !(isMobile || isLandscape) && ( - - )} - {availableLayers.length > 0 && !(isMobile || isLandscape) ? ( - - ) : null} - {isFullScreenSupported ? ( - - ) : null} - - - + + {hasCaptions && !(isMobile || isLandscape) && ( + + )} + {availableLayers.length > 0 && !(isMobile || isLandscape) ? ( + + ) : null} + {isFullScreenSupported ? ( + + ) : null} + + + + )} diff --git a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx index b17a03a68a..4b308d0710 100644 --- a/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx +++ b/packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx @@ -140,6 +140,47 @@ const SidePane = ({ mobileStream: isMobileHLSStream, }; + const SidepaneComponent = match(sidepane) + .with(SIDE_PANE_OPTIONS.POLLS, () => ( + + + + )) + .with(SIDE_PANE_OPTIONS.VB, () => ( + + + + )) + .with(SIDE_PANE_OPTIONS.CHAT, SIDE_PANE_OPTIONS.PARTICIPANTS, () => ( + + + + )) + .with(SIDE_PANE_OPTIONS.ROOM_DETAILS, () => ( + + + + )) + .otherwise(() => { + return null; + }); + + if (!trackId && !SidepaneComponent) { + return null; + } + return ( )} - - {match(sidepane) - .with(SIDE_PANE_OPTIONS.POLLS, () => ( - - - - )) - .with(SIDE_PANE_OPTIONS.VB, () => ( - - - - )) - .with(SIDE_PANE_OPTIONS.CHAT, SIDE_PANE_OPTIONS.PARTICIPANTS, () => ( - - - - )) - .with(SIDE_PANE_OPTIONS.ROOM_DETAILS, () => ( - - - - )) - .otherwise(() => { - return null; - })} + {SidepaneComponent} ); };