@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.
540 lines (538 loc) • 14.8 kB
JavaScript
import actionTypes, { HmsStateActionTypes, PollsStateActionTypes } from '../actionTypes';
export const setPrebuiltData = data => ({
type: HmsStateActionTypes.SET_PREBUILT_DATA,
payload: data
});
export const setOnLeaveHandler = onLeave => ({
type: HmsStateActionTypes.SET_ON_LEAVE_HANDLER,
payload: {
onLeave
}
});
export const clearStore = () => ({
type: HmsStateActionTypes.CLEAR_STATES
});
export const setRoomLocallyMuted = roomLocallyMuted => ({
type: HmsStateActionTypes.SET_ROOM_LOCALLY_MUTED,
roomLocallyMuted
});
export const setIsLocalVideoMutedState = isLocalVideoMuted => ({
type: HmsStateActionTypes.SET_IS_LOCAL_VIDEO_MUTED_STATE,
isLocalVideoMuted
});
export const setIsLocalAudioMutedState = isLocalAudioMuted => ({
type: HmsStateActionTypes.SET_IS_LOCAL_AUDIO_MUTED_STATE,
isLocalAudioMuted
});
export const setIsLocalScreenSharedState = isLocalScreenShared => ({
type: HmsStateActionTypes.SET_IS_LOCAL_SCREEN_SHARED_STATE,
isLocalScreenShared
});
export const setHMSRoleState = roles => ({
type: HmsStateActionTypes.SET_ROLES_STATE,
roles
});
export const setHMSRoomState = room => ({
type: HmsStateActionTypes.SET_ROOM_STATE,
room
});
export const setHMSLocalPeerState = localPeer => ({
type: HmsStateActionTypes.SET_LOCAL_PEER_STATE,
localPeer
});
export const setHMSInstance = hmsInstance => ({
type: actionTypes.SET_HMS_INSTANCE,
payload: {
hmsInstance
}
});
export const addMessage = data => ({
type: actionTypes.ADD_MESSAGE.REQUEST,
payload: data
});
export const addPinnedMessages = data => ({
type: actionTypes.ADD_PINNED_MESSAGES.REQUEST,
payload: data
});
export const clearMessageData = () => ({
type: actionTypes.CLEAR_MESSAGE_DATA.REQUEST
});
export const setPeerState = data => ({
type: actionTypes.SET_PEER_STATE,
payload: data
});
export const changePipModeStatus = pipModeStatus => ({
type: actionTypes.CHANGE_PIP_MODE_STATUS,
payload: {
pipModeStatus
}
});
export const clearPeerData = () => ({
type: actionTypes.CLEAR_PEER_DATA.REQUEST
});
export const saveUserData = data => ({
type: actionTypes.SAVE_USER_DATA.REQUEST,
payload: data
});
export const clearHmsReference = () => ({
type: actionTypes.CLEAR_HMS_INSTANCE
});
export const resetJoinConfig = () => ({
type: actionTypes.RESET_JOIN_CONFIG
});
export const changeMirrorCamera = value => ({
type: actionTypes.CHANGE_MIRROR_CAMERA,
payload: {
mirrorCamera: value
}
});
export const changeShowStats = value => ({
type: actionTypes.CHANGE_SHOW_STATS,
payload: {
showStats: value
}
});
export const changeShowHLSStats = value => ({
type: actionTypes.CHANGE_SHOW_HLS_STATS,
payload: {
showHLSStats: value
}
});
export const changeShowCustomHLSPlayerControls = value => ({
type: actionTypes.CHANGE_SHOW_CUSTOM_HLS_PLAYER_CONTROLS,
payload: {
showCustomHLSPlayerControls: value
}
});
export const changeEnableHLSPlayerControls = value => ({
type: actionTypes.CHANGE_ENABLE_HLS_PLAYER_CONTROLS,
payload: {
enableHLSPlayerControls: value
}
});
export const changeAutoSimulcast = value => ({
type: actionTypes.CHANGE_AUTO_SIMULCAST,
payload: {
autoSimulcast: value
}
});
export const setRTCStats = (trackId, stats) => ({
type: actionTypes.SET_RTC_STATS,
payload: {
trackId,
stats
}
});
export const changeHLSAspectRatio = value => ({
type: actionTypes.CHANGE_HLS_ASPECT_RATIO,
payload: {
hlsAspectRatio: value
}
});
export const changeUsername = userName => ({
type: HmsStateActionTypes.SET_USER_NAME,
payload: {
userName
}
});
export const setModalType = modalType => ({
type: actionTypes.SET_MODAL_TYPE,
payload: {
modalType
}
});
export const setPeerToUpdate = peerToUpdate => ({
type: actionTypes.SET_PEER_TO_UPDATE,
payload: {
peerToUpdate
}
});
export const addToPreviewPeersList = peer => ({
type: HmsStateActionTypes.ADD_TO_PREVIEW_PEERS_LIST,
peer
});
export const removeFromPreviewPeersList = peer => ({
type: HmsStateActionTypes.REMOVE_FROM_PREVIEW_PEERS_LIST,
peerId: peer.peerID
});
export const changeMeetingState = meetingState => ({
type: actionTypes.SET_MEETING_STATE,
payload: {
meetingState
}
});
export const setInsetViewMinimized = insetViewMinimized => ({
type: actionTypes.SET_INSET_VIEW_MINIMIZED,
payload: {
insetViewMinimized
}
});
export const setMiniViewPeerTrackNode = miniviewPeerTrackNode => ({
type: actionTypes.SET_MINI_VIEW_PEERTRACKNODE,
payload: {
miniviewPeerTrackNode
}
});
export const updateMiniViewPeerTrackNode = data => ({
type: actionTypes.UPDATE_MINI_VIEW_PEERTRACKNODE,
payload: data
});
export const setFullScreenPeerTrackNode = fullScreenPeerTrackNode => ({
type: actionTypes.SET_FULLSCREEN_PEERTRACKNODE,
payload: {
fullScreenPeerTrackNode
}
});
export const setFullScreenWhiteboard = fullScreenWhiteboard => ({
type: actionTypes.SET_FULLSCREEN_WHITEBOARD,
payload: {
fullScreenWhiteboard
}
});
export const updateFullScreenPeerTrackNode = data => ({
type: actionTypes.UPDATE_FULLSCREEN_PEERTRACKNODE,
payload: data
});
export const setLocalPeerTrackNode = localPeerTrackNode => ({
type: actionTypes.SET_LOCAL_PEERTRACKNODE,
payload: {
localPeerTrackNode
}
});
export const updateLocalPeerTrackNode = data => ({
type: actionTypes.UPDATE_LOCAL_PEERTRACKNODE,
payload: data
});
export const changeStartingHLSStream = startingHLSStream => ({
type: actionTypes.SET_STARTING_HLS_STREAM,
payload: {
startingHLSStream
}
});
export const setLayoutConfig = layoutConfig => ({
type: HmsStateActionTypes.SET_LAYOUT_CONFIG,
layoutConfig
});
export const setGridViewActivePage = pageNumber => ({
type: actionTypes.SET_GRID_VIEW_ACTIVE_PAGE,
payload: {
gridViewActivePage: pageNumber
}
});
export const setStartingOrStoppingRecording = startingOrStoppingRecording => ({
type: actionTypes.SET_STARTING_OR_STOPPING_RECORDING,
payload: {
startingOrStoppingRecording
}
});
export const addScreenshareTile = screenshareNode => ({
type: actionTypes.ADD_SCREENSHARE_TILE,
payload: {
screenshareNode
}
});
export const removeScreenshareTile = peerTrackNodeId => ({
type: actionTypes.REMOVE_SCREENSHARE_TILE,
payload: {
id: peerTrackNodeId
}
});
export const updateScreenshareTile = data => ({
type: actionTypes.UPDATE_SCREENSHARE_TILE,
payload: data
});
export const addNotification = notification => ({
type: actionTypes.ADD_NOTIFICATION,
payload: {
notification
}
});
export const removeNotification = notificationId => ({
type: actionTypes.REMOVE_NOTIFICATION,
payload: {
id: notificationId
}
});
export const setRoleChangeRequest = roleChangeRequest => ({
type: HmsStateActionTypes.SET_ROLE_CHANGE_REQUEST,
roleChangeRequest
});
export const setActiveChatBottomSheetTab = activeChatBottomSheetTab => ({
type: actionTypes.SET_ACTIVE_CHAT_BOTTOM_SHEET_TAB,
payload: {
activeChatBottomSheetTab
}
});
export const setChatFilterSheetVisible = chatFilterSheetVisible => ({
type: actionTypes.SET_CHAT_FILTER_SHEET_VISIBLE,
payload: {
chatFilterSheetVisible
}
});
export const setChatMoreActionsSheetVisible = chatMoreActionsSheetVisible => ({
type: actionTypes.SET_CHAT_MORE_ACTIONS_SHEET_VISIBLE,
payload: {
chatMoreActionsSheetVisible
}
});
export const setChatState = chatState => ({
type: actionTypes.SET_CHAT_STATE,
payload: {
chatState
}
});
export const addParticipant = participant => ({
type: HmsStateActionTypes.ADD_PARTICIPANT,
participant
});
export const addParticipants = participants => ({
type: HmsStateActionTypes.ADD_PARTICIPANTS,
participants
});
export const removeParticipant = participant => ({
type: HmsStateActionTypes.REMOVE_PARTICIPANT,
participant
});
export const removeParticipants = participants => ({
type: HmsStateActionTypes.REMOVE_PARTICIPANTS,
participants
});
export const addUpdateParticipant = participant => ({
type: HmsStateActionTypes.UPDATE_PARTICIPANT,
participant
});
export const replaceParticipantsList = (participants, roleName) => ({
type: HmsStateActionTypes.REPLACE_PARTICIPANTS_LIST,
participants,
roleName
});
export const setActiveSpeakers = activeSpeakers => ({
type: HmsStateActionTypes.SET_ACTIVE_SPEAKERS,
activeSpeakers
});
export const setReconnecting = reconnecting => ({
type: HmsStateActionTypes.SET_RECONNECTING,
reconnecting
});
export const setNoiseCancellationPlugin = noiseCancellationPlugin => ({
type: HmsStateActionTypes.SET_NOISE_CANCELLATION_PLUGIN,
noiseCancellationPlugin
});
export const setVideoPlugin = videoPlugin => ({
type: HmsStateActionTypes.SET_VIDEO_PLUGIN,
videoPlugin
});
export const setWhiteboard = whiteboard => ({
type: HmsStateActionTypes.SET_WHITEBOARD,
whiteboard
});
export const setHandleBackButton = handleBackButton => ({
type: actionTypes.SET_HANDLE_BACK_BUTTON,
payload: {
handleBackButton
}
});
export const setAutoEnterPipMode = autoEnterPipMode => ({
type: actionTypes.SET_AUTO_ENTER_PIP_MODE,
payload: {
autoEnterPipMode
}
});
export const setEditUsernameDisabled = editUsernameDisabled => ({
type: actionTypes.SET_EDIT_USERNAME_DISABLED,
payload: {
editUsernameDisabled
}
});
export const setSelectedMessageForAction = selectedMessageForAction => ({
type: actionTypes.SET_SELECTED_MESSAGE_FOR_ACTION,
payload: {
selectedMessageForAction
}
});
export const setInitialRole = initialRole => ({
type: actionTypes.SET_INITIAL_ROLE,
payload: {
initialRole
}
});
export const setChatPeerBlacklist = chatPeerBlacklist => ({
type: actionTypes.SET_CHAT_PEER_BLACKLIST,
payload: {
chatPeerBlacklist
}
});
export const filterOutMsgsFromBlockedPeers = chatPeerBlacklist => ({
type: actionTypes.FILTER_OUT_BLOCKED_MSGS,
payload: chatPeerBlacklist
});
export const setHlsDescriptionPaneVisible = visible => ({
type: actionTypes.SET_HLS_DESC_PANE_VISIBLE,
payload: {
visible
}
});
export const setHlsFullScreen = fullScreen => ({
type: actionTypes.SET_HLS_FULL_SCREEN,
payload: {
fullScreen
}
});
export const setAndroidHLSStreamPaused = paused => ({
type: actionTypes.SET_ANDROID_HLS_STREAM_PAUSED,
payload: {
hlsStreamPaused_android: paused
}
});
export const setSelectedVirtualBackground = vb => ({
type: actionTypes.SET_SELECTED_VIRTUAL_BG,
payload: {
selectedVirtualBackground: vb
}
});
export const setShowClosedCaptions = showClosedCaptions => ({
type: actionTypes.SET_SHOW_CLOSED_CAPTIONS,
payload: {
showClosedCaptions
}
});
/**
* POLLS
*/
export const setPollQDeleteConfirmationVisible = deleteConfirmationVisible => ({
type: PollsStateActionTypes.SET_DELETE_CONFIRMATION_VISIBLE,
deleteConfirmationVisible
});
export const setPollName = pollName => ({
type: PollsStateActionTypes.SET_POLL_NAME,
pollName
});
export const setPollConfig = pollConfig => ({
type: PollsStateActionTypes.SET_POLL_CONFIG,
pollConfig
});
export const pushToNavigationStack = screen => ({
type: PollsStateActionTypes.PUSH_TO_NAVIGATION_STACK,
screen
});
export const resetNavigationStack = () => ({
type: PollsStateActionTypes.RESET_NAVIGATION_STACK
});
export const popFromNavigationStack = () => ({
type: PollsStateActionTypes.POP_FROM_NAVIGATION_STACK
});
export const replaceTopOfNavigationStack = screen => ({
type: PollsStateActionTypes.REPLACE_TOP_OF_NAVIGATION_STACK,
screen
});
export const addPollQuestion = () => ({
type: PollsStateActionTypes.ADD_POLL_QUESTION
});
export const deletePollQuestion = () => ({
type: PollsStateActionTypes.DELETE_POLL_QUESTION
});
export const setSelectedPollQuestionIndex = index => ({
type: PollsStateActionTypes.SET_SELECTED_QUESTION_INDEX,
index
});
export const setPollQuestionType = (questionIndex, questionType) => ({
type: PollsStateActionTypes.SET_QUESTION_TYPE,
questionIndex,
questionType
});
export const setPollQuestionTitle = (questionIndex, title) => ({
type: PollsStateActionTypes.SET_QUESTION_TITLE,
questionIndex,
title
});
export const setPollQuestionPointWeightage = (questionIndex, pointWeightage) => ({
type: PollsStateActionTypes.SET_POINT_WEIGHTAGE,
questionIndex,
pointWeightage
});
export const addPollQuestionOption = questionIndex => ({
type: PollsStateActionTypes.ADD_QUESTION_OPTION,
questionIndex
});
export const deletePollQuestionOption = (questionIndex, index) => ({
type: PollsStateActionTypes.DELETE_QUESTION_OPTION,
index,
questionIndex
});
export const editPollQuestionOption = (questionIndex, optionIndex, option) => ({
type: PollsStateActionTypes.EDIT_QUESTION_OPTION,
questionIndex,
optionIndex,
option
});
export const setPollQuestionCorrectOption = (questionIndex, optionIndex, correctOption) => ({
type: PollsStateActionTypes.SET_QUESTION_CORRECT_OPTION,
questionIndex,
optionIndex,
correctOption
});
export const setPollQuestionSkippable = (questionIndex, skippable) => ({
type: PollsStateActionTypes.SET_QUESTION_SKIPPABLE,
questionIndex,
skippable
});
export const setPollQuestionResponseEditable = (questionIndex, responseEditable) => ({
type: PollsStateActionTypes.SET_QUESTION_RES_EDITABLE,
questionIndex,
responseEditable
});
export const setPollQuestionSaved = (questionIndex, saved) => ({
type: PollsStateActionTypes.SET_QUESTION_SAVED,
questionIndex,
saved
});
export const setLaunchingPoll = launching => ({
type: PollsStateActionTypes.SET_LAUNCHING_POLL,
launching
});
export const clearPollsState = () => ({
type: PollsStateActionTypes.CLEAR_POLLS_STATE
});
export const cleaPollFormState = () => ({
type: PollsStateActionTypes.CLEAR_POLL_FORM_STATE
});
export const setSelectedPollId = pollId => ({
type: PollsStateActionTypes.SET_SELECTED_POLL_ID,
pollId
});
export const addPoll = poll => ({
type: PollsStateActionTypes.ADD_POLL,
poll
});
export const updatePoll = poll => ({
type: PollsStateActionTypes.UPDATE_POLL,
poll
});
export const setPollQuestionResponse = (pollId, questionIndex, response) => ({
type: PollsStateActionTypes.SET_POLL_QUESTION_RESPONSE,
pollId,
questionIndex,
response
});
export const addPollQuestionResponse = (pollId, questionIndex, response) => ({
type: PollsStateActionTypes.ADD_POLL_QUESTION_RESPONSE,
pollId,
questionIndex,
response
});
export const removePollQuestionResponse = (pollId, questionIndex, response) => ({
type: PollsStateActionTypes.REMOVE_POLL_QUESTION_RESPONSE,
pollId,
questionIndex,
response
});
export const addCuedPollId = pollId => ({
type: PollsStateActionTypes.ADD_CUED_POLL_ID,
pollId
});
export const addLeaderboard = (pollId, leaderboard) => ({
type: PollsStateActionTypes.ADD_LEADERBOARD,
pollId,
leaderboard
});
//# sourceMappingURL=index.js.map