Skip to content

Commit

Permalink
fix: hls video dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 committed Feb 28, 2024
1 parent 6479b59 commit bc7bd71
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import React, { forwardRef } from 'react';
import { useMedia } from 'react-use';
import { config, Flex } from '../../../';
import { useIsLandscape } from '../../common/hooks';
import { Box } from '../../../Layout';

export const HMSVideo = forwardRef(({ children, ...props }, videoRef) => {
const isLandscape = useIsLandscape();
const isMobile = useMedia(config.media.md);
return (
<Flex
<Box
data-testid="hms-video"
css={{
size: '100%',
Expand Down Expand Up @@ -35,18 +31,19 @@ export const HMSVideo = forwardRef(({ children, ...props }, videoRef) => {
>
<video
style={{
flex: '1 1 0',
margin: '0 auto',
minHeight: '0',
objectFit: 'contain',
width: 'inherit',
height: isLandscape || isMobile ? '100%' : '',
position: isLandscape || isMobile ? 'absolute' : '',
maxWidth: '100%',
height: '100%',
'@lg': {
width: '100%',
heigth: 'auto',
},
}}
ref={videoRef}
playsInline
/>
{children}
</Flex>
</Box>
);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { MouseEventHandler } from 'react';
import { IconButton, Tooltip } from '../../..';
import { CSS, IconButton, Tooltip } from '../../..';

export const SeekControls = ({
title,
Expand All @@ -9,7 +9,7 @@ export const SeekControls = ({
}: {
title: string;
onClick?: MouseEventHandler<HTMLButtonElement>;
css: any;
css: CSS;
children: React.ReactNode;
}) => {
return (
Expand Down
8 changes: 5 additions & 3 deletions packages/roomkit-react/src/Prebuilt/layouts/HLSView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ const HLSView = () => {
direction={isMobile || isLandscape ? 'column' : 'row'}
css={{
w: sidepane !== '' && isLandscape ? '' : '100%',
h: sidepane !== '' && isMobile ? '36%' : '100%',
flex: '1 1 0',
h: sidepane !== '' && isMobile ? '' : '100%',
flex: sidepane !== '' && isMobile ? '' : '1 1 0',
}}
>
{hlsUrl && !streamEnded ? (
Expand Down Expand Up @@ -409,6 +409,9 @@ const HLSView = () => {
gap: '$2',
zIndex: 1,
size: '100%',
position: 'absolute',
top: 0,
left: 0,
visibility: controlsVisible ? `` : `hidden`,
opacity: controlsVisible ? `1` : '0',
}}
Expand Down Expand Up @@ -502,7 +505,6 @@ const HLSView = () => {
: `linear-gradient(180deg, ${theme.colors.background_dim.value}00 29.46%, ${theme.colors.background_dim.value}A3 100%);`,
width: '100%',
pt: '$8',
flexShrink: 0,
transition: 'visibility 0s 0.5s, opacity 0.5s linear',
visibility: controlsVisible ? `` : `hidden`,
opacity: controlsVisible ? `1` : '0',
Expand Down
5 changes: 2 additions & 3 deletions packages/roomkit-react/src/Prebuilt/layouts/SidePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ const Wrapper = styled('div', {
landscapeStream: {
true: {
'@lg': {
position: 'unset !important',
position: 'unset',
minHeight: '100%',
},
},
},
mobileStream: {
true: {
'@md': {
position: 'unset !important',
background: 'red',
position: 'unset',
},
},
},
Expand Down

0 comments on commit bc7bd71

Please sign in to comment.