Web SDK API Reference
Enumerations
- HMSAudioPluginType
- HMSLogLevel
- HMSNotificationSeverity
- HMSNotificationTypes
- HMSPlaylistType
- HMSRoomState
- HMSSimulcastLayer
- HMSVideoPluginCanvasContextType
- HMSVideoPluginType
Classes
Core Interfaces
Other Interfaces
- DeviceMap
- HLSConfig
- HLSMeetingURLVariant
- HLSVariant
- HMSAudioTrack
- HMSAudioTrackSettings
- HMSChangeMultiTrackStateParams
- HMSChangeMultiTrackStateRequest
- HMSChangeMultiTrackStateRequestNotification
- HMSChangeTrackStateRequest
- HMSChangeTrackStateRequestNotification
- HMSConfig
- HMSConfigInitialSettings
- HMSDeviceChangeEvent
- HMSDeviceChangeEventNotification
- HMSException
- HMSExceptionNotification
- HMSHLS
- HMSLeaveRoomRequest
- HMSLeaveRoomRequestNotification
- HMSLocalTrackStats
- HMSMediaSettings
- HMSMessage
- HMSMessageNotification
- HMSPeer
- HMSPeerListNotification
- HMSPeerNotification
- HMSPeerStats
- HMSPeerWithMuteStatus
- HMSPlaylist
- HMSPlaylistItem
- HMSPlaylistItemNotification
- HMSPlaylistSelection
- HMSPlaylistSelector
- HMSPublishAllowed
- HMSRTMP
- HMSReconnectionNotification
- HMSRecording
- HMSRemoteTrackStats
- HMSRole
- HMSRoleChangeRequest
- HMSRoleChangeStoreRequest
- HMSRoom
- HMSScreenAudioTrack
- HMSScreenVideoTrack
- HMSSpeaker
- HMSStatsStore
- HMSStatsStoreWrapper
- HMSStore
- HMSTrackNotification
- HMSTrackStats
- HMSVideoTrack
- HMSVideoTrackSettings
- IHMSPlaylistActions
- IHMSStatsStore
- IHMSStore
- RTMPRecordingConfig
- SimulcastLayerDefinition
References
IHMSNotifications
Renames and re-exports HMSNotifications
Type Aliases
HMSMessageID
Ƭ HMSMessageID: string
HMSNotification
Ƭ HMSNotification: HMSPeerNotification
| HMSPeerListNotification
| HMSTrackNotification
| HMSMessageNotification
| HMSExceptionNotification
| HMSChangeTrackStateRequestNotification
| HMSChangeMultiTrackStateRequestNotification
| HMSLeaveRoomRequestNotification
| HMSDeviceChangeEventNotification
| HMSReconnectionNotification
| HMSPlaylistItemNotification
<any
>
HMSNotificationCallback
Ƭ HMSNotificationCallback<T
>: (notification
: HMSNotificationInCallback
<T
>) => void
Type parameters
Name | Type |
---|---|
T | extends HMSNotificationTypeParam |
Type declaration
▸ (notification
): void
Parameters
Name | Type |
---|---|
notification | HMSNotificationInCallback <T > |
Returns
void
HMSNotificationInCallback
Ƭ HMSNotificationInCallback<T
>: T
extends HMSNotificationTypes
[] ? MappedNotifications
<T
>[number
] : T
extends HMSNotificationTypes
? HMSNotificationMapping
<T
> : HMSNotification
Type parameters
Name | Type |
---|---|
T | extends HMSNotificationTypeParam |
HMSNotificationMapping
Ƭ HMSNotificationMapping<T
, C
>: { CHANGE_MULTI_TRACK_STATE_REQUEST
: HMSChangeMultiTrackStateRequestNotification
; CHANGE_TRACK_STATE_REQUEST
: HMSChangeTrackStateRequestNotification
; DEVICE_CHANGE_UPDATE
: HMSDeviceChangeEventNotification
; ERROR
: HMSExceptionNotification
; METADATA_UPDATED
: HMSPeerNotification
; NAME_UPDATED
: HMSPeerNotification
; NEW_MESSAGE
: HMSMessageNotification
; PEER_JOINED
: HMSPeerNotification
; PEER_LEFT
: HMSPeerNotification
; PEER_LIST
: HMSPeerListNotification
; PLAYLIST_TRACK_ENDED
: HMSPlaylistItemNotification
<C
> ; RECONNECTED
: HMSReconnectionNotification
; RECONNECTING
: HMSReconnectionNotification
; REMOVED_FROM_ROOM
: HMSLeaveRoomRequestNotification
; ROLE_UPDATED
: HMSPeerNotification
; ROOM_ENDED
: HMSLeaveRoomRequestNotification
; TRACK_ADDED
: HMSTrackNotification
; TRACK_DEGRADED
: HMSTrackNotification
; TRACK_DESCRIPTION_CHANGED
: HMSTrackNotification
; TRACK_MUTED
: HMSTrackNotification
; TRACK_REMOVED
: HMSTrackNotification
; TRACK_RESTORED
: HMSTrackNotification
; TRACK_UNMUTED
: HMSTrackNotification
}[T
]
Type parameters
Name | Type |
---|---|
T | extends HMSNotificationTypes |
C | any |
HMSNotificationTypeParam
Ƭ HMSNotificationTypeParam: HMSNotificationTypes
| HMSNotificationTypes
[] | undefined
HMSPeerID
Ƭ HMSPeerID: string
HMSRoleName
Ƭ HMSRoleName: string
HMSRoomID
Ƭ HMSRoomID: string
HMSTrack
Ƭ HMSTrack: HMSVideoTrack
| HMSAudioTrack
| HMSScreenVideoTrack
| HMSScreenAudioTrack
HMSTrackDisplaySurface
Ƭ HMSTrackDisplaySurface: "application"
| "browser"
| "monitor"
| "window"
HMSTrackFacingMode
Ƭ HMSTrackFacingMode: "user"
| "environment"
| "left"
| "right"
HMSTrackID
Ƭ HMSTrackID: string
HMSTrackSource
Ƭ HMSTrackSource: "regular"
| "screen"
| "plugin"
| "audioplaylist"
| "videoplaylist"
| string
HMSTrackType
Ƭ HMSTrackType: "audio"
| "video"
Variables
parsedUserAgent
• Const
parsedUserAgent: UAParserInstance
selectAudioPlaylist
• Const
selectAudioPlaylist: HMSPlaylistSelector
selectHMSStats
• Const
selectHMSStats: Object
Type declaration
Name | Type |
---|---|
availablePublishBitrate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
availableSubscribeBitrate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
bitrateByTrackID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | number > |
bytesReceivedByTrackID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | number > |
framerateByTrackID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | number > |
jitter | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
jitterByTrackID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | number > |
localAudioTrackBitrate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSLocalTrackStats ) => undefined | number > |
localAudioTrackBytesSent | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSLocalTrackStats ) => undefined | number > |
localAudioTrackStats | OutputSelector <HMSStatsStore , undefined | HMSLocalTrackStats , (res1 : Record <string , undefined | HMSTrackStats >, res2 : undefined | string ) => undefined | HMSLocalTrackStats > |
localPeerStats | OutputSelector <HMSStatsStore , undefined | HMSPeerStats , (res1 : Record <string , undefined | HMSPeerStats >, res2 : string ) => undefined | HMSPeerStats > |
localVideoTrackBitrate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSLocalTrackStats ) => undefined | number > |
localVideoTrackBytesSent | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSLocalTrackStats ) => undefined | number > |
localVideoTrackFramerate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSLocalTrackStats ) => undefined | number > |
localVideoTrackQualityLimitationReason | OutputSelector <HMSStatsStore , undefined | string , (res : undefined | HMSLocalTrackStats ) => undefined | string > |
localVideoTrackStats | OutputSelector <HMSStatsStore , undefined | HMSLocalTrackStats , (res1 : Record <string , undefined | HMSTrackStats >, res2 : undefined | string ) => undefined | HMSLocalTrackStats > |
packetsLost | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
packetsLostByTrackID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | number > |
peerStatsByID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | HMSPeerStats > |
publishBitrate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
subscribeBitrate | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
totalBytesReceived | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
totalBytesSent | OutputSelector <HMSStatsStore , undefined | number , (res : undefined | HMSPeerStats ) => undefined | number > |
trackStatsByID | (id? : string ) => StoreSelector <HMSStatsStore , undefined | HMSTrackStats > |
selectVideoPlaylist
• Const
selectVideoPlaylist: HMSPlaylistSelector
Functions
createDefaultStatsStore
▸ createDefaultStatsStore(): HMSStatsStore
Returns
selectAppData
▸ selectAppData(id?
): StoreSelector
<HMSStore
, any
>
Select a particular key from ui app data by passed in key. if key is not passed, full data is returned.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, any
>
selectAppDataByPath
▸ selectAppDataByPath(...keys
): OutputSelector
<HMSStore
, undefined
| Record
<string
, any
>, (res
: undefined
| Record
<string
, any
>) => undefined
| Record
<string
, any
>>
Parameters
Name | Type |
---|---|
...keys | string [] |
Returns
OutputSelector
<HMSStore
, undefined
| Record
<string
, any
>, (res
: undefined
| Record
<string
, any
>) => undefined
| Record
<string
, any
>>
selectAudioPlaylistTrackByPeerID
▸ selectAudioPlaylistTrackByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
selectAudioTrackByID
▸ selectAudioTrackByID(id?
): StoreSelector
<HMSStore
, null
| HMSAudioTrack
>
Select the HMSAudioTrack object given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, null
| HMSAudioTrack
>
selectAudioTrackByPeerID
▸ selectAudioTrackByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
Select the primary audio track of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
selectAudioTrackVolume
▸ selectAudioTrackVolume(id?
): StoreSelector
<HMSStore
, undefined
| number
>
Select the local audio volume of an audio track given a track ID.
NOTE: Volume of a track is different from Audio Level of a track,
- Audio Level measures the audio of a track and it comes from 100ms's servers.
- Volume is how loud you hear the audio of a track, this is controlled by you at the client side.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| number
>
selectAudioVolumeByPeerID
▸ selectAudioVolumeByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| number
>
Select the local audio volume of the primary audio track of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| number
>
selectAuxiliaryAudioByPeerID
▸ selectAuxiliaryAudioByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
Select the first auxiliary audio track of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
selectAuxiliaryTracksByPeerID
▸ selectAuxiliaryTracksByPeerID(id?
): StoreSelector
<HMSStore
, HMSTrack
[]>
Select an array of auxiliary tracks of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, HMSTrack
[]>
selectAvailableRoleNames
▸ selectAvailableRoleNames(state
): string
[]
Select an array of names of available roles in the room.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
string
[]
selectBroadcastMessages
▸ selectBroadcastMessages(state
): HMSMessage
[]
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectBroadcastMessagesUnreadCount
▸ selectBroadcastMessagesUnreadCount(state
): number
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
number
selectCameraStreamByPeerID
▸ selectCameraStreamByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSVideoTrack
>
Select the camera stream of a peer given a peer ID. This is the primary video track of a peer.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSVideoTrack
>
selectConnectionQualities
▸ selectConnectionQualities(store
): Record
<string
, HMSConnectionQuality
>
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
Record
<string
, HMSConnectionQuality
>
selectConnectionQualityByPeerID
▸ selectConnectionQualityByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSConnectionQuality
>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSConnectionQuality
>
selectDegradedTracks
▸ selectDegradedTracks(state
): HMSVideoTrack
[]
Select an array of tracks that have been degraded(receiving lower video quality/no video) due to bad network locally.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectDevices
▸ selectDevices(store
): DeviceMap
Select the available audio input, audio output and video input devices on your machine.
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
An object of array of available audio input, audio output and video input devices.
type DeviceMap = { audioInput: InputDeviceInfo[]; audioOutput: MediaDeviceInfo[]; videoInput: InputDeviceInfo[]; }
selectDidIJoinWithin
▸ selectDidIJoinWithin(timeMs
): OutputSelector
<HMSStore
, undefined
| boolean
, (res
: HMSRoom
) => undefined
| boolean
>
Returns a boolean to indicate if the local peer joined within the past timeMs
milliseconds.
Ex: to know if the local peer joined within the last one second
const joinedWithinASecond = useHMSStore(selectDidIJoinWithin(1000));
Parameters
Name | Type |
---|---|
timeMs | number |
Returns
OutputSelector
<HMSStore
, undefined
| boolean
, (res
: HMSRoom
) => undefined
| boolean
>
selectDominantSpeaker
▸ selectDominantSpeaker(state
): null
| HMSPeer
Select the peer who's speaking the loudest at the moment
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
null
| HMSPeer
selectHLSState
▸ selectHLSState(state
): HMSHLS
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectHMSMessages
▸ selectHMSMessages(state
): HMSMessage
[]
Select an array of messages in the room(sent and received).
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectHMSMessagesCount
▸ selectHMSMessagesCount(state
): number
Select the number of messages(sent and received).
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
number
selectIsAllowedToPublish
▸ selectIsAllowedToPublish(state
): HMSPublishAllowed
Select what streams is the local peer allowed to publish from video, audio and screenshare.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectIsAllowedToSubscribe
▸ selectIsAllowedToSubscribe(state
): boolean
Select a boolean denoting whether if your local peer is allowed to subscribe to any other role.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
boolean
selectIsAudioLocallyMuted
▸ selectIsAudioLocallyMuted(id?
): StoreSelector
<HMSStore
, undefined
| boolean
>
Select a boolean denoting whether you've muted an audio track locally(only for you) given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| boolean
>
selectIsConnectedToRoom
▸ selectIsConnectedToRoom(state
): undefined
| boolean
Select a boolean flag denoting whether you've joined a room. NOTE: Returns true only after join, returns false during preview.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| boolean
selectIsInPreview
▸ selectIsInPreview(state
): boolean
Select a boolean denoting whether the room is in Preview state.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
boolean
selectIsLocalAudioEnabled
▸ selectIsLocalAudioEnabled(store
): boolean
Select a boolean denoting whether your local audio is unmuted and the audio from your microphone is shared to remote peers
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
boolean
selectIsLocalAudioPluginPresent
▸ selectIsLocalAudioPluginPresent(pluginName
): OutputSelector
<HMSStore
, boolean
, (res
: string
[]) => boolean
>
Parameters
Name | Type |
---|---|
pluginName | string |
Returns
OutputSelector
<HMSStore
, boolean
, (res
: string
[]) => boolean
>
selectIsLocalScreenShared
▸ selectIsLocalScreenShared(state
): boolean
Select a boolean denoting whether your screen is shared to remote peers in the room.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
boolean
selectIsLocalVideoDisplayEnabled
▸ selectIsLocalVideoDisplayEnabled(store
): undefined
| boolean
Select a boolean denoting whether you've chosen to unmute and share your local video.
NOTE: Once you call hmsActions.setLocalVideoEnabled(true)
to unmute your local video,
it takes some time to fetch your video from your video source.
This displayEnabled property gives immediate feedback for a more interactive UI,
without waiting for the video source
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
undefined
| boolean
selectIsLocalVideoEnabled
▸ selectIsLocalVideoEnabled(store
): boolean
Select a boolean denoting whether your local video is unmuted and the video from your camera is shared to remote peers
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
boolean
selectIsLocalVideoPluginPresent
▸ selectIsLocalVideoPluginPresent(pluginName
): OutputSelector
<HMSStore
, boolean
, (res
: string
[]) => boolean
>
Parameters
Name | Type |
---|---|
pluginName | string |
Returns
OutputSelector
<HMSStore
, boolean
, (res
: string
[]) => boolean
>
selectIsLocallyMutedByPeerID
▸ selectIsLocallyMutedByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| boolean
>
Select a boolean denoting whether you've muted the primary audio track of a peer locally(only for you) given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| boolean
>
selectIsPeerAudioEnabled
▸ selectIsPeerAudioEnabled(id?
): StoreSelector
<HMSStore
, boolean
>
Select a boolean denoting whether a peer has unmuted audio and sharing it to other peers.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, boolean
>
selectIsPeerVideoEnabled
▸ selectIsPeerVideoEnabled(id?
): StoreSelector
<HMSStore
, boolean
>
Select a boolean denoting whether a peer has unmuted video and sharing it to other peers.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, boolean
>
selectIsScreenShareLocallyMutedByPeerID
▸ selectIsScreenShareLocallyMutedByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| boolean
>
Select a boolean denoting whether you've muted the screen share audio track of a peer locally(only for you) given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| boolean
>
selectIsSomeoneScreenSharing
▸ selectIsSomeoneScreenSharing(state
): boolean
Select a boolean denoting whether someone is sharing screen in the room.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
boolean
selectLocalAudioTrackID
▸ selectLocalAudioTrackID(state
): undefined
| string
Select the track ID of your local peer's primary audio track
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| string
selectLocalMediaSettings
▸ selectLocalMediaSettings(store
): HMSMediaSettings
Select your media settings i.e., choosen audio input device, audio output device and video input device.
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
selectLocalPeer
▸ selectLocalPeer(state
): HMSPeer
Select the local peer object object assigned to you.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectLocalPeerID
▸ selectLocalPeerID(state
): string
Select the peer ID of your local peer.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
string
selectLocalPeerName
▸ selectLocalPeerName(state
): string
Select the peer name of your local peer.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
string
selectLocalPeerRole
▸ selectLocalPeerRole(state
): null
| HMSRole
Select the HMSRole object of your local peer.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
null
| HMSRole
selectLocalPeerRoleName
▸ selectLocalPeerRoleName(state
): undefined
| string
Select the role name of your local peer.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| string
selectLocalTrackIDs
▸ selectLocalTrackIDs(state
): string
[]
Select an array of track IDs of all your local peer's tracks
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
string
[]
selectLocalVideoTrackID
▸ selectLocalVideoTrackID(state
): undefined
| string
Select the track ID of your local peer's primary video track
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| string
selectMessageIDsInOrder
▸ selectMessageIDsInOrder(store
): string
[]
Select IDs of messages you've sent or received sorted chronologically.
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
string
[]
selectMessagesByPeerID
▸ selectMessagesByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSMessage
[]>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSMessage
[]>
selectMessagesByRole
▸ selectMessagesByRole(id?
): StoreSelector
<HMSStore
, undefined
| HMSMessage
[]>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSMessage
[]>
selectMessagesUnreadCountByPeerID
▸ selectMessagesUnreadCountByPeerID(id?
): StoreSelector
<HMSStore
, number
>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, number
>
selectMessagesUnreadCountByRole
▸ selectMessagesUnreadCountByRole(id?
): StoreSelector
<HMSStore
, number
>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, number
>
selectPeerAudioByID
▸ selectPeerAudioByID(id?
): StoreSelector
<HMSStore
, number
>
Select audio level of audioTrack of a peer given a peer IDß.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, number
>
selectPeerByCondition
▸ selectPeerByCondition(predicate
): OutputSelector
<HMSStore
, undefined
| HMSPeer
, (res
: HMSPeer
[]) => undefined
| HMSPeer
>
Selects the first peer passing the condition given by the argument predicate function
Ex: to select a peer whose metadata has spotlight set to true(assuming peer.metadata is a valid json string), use
const spotlightPeer = useHMSStore(selectPeerByCondition(peer => JSON.parse(peer.metadata).spotlight));
Parameters
Name | Type |
---|---|
predicate | (peer : HMSPeer ) => boolean |
Returns
OutputSelector
<HMSStore
, undefined
| HMSPeer
, (res
: HMSPeer
[]) => undefined
| HMSPeer
>
selectPeerByID
▸ selectPeerByID(id?
): StoreSelector
<HMSStore
, null
| HMSPeer
>
Select the HMSPeer object given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, null
| HMSPeer
>
selectPeerCount
▸ selectPeerCount(state
): number
selectPeerCount gives the number of peers Inside the room. This doesn't count the local peer if they're still in preview and haven't yet joined the room. Note that this will not necessarily equal the number of peers received through selectPeers, it's possible to know total number of people in the room without having details of everyone depending on dashboard settings.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
number
selectPeerMetadata
▸ selectPeerMetadata(peerId
): OutputSelector
<HMSStore
, any
, (res
: null
| HMSPeer
) => any
>
Selects the peer metadata for the passed in peer and returns it as JSON. If metadata is not present or conversion to JSON gives an error, an empty object is returned. Please directly use peer.metadata in case the metadata is not JSON by design.
Parameters
Name | Type |
---|---|
peerId | string |
Returns
OutputSelector
<HMSStore
, any
, (res
: null
| HMSPeer
) => any
>
selectPeerName
▸ selectPeerName(peerId
): OutputSelector
<HMSStore
, undefined
| string
, (res
: null
| HMSPeer
) => undefined
| string
>
Parameters
Name | Type |
---|---|
peerId | string |
Returns
OutputSelector
<HMSStore
, undefined
| string
, (res
: null
| HMSPeer
) => undefined
| string
>
selectPeerNameByID
▸ selectPeerNameByID(id?
): StoreSelector
<HMSStore
, undefined
| string
>
Select the name of a HMSPeer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| string
>
selectPeerScreenSharing
▸ selectPeerScreenSharing(state
): undefined
| HMSPeer
Select the first peer who is currently sharing their screen.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| HMSPeer
selectPeerSharingAudio
▸ selectPeerSharingAudio(state
): undefined
| HMSPeer
Select the first peer who is currently sharing their audio only screen
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| HMSPeer
selectPeerSharingAudioPlaylist
▸ selectPeerSharingAudioPlaylist(state
): undefined
| HMSPeer
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| HMSPeer
selectPeerSharingVideoPlaylist
▸ selectPeerSharingVideoPlaylist(state
): undefined
| HMSPeer
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| HMSPeer
selectPeers
▸ selectPeers(state
): HMSPeer
[]
Select an array of peers(remote peers and your local peer) present in the room.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
HMSPeer
[]
selectPeersByCondition
▸ selectPeersByCondition(predicate
): OutputSelector
<HMSStore
, HMSPeer
[], (res
: HMSPeer
[]) => HMSPeer
[]>
Selects all peers passing the condition given by the argument predicate function
Ex: to select peers with isHandRaised set to true in their metadata(assuming peer.metadata is a valid json string), use
const handRaisedPeers = useHMSStore(selectPeersByCondition(peer => JSON.parse(peer.metadata).isHandRaised));
Parameters
Name | Type |
---|---|
predicate | (peer : HMSPeer ) => boolean |
Returns
OutputSelector
<HMSStore
, HMSPeer
[], (res
: HMSPeer
[]) => HMSPeer
[]>
selectPeersByRole
▸ selectPeersByRole(role
): OutputSelector
<HMSStore
, HMSPeer
[], (res
: HMSPeer
[]) => HMSPeer
[]>
Select an array of peers of a particular role
Parameters
Name | Type | Description |
---|---|---|
role | string | HMSRoleName |
Returns
OutputSelector
<HMSStore
, HMSPeer
[], (res
: HMSPeer
[]) => HMSPeer
[]>
HMSPeer[]
selectPeersScreenSharing
▸ selectPeersScreenSharing(state
): HMSPeer
[]
Select an array of peers who are currently sharing their screen.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
HMSPeer
[]
selectPeersWithAudioStatus
▸ selectPeersWithAudioStatus(state
): HMSPeerWithMuteStatus
[]
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectPermissions
▸ selectPermissions(state
): undefined
| { browserRecording
: boolean
; changeRole
: boolean
; endRoom
: boolean
; hlsStreaming
: boolean
; mute
: boolean
; removeOthers
: boolean
; rtmpStreaming
: boolean
; unmute
: boolean
}
Select the permissions which determine what actions the local peer can do.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| { browserRecording
: boolean
; changeRole
: boolean
; endRoom
: boolean
; hlsStreaming
: boolean
; mute
: boolean
; removeOthers
: boolean
; rtmpStreaming
: boolean
; unmute
: boolean
}
selectRTMPState
▸ selectRTMPState(state
): HMSRTMP
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectRecordingState
▸ selectRecordingState(state
): HMSRecording
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectRemotePeers
▸ selectRemotePeers(state
): HMSPeer
[]
Select remote peers(other users you're connected with via the internet) present in the room.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
HMSPeer
[]
selectRoleByRoleName
▸ selectRoleByRoleName(roleName
): OutputSelector
<HMSStore
, HMSRole
, (res
: Record
<string
, HMSRole
>) => HMSRole
>
Parameters
Name | Type |
---|---|
roleName | string |
Returns
OutputSelector
<HMSStore
, HMSRole
, (res
: Record
<string
, HMSRole
>) => HMSRole
>
selectRoleChangeRequest
▸ selectRoleChangeRequest(state
): null
| HMSRoleChangeRequest
Select the role change request received for your local peer.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
null
| HMSRoleChangeRequest
selectRolesMap
▸ selectRolesMap(store
): Record
<string
, HMSRole
>
Select available roles in the room as a map between the role name and HMSRole object.
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
Record
<string
, HMSRole
>
selectRoom
▸ selectRoom(store
): HMSRoom
Select the current HMSRoom object to which you are connected.
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
selectRoomID
▸ selectRoomID(state
): string
Select the ID of the current room to which you are connected.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
string
selectRoomStartTime
▸ selectRoomStartTime(state
): undefined
| Date
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
undefined
| Date
selectRoomStarted
▸ selectRoomStarted(state
): boolean
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
boolean
selectRoomState
▸ selectRoomState(state
): HMSRoomState
Select the current state of the room.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
selectScreenAudioTrackByID
▸ selectScreenAudioTrackByID(id?
): StoreSelector
<HMSStore
, null
| HMSAudioTrack
>
Select the HMSScreenAudioTrack object given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, null
| HMSAudioTrack
>
selectScreenShareAudioByPeerID
▸ selectScreenShareAudioByPeerID(id?
): OutputSelector
<HMSStore
, HMSScreenAudioTrack
, (res
: { audio
: HMSScreenAudioTrack
; video
: HMSScreenVideoTrack
}) => HMSScreenAudioTrack
>
Select the screen share audio track of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
OutputSelector
<HMSStore
, HMSScreenAudioTrack
, (res
: { audio
: HMSScreenAudioTrack
; video
: HMSScreenVideoTrack
}) => HMSScreenAudioTrack
>
selectScreenShareByPeerID
▸ selectScreenShareByPeerID(id?
): OutputSelector
<HMSStore
, HMSScreenVideoTrack
, (res
: { audio
: HMSScreenAudioTrack
; video
: HMSScreenVideoTrack
}) => HMSScreenVideoTrack
>
Select the screen share video track of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
OutputSelector
<HMSStore
, HMSScreenVideoTrack
, (res
: { audio
: HMSScreenAudioTrack
; video
: HMSScreenVideoTrack
}) => HMSScreenVideoTrack
>
selectScreenSharesByPeerId
▸ selectScreenSharesByPeerId(id?
): StoreSelector
<HMSStore
, { audio
: HMSScreenAudioTrack
; video
: HMSScreenVideoTrack
}>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, { audio
: HMSScreenAudioTrack
; video
: HMSScreenVideoTrack
}>
selectScreenVideoTrackByID
▸ selectScreenVideoTrackByID(id?
): StoreSelector
<HMSStore
, null
| HMSScreenVideoTrack
>
Select the HMSScreenVideoTrack object given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, null
| HMSScreenVideoTrack
>
selectScreenshareAudioVolumeByPeerID
▸ selectScreenshareAudioVolumeByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| number
>
Select the local audio volume of the screen share of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| number
>
selectSessionId
▸ selectSessionId(state
): string
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
string
selectSessionMetadata
▸ selectSessionMetadata(store
): any
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
any
selectSimulcastLayerByTrack
▸ selectSimulcastLayerByTrack(id?
): StoreSelector
<HMSStore
, undefined
| HMSSimulcastLayer
>
Select the current simulcast layer of a track given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSSimulcastLayer
>
selectSpeakers
▸ selectSpeakers(store
): Record
<string
, HMSSpeaker
>
Parameters
Name | Type |
---|---|
store | HMSStore |
Returns
Record
<string
, HMSSpeaker
>
selectTrackAudioByID
▸ selectTrackAudioByID(id?
): StoreSelector
<HMSStore
, number
>
Select the audio level of a track given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, number
>
selectTrackByID
▸ selectTrackByID(id?
): StoreSelector
<HMSStore
, null
| HMSAudioTrack
| HMSVideoTrack
| HMSScreenVideoTrack
>
Select the HMSTrack object given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, null
| HMSAudioTrack
| HMSVideoTrack
| HMSScreenVideoTrack
>
selectUnreadHMSMessagesCount
▸ selectUnreadHMSMessagesCount(state
): number
Select the number of unread messages.
Parameters
Name | Type |
---|---|
state | HMSStore |
Returns
number
selectVideoPlaylistAudioTrackByPeerID
▸ selectVideoPlaylistAudioTrackByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSAudioTrack
>
selectVideoPlaylistVideoTrackByPeerID
▸ selectVideoPlaylistVideoTrackByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSVideoTrack
>
takes in a normal selector which has store and id as input and curries it to make it easier to use. Before: store.getState((store) => normalSelector(store, peerID)) After: store.getState(curriedSelector(peerID))
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSVideoTrack
>
selectVideoTrackByID
▸ selectVideoTrackByID(id?
): StoreSelector
<HMSStore
, null
| HMSVideoTrack
>
Select the HMSVideoTrack object given a track ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, null
| HMSVideoTrack
>
selectVideoTrackByPeerID
▸ selectVideoTrackByPeerID(id?
): StoreSelector
<HMSStore
, undefined
| HMSVideoTrack
>
Select the primary video track of a peer given a peer ID.
Parameters
Name | Type |
---|---|
id? | string |
Returns
StoreSelector
<HMSStore
, undefined
| HMSVideoTrack
>