livekit-client 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -13336,7 +13336,7 @@ var uaParser = {
13336
13336
  })(uaParser, uaParserExports);
13337
13337
  var UAParser = uaParserExports;
13338
13338
 
13339
- var version$1 = "1.6.1";
13339
+ var version$1 = "1.6.2";
13340
13340
 
13341
13341
  const version = version$1;
13342
13342
  const protocolVersion = 8;
@@ -21170,11 +21170,12 @@ class Room extends eventsExports.EventEmitter {
21170
21170
  * No actual connection to a server will be established, all state is
21171
21171
  * @experimental
21172
21172
  */
21173
- simulateParticipants(options) {
21173
+ async simulateParticipants(options) {
21174
21174
  var _a, _b;
21175
21175
  const publishOptions = _objectSpread2({
21176
21176
  audio: true,
21177
- video: true
21177
+ video: true,
21178
+ useRealTracks: false
21178
21179
  }, options.publish);
21179
21180
  const participantOptions = _objectSpread2({
21180
21181
  count: 9,
@@ -21198,7 +21199,9 @@ class Room extends eventsExports.EventEmitter {
21198
21199
  sid: Math.floor(Math.random() * 10000).toString(),
21199
21200
  type: TrackType.AUDIO,
21200
21201
  name: 'video-dummy'
21201
- }), new LocalVideoTrack(createDummyVideoStreamTrack((_a = 160 * participantOptions.aspectRatios[0]) !== null && _a !== void 0 ? _a : 1, 160, true, true)));
21202
+ }), new LocalVideoTrack(publishOptions.useRealTracks ? (await navigator.mediaDevices.getUserMedia({
21203
+ video: true
21204
+ })).getVideoTracks()[0] : createDummyVideoStreamTrack((_a = 160 * participantOptions.aspectRatios[0]) !== null && _a !== void 0 ? _a : 1, 160, true, true)));
21202
21205
  // @ts-ignore
21203
21206
  this.localParticipant.addTrackPublication(camPub);
21204
21207
  this.localParticipant.emit(ParticipantEvent.LocalTrackPublished, camPub);
@@ -21208,7 +21211,9 @@ class Room extends eventsExports.EventEmitter {
21208
21211
  source: TrackSource.MICROPHONE,
21209
21212
  sid: Math.floor(Math.random() * 10000).toString(),
21210
21213
  type: TrackType.AUDIO
21211
- }), new LocalAudioTrack(getEmptyAudioStreamTrack()));
21214
+ }), new LocalAudioTrack(publishOptions.useRealTracks ? (await navigator.mediaDevices.getUserMedia({
21215
+ audio: true
21216
+ })).getAudioTracks()[0] : getEmptyAudioStreamTrack()));
21212
21217
  // @ts-ignore
21213
21218
  this.localParticipant.addTrackPublication(audioPub);
21214
21219
  this.localParticipant.emit(ParticipantEvent.LocalTrackPublished, audioPub);