livekit-client 1.9.1 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. package/dist/livekit-client.esm.mjs +3338 -3037
  2. package/dist/livekit-client.esm.mjs.map +1 -1
  3. package/dist/livekit-client.umd.js +1 -1
  4. package/dist/livekit-client.umd.js.map +1 -1
  5. package/dist/src/api/SignalClient.d.ts +98 -97
  6. package/dist/src/api/SignalClient.d.ts.map +1 -1
  7. package/dist/src/connectionHelper/ConnectionCheck.d.ts +25 -24
  8. package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
  9. package/dist/src/connectionHelper/checks/Checker.d.ts +58 -58
  10. package/dist/src/connectionHelper/checks/publishAudio.d.ts +5 -5
  11. package/dist/src/connectionHelper/checks/publishVideo.d.ts +5 -5
  12. package/dist/src/connectionHelper/checks/reconnect.d.ts +5 -5
  13. package/dist/src/connectionHelper/checks/turn.d.ts +5 -5
  14. package/dist/src/connectionHelper/checks/webrtc.d.ts +5 -5
  15. package/dist/src/connectionHelper/checks/websocket.d.ts +5 -5
  16. package/dist/src/index.d.ts +34 -31
  17. package/dist/src/index.d.ts.map +1 -1
  18. package/dist/src/logger.d.ts +25 -25
  19. package/dist/src/options.d.ts +98 -98
  20. package/dist/src/proto/google/protobuf/timestamp.d.ts +145 -145
  21. package/dist/src/proto/livekit_models.d.ts +2300 -2300
  22. package/dist/src/proto/livekit_rtc.d.ts +14032 -14032
  23. package/dist/src/room/DefaultReconnectPolicy.d.ts +7 -7
  24. package/dist/src/room/DeviceManager.d.ts +8 -8
  25. package/dist/src/room/PCTransport.d.ts +37 -37
  26. package/dist/src/room/PCTransport.d.ts.map +1 -1
  27. package/dist/src/room/RTCEngine.d.ts +126 -120
  28. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  29. package/dist/src/room/ReconnectPolicy.d.ts +23 -23
  30. package/dist/src/room/RegionUrlProvider.d.ts +13 -13
  31. package/dist/src/room/Room.d.ts +232 -229
  32. package/dist/src/room/Room.d.ts.map +1 -1
  33. package/dist/src/room/defaults.d.ts +7 -7
  34. package/dist/src/room/defaults.d.ts.map +1 -1
  35. package/dist/src/room/errors.d.ts +42 -42
  36. package/dist/src/room/events.d.ts +455 -455
  37. package/dist/src/room/participant/LocalParticipant.d.ts +170 -170
  38. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  39. package/dist/src/room/participant/Participant.d.ts +93 -93
  40. package/dist/src/room/participant/ParticipantTrackPermission.d.ts +25 -25
  41. package/dist/src/room/participant/RemoteParticipant.d.ts +52 -51
  42. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  43. package/dist/src/room/participant/publishUtils.d.ts +19 -18
  44. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  45. package/dist/src/room/stats.d.ts +66 -66
  46. package/dist/src/room/timers.d.ts +12 -12
  47. package/dist/src/room/track/LocalAudioTrack.d.ts +24 -24
  48. package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
  49. package/dist/src/room/track/LocalTrack.d.ts +43 -43
  50. package/dist/src/room/track/LocalTrackPublication.d.ts +37 -37
  51. package/dist/src/room/track/LocalVideoTrack.d.ts +53 -53
  52. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  53. package/dist/src/room/track/RemoteAudioTrack.d.ts +52 -52
  54. package/dist/src/room/track/RemoteAudioTrack.d.ts.map +1 -1
  55. package/dist/src/room/track/RemoteTrack.d.ts +14 -14
  56. package/dist/src/room/track/RemoteTrackPublication.d.ts +60 -60
  57. package/dist/src/room/track/RemoteVideoTrack.d.ts +52 -52
  58. package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
  59. package/dist/src/room/track/Track.d.ts +124 -124
  60. package/dist/src/room/track/TrackPublication.d.ts +67 -67
  61. package/dist/src/room/track/create.d.ts +23 -23
  62. package/dist/src/room/track/create.d.ts.map +1 -1
  63. package/dist/src/room/track/options.d.ts +255 -247
  64. package/dist/src/room/track/options.d.ts.map +1 -1
  65. package/dist/src/room/track/types.d.ts +22 -22
  66. package/dist/src/room/track/utils.d.ts +13 -13
  67. package/dist/src/room/types.d.ts +25 -25
  68. package/dist/src/room/utils.d.ts +86 -85
  69. package/dist/src/room/utils.d.ts.map +1 -1
  70. package/dist/src/test/MockMediaStreamTrack.d.ts +25 -25
  71. package/dist/src/test/mocks.d.ts +10 -10
  72. package/dist/src/version.d.ts +2 -2
  73. package/dist/ts4.2/src/api/SignalClient.d.ts +1 -0
  74. package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +2 -1
  75. package/dist/ts4.2/src/index.d.ts +8 -6
  76. package/dist/ts4.2/src/room/PCTransport.d.ts +1 -1
  77. package/dist/ts4.2/src/room/RTCEngine.d.ts +7 -1
  78. package/dist/ts4.2/src/room/Room.d.ts +3 -0
  79. package/dist/ts4.2/src/room/defaults.d.ts +1 -1
  80. package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +4 -4
  81. package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +2 -1
  82. package/dist/ts4.2/src/room/participant/publishUtils.d.ts +2 -1
  83. package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +1 -1
  84. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -1
  85. package/dist/ts4.2/src/room/track/RemoteAudioTrack.d.ts +1 -1
  86. package/dist/ts4.2/src/room/track/create.d.ts +1 -1
  87. package/dist/ts4.2/src/room/track/options.d.ts +10 -2
  88. package/dist/ts4.2/src/room/utils.d.ts +1 -0
  89. package/package.json +12 -12
  90. package/src/api/SignalClient.ts +19 -16
  91. package/src/connectionHelper/ConnectionCheck.ts +2 -1
  92. package/src/index.ts +13 -8
  93. package/src/room/PCTransport.ts +9 -5
  94. package/src/room/RTCEngine.ts +44 -4
  95. package/src/room/Room.ts +87 -42
  96. package/src/room/defaults.ts +6 -4
  97. package/src/room/participant/LocalParticipant.ts +10 -9
  98. package/src/room/participant/RemoteParticipant.ts +2 -1
  99. package/src/room/participant/publishUtils.ts +7 -5
  100. package/src/room/track/LocalAudioTrack.ts +2 -1
  101. package/src/room/track/LocalVideoTrack.ts +3 -2
  102. package/src/room/track/RemoteAudioTrack.ts +2 -1
  103. package/src/room/track/RemoteVideoTrack.ts +4 -8
  104. package/src/room/track/create.ts +2 -2
  105. package/src/room/track/options.ts +23 -7
  106. package/src/room/utils.ts +15 -2
@@ -1,456 +1,456 @@
1
- /**
2
- * Events are the primary way LiveKit notifies your application of changes.
3
- *
4
- * The following are events emitted by [[Room]], listen to room events like
5
- *
6
- * ```typescript
7
- * room.on(RoomEvent.TrackPublished, (track, publication, participant) => {})
8
- * ```
9
- */
10
- export declare enum RoomEvent {
11
- /**
12
- * When the connection to the server has been established
13
- */
14
- Connected = "connected",
15
- /**
16
- * When the connection to the server has been interrupted and it's attempting
17
- * to reconnect.
18
- */
19
- Reconnecting = "reconnecting",
20
- /**
21
- * Fires when a reconnection has been successful.
22
- */
23
- Reconnected = "reconnected",
24
- /**
25
- * When disconnected from room. This fires when room.disconnect() is called or
26
- * when an unrecoverable connection issue had occured
27
- */
28
- Disconnected = "disconnected",
29
- /**
30
- * Whenever the connection state of the room changes
31
- *
32
- * args: ([[ConnectionState]])
33
- */
34
- ConnectionStateChanged = "connectionStateChanged",
35
- /**
36
- * @deprecated StateChanged has been renamed to ConnectionStateChanged
37
- */
38
- StateChanged = "connectionStateChanged",
39
- /**
40
- * When input or output devices on the machine have changed.
41
- */
42
- MediaDevicesChanged = "mediaDevicesChanged",
43
- /**
44
- * When a [[RemoteParticipant]] joins *after* the local
45
- * participant. It will not emit events for participants that are already
46
- * in the room
47
- *
48
- * args: ([[RemoteParticipant]])
49
- */
50
- ParticipantConnected = "participantConnected",
51
- /**
52
- * When a [[RemoteParticipant]] leaves *after* the local
53
- * participant has joined.
54
- *
55
- * args: ([[RemoteParticipant]])
56
- */
57
- ParticipantDisconnected = "participantDisconnected",
58
- /**
59
- * When a new track is published to room *after* the local
60
- * participant has joined. It will not fire for tracks that are already published.
61
- *
62
- * A track published doesn't mean the participant has subscribed to it. It's
63
- * simply reflecting the state of the room.
64
- *
65
- * args: ([[RemoteTrackPublication]], [[RemoteParticipant]])
66
- */
67
- TrackPublished = "trackPublished",
68
- /**
69
- * The [[LocalParticipant]] has subscribed to a new track. This event will **always**
70
- * fire as long as new tracks are ready for use.
71
- *
72
- * args: ([[RemoteTrack]], [[RemoteTrackPublication]], [[RemoteParticipant]])
73
- */
74
- TrackSubscribed = "trackSubscribed",
75
- /**
76
- * Could not subscribe to a track
77
- *
78
- * args: (track sid, [[RemoteParticipant]])
79
- */
80
- TrackSubscriptionFailed = "trackSubscriptionFailed",
81
- /**
82
- * A [[RemoteParticipant]] has unpublished a track
83
- *
84
- * args: ([[RemoteTrackPublication]], [[RemoteParticipant]])
85
- */
86
- TrackUnpublished = "trackUnpublished",
87
- /**
88
- * A subscribed track is no longer available. Clients should listen to this
89
- * event and ensure they detach tracks.
90
- *
91
- * args: ([[Track]], [[RemoteTrackPublication]], [[RemoteParticipant]])
92
- */
93
- TrackUnsubscribed = "trackUnsubscribed",
94
- /**
95
- * A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
96
- *
97
- * args: ([[TrackPublication]], [[Participant]])
98
- */
99
- TrackMuted = "trackMuted",
100
- /**
101
- * A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
102
- *
103
- * args: ([[TrackPublication]], [[Participant]])
104
- */
105
- TrackUnmuted = "trackUnmuted",
106
- /**
107
- * A local track was published successfully. This event is helpful to know
108
- * when to update your local UI with the newly published track.
109
- *
110
- * args: ([[LocalTrackPublication]], [[LocalParticipant]])
111
- */
112
- LocalTrackPublished = "localTrackPublished",
113
- /**
114
- * A local track was unpublished. This event is helpful to know when to remove
115
- * the local track from your UI.
116
- *
117
- * When a user stops sharing their screen by pressing "End" on the browser UI,
118
- * this event will also fire.
119
- *
120
- * args: ([[LocalTrackPublication]], [[LocalParticipant]])
121
- */
122
- LocalTrackUnpublished = "localTrackUnpublished",
123
- /**
124
- * When a local audio track is published the SDK checks whether there is complete silence
125
- * on that track and emits the LocalAudioSilenceDetected event in that case.
126
- * This allows for applications to show UI informing users that they might have to
127
- * reset their audio hardware or check for proper device connectivity.
128
- */
129
- LocalAudioSilenceDetected = "localAudioSilenceDetected",
130
- /**
131
- * Active speakers changed. List of speakers are ordered by their audio level.
132
- * loudest speakers first. This will include the LocalParticipant too.
133
- *
134
- * Speaker updates are sent only to the publishing participant and their subscribers.
135
- *
136
- * args: (Array<[[Participant]]>)
137
- */
138
- ActiveSpeakersChanged = "activeSpeakersChanged",
139
- /**
140
- * Participant metadata is a simple way for app-specific state to be pushed to
141
- * all users.
142
- * When RoomService.UpdateParticipantMetadata is called to change a participant's
143
- * state, *all* participants in the room will fire this event.
144
- *
145
- * args: (prevMetadata: string, [[Participant]])
146
- *
147
- */
148
- ParticipantMetadataChanged = "participantMetadataChanged",
149
- /**
150
- * Participant's display name changed
151
- *
152
- * args: (name: string, [[Participant]])
153
- *
154
- */
155
- ParticipantNameChanged = "participantNameChanged",
156
- /**
157
- * Room metadata is a simple way for app-specific state to be pushed to
158
- * all users.
159
- * When RoomService.UpdateRoomMetadata is called to change a room's state,
160
- * *all* participants in the room will fire this event.
161
- *
162
- * args: (string)
163
- */
164
- RoomMetadataChanged = "roomMetadataChanged",
165
- /**
166
- * Data received from another participant.
167
- * Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
168
- * All participants in the room will receive the messages sent to the room.
169
- *
170
- * args: (payload: Uint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]], topic?: string)
171
- */
172
- DataReceived = "dataReceived",
173
- /**
174
- * Connection quality was changed for a Participant. It'll receive updates
175
- * from the local participant, as well as any [[RemoteParticipant]]s that we are
176
- * subscribed to.
177
- *
178
- * args: (connectionQuality: [[ConnectionQuality]], participant: [[Participant]])
179
- */
180
- ConnectionQualityChanged = "connectionQualityChanged",
181
- /**
182
- * StreamState indicates if a subscribed (remote) track has been paused by the SFU
183
- * (typically this happens because of subscriber's bandwidth constraints)
184
- *
185
- * When bandwidth conditions allow, the track will be resumed automatically.
186
- * TrackStreamStateChanged will also be emitted when that happens.
187
- *
188
- * args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]],
189
- * participant: [[RemoteParticipant]])
190
- */
191
- TrackStreamStateChanged = "trackStreamStateChanged",
192
- /**
193
- * One of subscribed tracks have changed its permissions for the current
194
- * participant. If permission was revoked, then the track will no longer
195
- * be subscribed. If permission was granted, a TrackSubscribed event will
196
- * be emitted.
197
- *
198
- * args: (pub: [[RemoteTrackPublication]],
199
- * status: [[TrackPublication.SubscriptionStatus]],
200
- * participant: [[RemoteParticipant]])
201
- */
202
- TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged",
203
- /**
204
- * One of subscribed tracks have changed its status for the current
205
- * participant.
206
- *
207
- * args: (pub: [[RemoteTrackPublication]],
208
- * status: [[TrackPublication.SubscriptionStatus]],
209
- * participant: [[RemoteParticipant]])
210
- */
211
- TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged",
212
- /**
213
- * LiveKit will attempt to autoplay all audio tracks when you attach them to
214
- * audio elements. However, if that fails, we'll notify you via AudioPlaybackStatusChanged.
215
- * `Room.canPlayAudio` will indicate if audio playback is permitted.
216
- */
217
- AudioPlaybackStatusChanged = "audioPlaybackChanged",
218
- /**
219
- * When we have encountered an error while attempting to create a track.
220
- * The errors take place in getUserMedia().
221
- * Use MediaDeviceFailure.getFailure(error) to get the reason of failure.
222
- * [[LocalParticipant.lastCameraError]] and [[LocalParticipant.lastMicrophoneError]]
223
- * will indicate if it had an error while creating the audio or video track respectively.
224
- *
225
- * args: (error: Error)
226
- */
227
- MediaDevicesError = "mediaDevicesError",
228
- /**
229
- * A participant's permission has changed. Currently only fired on LocalParticipant.
230
- * args: (prevPermissions: [[ParticipantPermission]], participant: [[Participant]])
231
- */
232
- ParticipantPermissionsChanged = "participantPermissionsChanged",
233
- /**
234
- * Signal connected, can publish tracks.
235
- */
236
- SignalConnected = "signalConnected",
237
- /**
238
- * Recording of a room has started/stopped. Room.isRecording will be updated too.
239
- * args: (isRecording: boolean)
240
- */
241
- RecordingStatusChanged = "recordingStatusChanged",
242
- /**
243
- * Emits whenever the current buffer status of a data channel changes
244
- * args: (isLow: boolean, kind: [[DataPacket_Kind]])
245
- */
246
- DCBufferStatusChanged = "dcBufferStatusChanged"
247
- }
248
- export declare enum ParticipantEvent {
249
- /**
250
- * When a new track is published to room *after* the local
251
- * participant has joined. It will not fire for tracks that are already published.
252
- *
253
- * A track published doesn't mean the participant has subscribed to it. It's
254
- * simply reflecting the state of the room.
255
- *
256
- * args: ([[RemoteTrackPublication]])
257
- */
258
- TrackPublished = "trackPublished",
259
- /**
260
- * Successfully subscribed to the [[RemoteParticipant]]'s track.
261
- * This event will **always** fire as long as new tracks are ready for use.
262
- *
263
- * args: ([[RemoteTrack]], [[RemoteTrackPublication]])
264
- */
265
- TrackSubscribed = "trackSubscribed",
266
- /**
267
- * Could not subscribe to a track
268
- *
269
- * args: (track sid)
270
- */
271
- TrackSubscriptionFailed = "trackSubscriptionFailed",
272
- /**
273
- * A [[RemoteParticipant]] has unpublished a track
274
- *
275
- * args: ([[RemoteTrackPublication]])
276
- */
277
- TrackUnpublished = "trackUnpublished",
278
- /**
279
- * A subscribed track is no longer available. Clients should listen to this
280
- * event and ensure they detach tracks.
281
- *
282
- * args: ([[RemoteTrack]], [[RemoteTrackPublication]])
283
- */
284
- TrackUnsubscribed = "trackUnsubscribed",
285
- /**
286
- * A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
287
- *
288
- * args: ([[TrackPublication]])
289
- */
290
- TrackMuted = "trackMuted",
291
- /**
292
- * A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
293
- *
294
- * args: ([[TrackPublication]])
295
- */
296
- TrackUnmuted = "trackUnmuted",
297
- /**
298
- * A local track was published successfully. This event is helpful to know
299
- * when to update your local UI with the newly published track.
300
- *
301
- * args: ([[LocalTrackPublication]])
302
- */
303
- LocalTrackPublished = "localTrackPublished",
304
- /**
305
- * A local track was unpublished. This event is helpful to know when to remove
306
- * the local track from your UI.
307
- *
308
- * When a user stops sharing their screen by pressing "End" on the browser UI,
309
- * this event will also fire.
310
- *
311
- * args: ([[LocalTrackPublication]])
312
- */
313
- LocalTrackUnpublished = "localTrackUnpublished",
314
- /**
315
- * Participant metadata is a simple way for app-specific state to be pushed to
316
- * all users.
317
- * When RoomService.UpdateParticipantMetadata is called to change a participant's
318
- * state, *all* participants in the room will fire this event.
319
- * To access the current metadata, see [[Participant.metadata]].
320
- *
321
- * args: (prevMetadata: string)
322
- *
323
- */
324
- ParticipantMetadataChanged = "participantMetadataChanged",
325
- /**
326
- * Participant's display name changed
327
- *
328
- * args: (name: string, [[Participant]])
329
- *
330
- */
331
- ParticipantNameChanged = "participantNameChanged",
332
- /**
333
- * Data received from this participant as sender.
334
- * Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
335
- * All participants in the room will receive the messages sent to the room.
336
- *
337
- * args: (payload: Uint8Array, kind: [[DataPacket_Kind]])
338
- */
339
- DataReceived = "dataReceived",
340
- /**
341
- * Has speaking status changed for the current participant
342
- *
343
- * args: (speaking: boolean)
344
- */
345
- IsSpeakingChanged = "isSpeakingChanged",
346
- /**
347
- * Connection quality was changed for a Participant. It'll receive updates
348
- * from the local participant, as well as any [[RemoteParticipant]]s that we are
349
- * subscribed to.
350
- *
351
- * args: (connectionQuality: [[ConnectionQuality]])
352
- */
353
- ConnectionQualityChanged = "connectionQualityChanged",
354
- /**
355
- * StreamState indicates if a subscribed track has been paused by the SFU
356
- * (typically this happens because of subscriber's bandwidth constraints)
357
- *
358
- * When bandwidth conditions allow, the track will be resumed automatically.
359
- * TrackStreamStateChanged will also be emitted when that happens.
360
- *
361
- * args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]])
362
- */
363
- TrackStreamStateChanged = "trackStreamStateChanged",
364
- /**
365
- * One of subscribed tracks have changed its permissions for the current
366
- * participant. If permission was revoked, then the track will no longer
367
- * be subscribed. If permission was granted, a TrackSubscribed event will
368
- * be emitted.
369
- *
370
- * args: (pub: [[RemoteTrackPublication]],
371
- * status: [[TrackPublication.SubscriptionStatus]])
372
- */
373
- TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged",
374
- /**
375
- * One of the remote participants publications has changed its subscription status.
376
- *
377
- */
378
- TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged",
379
- /** @internal */
380
- MediaDevicesError = "mediaDevicesError",
381
- /**
382
- * A participant's permission has changed. Currently only fired on LocalParticipant.
383
- * args: (prevPermissions: [[ParticipantPermission]])
384
- */
385
- ParticipantPermissionsChanged = "participantPermissionsChanged"
386
- }
387
- /** @internal */
388
- export declare enum EngineEvent {
389
- TransportsCreated = "transportsCreated",
390
- Connected = "connected",
391
- Disconnected = "disconnected",
392
- Resuming = "resuming",
393
- Resumed = "resumed",
394
- Restarting = "restarting",
395
- Restarted = "restarted",
396
- SignalResumed = "signalResumed",
397
- SignalRestarted = "signalRestarted",
398
- Closing = "closing",
399
- MediaTrackAdded = "mediaTrackAdded",
400
- ActiveSpeakersUpdate = "activeSpeakersUpdate",
401
- DataPacketReceived = "dataPacketReceived",
402
- DCBufferStatusChanged = "dcBufferStatusChanged"
403
- }
404
- export declare enum TrackEvent {
405
- Message = "message",
406
- Muted = "muted",
407
- Unmuted = "unmuted",
408
- /**
409
- * Only fires on LocalTracks
410
- */
411
- Restarted = "restarted",
412
- Ended = "ended",
413
- Subscribed = "subscribed",
414
- Unsubscribed = "unsubscribed",
415
- /** @internal */
416
- UpdateSettings = "updateSettings",
417
- /** @internal */
418
- UpdateSubscription = "updateSubscription",
419
- /** @internal */
420
- AudioPlaybackStarted = "audioPlaybackStarted",
421
- /** @internal */
422
- AudioPlaybackFailed = "audioPlaybackFailed",
423
- /**
424
- * @internal
425
- * Only fires on LocalAudioTrack instances
426
- */
427
- AudioSilenceDetected = "audioSilenceDetected",
428
- /** @internal */
429
- VisibilityChanged = "visibilityChanged",
430
- /** @internal */
431
- VideoDimensionsChanged = "videoDimensionsChanged",
432
- /** @internal */
433
- ElementAttached = "elementAttached",
434
- /** @internal */
435
- ElementDetached = "elementDetached",
436
- /**
437
- * @internal
438
- * Only fires on LocalTracks
439
- */
440
- UpstreamPaused = "upstreamPaused",
441
- /**
442
- * @internal
443
- * Only fires on LocalTracks
444
- */
445
- UpstreamResumed = "upstreamResumed",
446
- /**
447
- * @internal
448
- * Fires on RemoteTrackPublication
449
- */
450
- SubscriptionPermissionChanged = "subscriptionPermissionChanged",
451
- /**
452
- * Fires on RemoteTrackPublication
453
- */
454
- SubscriptionStatusChanged = "subscriptionStatusChanged"
455
- }
1
+ /**
2
+ * Events are the primary way LiveKit notifies your application of changes.
3
+ *
4
+ * The following are events emitted by [[Room]], listen to room events like
5
+ *
6
+ * ```typescript
7
+ * room.on(RoomEvent.TrackPublished, (track, publication, participant) => {})
8
+ * ```
9
+ */
10
+ export declare enum RoomEvent {
11
+ /**
12
+ * When the connection to the server has been established
13
+ */
14
+ Connected = "connected",
15
+ /**
16
+ * When the connection to the server has been interrupted and it's attempting
17
+ * to reconnect.
18
+ */
19
+ Reconnecting = "reconnecting",
20
+ /**
21
+ * Fires when a reconnection has been successful.
22
+ */
23
+ Reconnected = "reconnected",
24
+ /**
25
+ * When disconnected from room. This fires when room.disconnect() is called or
26
+ * when an unrecoverable connection issue had occured
27
+ */
28
+ Disconnected = "disconnected",
29
+ /**
30
+ * Whenever the connection state of the room changes
31
+ *
32
+ * args: ([[ConnectionState]])
33
+ */
34
+ ConnectionStateChanged = "connectionStateChanged",
35
+ /**
36
+ * @deprecated StateChanged has been renamed to ConnectionStateChanged
37
+ */
38
+ StateChanged = "connectionStateChanged",
39
+ /**
40
+ * When input or output devices on the machine have changed.
41
+ */
42
+ MediaDevicesChanged = "mediaDevicesChanged",
43
+ /**
44
+ * When a [[RemoteParticipant]] joins *after* the local
45
+ * participant. It will not emit events for participants that are already
46
+ * in the room
47
+ *
48
+ * args: ([[RemoteParticipant]])
49
+ */
50
+ ParticipantConnected = "participantConnected",
51
+ /**
52
+ * When a [[RemoteParticipant]] leaves *after* the local
53
+ * participant has joined.
54
+ *
55
+ * args: ([[RemoteParticipant]])
56
+ */
57
+ ParticipantDisconnected = "participantDisconnected",
58
+ /**
59
+ * When a new track is published to room *after* the local
60
+ * participant has joined. It will not fire for tracks that are already published.
61
+ *
62
+ * A track published doesn't mean the participant has subscribed to it. It's
63
+ * simply reflecting the state of the room.
64
+ *
65
+ * args: ([[RemoteTrackPublication]], [[RemoteParticipant]])
66
+ */
67
+ TrackPublished = "trackPublished",
68
+ /**
69
+ * The [[LocalParticipant]] has subscribed to a new track. This event will **always**
70
+ * fire as long as new tracks are ready for use.
71
+ *
72
+ * args: ([[RemoteTrack]], [[RemoteTrackPublication]], [[RemoteParticipant]])
73
+ */
74
+ TrackSubscribed = "trackSubscribed",
75
+ /**
76
+ * Could not subscribe to a track
77
+ *
78
+ * args: (track sid, [[RemoteParticipant]])
79
+ */
80
+ TrackSubscriptionFailed = "trackSubscriptionFailed",
81
+ /**
82
+ * A [[RemoteParticipant]] has unpublished a track
83
+ *
84
+ * args: ([[RemoteTrackPublication]], [[RemoteParticipant]])
85
+ */
86
+ TrackUnpublished = "trackUnpublished",
87
+ /**
88
+ * A subscribed track is no longer available. Clients should listen to this
89
+ * event and ensure they detach tracks.
90
+ *
91
+ * args: ([[Track]], [[RemoteTrackPublication]], [[RemoteParticipant]])
92
+ */
93
+ TrackUnsubscribed = "trackUnsubscribed",
94
+ /**
95
+ * A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
96
+ *
97
+ * args: ([[TrackPublication]], [[Participant]])
98
+ */
99
+ TrackMuted = "trackMuted",
100
+ /**
101
+ * A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
102
+ *
103
+ * args: ([[TrackPublication]], [[Participant]])
104
+ */
105
+ TrackUnmuted = "trackUnmuted",
106
+ /**
107
+ * A local track was published successfully. This event is helpful to know
108
+ * when to update your local UI with the newly published track.
109
+ *
110
+ * args: ([[LocalTrackPublication]], [[LocalParticipant]])
111
+ */
112
+ LocalTrackPublished = "localTrackPublished",
113
+ /**
114
+ * A local track was unpublished. This event is helpful to know when to remove
115
+ * the local track from your UI.
116
+ *
117
+ * When a user stops sharing their screen by pressing "End" on the browser UI,
118
+ * this event will also fire.
119
+ *
120
+ * args: ([[LocalTrackPublication]], [[LocalParticipant]])
121
+ */
122
+ LocalTrackUnpublished = "localTrackUnpublished",
123
+ /**
124
+ * When a local audio track is published the SDK checks whether there is complete silence
125
+ * on that track and emits the LocalAudioSilenceDetected event in that case.
126
+ * This allows for applications to show UI informing users that they might have to
127
+ * reset their audio hardware or check for proper device connectivity.
128
+ */
129
+ LocalAudioSilenceDetected = "localAudioSilenceDetected",
130
+ /**
131
+ * Active speakers changed. List of speakers are ordered by their audio level.
132
+ * loudest speakers first. This will include the LocalParticipant too.
133
+ *
134
+ * Speaker updates are sent only to the publishing participant and their subscribers.
135
+ *
136
+ * args: (Array<[[Participant]]>)
137
+ */
138
+ ActiveSpeakersChanged = "activeSpeakersChanged",
139
+ /**
140
+ * Participant metadata is a simple way for app-specific state to be pushed to
141
+ * all users.
142
+ * When RoomService.UpdateParticipantMetadata is called to change a participant's
143
+ * state, *all* participants in the room will fire this event.
144
+ *
145
+ * args: (prevMetadata: string, [[Participant]])
146
+ *
147
+ */
148
+ ParticipantMetadataChanged = "participantMetadataChanged",
149
+ /**
150
+ * Participant's display name changed
151
+ *
152
+ * args: (name: string, [[Participant]])
153
+ *
154
+ */
155
+ ParticipantNameChanged = "participantNameChanged",
156
+ /**
157
+ * Room metadata is a simple way for app-specific state to be pushed to
158
+ * all users.
159
+ * When RoomService.UpdateRoomMetadata is called to change a room's state,
160
+ * *all* participants in the room will fire this event.
161
+ *
162
+ * args: (string)
163
+ */
164
+ RoomMetadataChanged = "roomMetadataChanged",
165
+ /**
166
+ * Data received from another participant.
167
+ * Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
168
+ * All participants in the room will receive the messages sent to the room.
169
+ *
170
+ * args: (payload: Uint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]], topic?: string)
171
+ */
172
+ DataReceived = "dataReceived",
173
+ /**
174
+ * Connection quality was changed for a Participant. It'll receive updates
175
+ * from the local participant, as well as any [[RemoteParticipant]]s that we are
176
+ * subscribed to.
177
+ *
178
+ * args: (connectionQuality: [[ConnectionQuality]], participant: [[Participant]])
179
+ */
180
+ ConnectionQualityChanged = "connectionQualityChanged",
181
+ /**
182
+ * StreamState indicates if a subscribed (remote) track has been paused by the SFU
183
+ * (typically this happens because of subscriber's bandwidth constraints)
184
+ *
185
+ * When bandwidth conditions allow, the track will be resumed automatically.
186
+ * TrackStreamStateChanged will also be emitted when that happens.
187
+ *
188
+ * args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]],
189
+ * participant: [[RemoteParticipant]])
190
+ */
191
+ TrackStreamStateChanged = "trackStreamStateChanged",
192
+ /**
193
+ * One of subscribed tracks have changed its permissions for the current
194
+ * participant. If permission was revoked, then the track will no longer
195
+ * be subscribed. If permission was granted, a TrackSubscribed event will
196
+ * be emitted.
197
+ *
198
+ * args: (pub: [[RemoteTrackPublication]],
199
+ * status: [[TrackPublication.SubscriptionStatus]],
200
+ * participant: [[RemoteParticipant]])
201
+ */
202
+ TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged",
203
+ /**
204
+ * One of subscribed tracks have changed its status for the current
205
+ * participant.
206
+ *
207
+ * args: (pub: [[RemoteTrackPublication]],
208
+ * status: [[TrackPublication.SubscriptionStatus]],
209
+ * participant: [[RemoteParticipant]])
210
+ */
211
+ TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged",
212
+ /**
213
+ * LiveKit will attempt to autoplay all audio tracks when you attach them to
214
+ * audio elements. However, if that fails, we'll notify you via AudioPlaybackStatusChanged.
215
+ * `Room.canPlayAudio` will indicate if audio playback is permitted.
216
+ */
217
+ AudioPlaybackStatusChanged = "audioPlaybackChanged",
218
+ /**
219
+ * When we have encountered an error while attempting to create a track.
220
+ * The errors take place in getUserMedia().
221
+ * Use MediaDeviceFailure.getFailure(error) to get the reason of failure.
222
+ * [[LocalParticipant.lastCameraError]] and [[LocalParticipant.lastMicrophoneError]]
223
+ * will indicate if it had an error while creating the audio or video track respectively.
224
+ *
225
+ * args: (error: Error)
226
+ */
227
+ MediaDevicesError = "mediaDevicesError",
228
+ /**
229
+ * A participant's permission has changed. Currently only fired on LocalParticipant.
230
+ * args: (prevPermissions: [[ParticipantPermission]], participant: [[Participant]])
231
+ */
232
+ ParticipantPermissionsChanged = "participantPermissionsChanged",
233
+ /**
234
+ * Signal connected, can publish tracks.
235
+ */
236
+ SignalConnected = "signalConnected",
237
+ /**
238
+ * Recording of a room has started/stopped. Room.isRecording will be updated too.
239
+ * args: (isRecording: boolean)
240
+ */
241
+ RecordingStatusChanged = "recordingStatusChanged",
242
+ /**
243
+ * Emits whenever the current buffer status of a data channel changes
244
+ * args: (isLow: boolean, kind: [[DataPacket_Kind]])
245
+ */
246
+ DCBufferStatusChanged = "dcBufferStatusChanged"
247
+ }
248
+ export declare enum ParticipantEvent {
249
+ /**
250
+ * When a new track is published to room *after* the local
251
+ * participant has joined. It will not fire for tracks that are already published.
252
+ *
253
+ * A track published doesn't mean the participant has subscribed to it. It's
254
+ * simply reflecting the state of the room.
255
+ *
256
+ * args: ([[RemoteTrackPublication]])
257
+ */
258
+ TrackPublished = "trackPublished",
259
+ /**
260
+ * Successfully subscribed to the [[RemoteParticipant]]'s track.
261
+ * This event will **always** fire as long as new tracks are ready for use.
262
+ *
263
+ * args: ([[RemoteTrack]], [[RemoteTrackPublication]])
264
+ */
265
+ TrackSubscribed = "trackSubscribed",
266
+ /**
267
+ * Could not subscribe to a track
268
+ *
269
+ * args: (track sid)
270
+ */
271
+ TrackSubscriptionFailed = "trackSubscriptionFailed",
272
+ /**
273
+ * A [[RemoteParticipant]] has unpublished a track
274
+ *
275
+ * args: ([[RemoteTrackPublication]])
276
+ */
277
+ TrackUnpublished = "trackUnpublished",
278
+ /**
279
+ * A subscribed track is no longer available. Clients should listen to this
280
+ * event and ensure they detach tracks.
281
+ *
282
+ * args: ([[RemoteTrack]], [[RemoteTrackPublication]])
283
+ */
284
+ TrackUnsubscribed = "trackUnsubscribed",
285
+ /**
286
+ * A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
287
+ *
288
+ * args: ([[TrackPublication]])
289
+ */
290
+ TrackMuted = "trackMuted",
291
+ /**
292
+ * A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
293
+ *
294
+ * args: ([[TrackPublication]])
295
+ */
296
+ TrackUnmuted = "trackUnmuted",
297
+ /**
298
+ * A local track was published successfully. This event is helpful to know
299
+ * when to update your local UI with the newly published track.
300
+ *
301
+ * args: ([[LocalTrackPublication]])
302
+ */
303
+ LocalTrackPublished = "localTrackPublished",
304
+ /**
305
+ * A local track was unpublished. This event is helpful to know when to remove
306
+ * the local track from your UI.
307
+ *
308
+ * When a user stops sharing their screen by pressing "End" on the browser UI,
309
+ * this event will also fire.
310
+ *
311
+ * args: ([[LocalTrackPublication]])
312
+ */
313
+ LocalTrackUnpublished = "localTrackUnpublished",
314
+ /**
315
+ * Participant metadata is a simple way for app-specific state to be pushed to
316
+ * all users.
317
+ * When RoomService.UpdateParticipantMetadata is called to change a participant's
318
+ * state, *all* participants in the room will fire this event.
319
+ * To access the current metadata, see [[Participant.metadata]].
320
+ *
321
+ * args: (prevMetadata: string)
322
+ *
323
+ */
324
+ ParticipantMetadataChanged = "participantMetadataChanged",
325
+ /**
326
+ * Participant's display name changed
327
+ *
328
+ * args: (name: string, [[Participant]])
329
+ *
330
+ */
331
+ ParticipantNameChanged = "participantNameChanged",
332
+ /**
333
+ * Data received from this participant as sender.
334
+ * Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
335
+ * All participants in the room will receive the messages sent to the room.
336
+ *
337
+ * args: (payload: Uint8Array, kind: [[DataPacket_Kind]])
338
+ */
339
+ DataReceived = "dataReceived",
340
+ /**
341
+ * Has speaking status changed for the current participant
342
+ *
343
+ * args: (speaking: boolean)
344
+ */
345
+ IsSpeakingChanged = "isSpeakingChanged",
346
+ /**
347
+ * Connection quality was changed for a Participant. It'll receive updates
348
+ * from the local participant, as well as any [[RemoteParticipant]]s that we are
349
+ * subscribed to.
350
+ *
351
+ * args: (connectionQuality: [[ConnectionQuality]])
352
+ */
353
+ ConnectionQualityChanged = "connectionQualityChanged",
354
+ /**
355
+ * StreamState indicates if a subscribed track has been paused by the SFU
356
+ * (typically this happens because of subscriber's bandwidth constraints)
357
+ *
358
+ * When bandwidth conditions allow, the track will be resumed automatically.
359
+ * TrackStreamStateChanged will also be emitted when that happens.
360
+ *
361
+ * args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]])
362
+ */
363
+ TrackStreamStateChanged = "trackStreamStateChanged",
364
+ /**
365
+ * One of subscribed tracks have changed its permissions for the current
366
+ * participant. If permission was revoked, then the track will no longer
367
+ * be subscribed. If permission was granted, a TrackSubscribed event will
368
+ * be emitted.
369
+ *
370
+ * args: (pub: [[RemoteTrackPublication]],
371
+ * status: [[TrackPublication.SubscriptionStatus]])
372
+ */
373
+ TrackSubscriptionPermissionChanged = "trackSubscriptionPermissionChanged",
374
+ /**
375
+ * One of the remote participants publications has changed its subscription status.
376
+ *
377
+ */
378
+ TrackSubscriptionStatusChanged = "trackSubscriptionStatusChanged",
379
+ /** @internal */
380
+ MediaDevicesError = "mediaDevicesError",
381
+ /**
382
+ * A participant's permission has changed. Currently only fired on LocalParticipant.
383
+ * args: (prevPermissions: [[ParticipantPermission]])
384
+ */
385
+ ParticipantPermissionsChanged = "participantPermissionsChanged"
386
+ }
387
+ /** @internal */
388
+ export declare enum EngineEvent {
389
+ TransportsCreated = "transportsCreated",
390
+ Connected = "connected",
391
+ Disconnected = "disconnected",
392
+ Resuming = "resuming",
393
+ Resumed = "resumed",
394
+ Restarting = "restarting",
395
+ Restarted = "restarted",
396
+ SignalResumed = "signalResumed",
397
+ SignalRestarted = "signalRestarted",
398
+ Closing = "closing",
399
+ MediaTrackAdded = "mediaTrackAdded",
400
+ ActiveSpeakersUpdate = "activeSpeakersUpdate",
401
+ DataPacketReceived = "dataPacketReceived",
402
+ DCBufferStatusChanged = "dcBufferStatusChanged"
403
+ }
404
+ export declare enum TrackEvent {
405
+ Message = "message",
406
+ Muted = "muted",
407
+ Unmuted = "unmuted",
408
+ /**
409
+ * Only fires on LocalTracks
410
+ */
411
+ Restarted = "restarted",
412
+ Ended = "ended",
413
+ Subscribed = "subscribed",
414
+ Unsubscribed = "unsubscribed",
415
+ /** @internal */
416
+ UpdateSettings = "updateSettings",
417
+ /** @internal */
418
+ UpdateSubscription = "updateSubscription",
419
+ /** @internal */
420
+ AudioPlaybackStarted = "audioPlaybackStarted",
421
+ /** @internal */
422
+ AudioPlaybackFailed = "audioPlaybackFailed",
423
+ /**
424
+ * @internal
425
+ * Only fires on LocalAudioTrack instances
426
+ */
427
+ AudioSilenceDetected = "audioSilenceDetected",
428
+ /** @internal */
429
+ VisibilityChanged = "visibilityChanged",
430
+ /** @internal */
431
+ VideoDimensionsChanged = "videoDimensionsChanged",
432
+ /** @internal */
433
+ ElementAttached = "elementAttached",
434
+ /** @internal */
435
+ ElementDetached = "elementDetached",
436
+ /**
437
+ * @internal
438
+ * Only fires on LocalTracks
439
+ */
440
+ UpstreamPaused = "upstreamPaused",
441
+ /**
442
+ * @internal
443
+ * Only fires on LocalTracks
444
+ */
445
+ UpstreamResumed = "upstreamResumed",
446
+ /**
447
+ * @internal
448
+ * Fires on RemoteTrackPublication
449
+ */
450
+ SubscriptionPermissionChanged = "subscriptionPermissionChanged",
451
+ /**
452
+ * Fires on RemoteTrackPublication
453
+ */
454
+ SubscriptionStatusChanged = "subscriptionStatusChanged"
455
+ }
456
456
  //# sourceMappingURL=events.d.ts.map