@100mslive/hms-video-store 0.2.82 → 0.2.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/common/ui-logger.d.ts +13 -13
  2. package/dist/core/IHMSActions.d.ts +266 -264
  3. package/dist/core/IHMSNotifications.d.ts +14 -15
  4. package/dist/core/IHMSStore.d.ts +54 -56
  5. package/dist/core/hmsSDKStore/HMSNotifications.d.ts +25 -25
  6. package/dist/core/hmsSDKStore/HMSPlaylist.d.ts +21 -21
  7. package/dist/core/hmsSDKStore/HMSReactiveStore.d.ts +79 -79
  8. package/dist/core/hmsSDKStore/HMSSDKActions.d.ts +157 -157
  9. package/dist/core/hmsSDKStore/adapter.d.ts +49 -49
  10. package/dist/core/hmsSDKStore/common/mapping.d.ts +7 -7
  11. package/dist/core/hmsSDKStore/internalTypes.d.ts +4 -4
  12. package/dist/core/hmsSDKStore/sdkTypes.d.ts +3 -2
  13. package/dist/core/hmsSDKStore/sdkUtils/ActionBatcher.d.ts +19 -19
  14. package/dist/core/hmsSDKStore/sdkUtils/sdkUtils.d.ts +2 -2
  15. package/dist/core/hmsSDKStore/sdkUtils/storeMergeUtils.d.ts +14 -14
  16. package/dist/core/index.d.ts +9 -7
  17. package/dist/core/schema/device-change.d.ts +13 -13
  18. package/dist/core/schema/error.d.ts +13 -13
  19. package/dist/core/schema/index.d.ts +11 -11
  20. package/dist/core/schema/message.d.ts +31 -31
  21. package/dist/core/schema/notification.d.ts +40 -40
  22. package/dist/core/schema/peer.d.ts +67 -67
  23. package/dist/core/schema/playlist.d.ts +127 -109
  24. package/dist/core/schema/requests.d.ts +31 -31
  25. package/dist/core/schema/role.d.ts +3 -3
  26. package/dist/core/schema/room.d.ts +23 -23
  27. package/dist/core/schema/schema.d.ts +29 -29
  28. package/dist/core/schema/settings.d.ts +5 -5
  29. package/dist/core/selectors/derivedSelectors.d.ts +29 -29
  30. package/dist/core/selectors/index.d.ts +5 -5
  31. package/dist/core/selectors/playlistselectors.d.ts +3 -3
  32. package/dist/core/selectors/selectorUtils.d.ts +18 -18
  33. package/dist/core/selectors/selectors.d.ts +185 -191
  34. package/dist/core/selectors/selectorsByID.d.ts +127 -128
  35. package/dist/core/selectors/selectorsByReference.d.ts +3 -3
  36. package/dist/hms-video-store.cjs.js +1 -0
  37. package/dist/hms-video-store.esm.js +1 -5376
  38. package/dist/index.d.ts +1 -1
  39. package/package.json +21 -84
  40. package/dist/hms-video-store.cjs.development.js +0 -5468
  41. package/dist/hms-video-store.cjs.development.js.map +0 -1
  42. package/dist/hms-video-store.cjs.production.min.js +0 -2
  43. package/dist/hms-video-store.cjs.production.min.js.map +0 -1
  44. package/dist/hms-video-store.esm.js.map +0 -1
  45. package/dist/index.js +0 -8
  46. package/dist/test/fakeStore.d.ts +0 -23
  47. package/dist/test/fixtures.d.ts +0 -3
  48. package/src/common/ui-logger.ts +0 -88
  49. package/src/core/IHMSActions.ts +0 -318
  50. package/src/core/IHMSNotifications.ts +0 -16
  51. package/src/core/IHMSStore.ts +0 -60
  52. package/src/core/hmsSDKStore/HMSNotifications.ts +0 -194
  53. package/src/core/hmsSDKStore/HMSPlaylist.ts +0 -78
  54. package/src/core/hmsSDKStore/HMSReactiveStore.ts +0 -271
  55. package/src/core/hmsSDKStore/HMSSDKActions.ts +0 -1156
  56. package/src/core/hmsSDKStore/adapter.ts +0 -244
  57. package/src/core/hmsSDKStore/common/mapping.ts +0 -32
  58. package/src/core/hmsSDKStore/internalTypes.ts +0 -8
  59. package/src/core/hmsSDKStore/sdkTypes.ts +0 -55
  60. package/src/core/hmsSDKStore/sdkUtils/ActionBatcher.ts +0 -63
  61. package/src/core/hmsSDKStore/sdkUtils/sdkUtils.ts +0 -5
  62. package/src/core/hmsSDKStore/sdkUtils/storeMergeUtils.ts +0 -98
  63. package/src/core/index.ts +0 -18
  64. package/src/core/schema/device-change.ts +0 -14
  65. package/src/core/schema/error.ts +0 -13
  66. package/src/core/schema/index.ts +0 -11
  67. package/src/core/schema/message.ts +0 -35
  68. package/src/core/schema/notification.ts +0 -41
  69. package/src/core/schema/peer.ts +0 -78
  70. package/src/core/schema/playlist.ts +0 -114
  71. package/src/core/schema/requests.ts +0 -36
  72. package/src/core/schema/role.ts +0 -5
  73. package/src/core/schema/room.ts +0 -26
  74. package/src/core/schema/schema.ts +0 -94
  75. package/src/core/schema/settings.ts +0 -5
  76. package/src/core/selectors/derivedSelectors.ts +0 -81
  77. package/src/core/selectors/index.ts +0 -5
  78. package/src/core/selectors/playlistselectors.ts +0 -67
  79. package/src/core/selectors/selectorUtils.ts +0 -63
  80. package/src/core/selectors/selectors.ts +0 -400
  81. package/src/core/selectors/selectorsByID.ts +0 -401
  82. package/src/core/selectors/selectorsByReference.ts +0 -45
  83. package/src/index.ts +0 -1
  84. package/src/test/fakeStore.ts +0 -272
  85. package/src/test/fixtures.ts +0 -22
  86. package/src/test/integration/.gitkeep +0 -0
  87. package/src/test/unit/HMSNotifications.test.ts +0 -123
  88. package/src/test/unit/reactiveStore.test.ts +0 -129
  89. package/src/test/unit/roleSelectors.test.ts +0 -85
  90. package/src/test/unit/selectors.test.ts +0 -316
  91. package/src/test/unit/selectorsByReference.test.ts +0 -27
  92. package/src/test/unit/storeMergeUtils.test.ts +0 -168
@@ -1,13 +1,13 @@
1
- import { HMSLogLevel } from '../core/hmsSDKStore/sdkTypes';
2
- export declare class HMSLogger {
3
- static level: HMSLogLevel;
4
- static v(tag: string, ...data: any[]): void;
5
- static d(...data: any[]): void;
6
- static i(...data: any[]): void;
7
- static w(...data: any[]): void;
8
- static e(...data: any[]): void;
9
- static time(mark: string): void;
10
- static timeEnd(mark: string): void;
11
- static cleanUp(): void;
12
- private static log;
13
- }
1
+ import { HMSLogLevel } from '../core/hmsSDKStore/sdkTypes';
2
+ export declare class HMSLogger {
3
+ static level: HMSLogLevel;
4
+ static v(tag: string, ...data: any[]): void;
5
+ static d(...data: any[]): void;
6
+ static i(...data: any[]): void;
7
+ static w(...data: any[]): void;
8
+ static e(...data: any[]): void;
9
+ static time(mark: string): void;
10
+ static timeEnd(mark: string): void;
11
+ static cleanUp(): void;
12
+ private static log;
13
+ }
@@ -1,264 +1,266 @@
1
- import { HMSConfig, HMSSimulcastLayer, HMSAudioTrackSettings, HMSVideoTrackSettings, HMSLogLevel, HMSVideoPlugin, HMSAudioPlugin } from '@100mslive/hms-video';
2
- import { HMSMessageID, HMSPeerID, HMSRoleName, HMSTrackID, HMSTrackSource, IHMSPlaylistActions, HMSChangeMultiTrackStateParams } from './schema';
3
- import { HMSRoleChangeRequest } from './selectors';
4
- import { RTMPRecordingConfig } from './hmsSDKStore/sdkTypes';
5
- /**
6
- * The below interface defines our SDK API Surface for taking room related actions.
7
- * It talks to our 100ms backend and handles error reconnections, state managements
8
- * and lots of other things so you don't have to. You can use this gateway with any
9
- * sort of UI to make connecting to our backend easier.
10
- * In case you use react, we also provide a HMSProvider class with very powerful hooks
11
- * and out of box components which you can use to setup your website in minutes. Our
12
- * components have in built integration with this interface and you won't have to worry
13
- * about passing props if you use them.
14
- *
15
- * @remarks
16
- * There is a one to one mapping between an instance of this class and a 100ms room,
17
- * in case you're creating multiple rooms please create new instance per room.
18
- *
19
- * @category Core
20
- */
21
- export interface IHMSActions {
22
- preview(config: HMSConfig): Promise<void>;
23
- /**
24
- * join function can be used to join the room, if the room join is successful,
25
- * current details of participants and track details are populated in the store.
26
- *
27
- * @remarks
28
- * If join is called while an earlier join is in progress for the room id, it
29
- * is ignored
30
- *
31
- * @param config join config with room id, required for joining the room
32
- */
33
- join(config: HMSConfig): void;
34
- /**
35
- * This function can be used to leave the room, if the call is repeated it's ignored.
36
- */
37
- leave(): Promise<void>;
38
- /**
39
- * If you want to enable screenshare for the local peer this class can be called.
40
- * The store will be populated with the incoming track, and the subscriber(or
41
- * react component if our hook is used) will be notified/rerendered
42
- * @param enabled boolean
43
- * @param audioOnly boolean To publish only audio from screenshare
44
- */
45
- setScreenShareEnabled(enabled: boolean, audioOnly?: boolean): Promise<void>;
46
- /**
47
- * You can use the addTrack method to add an auxiliary track(canvas capture, electron screen-share, etc...)
48
- * This method adds the track to the local peer's list of auxiliary tracks and publishes it to make it available to remote peers.
49
- * @param track MediaStreamTrack - Track to be added
50
- * @param type HMSTrackSource - 'regular' | 'screen' | 'plugin' - Source of track - default: 'regular'
51
- */
52
- addTrack(track: MediaStreamTrack, type: HMSTrackSource): Promise<void>;
53
- /**
54
- * You can use the removeTrack method to remove an auxiliary track.
55
- * This method removes the track from the local peer's list of auxiliary tracks and unpublishes it.
56
- * @param trackId string - ID of the track to be removed
57
- */
58
- removeTrack(trackId: HMSTrackID): Promise<void>;
59
- /**
60
- * @deprecated The method should not be used
61
- * @see sendBroadcastMessage
62
- * Send a plain text message to all the other participants in the room.
63
- * @param message - string message to broadcast
64
- */
65
- sendMessage(message: string): void;
66
- /**
67
- * Send a plain text message to all the other participants in the room.
68
- * @param message - string message to broadcast
69
- * @param type - type of message eg: image, video etc. - optional defaults to chat
70
- */
71
- sendBroadcastMessage(message: string, type?: string): Promise<void>;
72
- /**
73
- *
74
- * @param message - string message to send
75
- * @param roles - roles to which to send the message
76
- * @param type - type of message eg: image, video etc. - optional defaults to chat
77
- */
78
- sendGroupMessage(message: string, roles: HMSRoleName[], type?: string): Promise<void>;
79
- /**
80
- *
81
- * @param message
82
- * @param peerID - id of the peer to which message has to be sent
83
- * @param type - type of message eg: image, video etc. - optional defaults to chat
84
- */
85
- sendDirectMessage(message: string, peerID: HMSPeerID, type?: string): Promise<void>;
86
- /**
87
- * If just readStatus argument is passed, the function will set read flag of every message
88
- * as the readStatus argument passed.
89
- * If both readStatus and messageId argument is passed, then just read flag of message
90
- * with passed messageId will be set as readStatus argument. if message with passed messageId is not
91
- * found in store, no change in store will take place.
92
- *
93
- * @param readStatus boolean value which you want to set as read flag for message/messages.
94
- * @param messageId message id whose read falg you want to set.
95
- */
96
- setMessageRead(readStatus: boolean, messageId?: HMSMessageID): void;
97
- /**
98
- * This function can be used to enable/disable(unmute/mute) local audio track
99
- * @param enabled boolean - true to unmute, false to mute
100
- */
101
- setLocalAudioEnabled(enabled: boolean): Promise<void>;
102
- /**
103
- * This function can be used to enable/disable(unmute/mute) local video track
104
- * @param enabled boolean - true to unmute, false to mute
105
- */
106
- setLocalVideoEnabled(enabled: boolean): Promise<void>;
107
- /**
108
- * @param trackId string - ID of the track whose mute status needs to be set
109
- * @param enabled boolean - true when we want to unmute the track and false when we want to unmute it
110
- */
111
- setEnabledTrack(trackId: HMSTrackID, enabled: boolean): Promise<void>;
112
- /**
113
- * Change settings of the local peer's audio track
114
- * @param settings HMSAudioTrackSettings
115
- * ({ volume, codec, maxBitrate, deviceId, advanced })
116
- */
117
- setAudioSettings(settings: Partial<HMSAudioTrackSettings>): Promise<void>;
118
- /**
119
- * Change settings of the local peer's video track
120
- * @param settings HMSVideoTrackSettings
121
- * ({ width, height, codec, maxFramerate, maxBitrate, deviceId, advanced })
122
- */
123
- setVideoSettings(settings: Partial<HMSVideoTrackSettings>): Promise<void>;
124
- /**
125
- * You can use the attach and detach video function
126
- * to add/remove video from an element for a track ID. The benefit of using this
127
- * instead of removing the video yourself is that it'll also auto unsubscribe to
128
- * the stream coming from server saving significant bandwidth for the user.
129
- * @param localTrackID trackID as stored in the store for the peer
130
- * @param videoElement HTML native element where the video has to be shown
131
- */
132
- attachVideo(localTrackID: HMSTrackID, videoElement: HTMLVideoElement): Promise<void>;
133
- /**
134
- * @see attachVideo
135
- */
136
- detachVideo(localTrackID: HMSTrackID, videoElement: HTMLVideoElement): Promise<void>;
137
- /**
138
- * Set the output volume of audio tracks(overall/particular audio track)
139
- * @param value number between 0-100
140
- * @param trackId string If undefined sets the overall volume(of every audio track in the room); If valid - set the volume of particular audio track
141
- *
142
- */
143
- setVolume(value: number, trackId?: HMSTrackID): void;
144
- /**
145
- * Set the audio output(speaker) device
146
- * @param deviceId string deviceId of the audio output device
147
- */
148
- setAudioOutputDevice(deviceId: string): void;
149
- /**
150
- * set the quality of the selected videoTrack
151
- * @param trackId
152
- * @param layer
153
- */
154
- setPreferredLayer(trackId: HMSTrackID, layer: HMSSimulcastLayer): void;
155
- /**
156
- * Add or remove a video plugin from/to the local peer video track. Eg. Virtual Background, Face Filters etc.
157
- * Video plugins can be added/removed at any time after the join is successful.
158
- * pluginFrameRate is the rate at which the output plugin will do processing
159
- * @param plugin HMSVideoPlugin
160
- * @param pluginFrameRate number
161
- * @see HMSVideoPlugin
162
- */
163
- addPluginToVideoTrack(plugin: HMSVideoPlugin, pluginFrameRate?: number): Promise<void>;
164
- addPluginToAudioTrack(plugin: HMSAudioPlugin): Promise<void>;
165
- /**
166
- * @see addPluginToVideoTrack
167
- */
168
- removePluginFromVideoTrack(plugin: HMSVideoPlugin): Promise<void>;
169
- removePluginFromAudioTrack(plugin: HMSAudioPlugin): Promise<void>;
170
- /**
171
- * Request for a role change of a remote peer. Can be forced.
172
- * @param forPeerId The remote peer id whose role needs to be changed
173
- * @param toRole The name of the new role.
174
- * @param [force] this being true would mean that user won't get a request to accept role change
175
- */
176
- changeRole(forPeerId: HMSPeerID, toRole: HMSRoleName, force?: boolean): Promise<void>;
177
- /**
178
- * Accept the role change request received
179
- * @param {HMSRoleChangeRequest} request The original request that was received
180
- */
181
- acceptChangeRole(request: HMSRoleChangeRequest): Promise<void>;
182
- /**
183
- * Reject pending role change request
184
- * @param {HMSRoleChangeRequest} request The original request that was received
185
- */
186
- rejectChangeRole(request: HMSRoleChangeRequest): void;
187
- /**
188
- * Change track state a remote peer's track
189
- * This can be used to mute/unmute a remote peer's track
190
- * @param forRemoteTrackID The track ID or array of track IDs for which you want to change the state
191
- * @param enabled `true` if you wish to enable(unmute permission is required) the track, `false` if you wish to disable(mute permission is required) the track
192
- */
193
- setRemoteTrackEnabled(forRemoteTrackID: HMSTrackID | HMSTrackID[], enabled: boolean): Promise<void>;
194
- /**
195
- * Use this to mute/unmute multipe tracks by source, role or type
196
- * @param {HMSChangeMultiTrackStateParams} params
197
- */
198
- setRemoteTracksEnabled(params: HMSChangeMultiTrackStateParams): Promise<void>;
199
- /**
200
- * Method to be called with some UI interaction after autoplay error is received
201
- * Most browsers have limitations where an audio can not be played if there was no user interaction.
202
- * SDK throws an autoplay error in this case, this method can be called after an UI interaction
203
- * to resolve the autoplay error
204
- */
205
- unblockAudio: () => Promise<void>;
206
- /**
207
- * If you have the **endRoom** permission, you can end the room. That means everyone will be kicked out.
208
- * If lock is passed as true, the room cannot be used further.
209
- */
210
- endRoom: (lock: boolean, reason: string) => Promise<void>;
211
- /**
212
- * If you have **removeOthers** permission, you can remove a peer from the room.
213
- * @param peerID peerID of the peer to be removed from the room
214
- * @param reason a string explaining why the peer is removed from the room.
215
- * This string could be used to notify the user before they're removed from the room
216
- * using the `REMOVED_FROM_ROOM` type of notification
217
- */
218
- removePeer(peerID: HMSPeerID, reason: string): Promise<void>;
219
- /**
220
- * If you want to start RTMP streaming or recording.
221
- * @param params.meetingURL This is the meeting url which is opened in a headless chrome instance for streaming and recording.
222
- * Make sure this url leads the joiner straight to the room without any preview screen or requiring additional clicks.
223
- * @param params.RTMPURLs The list of ingest URLs where the call as visible in the meeting url should be streamed.
224
- * Optional, when not specified the method is used to just start the recording.
225
- * @param params.record If you want to start the recording or not.
226
- */
227
- startRTMPOrRecording(params: RTMPRecordingConfig): Promise<void>;
228
- /**
229
- * If you want to stop both RTMP streaming and recording.
230
- */
231
- stopRTMPAndRecording(): Promise<void>;
232
- /**
233
- * If you want to update the name of peer.
234
- */
235
- changeName(name: string): Promise<void>;
236
- /**
237
- * If you want to update the metadata of peer.
238
- */
239
- changeMetadata(metadata: string | any): Promise<void>;
240
- /**
241
- * Set the type of logs from the SDK you want to be logged in the browser console.
242
- *
243
- * Note that HMSLogLevel is decremental meaning,
244
- * - HMSLogLevel.VERBOSE(0) - will log every message from SDK.
245
- * - HMSLogLevel.DEBUG(1) - will log messages that are helpful in debugging, important info, warnings and errors.
246
- * - HMSLogLevel.INFO(2) - will log important info, warnings and errors.
247
- * - HMSLogLevel.WARN(3) - will log warnings and errors.
248
- * - HMSLogLevel.ERROR(4) - will log only errors.
249
- * - HMSLogLevel.NONE(5) - won't log anything.
250
- *
251
- * Usage: `hmsActions.setLogLevel(4)` or `hmsActions.setLogLevel(HMSlogLevel.ERROR)`.
252
- */
253
- setLogLevel(level: HMSLogLevel): void;
254
- /**
255
- * audio Playlist contains all actions that can be performed on the audio playlist
256
- * This will be available after joining the room
257
- */
258
- audioPlaylist: IHMSPlaylistActions;
259
- /**
260
- * video Playlist contains all actions that can be performed on the video playlist
261
- * This will be available after joining the room
262
- */
263
- videoPlaylist: IHMSPlaylistActions;
264
- }
1
+ import { HMSConfig, HMSSimulcastLayer, HMSAudioTrackSettings, HMSVideoTrackSettings, HMSLogLevel, HMSVideoPlugin, HMSAudioPlugin } from '@100mslive/hms-video';
2
+ import { HMSMessageID, HMSPeerID, HMSRoleName, HMSTrackID, HMSTrackSource, IHMSPlaylistActions, HMSChangeMultiTrackStateParams } from './schema';
3
+ import { HMSRoleChangeRequest } from './selectors';
4
+ import { RTMPRecordingConfig } from './hmsSDKStore/sdkTypes';
5
+ /**
6
+ * The below interface defines our SDK API Surface for taking room related actions.
7
+ * It talks to our 100ms backend and handles error reconnections, state managements
8
+ * and lots of other things so you don't have to. You can use this gateway with any
9
+ * sort of UI to make connecting to our backend easier.
10
+ * In case you use react, we also provide a HMSProvider class with very powerful hooks
11
+ * and out of box components which you can use to setup your website in minutes. Our
12
+ * components have in built integration with this interface and you won't have to worry
13
+ * about passing props if you use them.
14
+ *
15
+ * @remarks
16
+ * There is a one to one mapping between an instance of this class and a 100ms room,
17
+ * in case you're creating multiple rooms please create new instance per room.
18
+ *
19
+ * @category Core
20
+ */
21
+ export interface IHMSActions {
22
+ preview(config: HMSConfig): Promise<void>;
23
+ /**
24
+ * join function can be used to join the room, if the room join is successful,
25
+ * current details of participants and track details are populated in the store.
26
+ *
27
+ * @remarks
28
+ * If join is called while an earlier join is in progress for the room id, it
29
+ * is ignored
30
+ *
31
+ * @param config join config with room id, required for joining the room
32
+ */
33
+ join(config: HMSConfig): void;
34
+ /**
35
+ * This function can be used to leave the room, if the call is repeated it's ignored.
36
+ */
37
+ leave(): Promise<void>;
38
+ /**
39
+ * If you want to enable screenshare for the local peer this class can be called.
40
+ * The store will be populated with the incoming track, and the subscriber(or
41
+ * react component if our hook is used) will be notified/rerendered
42
+ * @param enabled boolean
43
+ * @param audioOnly boolean To publish only audio from screenshare
44
+ */
45
+ setScreenShareEnabled(enabled: boolean, audioOnly?: boolean): Promise<void>;
46
+ /**
47
+ * You can use the addTrack method to add an auxiliary track(canvas capture, electron screen-share, etc...)
48
+ * This method adds the track to the local peer's list of auxiliary tracks and publishes it to make it available to remote peers.
49
+ * @param track MediaStreamTrack - Track to be added
50
+ * @param type HMSTrackSource - 'regular' | 'screen' | 'plugin' - Source of track - default: 'regular'
51
+ */
52
+ addTrack(track: MediaStreamTrack, type: HMSTrackSource): Promise<void>;
53
+ /**
54
+ * You can use the removeTrack method to remove an auxiliary track.
55
+ * This method removes the track from the local peer's list of auxiliary tracks and unpublishes it.
56
+ * @param trackId string - ID of the track to be removed
57
+ */
58
+ removeTrack(trackId: HMSTrackID): Promise<void>;
59
+ /**
60
+ * @deprecated The method should not be used
61
+ * @see sendBroadcastMessage
62
+ * Send a plain text message to all the other participants in the room.
63
+ * @param message - string message to broadcast
64
+ */
65
+ sendMessage(message: string): void;
66
+ /**
67
+ * Send a plain text message to all the other participants in the room.
68
+ * @param message - string message to broadcast
69
+ * @param type - type of message eg: image, video etc. - optional defaults to chat
70
+ */
71
+ sendBroadcastMessage(message: string, type?: string): Promise<void>;
72
+ /**
73
+ *
74
+ * @param message - string message to send
75
+ * @param roles - roles to which to send the message
76
+ * @param type - type of message eg: image, video etc. - optional defaults to chat
77
+ */
78
+ sendGroupMessage(message: string, roles: HMSRoleName[], type?: string): Promise<void>;
79
+ /**
80
+ *
81
+ * @param message
82
+ * @param peerID - id of the peer to which message has to be sent
83
+ * @param type - type of message eg: image, video etc. - optional defaults to chat
84
+ */
85
+ sendDirectMessage(message: string, peerID: HMSPeerID, type?: string): Promise<void>;
86
+ /**
87
+ * If just readStatus argument is passed, the function will set read flag of every message
88
+ * as the readStatus argument passed.
89
+ * If both readStatus and messageId argument is passed, then just read flag of message
90
+ * with passed messageId will be set as readStatus argument. if message with passed messageId is not
91
+ * found in store, no change in store will take place.
92
+ *
93
+ * @param readStatus boolean value which you want to set as read flag for message/messages.
94
+ * @param messageId message id whose read falg you want to set.
95
+ */
96
+ setMessageRead(readStatus: boolean, messageId?: HMSMessageID): void;
97
+ /**
98
+ * This function can be used to enable/disable(unmute/mute) local audio track
99
+ * @param enabled boolean - true to unmute, false to mute
100
+ */
101
+ setLocalAudioEnabled(enabled: boolean): Promise<void>;
102
+ /**
103
+ * This function can be used to enable/disable(unmute/mute) local video track
104
+ * @param enabled boolean - true to unmute, false to mute
105
+ */
106
+ setLocalVideoEnabled(enabled: boolean): Promise<void>;
107
+ /**
108
+ * @param trackId string - ID of the track whose mute status needs to be set
109
+ * @param enabled boolean - true when we want to unmute the track and false when we want to unmute it
110
+ */
111
+ setEnabledTrack(trackId: HMSTrackID, enabled: boolean): Promise<void>;
112
+ /**
113
+ * Change settings of the local peer's audio track
114
+ * @param settings HMSAudioTrackSettings
115
+ * ({ volume, codec, maxBitrate, deviceId, advanced })
116
+ */
117
+ setAudioSettings(settings: Partial<HMSAudioTrackSettings>): Promise<void>;
118
+ /**
119
+ * Change settings of the local peer's video track
120
+ * @param settings HMSVideoTrackSettings
121
+ * ({ width, height, codec, maxFramerate, maxBitrate, deviceId, advanced })
122
+ */
123
+ setVideoSettings(settings: Partial<HMSVideoTrackSettings>): Promise<void>;
124
+ /**
125
+ * You can use the attach and detach video function
126
+ * to add/remove video from an element for a track ID. The benefit of using this
127
+ * instead of removing the video yourself is that it'll also auto unsubscribe to
128
+ * the stream coming from server saving significant bandwidth for the user.
129
+ * @param localTrackID trackID as stored in the store for the peer
130
+ * @param videoElement HTML native element where the video has to be shown
131
+ */
132
+ attachVideo(localTrackID: HMSTrackID, videoElement: HTMLVideoElement): Promise<void>;
133
+ /**
134
+ * @see attachVideo
135
+ */
136
+ detachVideo(localTrackID: HMSTrackID, videoElement: HTMLVideoElement): Promise<void>;
137
+ /**
138
+ * Set the output volume of audio tracks(overall/particular audio track)
139
+ * @param value number between 0-100
140
+ * @param trackId string If undefined sets the overall volume(of every audio track in the room); If valid - set the volume of particular audio track
141
+ *
142
+ */
143
+ setVolume(value: number, trackId?: HMSTrackID): void;
144
+ /**
145
+ * Set the audio output(speaker) device
146
+ * @param deviceId string deviceId of the audio output device
147
+ */
148
+ setAudioOutputDevice(deviceId: string): void;
149
+ /**
150
+ * set the quality of the selected videoTrack
151
+ * @param trackId
152
+ * @param layer
153
+ */
154
+ setPreferredLayer(trackId: HMSTrackID, layer: HMSSimulcastLayer): void;
155
+ /**
156
+ * Add or remove a video plugin from/to the local peer video track. Eg. Virtual Background, Face Filters etc.
157
+ * Video plugins can be added/removed at any time after the join is successful.
158
+ * pluginFrameRate is the rate at which the output plugin will do processing
159
+ * @param plugin HMSVideoPlugin
160
+ * @param pluginFrameRate number
161
+ * @see HMSVideoPlugin
162
+ */
163
+ addPluginToVideoTrack(plugin: HMSVideoPlugin, pluginFrameRate?: number): Promise<void>;
164
+ addPluginToAudioTrack(plugin: HMSAudioPlugin): Promise<void>;
165
+ /**
166
+ * @see addPluginToVideoTrack
167
+ */
168
+ removePluginFromVideoTrack(plugin: HMSVideoPlugin): Promise<void>;
169
+ removePluginFromAudioTrack(plugin: HMSAudioPlugin): Promise<void>;
170
+ /**
171
+ * Request for a role change of a remote peer. Can be forced.
172
+ * @param forPeerId The remote peer id whose role needs to be changed
173
+ * @param toRole The name of the new role.
174
+ * @param [force] this being true would mean that user won't get a request to accept role change
175
+ */
176
+ changeRole(forPeerId: HMSPeerID, toRole: HMSRoleName, force?: boolean): Promise<void>;
177
+ /**
178
+ * Accept the role change request received
179
+ * @param {HMSRoleChangeRequest} request The original request that was received
180
+ */
181
+ acceptChangeRole(request: HMSRoleChangeRequest): Promise<void>;
182
+ /**
183
+ * Reject pending role change request
184
+ * @param {HMSRoleChangeRequest} request The original request that was received
185
+ */
186
+ rejectChangeRole(request: HMSRoleChangeRequest): void;
187
+ /**
188
+ * Change track state a remote peer's track
189
+ * This can be used to mute/unmute a remote peer's track
190
+ * @param forRemoteTrackID The track ID or array of track IDs for which you want to change the state
191
+ * @param enabled `true` if you wish to enable(unmute permission is required) the track, `false` if you wish to disable(mute permission is required) the track
192
+ */
193
+ setRemoteTrackEnabled(forRemoteTrackID: HMSTrackID | HMSTrackID[], enabled: boolean): Promise<void>;
194
+ /**
195
+ * Use this to mute/unmute multipe tracks by source, role or type
196
+ * @param {HMSChangeMultiTrackStateParams} params
197
+ */
198
+ setRemoteTracksEnabled(params: HMSChangeMultiTrackStateParams): Promise<void>;
199
+ /**
200
+ * Method to be called with some UI interaction after autoplay error is received
201
+ * Most browsers have limitations where an audio can not be played if there was no user interaction.
202
+ * SDK throws an autoplay error in this case, this method can be called after an UI interaction
203
+ * to resolve the autoplay error
204
+ */
205
+ unblockAudio: () => Promise<void>;
206
+ /**
207
+ * If you have the **endRoom** permission, you can end the room. That means everyone will be kicked out.
208
+ * If lock is passed as true, the room cannot be used further.
209
+ */
210
+ endRoom: (lock: boolean, reason: string) => Promise<void>;
211
+ /**
212
+ * If you have **removeOthers** permission, you can remove a peer from the room.
213
+ * @param peerID peerID of the peer to be removed from the room
214
+ * @param reason a string explaining why the peer is removed from the room.
215
+ * This string could be used to notify the user before they're removed from the room
216
+ * using the `REMOVED_FROM_ROOM` type of notification
217
+ */
218
+ removePeer(peerID: HMSPeerID, reason: string): Promise<void>;
219
+ /**
220
+ * If you want to start RTMP streaming or recording.
221
+ * @param params.meetingURL This is the meeting url which is opened in a headless chrome instance for streaming and recording.
222
+ * Make sure this url leads the joiner straight to the room without any preview screen or requiring additional clicks.
223
+ * @param params.RTMPURLs The list of ingest URLs where the call as visible in the meeting url should be streamed.
224
+ * Optional, when not specified the method is used to just start the recording.
225
+ * @param params.record If you want to start the recording or not.
226
+ */
227
+ startRTMPOrRecording(params: RTMPRecordingConfig): Promise<void>;
228
+ /**
229
+ * If you want to stop both RTMP streaming and recording.
230
+ */
231
+ stopRTMPAndRecording(): Promise<void>;
232
+ /**
233
+ * If you want to update the name of peer.
234
+ * @beta
235
+ */
236
+ changeName(name: string): Promise<void>;
237
+ /**
238
+ * If you want to update the metadata of peer.
239
+ * @beta
240
+ */
241
+ changeMetadata(metadata: string | any): Promise<void>;
242
+ /**
243
+ * Set the type of logs from the SDK you want to be logged in the browser console.
244
+ *
245
+ * Note that HMSLogLevel is decremental meaning,
246
+ * - HMSLogLevel.VERBOSE(0) - will log every message from SDK.
247
+ * - HMSLogLevel.DEBUG(1) - will log messages that are helpful in debugging, important info, warnings and errors.
248
+ * - HMSLogLevel.INFO(2) - will log important info, warnings and errors.
249
+ * - HMSLogLevel.WARN(3) - will log warnings and errors.
250
+ * - HMSLogLevel.ERROR(4) - will log only errors.
251
+ * - HMSLogLevel.NONE(5) - won't log anything.
252
+ *
253
+ * Usage: `hmsActions.setLogLevel(4)` or `hmsActions.setLogLevel(HMSlogLevel.ERROR)`.
254
+ */
255
+ setLogLevel(level: HMSLogLevel): void;
256
+ /**
257
+ * audio Playlist contains all actions that can be performed on the audio playlist
258
+ * This will be available after joining the room
259
+ */
260
+ audioPlaylist: IHMSPlaylistActions;
261
+ /**
262
+ * video Playlist contains all actions that can be performed on the video playlist
263
+ * This will be available after joining the room
264
+ */
265
+ videoPlaylist: IHMSPlaylistActions;
266
+ }
@@ -1,15 +1,14 @@
1
- import { HMSNotification } from './schema/notification';
2
- declare type NotificationCallback = (notification: HMSNotification) => void;
3
- /**
4
- * @category Core
5
- */
6
- export interface IHMSNotifications {
7
- /**
8
- * you can subscribe to notifications for new message, peer add etc. using this function.
9
- * note that this is not meant to maintain any state on your side, as the reactive store already
10
- * does that. The intent of this function is mainly to display toast notifications or send analytics.
11
- * We'll provide a display message which can be displayed as it is for common cases.
12
- */
13
- onNotification: (cb: NotificationCallback) => () => void;
14
- }
15
- export {};
1
+ import { HMSNotification } from './schema/notification';
2
+ export declare type HMSNotificationCallback = (notification: HMSNotification) => void;
3
+ /**
4
+ * @category Core
5
+ */
6
+ export interface IHMSNotifications {
7
+ /**
8
+ * you can subscribe to notifications for new message, peer add etc. using this function.
9
+ * note that this is not meant to maintain any state on your side, as the reactive store already
10
+ * does that. The intent of this function is mainly to display toast notifications or send analytics.
11
+ * We'll provide a display message which can be displayed as it is for common cases.
12
+ */
13
+ onNotification: (cb: HMSNotificationCallback) => () => void;
14
+ }