UNPKG

@100mslive/react-native-room-kit

Version:

100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.

25 lines 2.12 kB
import { HMSStreamingState } from '@100mslive/react-native-hms'; export const selectAllowedTracksToPublish = state => { var _state$hmsStates$loca; return (_state$hmsStates$loca = state.hmsStates.localPeer) === null || _state$hmsStates$loca === void 0 || (_state$hmsStates$loca = _state$hmsStates$loca.role) === null || _state$hmsStates$loca === void 0 || (_state$hmsStates$loca = _state$hmsStates$loca.publishSettings) === null || _state$hmsStates$loca === void 0 ? void 0 : _state$hmsStates$loca.allowed; }; export const selectCanPublishTrack = (state, track) => { var _selectAllowedTracksT; return ((_selectAllowedTracksT = selectAllowedTracksToPublish(state)) === null || _selectAllowedTracksT === void 0 ? void 0 : _selectAllowedTracksT.includes(track)) ?? false; }; export const selectCanPublishTrackForRole = (role, track) => { var _role$publishSettings; return (role === null || role === void 0 || (_role$publishSettings = role.publishSettings) === null || _role$publishSettings === void 0 || (_role$publishSettings = _role$publishSettings.allowed) === null || _role$publishSettings === void 0 ? void 0 : _role$publishSettings.includes(track)) ?? false; }; export const selectIsHLSStreamingOn = state => { var _state$hmsStates$room; return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.state) === HMSStreamingState.STARTED ?? false; }; export const selectIsRTMPStreamingOn = state => { var _state$hmsStates$room2; return ((_state$hmsStates$room2 = state.hmsStates.room) === null || _state$hmsStates$room2 === void 0 || (_state$hmsStates$room2 = _state$hmsStates$room2.rtmpHMSRtmpStreamingState) === null || _state$hmsStates$room2 === void 0 ? void 0 : _state$hmsStates$room2.state) === HMSStreamingState.STARTED ?? false; }; export const selectIsAnyStreamingOn = state => { return selectIsHLSStreamingOn(state) || selectIsRTMPStreamingOn(state); }; //# sourceMappingURL=hooks-sdk-selectors.js.map