UNPKG

communication-react-19

Version:

React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)

22 lines 1.13 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import * as reselect from 'reselect'; import { getLocalVideoStreams, getRemoteParticipants } from './baseSelectors'; /** * @private */ export const mediaGallerySelector = reselect.createSelector([getLocalVideoStreams], (localVideoStreams) => { var _a, _b; return { isVideoStreamOn: !!((_b = (_a = localVideoStreams === null || localVideoStreams === void 0 ? void 0 : localVideoStreams.find((stream) => stream.mediaStreamType === 'Video')) === null || _a === void 0 ? void 0 : _a.view) === null || _b === void 0 ? void 0 : _b.target) }; }); /** * Custom selector for this hook to retrieve all the participants that are currently * connected to the call. */ export const getRemoteParticipantsConnectedSelector = reselect.createSelector([getRemoteParticipants], (remoteParticipants) => { const participants = Object.values(remoteParticipants !== null && remoteParticipants !== void 0 ? remoteParticipants : {}); return participants.filter((p) => p.state === 'Connected'); }); //# sourceMappingURL=mediaGallerySelector.js.map