livekit-client 0.14.2 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/{lint.yaml → test.yaml} +7 -4
- package/.gitmodules +3 -0
- package/README.md +46 -14
- package/dist/api/SignalClient.d.ts +7 -32
- package/dist/api/SignalClient.js +37 -8
- package/dist/api/SignalClient.js.map +1 -1
- package/dist/connect.d.ts +1 -1
- package/dist/connect.js +71 -73
- package/dist/connect.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +10 -0
- package/dist/logger.js +15 -0
- package/dist/logger.js.map +1 -1
- package/dist/options.d.ts +83 -19
- package/dist/options.js +0 -10
- package/dist/options.js.map +1 -1
- package/dist/proto/livekit_models.d.ts +42 -1
- package/dist/proto/livekit_models.js +292 -4
- package/dist/proto/livekit_models.js.map +1 -1
- package/dist/proto/livekit_rtc.d.ts +115 -7
- package/dist/proto/livekit_rtc.js +810 -30
- package/dist/proto/livekit_rtc.js.map +1 -1
- package/dist/room/RTCEngine.d.ts +4 -2
- package/dist/room/RTCEngine.js +31 -35
- package/dist/room/RTCEngine.js.map +1 -1
- package/dist/room/Room.d.ts +16 -17
- package/dist/room/Room.js +125 -77
- package/dist/room/Room.js.map +1 -1
- package/dist/room/events.d.ts +115 -6
- package/dist/room/events.js +114 -5
- package/dist/room/events.js.map +1 -1
- package/dist/room/participant/LocalParticipant.d.ts +29 -11
- package/dist/room/participant/LocalParticipant.js +209 -160
- package/dist/room/participant/LocalParticipant.js.map +1 -1
- package/dist/room/participant/Participant.d.ts +2 -0
- package/dist/room/participant/Participant.js +3 -1
- package/dist/room/participant/Participant.js.map +1 -1
- package/dist/room/participant/RemoteParticipant.d.ts +1 -1
- package/dist/room/participant/RemoteParticipant.js +6 -5
- package/dist/room/participant/RemoteParticipant.js.map +1 -1
- package/dist/room/participant/publishUtils.d.ts +11 -0
- package/dist/room/participant/publishUtils.js +148 -0
- package/dist/room/participant/publishUtils.js.map +1 -0
- package/dist/room/participant/publishUtils.test.d.ts +1 -0
- package/dist/room/participant/publishUtils.test.js +79 -0
- package/dist/room/participant/publishUtils.test.js.map +1 -0
- package/dist/room/stats.d.ts +21 -6
- package/dist/room/stats.js +22 -1
- package/dist/room/stats.js.map +1 -1
- package/dist/room/track/LocalAudioTrack.d.ts +8 -3
- package/dist/room/track/LocalAudioTrack.js +49 -3
- package/dist/room/track/LocalAudioTrack.js.map +1 -1
- package/dist/room/track/LocalTrack.d.ts +4 -3
- package/dist/room/track/LocalTrack.js +6 -48
- package/dist/room/track/LocalTrack.js.map +1 -1
- package/dist/room/track/LocalVideoTrack.d.ts +14 -5
- package/dist/room/track/LocalVideoTrack.js +154 -62
- package/dist/room/track/LocalVideoTrack.js.map +1 -1
- package/dist/room/track/LocalVideoTrack.test.d.ts +1 -0
- package/dist/room/track/LocalVideoTrack.test.js +68 -0
- package/dist/room/track/LocalVideoTrack.test.js.map +1 -0
- package/dist/room/track/RemoteAudioTrack.d.ts +7 -0
- package/dist/room/track/RemoteAudioTrack.js +61 -0
- package/dist/room/track/RemoteAudioTrack.js.map +1 -1
- package/dist/room/track/RemoteTrackPublication.d.ts +2 -3
- package/dist/room/track/RemoteTrackPublication.js +12 -10
- package/dist/room/track/RemoteTrackPublication.js.map +1 -1
- package/dist/room/track/RemoteVideoTrack.d.ts +10 -6
- package/dist/room/track/RemoteVideoTrack.js +97 -44
- package/dist/room/track/RemoteVideoTrack.js.map +1 -1
- package/dist/room/track/Track.d.ts +10 -2
- package/dist/room/track/Track.js +29 -2
- package/dist/room/track/Track.js.map +1 -1
- package/dist/room/track/TrackPublication.d.ts +2 -0
- package/dist/room/track/TrackPublication.js +1 -0
- package/dist/room/track/TrackPublication.js.map +1 -1
- package/dist/room/track/create.d.ts +4 -6
- package/dist/room/track/create.js +10 -57
- package/dist/room/track/create.js.map +1 -1
- package/dist/room/track/defaults.d.ts +4 -0
- package/dist/room/track/defaults.js +21 -0
- package/dist/room/track/defaults.js.map +1 -0
- package/dist/room/track/options.d.ts +15 -65
- package/dist/room/track/options.js +14 -13
- package/dist/room/track/options.js.map +1 -1
- package/dist/room/track/utils.d.ts +3 -0
- package/dist/room/track/utils.js +68 -0
- package/dist/room/track/utils.js.map +1 -0
- package/dist/room/track/utils.test.d.ts +1 -0
- package/dist/room/track/utils.test.js +85 -0
- package/dist/room/track/utils.test.js.map +1 -0
- package/dist/room/utils.d.ts +7 -1
- package/dist/room/utils.js +29 -6
- package/dist/room/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/example/index.html +194 -178
- package/example/sample.ts +454 -325
- package/example/styles.css +144 -0
- package/example/webpack.config.js +1 -1
- package/jest.config.js +6 -0
- package/package.json +9 -6
- package/tsconfig.eslint.json +8 -1
- package/dist/room/defaults.d.ts +0 -5
- package/dist/room/defaults.js +0 -32
- package/dist/room/defaults.js.map +0 -1
package/dist/room/events.d.ts
CHANGED
@@ -145,6 +145,17 @@ export declare enum RoomEvent {
|
|
145
145
|
* args: (payload: Uint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]])
|
146
146
|
*/
|
147
147
|
DataReceived = "dataReceived",
|
148
|
+
/**
|
149
|
+
* StreamState indicates if a subscribed track has been paused by the SFU
|
150
|
+
* (typically this happens because of subscriber's bandwidth constraints)
|
151
|
+
*
|
152
|
+
* When bandwidth conditions allow, the track will be resumed automatically.
|
153
|
+
* TrackStreamStateChanged will also be emitted when that happens.
|
154
|
+
*
|
155
|
+
* args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]],
|
156
|
+
* participant: [[RemoteParticipant]])
|
157
|
+
*/
|
158
|
+
TrackStreamStateChanged = "trackStreamStateChanged",
|
148
159
|
/**
|
149
160
|
* LiveKit will attempt to autoplay all audio tracks when you attach them to
|
150
161
|
* audio elements. However, if that fails, we'll notify you via AudioPlaybackStatusChanged.
|
@@ -171,20 +182,123 @@ export declare enum RoomEvent {
|
|
171
182
|
ConnectionQualityChanged = "connectionQualityChanged"
|
172
183
|
}
|
173
184
|
export declare enum ParticipantEvent {
|
185
|
+
/**
|
186
|
+
* When a new track is published to room *after* the local
|
187
|
+
* participant has joined. It will not fire for tracks that are already published.
|
188
|
+
*
|
189
|
+
* A track published doesn't mean the participant has subscribed to it. It's
|
190
|
+
* simply reflecting the state of the room.
|
191
|
+
*
|
192
|
+
* args: ([[RemoteTrackPublication]])
|
193
|
+
*/
|
174
194
|
TrackPublished = "trackPublished",
|
195
|
+
/**
|
196
|
+
* The [[LocalParticipant]] has subscribed to a new track. This event will **always**
|
197
|
+
* fire as long as new tracks are ready for use.
|
198
|
+
*
|
199
|
+
* args: ([[RemoteTrack]], [[RemoteTrackPublication]])
|
200
|
+
*/
|
175
201
|
TrackSubscribed = "trackSubscribed",
|
202
|
+
/**
|
203
|
+
* Could not subscribe to a track
|
204
|
+
*
|
205
|
+
* args: (track sid)
|
206
|
+
*/
|
176
207
|
TrackSubscriptionFailed = "trackSubscriptionFailed",
|
208
|
+
/**
|
209
|
+
* A local track was unpublished. This event is helpful to know when to remove
|
210
|
+
* the local track from your UI.
|
211
|
+
*
|
212
|
+
* When a user stops sharing their screen by pressing "End" on the browser UI,
|
213
|
+
* this event will also fire.
|
214
|
+
*
|
215
|
+
* args: ([[LocalTrackPublication]])
|
216
|
+
*/
|
177
217
|
TrackUnpublished = "trackUnpublished",
|
218
|
+
/**
|
219
|
+
* A subscribed track is no longer available. Clients should listen to this
|
220
|
+
* event and ensure they detach tracks.
|
221
|
+
*
|
222
|
+
* args: ([[Track]], [[RemoteTrackPublication]])
|
223
|
+
*/
|
178
224
|
TrackUnsubscribed = "trackUnsubscribed",
|
225
|
+
/**
|
226
|
+
* A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
|
227
|
+
*
|
228
|
+
* args: ([[TrackPublication]])
|
229
|
+
*/
|
179
230
|
TrackMuted = "trackMuted",
|
231
|
+
/**
|
232
|
+
* A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
|
233
|
+
*
|
234
|
+
* args: ([[TrackPublication]])
|
235
|
+
*/
|
180
236
|
TrackUnmuted = "trackUnmuted",
|
237
|
+
/**
|
238
|
+
* A local track was published successfully. This event is helpful to know
|
239
|
+
* when to update your local UI with the newly published track.
|
240
|
+
*
|
241
|
+
* args: ([[LocalTrackPublication]])
|
242
|
+
*/
|
181
243
|
LocalTrackPublished = "localTrackPublished",
|
244
|
+
/**
|
245
|
+
* A local track was unpublished. This event is helpful to know when to remove
|
246
|
+
* the local track from your UI.
|
247
|
+
*
|
248
|
+
* When a user stops sharing their screen by pressing "End" on the browser UI,
|
249
|
+
* this event will also fire.
|
250
|
+
*
|
251
|
+
* args: ([[LocalTrackPublication]])
|
252
|
+
*/
|
182
253
|
LocalTrackUnpublished = "localTrackUnpublished",
|
254
|
+
/**
|
255
|
+
* @deprecated Use ParticipantMetadataChanged instead
|
256
|
+
* @internal
|
257
|
+
*/
|
183
258
|
MetadataChanged = "metadataChanged",
|
259
|
+
/**
|
260
|
+
* Participant metadata is a simple way for app-specific state to be pushed to
|
261
|
+
* all users.
|
262
|
+
* When RoomService.UpdateParticipantMetadata is called to change a participant's
|
263
|
+
* state, *all* participants in the room will fire this event.
|
264
|
+
* To access the current metadata, see [[Participant.metadata]].
|
265
|
+
*
|
266
|
+
* args: (prevMetadata: string)
|
267
|
+
*
|
268
|
+
*/
|
184
269
|
ParticipantMetadataChanged = "participantMetadataChanged",
|
270
|
+
/**
|
271
|
+
* Data received from this participant as sender.
|
272
|
+
* Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
|
273
|
+
* All participants in the room will receive the messages sent to the room.
|
274
|
+
*
|
275
|
+
* args: (payload: Uint8Array, kind: [[DataPacket_Kind]])
|
276
|
+
*/
|
185
277
|
DataReceived = "dataReceived",
|
278
|
+
/**
|
279
|
+
* Has speaking status changed for the current participant
|
280
|
+
*
|
281
|
+
* args: (speaking: boolean)
|
282
|
+
*/
|
186
283
|
IsSpeakingChanged = "isSpeakingChanged",
|
284
|
+
/**
|
285
|
+
* Connection quality was changed for a Participant. It'll receive updates
|
286
|
+
* from the local participant, as well as any [[RemoteParticipant]]s that we are
|
287
|
+
* subscribed to.
|
288
|
+
*
|
289
|
+
* args: (connectionQuality: [[ConnectionQuality]])
|
290
|
+
*/
|
187
291
|
ConnectionQualityChanged = "connectionQualityChanged",
|
292
|
+
/**
|
293
|
+
* StreamState indicates if a subscribed track has been paused by the SFU
|
294
|
+
* (typically this happens because of subscriber's bandwidth constraints)
|
295
|
+
*
|
296
|
+
* When bandwidth conditions allow, the track will be resumed automatically.
|
297
|
+
* TrackStreamStateChanged will also be emitted when that happens.
|
298
|
+
*
|
299
|
+
* args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]])
|
300
|
+
*/
|
301
|
+
TrackStreamStateChanged = "trackStreamStateChanged",
|
188
302
|
/** @internal */
|
189
303
|
MediaDevicesError = "mediaDevicesError"
|
190
304
|
}
|
@@ -194,14 +308,9 @@ export declare enum EngineEvent {
|
|
194
308
|
Disconnected = "disconnected",
|
195
309
|
Reconnecting = "reconnecting",
|
196
310
|
Reconnected = "reconnected",
|
197
|
-
ParticipantUpdate = "participantUpdate",
|
198
311
|
MediaTrackAdded = "mediaTrackAdded",
|
199
312
|
ActiveSpeakersUpdate = "activeSpeakersUpdate",
|
200
|
-
|
201
|
-
DataPacketReceived = "dataPacketReceived",
|
202
|
-
RemoteMuteChanged = "remoteMuteChanged",
|
203
|
-
RoomUpdate = "roomUpdate",
|
204
|
-
ConnectionQualityUpdate = "connectionQualityUpdate"
|
313
|
+
DataPacketReceived = "dataPacketReceived"
|
205
314
|
}
|
206
315
|
export declare enum TrackEvent {
|
207
316
|
Message = "message",
|
package/dist/room/events.js
CHANGED
@@ -149,6 +149,17 @@ var RoomEvent;
|
|
149
149
|
* args: (payload: Uint8Array, participant: [[Participant]], kind: [[DataPacket_Kind]])
|
150
150
|
*/
|
151
151
|
RoomEvent["DataReceived"] = "dataReceived";
|
152
|
+
/**
|
153
|
+
* StreamState indicates if a subscribed track has been paused by the SFU
|
154
|
+
* (typically this happens because of subscriber's bandwidth constraints)
|
155
|
+
*
|
156
|
+
* When bandwidth conditions allow, the track will be resumed automatically.
|
157
|
+
* TrackStreamStateChanged will also be emitted when that happens.
|
158
|
+
*
|
159
|
+
* args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]],
|
160
|
+
* participant: [[RemoteParticipant]])
|
161
|
+
*/
|
162
|
+
RoomEvent["TrackStreamStateChanged"] = "trackStreamStateChanged";
|
152
163
|
/**
|
153
164
|
* LiveKit will attempt to autoplay all audio tracks when you attach them to
|
154
165
|
* audio elements. However, if that fails, we'll notify you via AudioPlaybackStatusChanged.
|
@@ -176,20 +187,123 @@ var RoomEvent;
|
|
176
187
|
})(RoomEvent = exports.RoomEvent || (exports.RoomEvent = {}));
|
177
188
|
var ParticipantEvent;
|
178
189
|
(function (ParticipantEvent) {
|
190
|
+
/**
|
191
|
+
* When a new track is published to room *after* the local
|
192
|
+
* participant has joined. It will not fire for tracks that are already published.
|
193
|
+
*
|
194
|
+
* A track published doesn't mean the participant has subscribed to it. It's
|
195
|
+
* simply reflecting the state of the room.
|
196
|
+
*
|
197
|
+
* args: ([[RemoteTrackPublication]])
|
198
|
+
*/
|
179
199
|
ParticipantEvent["TrackPublished"] = "trackPublished";
|
200
|
+
/**
|
201
|
+
* The [[LocalParticipant]] has subscribed to a new track. This event will **always**
|
202
|
+
* fire as long as new tracks are ready for use.
|
203
|
+
*
|
204
|
+
* args: ([[RemoteTrack]], [[RemoteTrackPublication]])
|
205
|
+
*/
|
180
206
|
ParticipantEvent["TrackSubscribed"] = "trackSubscribed";
|
207
|
+
/**
|
208
|
+
* Could not subscribe to a track
|
209
|
+
*
|
210
|
+
* args: (track sid)
|
211
|
+
*/
|
181
212
|
ParticipantEvent["TrackSubscriptionFailed"] = "trackSubscriptionFailed";
|
213
|
+
/**
|
214
|
+
* A local track was unpublished. This event is helpful to know when to remove
|
215
|
+
* the local track from your UI.
|
216
|
+
*
|
217
|
+
* When a user stops sharing their screen by pressing "End" on the browser UI,
|
218
|
+
* this event will also fire.
|
219
|
+
*
|
220
|
+
* args: ([[LocalTrackPublication]])
|
221
|
+
*/
|
182
222
|
ParticipantEvent["TrackUnpublished"] = "trackUnpublished";
|
223
|
+
/**
|
224
|
+
* A subscribed track is no longer available. Clients should listen to this
|
225
|
+
* event and ensure they detach tracks.
|
226
|
+
*
|
227
|
+
* args: ([[Track]], [[RemoteTrackPublication]])
|
228
|
+
*/
|
183
229
|
ParticipantEvent["TrackUnsubscribed"] = "trackUnsubscribed";
|
230
|
+
/**
|
231
|
+
* A track that was muted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
|
232
|
+
*
|
233
|
+
* args: ([[TrackPublication]])
|
234
|
+
*/
|
184
235
|
ParticipantEvent["TrackMuted"] = "trackMuted";
|
236
|
+
/**
|
237
|
+
* A track that was unmuted, fires on both [[RemoteParticipant]]s and [[LocalParticipant]]
|
238
|
+
*
|
239
|
+
* args: ([[TrackPublication]])
|
240
|
+
*/
|
185
241
|
ParticipantEvent["TrackUnmuted"] = "trackUnmuted";
|
242
|
+
/**
|
243
|
+
* A local track was published successfully. This event is helpful to know
|
244
|
+
* when to update your local UI with the newly published track.
|
245
|
+
*
|
246
|
+
* args: ([[LocalTrackPublication]])
|
247
|
+
*/
|
186
248
|
ParticipantEvent["LocalTrackPublished"] = "localTrackPublished";
|
249
|
+
/**
|
250
|
+
* A local track was unpublished. This event is helpful to know when to remove
|
251
|
+
* the local track from your UI.
|
252
|
+
*
|
253
|
+
* When a user stops sharing their screen by pressing "End" on the browser UI,
|
254
|
+
* this event will also fire.
|
255
|
+
*
|
256
|
+
* args: ([[LocalTrackPublication]])
|
257
|
+
*/
|
187
258
|
ParticipantEvent["LocalTrackUnpublished"] = "localTrackUnpublished";
|
259
|
+
/**
|
260
|
+
* @deprecated Use ParticipantMetadataChanged instead
|
261
|
+
* @internal
|
262
|
+
*/
|
188
263
|
ParticipantEvent["MetadataChanged"] = "metadataChanged";
|
264
|
+
/**
|
265
|
+
* Participant metadata is a simple way for app-specific state to be pushed to
|
266
|
+
* all users.
|
267
|
+
* When RoomService.UpdateParticipantMetadata is called to change a participant's
|
268
|
+
* state, *all* participants in the room will fire this event.
|
269
|
+
* To access the current metadata, see [[Participant.metadata]].
|
270
|
+
*
|
271
|
+
* args: (prevMetadata: string)
|
272
|
+
*
|
273
|
+
*/
|
189
274
|
ParticipantEvent["ParticipantMetadataChanged"] = "participantMetadataChanged";
|
275
|
+
/**
|
276
|
+
* Data received from this participant as sender.
|
277
|
+
* Data packets provides the ability to use LiveKit to send/receive arbitrary payloads.
|
278
|
+
* All participants in the room will receive the messages sent to the room.
|
279
|
+
*
|
280
|
+
* args: (payload: Uint8Array, kind: [[DataPacket_Kind]])
|
281
|
+
*/
|
190
282
|
ParticipantEvent["DataReceived"] = "dataReceived";
|
283
|
+
/**
|
284
|
+
* Has speaking status changed for the current participant
|
285
|
+
*
|
286
|
+
* args: (speaking: boolean)
|
287
|
+
*/
|
191
288
|
ParticipantEvent["IsSpeakingChanged"] = "isSpeakingChanged";
|
289
|
+
/**
|
290
|
+
* Connection quality was changed for a Participant. It'll receive updates
|
291
|
+
* from the local participant, as well as any [[RemoteParticipant]]s that we are
|
292
|
+
* subscribed to.
|
293
|
+
*
|
294
|
+
* args: (connectionQuality: [[ConnectionQuality]])
|
295
|
+
*/
|
192
296
|
ParticipantEvent["ConnectionQualityChanged"] = "connectionQualityChanged";
|
297
|
+
/**
|
298
|
+
* StreamState indicates if a subscribed track has been paused by the SFU
|
299
|
+
* (typically this happens because of subscriber's bandwidth constraints)
|
300
|
+
*
|
301
|
+
* When bandwidth conditions allow, the track will be resumed automatically.
|
302
|
+
* TrackStreamStateChanged will also be emitted when that happens.
|
303
|
+
*
|
304
|
+
* args: (pub: [[RemoteTrackPublication]], streamState: [[Track.StreamState]])
|
305
|
+
*/
|
306
|
+
ParticipantEvent["TrackStreamStateChanged"] = "trackStreamStateChanged";
|
193
307
|
// fired only on LocalParticipant
|
194
308
|
/** @internal */
|
195
309
|
ParticipantEvent["MediaDevicesError"] = "mediaDevicesError";
|
@@ -201,14 +315,9 @@ var EngineEvent;
|
|
201
315
|
EngineEvent["Disconnected"] = "disconnected";
|
202
316
|
EngineEvent["Reconnecting"] = "reconnecting";
|
203
317
|
EngineEvent["Reconnected"] = "reconnected";
|
204
|
-
EngineEvent["ParticipantUpdate"] = "participantUpdate";
|
205
318
|
EngineEvent["MediaTrackAdded"] = "mediaTrackAdded";
|
206
319
|
EngineEvent["ActiveSpeakersUpdate"] = "activeSpeakersUpdate";
|
207
|
-
EngineEvent["SpeakersChanged"] = "speakersChanged";
|
208
320
|
EngineEvent["DataPacketReceived"] = "dataPacketReceived";
|
209
|
-
EngineEvent["RemoteMuteChanged"] = "remoteMuteChanged";
|
210
|
-
EngineEvent["RoomUpdate"] = "roomUpdate";
|
211
|
-
EngineEvent["ConnectionQualityUpdate"] = "connectionQualityUpdate";
|
212
321
|
})(EngineEvent = exports.EngineEvent || (exports.EngineEvent = {}));
|
213
322
|
var TrackEvent;
|
214
323
|
(function (TrackEvent) {
|
package/dist/room/events.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/room/events.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,IAAY,
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/room/events.ts"],"names":[],"mappings":"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"}
|
@@ -1,21 +1,26 @@
|
|
1
|
+
import { RoomOptions } from '../../options';
|
1
2
|
import { DataPacket_Kind } from '../../proto/livekit_models';
|
2
3
|
import RTCEngine from '../RTCEngine';
|
3
4
|
import LocalTrack from '../track/LocalTrack';
|
4
5
|
import LocalTrackPublication from '../track/LocalTrackPublication';
|
5
|
-
import { TrackPublishOptions } from '../track/options';
|
6
|
+
import { CreateLocalTracksOptions, ScreenShareCaptureOptions, TrackPublishOptions } from '../track/options';
|
6
7
|
import { Track } from '../track/Track';
|
7
8
|
import Participant from './Participant';
|
8
9
|
import RemoteParticipant from './RemoteParticipant';
|
9
10
|
export default class LocalParticipant extends Participant {
|
10
|
-
private engine;
|
11
11
|
audioTracks: Map<string, LocalTrackPublication>;
|
12
12
|
videoTracks: Map<string, LocalTrackPublication>;
|
13
13
|
/** map of track sid => all published tracks */
|
14
14
|
tracks: Map<string, LocalTrackPublication>;
|
15
|
+
private pendingPublishing;
|
16
|
+
private cameraError;
|
17
|
+
private microphoneError;
|
18
|
+
private engine;
|
19
|
+
private roomOptions?;
|
15
20
|
/** @internal */
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
constructor(sid: string, identity: string, engine: RTCEngine, options: RoomOptions);
|
22
|
+
get lastCameraError(): Error | undefined;
|
23
|
+
get lastMicrophoneError(): Error | undefined;
|
19
24
|
getTrack(source: Track.Source): LocalTrackPublication | undefined;
|
20
25
|
getTrackByName(name: string): LocalTrackPublication | undefined;
|
21
26
|
/**
|
@@ -39,6 +44,23 @@ export default class LocalParticipant extends Participant {
|
|
39
44
|
* way to manage the common tracks (camera, mic, or screen share)
|
40
45
|
*/
|
41
46
|
private setTrackEnabled;
|
47
|
+
/**
|
48
|
+
* Publish both camera and microphone at the same time. This is useful for
|
49
|
+
* displaying a single Permission Dialog box to the end user.
|
50
|
+
*/
|
51
|
+
enableCameraAndMicrophone(): Promise<void>;
|
52
|
+
/**
|
53
|
+
* Create local camera and/or microphone tracks
|
54
|
+
* @param options
|
55
|
+
* @returns
|
56
|
+
*/
|
57
|
+
createTracks(options?: CreateLocalTracksOptions): Promise<LocalTrack[]>;
|
58
|
+
/**
|
59
|
+
* Creates a screen capture tracks with getDisplayMedia().
|
60
|
+
* A LocalVideoTrack is always created and returned.
|
61
|
+
* If { audio: true }, and the browser supports audio capture, a LocalAudioTrack is also created.
|
62
|
+
*/
|
63
|
+
createScreenTracks(options?: ScreenShareCaptureOptions): Promise<Array<LocalTrack>>;
|
42
64
|
/**
|
43
65
|
* Publish a new track to the room
|
44
66
|
* @param track
|
@@ -64,12 +86,8 @@ export default class LocalParticipant extends Participant {
|
|
64
86
|
onTrackUnmuted: (track: LocalTrack) => void;
|
65
87
|
/** @internal */
|
66
88
|
onTrackMuted: (track: LocalTrack, muted?: boolean | undefined) => void;
|
89
|
+
private handleSubscribedQualityUpdate;
|
90
|
+
private onTrackUnpublish;
|
67
91
|
private getPublicationForTrack;
|
68
92
|
private setPreferredCodec;
|
69
|
-
private computeVideoEncodings;
|
70
|
-
private presets169;
|
71
|
-
private presets43;
|
72
|
-
private presetsScreenShare;
|
73
|
-
private determineAppropriateEncoding;
|
74
|
-
private presetsForResolution;
|
75
93
|
}
|