Skip to content

Commit

Permalink
Merge branch 'dev' into disable-closed-caption-prebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
amar-1995 committed May 24, 2024
2 parents 3910746 + 2cff6d2 commit fd69b36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/roomkit-react/src/Prebuilt/common/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import { useRoomLayout } from '../provider/roomLayoutProvider';
// @ts-ignore
import { useSetAppDataByKey } from '../components/AppData/useUISettings';
import { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';
// @ts-ignore: No implicit any
import { isScreenshareSupported } from '../common/utils';
import { APP_DATA, CHAT_SELECTOR, RTMP_RECORD_DEFAULT_RESOLUTION } from './constants';
/**
* Hook to execute a callback when alone in room(after a certain 5d of time)
Expand Down Expand Up @@ -232,9 +234,11 @@ export interface WaitingRoomInfo {
export function useWaitingRoomInfo(): WaitingRoomInfo {
const localPeerRole = useHMSStore(selectLocalPeerRole);
const { video, audio, screen } = useHMSStore(selectIsAllowedToPublish);
const isScreenShareAllowed = isScreenshareSupported();
const roles = useHMSStore(selectRolesMap);
const peersByRoles = useHMSStore(selectPeersByRoles(localPeerRole?.subscribeParams.subscribeToRoles || []));
const isNotAllowedToPublish = !(video || audio || screen);
// show no publish as screenshare in mweb is not possible
const isNotAllowedToPublish = !(video || audio || (screen && isScreenShareAllowed));
const isScreenOnlyPublishParams: boolean = screen && !(video || audio);
const hasSubscribedRolePublishing: boolean = useMemo(() => {
return peersByRoles.some((peer: HMSPeer) => {
Expand Down

0 comments on commit fd69b36

Please sign in to comment.