@videosdk.live/react-sdk 0.1.95 → 0.1.97
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.
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +11 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/types/character.d.ts +9 -3
- package/dist/types/index.d.ts +19 -2
- package/dist/types/participant.d.ts +230 -189
- package/package.json +2 -2
|
@@ -2,9 +2,10 @@ import { Participant } from './participant';
|
|
|
2
2
|
import { Stream } from './stream';
|
|
3
3
|
|
|
4
4
|
export enum CharacterMode {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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.
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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: '
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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.
|
|
3
|
+
"version": "0.1.97",
|
|
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.
|
|
76
|
+
"@videosdk.live/js-sdk": "0.0.93",
|
|
77
77
|
"events": "^3.3.0"
|
|
78
78
|
}
|
|
79
79
|
}
|