Skip to content

Commit

Permalink
fix: conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 committed Nov 15, 2024
2 parents 7783b2b + 8e5a734 commit 0358d2b
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 55 deletions.
2 changes: 1 addition & 1 deletion examples/prebuilt-react-integration/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hls-player/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hls-stats/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hms-video-store/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/hms-video-store/src/IHMSActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
IHMSSessionStoreActions,
} from './schema';
import { HMSRoleChangeRequest } from './selectors';
import { HMSStats } from './webrtc-stats';

/**
* The below interface defines our SDK API Surface for taking room related actions.
Expand Down Expand Up @@ -587,4 +588,10 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
* Method to get enabled flags and endpoints. Should only be called after joining.
*/
getDebugInfo(): DebugInfo | undefined;

/**
* @internal
* Method to check if received bitrate is 0 for all remote peers or whether the room has whiteboard/quiz running. To be used by beam.
*/
hasActiveElements(hmsStats: HMSStats): boolean;
}
21 changes: 21 additions & 0 deletions packages/hms-video-store/src/reactive-store/HMSSDKActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import {
selectVideoTrackByID,
} from '../selectors';
import { FindPeerByNameRequestParams } from '../signal/interfaces';
import { HMSStats } from '../webrtc-stats';

/**
* This class implements the IHMSActions interface for 100ms SDK. It connects with SDK
Expand Down Expand Up @@ -1671,4 +1672,24 @@ export class HMSSDKActions<T extends HMSGenericTypes = { sessionStore: Record<st
private setState: NamedSetState<HMSStore<T>> = (fn, name) => {
return this.store.namedSetState(fn, name);
};

/**
* @internal
* This will be used by beam to check if the recording should continue, it will pass __hms.stats
* It will poll at a fixed interval and start an exit timer if the method fails twice consecutively
* The exit timer is stopped if the method returns true before that
* @param hmsStats
*/
hasActiveElements(hmsStats: HMSStats): boolean {
const isWhiteboardPresent = Object.keys(this.store.getState().whiteboards).length > 0;
const isQuizOrPollPresent = Object.keys(this.store.getState().polls).length > 0;
const peerCount = Object.keys(this.store.getState().peers).length > 0;
const remoteTracks = hmsStats.getState().remoteTrackStats;
return (
peerCount &&
(isWhiteboardPresent ||
isQuizOrPollPresent ||
Object.values(remoteTracks).some(track => track && typeof track.bitrate === 'number' && track.bitrate > 0))
);
}
}
6 changes: 3 additions & 3 deletions packages/hms-virtual-background/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hms-whiteboard/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react-icons/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/react-sdk/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions packages/roomkit-react/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { AnimatePresence } from 'framer-motion';
import { TrackWithPeerAndDimensions } from '@100mslive/react-sdk';
import { Box } from '../../../Layout';
// @ts-ignore: No implicit Any
Expand All @@ -9,35 +10,37 @@ export const Grid = React.forwardRef<HTMLDivElement, { tiles: TrackWithPeerAndDi
({ tiles, edgeToEdge }, ref) => {
const videoTileProps = useVideoTileContext();
return (
<Box
ref={ref}
css={{
flex: '1 1 0',
gap: '$4',
display: 'flex',
placeContent: 'center',
alignItems: 'center',
justifyContent: 'center',
flexFlow: 'row wrap',
minHeight: 0,
'@lg': { gap: edgeToEdge ? 0 : '$4' },
}}
>
{tiles?.map(tile => {
return (
<VideoTile
key={tile.track?.id || tile.peer?.id}
width={tile.width}
height={tile.height}
peerId={tile.peer?.id}
trackId={tile.track?.id}
rootCSS={{ padding: 0 }}
objectFit="contain"
{...videoTileProps}
/>
);
})}
</Box>
<AnimatePresence>
<Box
ref={ref}
css={{
flex: '1 1 0',
gap: '$4',
display: 'flex',
placeContent: 'center',
alignItems: 'center',
justifyContent: 'center',
flexFlow: 'row wrap',
minHeight: 0,
'@lg': { gap: edgeToEdge ? 0 : '$4' },
}}
>
{tiles?.map(tile => {
return (
<VideoTile
key={tile.track?.id || tile.peer?.id}
width={tile.width}
height={tile.height}
peerId={tile.peer?.id}
trackId={tile.track?.id}
rootCSS={{ padding: 0 }}
objectFit="contain"
{...videoTileProps}
/>
);
})}
</Box>
</AnimatePresence>
);
},
);
21 changes: 15 additions & 6 deletions packages/roomkit-react/src/VideoTile/StyledVideoTile.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
import { motion } from 'framer-motion';
import { Box } from '../Layout';
import { styled } from '../Theme';
import { flexCenter } from '../utils';

export const Root = styled('div', {
padding: '0.75rem',
// show videotile context menu on hover
// [`&:hover .tile-menu`]: {
// display: 'inline-block',
// },
});

const MotionRoot = motion(Root);
MotionRoot.defaultProps = {
layout: true,
transition: {
type: 'spring',
stiffness: 300,
damping: 30,
mass: 1,
duration: 0.15,
},
};

const Container = styled('div', {
width: '100%',
height: '100%',
Expand Down Expand Up @@ -128,7 +137,7 @@ const AvatarContainer = styled(Box, {
});

interface VideoTileType {
Root: typeof Root;
Root: typeof MotionRoot;
Container: typeof Container;
Overlay: typeof Overlay;
Info: typeof Info;
Expand All @@ -139,7 +148,7 @@ interface VideoTileType {
}

export const StyledVideoTile: VideoTileType = {
Root,
Root: MotionRoot,
Container,
Overlay,
Info,
Expand Down
4 changes: 2 additions & 2 deletions packages/roomkit-web/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10433,6 +10433,13 @@ fragment-cache@^0.2.1:
dependencies:
map-cache "^0.2.2"

framer-motion@^11.11.0:
version "11.11.9"
resolved "https://registry.yarnpkg.com/framer-motion/-/framer-motion-11.11.9.tgz#a60ddf5abbd924812df923068628537a5c6ad8b9"
integrity sha512-XpdZseuCrZehdHGuW22zZt3SF5g6AHJHJi7JwQIigOznW4Jg1n0oGPMJQheMaKLC+0rp5gxUKMRYI6ytd3q4RQ==
dependencies:
tslib "^2.4.0"

[email protected]:
version "0.5.2"
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
Expand Down

0 comments on commit 0358d2b

Please sign in to comment.