livekit-client 0.18.4-RC7 → 0.18.5

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