UNPKG

@azure/communication-react

Version:

React library for building modern communication user experiences utilizing Azure Communication Services

22 lines 1.12 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