diff --git a/docs/api-reference/javascript/v2/classes/HMSReactiveStore.md b/docs/api-reference/javascript/v2/classes/HMSReactiveStore.md index f1487c1c4..be702cbe6 100644 --- a/docs/api-reference/javascript/v2/classes/HMSReactiveStore.md +++ b/docs/api-reference/javascript/v2/classes/HMSReactiveStore.md @@ -113,13 +113,13 @@ all data related to the corresponding HMS Room. ▸ **triggerOnSubscribe**(): `void` -By default store.subscribe does not call the handler with the current state at time of subscription, +By default, store.subscribe does not call the handler with the current state at time of subscription, this behaviour can be modified by calling this function. What it means is that instead of calling the handler only for changes which happen post subscription we'll also call it exactly once at the time of subscription with the current state. This behaviour is similar to that of BehaviourSubject in RxJS. This will be an irreversible change -Note: you don't need this if you're using our react hooks, it takes care of this requirement. +Note: you don't need this if you're using our React hooks, it takes care of this requirement. #### Returns diff --git a/docs/api-reference/javascript/v2/interfaces/DiagnosticsRTCStats.md b/docs/api-reference/javascript/v2/interfaces/DiagnosticsRTCStats.md index 280708d3d..3df5ab1b4 100644 --- a/docs/api-reference/javascript/v2/interfaces/DiagnosticsRTCStats.md +++ b/docs/api-reference/javascript/v2/interfaces/DiagnosticsRTCStats.md @@ -29,6 +29,12 @@ nav: '4.4' --- +### jitter + +• **jitter**: `number` + +--- + ### packetsLost • **packetsLost**: `number` diff --git a/docs/api-reference/javascript/v2/interfaces/HLSMeetingURLVariant.md b/docs/api-reference/javascript/v2/interfaces/HLSMeetingURLVariant.md index 46fdb775a..c3f7fc99e 100644 --- a/docs/api-reference/javascript/v2/interfaces/HLSMeetingURLVariant.md +++ b/docs/api-reference/javascript/v2/interfaces/HLSMeetingURLVariant.md @@ -18,4 +18,4 @@ Make sure this URL leads the joiner straight to the room without any preview scr • `Optional` **metadata**: `string` -additional metadata for this URL for example - landscape/portrait, the field is not currently supported +additional metadata for this URL for example - landscape/portrait diff --git a/docs/api-reference/javascript/v2/interfaces/HMSActions.md b/docs/api-reference/javascript/v2/interfaces/HMSActions.md index 90a4d3ee4..cfa1e9fc8 100644 --- a/docs/api-reference/javascript/v2/interfaces/HMSActions.md +++ b/docs/api-reference/javascript/v2/interfaces/HMSActions.md @@ -7,9 +7,9 @@ The below interface defines our SDK API Surface for taking room related actions. It talks to our 100ms backend and handles error reconnections, state managements and lots of other things so you don't have to. You can use this gateway with any sort of UI to make connecting to our backend easier. -In case you use react, we also provide a HMSProvider class with very powerful hooks -and out of box components which you can use to setup your website in minutes. Our -components have in built integration with this interface and you won't have to worry +In case you use React, we also provide a HMSProvider class with very powerful hooks +and out of box components which you can use to set up your website in minutes. Our +components have in built integration with this interface, and you won't have to worry about passing props if you use them. **`Remarks`** @@ -47,21 +47,26 @@ If lock is passed as true, the room cannot be used further. ##### Parameters -| Name | Type | -| :------- | :-------- | -| `lock` | `boolean` | -| `reason` | `string` | +| Name | Type | Description | +| :------- | :-------- | :---------------------------------- | +| `lock` | `boolean` | boolean - true to lock the room | +| `reason` | `string` | string - reason for ending the room | ##### Returns `Promise`<`void`\> +Promise - resolves when the room is ended + --- ### interactivityCenter • **interactivityCenter**: `HMSInteractivityCenter` +interactivityCenter contains all actions that can be performed on the interactivity center +This will be available after joining the room + --- ### sessionStore @@ -92,6 +97,8 @@ to resolve the autoplay error `Promise`<`void`\> +Promise - resolves when the autoplay error is resolved + --- ### videoPlaylist @@ -119,6 +126,8 @@ Accept the role change request received `Promise`<`void`\> +Promise - resolves when the role is accepted + --- ### addPluginToAudioTrack @@ -210,6 +219,8 @@ This method adds the track to the local peer's list of auxiliary tracks and publ `Promise`<`void`\> +Promise - resolves when the track is added + --- ### attachVideo @@ -232,6 +243,8 @@ the stream coming from server saving significant bandwidth for the user. `Promise`<`void`\> +Promise - resolves when the video is attached + --- ### cancelMidCallPreview @@ -244,6 +257,8 @@ stop tracks fetched during midcall preview and general cleanup `Promise`<`void`\> +Promise - resolves when the tracks are stopped + --- ### changeMetadata @@ -325,6 +340,8 @@ Request for a role change of a remote peer. Can be forced. `Promise`<`void`\> +Promise - resolves when the role is changed + --- ### changeRoleOfPeersWithRoles @@ -344,6 +361,8 @@ Request for a role change of a remote peer. Can be forced. `Promise`<`void`\> +Promise - resolves when the role is changed + --- ### detachVideo @@ -377,6 +396,8 @@ enable sending audio speaker data to beam `Promise`<`void`\> +Promise - resolves when the speaker data is enabled + --- ### findPeerByName @@ -399,12 +420,14 @@ enable sending audio speaker data to beam ▸ **getAuthTokenByRoomCode**(`tokenRequest`, `tokenRequestOptions?`): `Promise`<`string`\> +Get the auth token for the room code. This is useful when you want to join a room using a room code. + #### Parameters -| Name | Type | -| :--------------------- | :----------------------------------------------------------------------------------- | -| `tokenRequest` | [`TokenRequest`](/api-reference/javascript/v2/interfaces/TokenRequest) | -| `tokenRequestOptions?` | [`TokenRequestOptions`](/api-reference/javascript/v2/interfaces/TokenRequestOptions) | +| Name | Type | Description | +| :--------------------- | :----------------------------------------------------------------------------------- | :-------------------- | +| `tokenRequest` | [`TokenRequest`](/api-reference/javascript/v2/interfaces/TokenRequest) | token request object | +| `tokenRequestOptions?` | [`TokenRequestOptions`](/api-reference/javascript/v2/interfaces/TokenRequestOptions) | token request options | #### Returns @@ -432,48 +455,64 @@ enable sending audio speaker data to beam ▸ **getPeer**(`peerId`): `Promise`<`undefined` \| [`HMSPeer`](/api-reference/javascript/v2/interfaces/HMSPeer)\> +get the peer object by peerId + #### Parameters -| Name | Type | -| :------- | :------- | -| `peerId` | `string` | +| Name | Type | Description | +| :------- | :------- | :---------------------- | +| `peerId` | `string` | string - ID of the peer | #### Returns `Promise`<`undefined` \| [`HMSPeer`](/api-reference/javascript/v2/interfaces/HMSPeer)\> +Promise - resolves with the peer object + --- ### getPeerListIterator ▸ **getPeerListIterator**(`options?`): [`HMSPeerListIterator`](/api-reference/javascript/v2/interfaces/HMSPeerListIterator) +get the list of peers in the room + #### Parameters -| Name | Type | -| :--------- | :------------------------------------------------------------------------------------------------- | -| `options?` | [`HMSPeerListIteratorOptions`](/api-reference/javascript/v2/interfaces/HMSPeerListIteratorOptions) | +| Name | Type | Description | +| :--------- | :------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------- | +| `options?` | [`HMSPeerListIteratorOptions`](/api-reference/javascript/v2/interfaces/HMSPeerListIteratorOptions) | HMSPeerListIteratorOptions - options for the peer list iterator | #### Returns [`HMSPeerListIterator`](/api-reference/javascript/v2/interfaces/HMSPeerListIterator) +HMSPeerListIterator - iterator for the peer list + +**`See`** + +https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/large-room + --- ### getTrackById ▸ **getTrackById**(`trackId`): `undefined` \| `HMSTrack` +Get the track object by trackId + #### Parameters -| Name | Type | -| :-------- | :------- | -| `trackId` | `string` | +| Name | Type | Description | +| :-------- | :------- | :----------------------- | +| `trackId` | `string` | string - ID of the track | #### Returns `undefined` \| `HMSTrack` +HMSTrack | undefined - track object + --- ### ignoreMessageTypes @@ -519,6 +558,8 @@ Notifications for the ignored messages will still be sent, it'll only not be put ▸ **initDiagnostics**(): [`HMSDiagnosticsInterface`](/api-reference/javascript/v2/interfaces/HMSDiagnosticsInterface) +Method to initialize diagnostics. Should only be called after joining. + #### Returns [`HMSDiagnosticsInterface`](/api-reference/javascript/v2/interfaces/HMSDiagnosticsInterface) @@ -542,6 +583,8 @@ current details of participants and track details are populated in the store. `Promise`<`void`\> +Promise - resolves when the room is joined + **`Remarks`** If join is called while an earlier join is in progress for the room id, it @@ -554,37 +597,48 @@ is ignored ▸ **leave**(): `Promise`<`void`\> This function can be used to leave the room, if the call is repeated it's ignored. +This function also cleans up the store and removes all the tracks and participants. #### Returns `Promise`<`void`\> +Promise - resolves when the room is left + --- ### lowerLocalPeerHand ▸ **lowerLocalPeerHand**(): `Promise`<`void`\> +lower hand for local peer + #### Returns `Promise`<`void`\> +Promise - resolves when the hand is lowered + --- ### lowerRemotePeerHand ▸ **lowerRemotePeerHand**(`peerId`): `Promise`<`void`\> +lower hand for remote peer + #### Parameters -| Name | Type | -| :------- | :------- | -| `peerId` | `string` | +| Name | Type | Description | +| :------- | :------- | :---------------------- | +| `peerId` | `string` | string - ID of the peer | #### Returns `Promise`<`void`\> +Promise - resolves when the hand is lowered + --- ### populateSessionMetadata @@ -607,42 +661,55 @@ use `actions.sessionStore.observe` instead ▸ **preview**(`config`): `Promise`<`void`\> +Preview function can be used to preview the camera and microphone before joining the room. +This function is useful when you want to check and/or modify the camera and microphone settings before joining the Room. + #### Parameters -| Name | Type | -| :------- | :---------------------------------------------------------------------------------------------------------- | -| `config` | `HMSMidCallPreviewConfig` \| [`HMSPreviewConfig`](/api-reference/javascript/v2/interfaces/HMSPreviewConfig) | +| Name | Type | Description | +| :------- | :---------------------------------------------------------------------------------------------------------- | :------------------------------------------------ | +| `config` | `HMSMidCallPreviewConfig` \| [`HMSPreviewConfig`](/api-reference/javascript/v2/interfaces/HMSPreviewConfig) | preview config with camera and microphone devices | #### Returns `Promise`<`void`\> +Promise - resolves when the preview is successful + --- ### raiseLocalPeerHand ▸ **raiseLocalPeerHand**(): `Promise`<`void`\> +raise hand for local peer + #### Returns `Promise`<`void`\> +Promise - resolves when the hand is raised + --- ### raiseRemotePeerHand ▸ **raiseRemotePeerHand**(`peerId`): `Promise`<`void`\> +raise hand for remote peer + #### Parameters -| Name | Type | -| :------- | :------- | -| `peerId` | `string` | +| Name | Type | Description | +| :------- | :------- | :---------------------- | +| `peerId` | `string` | string - ID of the peer | #### Returns `Promise`<`void`\> +Promise - resolves when the hand is raised + --- ### refreshDevices @@ -690,6 +757,8 @@ If you have **removeOthers** permission, you can remove a peer from the room. `Promise`<`void`\> +Promise - resolves when the peer is removed + --- ### removePluginFromAudioTrack @@ -772,6 +841,8 @@ This method removes the track from the local peer's list of auxiliary tracks and `Promise`<`void`\> +Promise - resolves when the track is removed + --- ### sendBroadcastMessage @@ -791,6 +862,8 @@ Send a plain text message to all the other participants in the room. `Promise`<`void`\> +Promise - resolves when the message is sent + --- ### sendDirectMessage @@ -809,6 +882,8 @@ Send a plain text message to all the other participants in the room. `Promise`<`void`\> +Promise - resolves when the message is sent + --- ### sendGroupMessage @@ -827,6 +902,8 @@ Send a plain text message to all the other participants in the room. `Promise`<`void`\> +Promise - resolves when the message is sent + --- ### sendHLSTimedMetadata @@ -837,16 +914,18 @@ Used to define date range metadata in a media playlist. This api adds EXT-X-DATERANGE tags to the media playlist. It is useful for defining timed metadata for interstitial regions such as advertisements, but can be used to define any timed metadata needed by your stream. -usage (e.g) + +```js const metadataList = `[{ - payload: "some string 1", - duration: 2 -}, -{ - payload: "some string 2", - duration: 3 -}]` + payload: "some string 1", + duration: 2 + }, + { + payload: "some string 2", + duration: 3 +}]`; sendHLSTimedMetadata(metadataList); +``` #### Parameters @@ -965,6 +1044,8 @@ Set the audio output(speaker) device `Promise`<`void`\> +Promise - resolves when the audio output device is set + --- ### setAudioSettings @@ -1000,6 +1081,8 @@ Change settings of the local peer's audio track `Promise`<`void`\> +Promise - resolves when the track is enabled + --- ### setLocalAudioEnabled @@ -1018,6 +1101,8 @@ This function can be used to enable/disable(unmute/mute) local audio track `Promise`<`void`\> +Promise - resolves when the audio is enabled + --- ### setLocalVideoEnabled @@ -1036,6 +1121,8 @@ This function can be used to enable/disable(unmute/mute) local video track `Promise`<`void`\> +Promise - resolves when the video is enabled + --- ### setLogLevel @@ -1116,15 +1203,17 @@ set the quality of the selected videoTrack for simulcast. #### Parameters -| Name | Type | -| :-------- | :--------------------------------------------------------------------------------------------------- | -| `trackId` | `string` | -| `layer` | [`HMSPreferredSimulcastLayer`](/api-reference/javascript/v2/home/content#hmspreferredsimulcastlayer) | +| Name | Type | Description | +| :-------- | :--------------------------------------------------------------------------------------------------- | :-------------------------------------- | +| `trackId` | `string` | HMSTrackID - trackId of the video track | +| `layer` | [`HMSPreferredSimulcastLayer`](/api-reference/javascript/v2/home/content#hmspreferredsimulcastlayer) | HMSSimulcastLayer - layer to be set | #### Returns `Promise`<`void`\> +Promise - resolves when the layer is set + --- ### setRemoteTrackEnabled @@ -1145,6 +1234,8 @@ This can be used to mute/unmute a remote peer's track `Promise`<`void`\> +Promise - resolves when the track state is changed + --- ### setRemoteTracksEnabled @@ -1163,6 +1254,8 @@ Use this to mute/unmute multiple tracks by source, role or type `Promise`<`void`\> +Promise - resolves when the track state is changed + --- ### setScreenShareEnabled @@ -1175,15 +1268,17 @@ react component if our hook is used) will be notified/rerendered #### Parameters -| Name | Type | Description | -| :-------- | :------------------------------------------------------------------------------------- | :--------------------------------------------------- | -| `enabled` | `boolean` | boolean | -| `config?` | [`HMSScreenShareConfig`](/api-reference/javascript/v2/interfaces/HMSScreenShareConfig) | check the config object for details about the fields | +| Name | Type | Description | +| :-------- | :------------------------------------------------------------------------------------- | :----------------------------------------------------- | +| `enabled` | `boolean` | boolean - true to enable screenshare, false to disable | +| `config?` | [`HMSScreenShareConfig`](/api-reference/javascript/v2/interfaces/HMSScreenShareConfig) | check the config object for details about the fields | #### Returns `Promise`<`void`\> +Promise - resolves when the screenshare is enabled + --- ### setSessionMetadata @@ -1247,6 +1342,8 @@ Set the output volume of audio tracks(overall/particular audio track) `Promise`<`void`\> +Promise - resolves when the volume is set + --- ### startHLSStreaming @@ -1258,14 +1355,16 @@ otherwise #### Parameters -| Name | Type | -| :-------- | :--------------------------------------------------------------- | -| `params?` | [`HLSConfig`](/api-reference/javascript/v2/interfaces/HLSConfig) | +| Name | Type | Description | +| :-------- | :--------------------------------------------------------------- | :---------------------------------------------------- | +| `params?` | [`HLSConfig`](/api-reference/javascript/v2/interfaces/HLSConfig) | HLSConfig - HLSConfig object with the required fields | #### Returns `Promise`<`void`\> +Promise - resolves when the HLS streaming is started + --- ### startRTMPOrRecording @@ -1284,6 +1383,8 @@ If you want to start RTMP streaming or recording. `Promise`<`void`\> +Promise - resolves when the RTMP streaming and recording is started + --- ### startTranscription @@ -1312,14 +1413,16 @@ If you want to stop HLS streaming. The passed in arguments is not considered at #### Parameters -| Name | Type | -| :-------- | :--------------------------------------------------------------- | -| `params?` | [`HLSConfig`](/api-reference/javascript/v2/interfaces/HLSConfig) | +| Name | Type | Description | +| :-------- | :--------------------------------------------------------------- | :---------------------------------------------------- | +| `params?` | [`HLSConfig`](/api-reference/javascript/v2/interfaces/HLSConfig) | HLSConfig - HLSConfig object with the required fields | #### Returns `Promise`<`void`\> +Promise - resolves when the HLS streaming is stopped + --- ### stopRTMPAndRecording @@ -1332,6 +1435,8 @@ If you want to stop both RTMP streaming and recording. `Promise`<`void`\> +Promise - resolves when the RTMP streaming and recording is stopped + --- ### stopTranscription @@ -1360,15 +1465,17 @@ After leave send feedback to backend for call quality purpose. #### Parameters -| Name | Type | -| :--------------- | :------------------- | -| `feedback` | `HMSSessionFeedback` | -| `eventEndpoint?` | `string` | +| Name | Type | Description | +| :--------------- | :------------------- | :----------------------------------- | +| `feedback` | `HMSSessionFeedback` | HMSSessionFeedback - feedback object | +| `eventEndpoint?` | `string` | string - endpoint to send feedback | #### Returns `Promise`<`void`\> +Promise - resolves when the feedback is submitted + --- ### switchCamera @@ -1381,6 +1488,8 @@ Toggle the camera between front and back if the both the camera's exist `Promise`<`void`\> +Promise - resolves when the camera is toggled + --- ### validateAudioPluginSupport