livekit-client 0.18.4-RC6 → 0.18.4

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