@videosdk.live/react-sdk 0.1.96 → 0.1.98

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.
@@ -2,9 +2,10 @@ import { Participant } from './participant';
2
2
  import { Stream } from './stream';
3
3
 
4
4
  export enum CharacterMode {
5
- Text2Text = 'text2text',
6
- Speech2Text = 'speech2text',
7
- Speech2Speech = 'speech2speech'
5
+ TEXT = "text",
6
+ CO_PILOT = "co_pilot",
7
+ AUTO_PILOT = "auto_pilot",
8
+ VISION_PILOT = "vision_pilot"
8
9
  }
9
10
 
10
11
  export enum CharacterState {
@@ -59,6 +60,11 @@ export class Character extends Participant {
59
60
  */
60
61
  sendMessage(text: string): Promise<void>;
61
62
 
63
+ /**
64
+ * @description This method can be used to interrupt a character participant
65
+ */
66
+ interrupt(): Promise<void>;
67
+
62
68
  /**
63
69
  * Add event listener
64
70
  * @param eventType Event name to which you want to subscribe.
@@ -490,6 +490,22 @@ export function useParticipant(
490
490
  payload: string;
491
491
  token: string;
492
492
  }) => Promise<void>;
493
+ getShareAudioStats: () => Promise<
494
+ Array<{
495
+ bitrate: number;
496
+ rtt: number;
497
+ network: string;
498
+ codec: string;
499
+ jitter: number;
500
+ limitation: any;
501
+ totalPackets: number;
502
+ packetsLost: number;
503
+ concealmentEvents: number;
504
+ insertedSamplesForDecelaration: number;
505
+ removedSamplesForAccelaration: number;
506
+ size: any;
507
+ }>
508
+ >;
493
509
  getAudioStats: () => Promise<
494
510
  Array<{
495
511
  bitrate: number;
@@ -1089,7 +1105,7 @@ export function useTranscription({
1089
1105
  * console.log('character message Payload:', data);
1090
1106
  * }
1091
1107
  *
1092
- * const { join, leave, sendMessage } = useCharacter({
1108
+ * const { join, leave, sendMessage, interrupt } = useCharacter({
1093
1109
  * interactionId,
1094
1110
  * // OR
1095
1111
  * id,
@@ -1134,7 +1150,7 @@ export function useCharacter(
1134
1150
  id: string;
1135
1151
  displayName: string;
1136
1152
  characterRole: string;
1137
- characterMode: 'text2text' | 'speech2text' | 'speech2speech';
1153
+ characterMode: 'text' | 'co_pilot' | 'auto_pilot' | 'vision_pilot';
1138
1154
  knowledgeBases: string[];
1139
1155
  },
1140
1156
  {
@@ -1201,6 +1217,7 @@ export function useCharacter(
1201
1217
  join: () => Promise<void>;
1202
1218
  leave: () => Promise<void>;
1203
1219
  sendMessage: (text: string) => Promise<void>;
1220
+ interrupt: () => Promise<void>;
1204
1221
  };
1205
1222
 
1206
1223
  /**
@@ -1,194 +1,235 @@
1
1
  export class Participant {
2
- /**
3
- * @description This represents the participant's ID
4
- */
5
- id: string;
6
- /**
7
- * @description This represents the participant's name
8
- */
9
- displayName: string;
10
- /**
11
- * @description This represents the all the Streams that the participant is producing
12
- *
13
- */
14
- streams: Map<string, Stream>;
15
- /**
16
- * @description This represents the quality of video being consumed for the participant
17
- *
18
- */
19
- quality: 'low' | 'med' | 'high';
20
- /**
21
- * @description This represents if the participant is local or remote
22
- *
23
- */
24
- local: boolean;
25
- /**
26
- * @description This represents participant's current pin state
27
- *
28
- */
29
- pinState: {
30
- cam: boolean;
31
- share: boolean;
32
- };
33
- /**
34
- * @description This represents participant's current webcam status
35
- */
36
- webcamOn: boolean;
37
- /**
38
- * @description This represents participant's current mic status
39
- *
40
- */
41
- micOn: boolean;
42
- /**
43
- * @description This represents participant's current mode
44
- *
45
- */
46
- mode: 'CONFERENCE' | 'VIEWER';
47
- /**
48
- * @description This represents metaData which is passed in MeetingProvider
49
- *
50
- */
51
- metaData: object;
2
+ /**
3
+ * @description This represents the participant's ID
4
+ */
5
+ id: string;
6
+ /**
7
+ * @description This represents the participant's name
8
+ */
9
+ displayName: string;
10
+ /**
11
+ * @description This represents the all the Streams that the participant is producing
12
+ *
13
+ */
14
+ streams: Map<string, Stream>;
15
+ /**
16
+ * @description This represents the quality of video being consumed for the participant
17
+ *
18
+ */
19
+ quality: 'low' | 'med' | 'high';
20
+ /**
21
+ * @description This represents if the participant is local or remote
22
+ *
23
+ */
24
+ local: boolean;
25
+ /**
26
+ * @description This represents participant's current pin state
27
+ *
28
+ */
29
+ pinState: {
30
+ cam: boolean;
31
+ share: boolean;
32
+ };
33
+ /**
34
+ * @description This represents participant's current webcam status
35
+ */
36
+ webcamOn: boolean;
37
+ /**
38
+ * @description This represents participant's current mic status
39
+ *
40
+ */
41
+ micOn: boolean;
42
+ /**
43
+ * @description This represents participant's current mode
44
+ *
45
+ */
46
+ mode: 'CONFERENCE' | 'VIEWER';
47
+ /**
48
+ * @description This represents metaData which is passed in MeetingProvider
49
+ *
50
+ */
51
+ metaData: object;
52
52
 
53
- /**
54
- * @description This method can be used to kickout a participant from the meeting
55
- */
56
- remove(): void;
57
- /**
58
- * @description This method can be used to enable mic of the participant in the meeting
59
- */
60
- enableMic(): void;
61
- /**
62
- * @description This method can be used to disable mic of the participant in the meeting
63
- */
64
- disableMic(): void;
65
- /**
66
- * @description This method can be used to enable webcam of the participant in the meeting
67
- */
68
- enableWebcam(): void;
69
- /**
70
- * @description This method can be used to disable webcam of the participant in the meeting
71
- */
72
- disableWebcam(): void;
73
- /**
74
- * @description This method can be used to capture image in the meeting
75
- */
76
- captureImage({height,width}:{height?:number,width?:number}): Promise<string | null>;
77
- /**
78
- * @description This method can be used to set the incoming video quality of the participant
79
- * @param quality
80
- */
81
- setQuality(quality: 'low' | 'med' | 'high'): void;
82
- /**
83
- * @description This method can be used to set the video quality of the participant based on the size of the viewport it is being displayed in
84
- * @param width Width of the Viewport in which participant video is shown
85
- * @param height Height of the Viewport in which participant video is shown
86
- */
87
- setViewPort(width: number, height: number): void;
53
+ /**
54
+ * @description This method can be used to kickout a participant from the meeting
55
+ */
56
+ remove(): void;
57
+ /**
58
+ * @description This method can be used to enable mic of the participant in the meeting
59
+ */
60
+ enableMic(): void;
61
+ /**
62
+ * @description This method can be used to disable mic of the participant in the meeting
63
+ */
64
+ disableMic(): void;
65
+ /**
66
+ * @description This method can be used to enable webcam of the participant in the meeting
67
+ */
68
+ enableWebcam(): void;
69
+ /**
70
+ * @description This method can be used to disable webcam of the participant in the meeting
71
+ */
72
+ disableWebcam(): void;
73
+ /**
74
+ * @description This method can be used to capture image in the meeting
75
+ */
76
+ captureImage({
77
+ height,
78
+ width
79
+ }: {
80
+ height?: number;
81
+ width?: number;
82
+ }): Promise<string | null>;
83
+ /**
84
+ * @description This method can be used to set the incoming video quality of the participant
85
+ * @param quality
86
+ */
87
+ setQuality(quality: 'low' | 'med' | 'high'): void;
88
+ /**
89
+ * @description This method can be used to set the video quality of the participant based on the size of the viewport it is being displayed in
90
+ * @param width Width of the Viewport in which participant video is shown
91
+ * @param height Height of the Viewport in which participant video is shown
92
+ */
93
+ setViewPort(width: number, height: number): void;
88
94
 
89
- /**
90
- * @param type If `SHARE_AND_CAM` is provided, it will pin screenshare and camera of the participant.
91
- * If `CAM` is provided, it will only pin the participant's camera, If `SHARE` is provided, it will only pin the participant's screen share
92
- */
93
- pin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
94
- /**
95
- * @param type If `SHARE_AND_CAM` is provided, it will unpin screenshare and camera of the participant.
96
- * If `CAM` is provided, it will only unpin the participant's camera, If `SHARE` is provided, it will only unpin the participant's screen share
97
- */
98
- unpin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
99
- /**
100
- * @deprecated
101
- * @param options
102
- */
103
- switchTo({ meetingId, payload, token }: { meetingId: string; payload: string; token: string }): Promise<void>;
104
- /**
105
- * @description This method returns the Video Statistics of the participant.
106
- * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
107
- */
108
- getVideoStats(): Promise<
109
- Array<{
110
- bitrate: number;
111
- rtt: number;
112
- network: string;
113
- codec: string;
114
- jitter: number;
115
- limitation: any;
116
- totalPackets: number;
117
- packetsLost: number;
118
- concealmentEvents: number;
119
- insertedSamplesForDecelaration: number;
120
- removedSamplesForAccelaration: number;
121
- size: any;
122
- currentSpatialLayer: number;
123
- currentTemporalLayer: number;
124
- preferredSpatialLayer: number;
125
- preferredTemporalLayer: number;
126
- }>
127
- >;
128
- /**
129
- * @description This method returns the Screen Share Statistics of the participant.
130
- * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
131
- */
132
- getShareStats(): Promise<
133
- Array<{
134
- bitrate: number;
135
- rtt: number;
136
- network: string;
137
- codec: string;
138
- jitter: number;
139
- limitation: any;
140
- totalPackets: number;
141
- packetsLost: number;
142
- concealmentEvents: number;
143
- insertedSamplesForDecelaration: number;
144
- removedSamplesForAccelaration: number;
145
- size: any;
146
- currentSpatialLayer: number;
147
- currentTemporalLayer: number;
148
- preferredSpatialLayer: number;
149
- preferredTemporalLayer: number;
150
- }>
151
- >;
152
- /**
153
- * @description This method returns the Audio Statistics of the participant.
154
- * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
155
- */
156
- getAudioStats(): Promise<
157
- Array<{
158
- bitrate: number;
159
- rtt: number;
160
- network: string;
161
- codec: string;
162
- jitter: number;
163
- totalPackets: number;
164
- packetsLost: number;
165
- concealmentEvents: number;
166
- insertedSamplesForDecelaration: number;
167
- removedSamplesForAccelaration: number;
168
- size: any;
169
- }>
170
- >;
171
- consumeMicStreams(): void;
172
- consumeWebcamStreams(): void;
173
- stopConsumingWebcamStreams(): void;
174
- stopConsumingMicStreams(): void;
175
- /**
176
- * Add event listener
177
- * @param eventType Event name to which you want to subscribe.
178
- * @param listener Callback function which will be triggered when the event happens
179
- */
180
- on(
181
- eventType: 'stream-enabled' | 'stream-disabled' | 'media-status-changed' | 'video-quality-changed',
182
- listener: (data: any) => void,
183
- ): void;
184
- /**
185
- * Remove event
186
- * @param eventType Event name to which you want to unsubscribe.
187
- * @param listener Callback function which was passed while subscribing to the event
188
- */
189
- off(
190
- eventType: 'stream-enabled' | 'stream-disabled' | 'media-status-changed' | 'video-quality-changed',
191
- listener: (data: any) => void,
192
- ): void;
95
+ /**
96
+ * @param type If `SHARE_AND_CAM` is provided, it will pin screenshare and camera of the participant.
97
+ * If `CAM` is provided, it will only pin the participant's camera, If `SHARE` is provided, it will only pin the participant's screen share
98
+ */
99
+ pin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
100
+ /**
101
+ * @param type If `SHARE_AND_CAM` is provided, it will unpin screenshare and camera of the participant.
102
+ * If `CAM` is provided, it will only unpin the participant's camera, If `SHARE` is provided, it will only unpin the participant's screen share
103
+ */
104
+ unpin(type: 'SHARE_AND_CAM' | 'CAM' | 'SHARE'): void;
105
+ /**
106
+ * @deprecated
107
+ * @param options
108
+ */
109
+ switchTo({
110
+ meetingId,
111
+ payload,
112
+ token
113
+ }: {
114
+ meetingId: string;
115
+ payload: string;
116
+ token: string;
117
+ }): Promise<void>;
118
+ /**
119
+ * @description This method returns the Video Statistics of the participant.
120
+ * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
121
+ */
122
+ getVideoStats(): Promise<
123
+ Array<{
124
+ bitrate: number;
125
+ rtt: number;
126
+ network: string;
127
+ codec: string;
128
+ jitter: number;
129
+ limitation: any;
130
+ totalPackets: number;
131
+ packetsLost: number;
132
+ concealmentEvents: number;
133
+ insertedSamplesForDecelaration: number;
134
+ removedSamplesForAccelaration: number;
135
+ size: any;
136
+ currentSpatialLayer: number;
137
+ currentTemporalLayer: number;
138
+ preferredSpatialLayer: number;
139
+ preferredTemporalLayer: number;
140
+ }>
141
+ >;
142
+ /**
143
+ * @description This method returns the Screen Share Audio Statistics of the participant.
144
+ * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
145
+ */
146
+ getShareAudioStats(): Promise<
147
+ Array<{
148
+ bitrate: number;
149
+ rtt: number;
150
+ network: string;
151
+ codec: string;
152
+ jitter: number;
153
+ totalPackets: number;
154
+ packetsLost: number;
155
+ concealmentEvents: number;
156
+ insertedSamplesForDecelaration: number;
157
+ removedSamplesForAccelaration: number;
158
+ size: any;
159
+ }>
160
+ >;
161
+ /**
162
+ * @description This method returns the Screen Share Statistics of the participant.
163
+ * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
164
+ */
165
+ getShareStats(): Promise<
166
+ Array<{
167
+ bitrate: number;
168
+ rtt: number;
169
+ network: string;
170
+ codec: string;
171
+ jitter: number;
172
+ limitation: any;
173
+ totalPackets: number;
174
+ packetsLost: number;
175
+ concealmentEvents: number;
176
+ insertedSamplesForDecelaration: number;
177
+ removedSamplesForAccelaration: number;
178
+ size: any;
179
+ currentSpatialLayer: number;
180
+ currentTemporalLayer: number;
181
+ preferredSpatialLayer: number;
182
+ preferredTemporalLayer: number;
183
+ }>
184
+ >;
185
+ /**
186
+ * @description This method returns the Audio Statistics of the participant.
187
+ * To learn more about the video statistics check these [reference](https://docs.videosdk.live/react/guide/video-and-audio-calling-api-sdk/render-media/understanding-call-quality)
188
+ */
189
+ getAudioStats(): Promise<
190
+ Array<{
191
+ bitrate: number;
192
+ rtt: number;
193
+ network: string;
194
+ codec: string;
195
+ jitter: number;
196
+ totalPackets: number;
197
+ packetsLost: number;
198
+ concealmentEvents: number;
199
+ insertedSamplesForDecelaration: number;
200
+ removedSamplesForAccelaration: number;
201
+ size: any;
202
+ }>
203
+ >;
204
+ consumeMicStreams(): void;
205
+ consumeWebcamStreams(): void;
206
+ stopConsumingWebcamStreams(): void;
207
+ stopConsumingMicStreams(): void;
208
+ /**
209
+ * Add event listener
210
+ * @param eventType Event name to which you want to subscribe.
211
+ * @param listener Callback function which will be triggered when the event happens
212
+ */
213
+ on(
214
+ eventType:
215
+ | 'stream-enabled'
216
+ | 'stream-disabled'
217
+ | 'media-status-changed'
218
+ | 'video-quality-changed',
219
+ listener: (data: any) => void
220
+ ): void;
221
+ /**
222
+ * Remove event
223
+ * @param eventType Event name to which you want to unsubscribe.
224
+ * @param listener Callback function which was passed while subscribing to the event
225
+ */
226
+ off(
227
+ eventType:
228
+ | 'stream-enabled'
229
+ | 'stream-disabled'
230
+ | 'media-status-changed'
231
+ | 'video-quality-changed',
232
+ listener: (data: any) => void
233
+ ): void;
193
234
  }
194
235
  import { Stream } from './stream';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@videosdk.live/react-sdk",
3
- "version": "0.1.96",
3
+ "version": "0.1.98",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.modern.js",
@@ -73,7 +73,7 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@videosdk.live/js-sdk": "0.0.92",
76
+ "@videosdk.live/js-sdk": "0.0.94",
77
77
  "events": "^3.3.0"
78
78
  }
79
79
  }