mediasoup-client 3.6.67 → 3.6.69

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 (57) hide show
  1. package/lib/Consumer.d.ts +4 -3
  2. package/lib/Consumer.d.ts.map +1 -1
  3. package/lib/Consumer.js +9 -9
  4. package/lib/DataConsumer.d.ts +1 -1
  5. package/lib/DataConsumer.d.ts.map +1 -1
  6. package/lib/DataConsumer.js +2 -2
  7. package/lib/DataProducer.d.ts +1 -1
  8. package/lib/DataProducer.d.ts.map +1 -1
  9. package/lib/DataProducer.js +2 -2
  10. package/lib/Device.d.ts +1 -1
  11. package/lib/Device.d.ts.map +1 -1
  12. package/lib/Device.js +5 -5
  13. package/lib/Producer.d.ts +3 -3
  14. package/lib/Producer.d.ts.map +1 -1
  15. package/lib/Producer.js +11 -11
  16. package/lib/Transport.d.ts +10 -10
  17. package/lib/Transport.d.ts.map +1 -1
  18. package/lib/Transport.js +49 -43
  19. package/lib/handlers/Chrome55.d.ts +3 -3
  20. package/lib/handlers/Chrome55.d.ts.map +1 -1
  21. package/lib/handlers/Chrome55.js +16 -17
  22. package/lib/handlers/Chrome67.d.ts +3 -3
  23. package/lib/handlers/Chrome67.d.ts.map +1 -1
  24. package/lib/handlers/Chrome67.js +21 -23
  25. package/lib/handlers/Chrome70.d.ts +3 -3
  26. package/lib/handlers/Chrome70.d.ts.map +1 -1
  27. package/lib/handlers/Chrome70.js +20 -20
  28. package/lib/handlers/Chrome74.d.ts +3 -3
  29. package/lib/handlers/Chrome74.d.ts.map +1 -1
  30. package/lib/handlers/Chrome74.js +24 -24
  31. package/lib/handlers/Edge11.d.ts +4 -4
  32. package/lib/handlers/Edge11.d.ts.map +1 -1
  33. package/lib/handlers/Edge11.js +11 -11
  34. package/lib/handlers/FakeHandler.d.ts +1 -1
  35. package/lib/handlers/FakeHandler.d.ts.map +1 -1
  36. package/lib/handlers/FakeHandler.js +5 -5
  37. package/lib/handlers/Firefox60.d.ts +3 -3
  38. package/lib/handlers/Firefox60.d.ts.map +1 -1
  39. package/lib/handlers/Firefox60.js +23 -23
  40. package/lib/handlers/HandlerInterface.d.ts +7 -0
  41. package/lib/handlers/HandlerInterface.d.ts.map +1 -1
  42. package/lib/handlers/ReactNative.d.ts +3 -3
  43. package/lib/handlers/ReactNative.d.ts.map +1 -1
  44. package/lib/handlers/ReactNative.js +14 -14
  45. package/lib/handlers/ReactNativeUnifiedPlan.d.ts +3 -3
  46. package/lib/handlers/ReactNativeUnifiedPlan.d.ts.map +1 -1
  47. package/lib/handlers/ReactNativeUnifiedPlan.js +24 -24
  48. package/lib/handlers/Safari11.d.ts +3 -3
  49. package/lib/handlers/Safari11.d.ts.map +1 -1
  50. package/lib/handlers/Safari11.js +20 -20
  51. package/lib/handlers/Safari12.d.ts +3 -3
  52. package/lib/handlers/Safari12.d.ts.map +1 -1
  53. package/lib/handlers/Safari12.js +24 -24
  54. package/lib/index.d.ts +1 -1
  55. package/lib/index.js +1 -1
  56. package/npm-scripts.js +1 -1
  57. package/package.json +8 -8
@@ -205,7 +205,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
205
205
  }
206
206
  async send({ track, encodings, codecOptions, codec }) {
207
207
  var _a;
208
- this._assertSendDirection();
208
+ this.assertSendDirection();
209
209
  logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);
210
210
  if (codec) {
211
211
  logger.warn('send() | codec selection is not available in %s handler', this.name);
@@ -222,7 +222,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
222
222
  sendingRemoteRtpParameters.codecs =
223
223
  ortc.reduceCodecs(sendingRemoteRtpParameters.codecs);
224
224
  if (!this._transportReady) {
225
- await this._setupTransport({
225
+ await this.setupTransport({
226
226
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
227
227
  localSdpObject
228
228
  });
@@ -287,7 +287,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
287
287
  };
288
288
  }
289
289
  async stopSending(localId) {
290
- this._assertSendDirection();
290
+ this.assertSendDirection();
291
291
  logger.debug('stopSending() [localId:%s]', localId);
292
292
  const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
293
293
  if (!rtpSender)
@@ -325,7 +325,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
325
325
  // Unimplemented.
326
326
  }
327
327
  async replaceTrack(localId, track) {
328
- this._assertSendDirection();
328
+ this.assertSendDirection();
329
329
  if (track) {
330
330
  logger.debug('replaceTrack() [localId:%s, track.id:%s]', localId, track.id);
331
331
  }
@@ -345,7 +345,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
345
345
  this._sendStream.addTrack(track);
346
346
  }
347
347
  async setMaxSpatialLayer(localId, spatialLayer) {
348
- this._assertSendDirection();
348
+ this.assertSendDirection();
349
349
  logger.debug('setMaxSpatialLayer() [localId:%s, spatialLayer:%s]', localId, spatialLayer);
350
350
  const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
351
351
  if (!rtpSender)
@@ -360,7 +360,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
360
360
  await rtpSender.setParameters(parameters);
361
361
  }
362
362
  async setRtpEncodingParameters(localId, params) {
363
- this._assertSendDirection();
363
+ this.assertSendDirection();
364
364
  logger.debug('setRtpEncodingParameters() [localId:%s, params:%o]', localId, params);
365
365
  const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
366
366
  if (!rtpSender)
@@ -372,7 +372,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
372
372
  await rtpSender.setParameters(parameters);
373
373
  }
374
374
  async getSenderStats(localId) {
375
- this._assertSendDirection();
375
+ this.assertSendDirection();
376
376
  const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
377
377
  if (!rtpSender)
378
378
  throw new Error('associated RTCRtpSender not found');
@@ -380,7 +380,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
380
380
  }
381
381
  async sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol }) {
382
382
  var _a;
383
- this._assertSendDirection();
383
+ this.assertSendDirection();
384
384
  const options = {
385
385
  negotiated: true,
386
386
  id: this._nextSendSctpStreamId,
@@ -403,7 +403,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
403
403
  const offerMediaObject = localSdpObject.media
404
404
  .find((m) => m.type === 'application');
405
405
  if (!this._transportReady) {
406
- await this._setupTransport({
406
+ await this.setupTransport({
407
407
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
408
408
  localSdpObject
409
409
  });
@@ -424,21 +424,19 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
424
424
  };
425
425
  return { dataChannel, sctpStreamParameters };
426
426
  }
427
- async receive(
428
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
429
- optionsList) {
427
+ async receive(optionsList) {
430
428
  var _a;
431
- this._assertRecvDirection();
429
+ this.assertRecvDirection();
432
430
  const results = [];
433
431
  for (const options of optionsList) {
434
- const { trackId, kind, rtpParameters } = options;
432
+ const { trackId, kind, rtpParameters, streamId } = options;
435
433
  logger.debug('receive() [trackId:%s, kind:%s]', trackId, kind);
436
434
  const mid = kind;
437
435
  this._remoteSdp.receive({
438
436
  mid,
439
437
  kind,
440
438
  offerRtpParameters: rtpParameters,
441
- streamId: rtpParameters.rtcp.cname,
439
+ streamId: streamId || rtpParameters.rtcp.cname,
442
440
  trackId
443
441
  });
444
442
  }
@@ -461,7 +459,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
461
459
  }
462
460
  answer = { type: 'answer', sdp: sdpTransform.write(localSdpObject) };
463
461
  if (!this._transportReady) {
464
- await this._setupTransport({
462
+ await this.setupTransport({
465
463
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
466
464
  localSdpObject
467
465
  });
@@ -487,7 +485,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
487
485
  return results;
488
486
  }
489
487
  async stopReceiving(localIds) {
490
- this._assertRecvDirection();
488
+ this.assertRecvDirection();
491
489
  for (const localId of localIds) {
492
490
  logger.debug('stopReceiving() [localId:%s]', localId);
493
491
  const { mid, rtpParameters } = this._mapRecvLocalIdInfo.get(localId) || {};
@@ -513,7 +511,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
513
511
  // Unimplemented.
514
512
  }
515
513
  async getReceiverStats(localId) {
516
- this._assertRecvDirection();
514
+ this.assertRecvDirection();
517
515
  const { rtpReceiver } = this._mapRecvLocalIdInfo.get(localId) || {};
518
516
  if (!rtpReceiver)
519
517
  throw new Error('associated RTCRtpReceiver not found');
@@ -521,7 +519,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
521
519
  }
522
520
  async receiveDataChannel({ sctpStreamParameters, label, protocol }) {
523
521
  var _a;
524
- this._assertRecvDirection();
522
+ this.assertRecvDirection();
525
523
  const { streamId, ordered, maxPacketLifeTime, maxRetransmits } = sctpStreamParameters;
526
524
  const options = {
527
525
  negotiated: true,
@@ -544,7 +542,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
544
542
  const answer = await this._pc.createAnswer();
545
543
  if (!this._transportReady) {
546
544
  const localSdpObject = sdpTransform.parse(answer.sdp);
547
- await this._setupTransport({
545
+ await this.setupTransport({
548
546
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
549
547
  localSdpObject
550
548
  });
@@ -555,7 +553,7 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
555
553
  }
556
554
  return { dataChannel };
557
555
  }
558
- async _setupTransport({ localDtlsRole, localSdpObject }) {
556
+ async setupTransport({ localDtlsRole, localSdpObject }) {
559
557
  if (!localSdpObject)
560
558
  localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
561
559
  // Get our local DTLS parameters.
@@ -570,12 +568,12 @@ class Chrome67 extends HandlerInterface_1.HandlerInterface {
570
568
  });
571
569
  this._transportReady = true;
572
570
  }
573
- _assertSendDirection() {
571
+ assertSendDirection() {
574
572
  if (this._direction !== 'send') {
575
573
  throw new Error('method can just be called for handlers with "send" direction');
576
574
  }
577
575
  }
578
- _assertRecvDirection() {
576
+ assertRecvDirection() {
579
577
  if (this._direction !== 'recv') {
580
578
  throw new Error('method can just be called for handlers with "recv" direction');
581
579
  }
@@ -42,8 +42,8 @@ export declare class Chrome70 extends HandlerInterface {
42
42
  resumeReceiving(localIds: string[]): Promise<void>;
43
43
  getReceiverStats(localId: string): Promise<RTCStatsReport>;
44
44
  receiveDataChannel({ sctpStreamParameters, label, protocol }: HandlerReceiveDataChannelOptions): Promise<HandlerReceiveDataChannelResult>;
45
- private _setupTransport;
46
- private _assertSendDirection;
47
- private _assertRecvDirection;
45
+ private setupTransport;
46
+ private assertSendDirection;
47
+ private assertRecvDirection;
48
48
  }
49
49
  //# sourceMappingURL=Chrome70.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chrome70.d.ts","sourceRoot":"","sources":["../../src/handlers/Chrome70.ts"],"names":[],"mappings":"AAMA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,aAAa,EAAY,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAwB,MAAM,mBAAmB,CAAC;AAM3E,qBAAa,QAAS,SAAQ,gBAAgB;IAG7C,OAAO,CAAC,UAAU,CAAC,CAAkB;IAErC,OAAO,CAAC,UAAU,CAAC,CAAY;IAE/B,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAGvE,OAAO,CAAC,iCAAiC,CAAC,CAAmC;IAG7E,OAAO,CAAC,oBAAoB,CAAC,CAA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OAAO,CAAC,+BAA+B,CAAC;YAiE7B,cAAc;IAuC5B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;CAQ3B"}
@@ -199,7 +199,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
199
199
  }
200
200
  async send({ track, encodings, codecOptions, codec }) {
201
201
  var _a;
202
- this._assertSendDirection();
202
+ this.assertSendDirection();
203
203
  logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);
204
204
  const sendingRtpParameters = utils.clone(this._sendingRtpParametersByKind[track.kind], {});
205
205
  // This may throw.
@@ -215,7 +215,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
215
215
  let localSdpObject = sdpTransform.parse(offer.sdp);
216
216
  let offerMediaObject;
217
217
  if (!this._transportReady) {
218
- await this._setupTransport({
218
+ await this.setupTransport({
219
219
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
220
220
  localSdpObject
221
221
  });
@@ -314,7 +314,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
314
314
  };
315
315
  }
316
316
  async stopSending(localId) {
317
- this._assertSendDirection();
317
+ this.assertSendDirection();
318
318
  logger.debug('stopSending() [localId:%s]', localId);
319
319
  const transceiver = this._mapMidTransceiver.get(localId);
320
320
  if (!transceiver)
@@ -345,7 +345,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
345
345
  // Unimplemented.
346
346
  }
347
347
  async replaceTrack(localId, track) {
348
- this._assertSendDirection();
348
+ this.assertSendDirection();
349
349
  if (track) {
350
350
  logger.debug('replaceTrack() [localId:%s, track.id:%s]', localId, track.id);
351
351
  }
@@ -358,7 +358,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
358
358
  await transceiver.sender.replaceTrack(track);
359
359
  }
360
360
  async setMaxSpatialLayer(localId, spatialLayer) {
361
- this._assertSendDirection();
361
+ this.assertSendDirection();
362
362
  logger.debug('setMaxSpatialLayer() [localId:%s, spatialLayer:%s]', localId, spatialLayer);
363
363
  const transceiver = this._mapMidTransceiver.get(localId);
364
364
  if (!transceiver)
@@ -373,7 +373,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
373
373
  await transceiver.sender.setParameters(parameters);
374
374
  }
375
375
  async setRtpEncodingParameters(localId, params) {
376
- this._assertSendDirection();
376
+ this.assertSendDirection();
377
377
  logger.debug('setRtpEncodingParameters() [localId:%s, params:%o]', localId, params);
378
378
  const transceiver = this._mapMidTransceiver.get(localId);
379
379
  if (!transceiver)
@@ -385,7 +385,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
385
385
  await transceiver.sender.setParameters(parameters);
386
386
  }
387
387
  async getSenderStats(localId) {
388
- this._assertSendDirection();
388
+ this.assertSendDirection();
389
389
  const transceiver = this._mapMidTransceiver.get(localId);
390
390
  if (!transceiver)
391
391
  throw new Error('associated RTCRtpTransceiver not found');
@@ -393,7 +393,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
393
393
  }
394
394
  async sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol }) {
395
395
  var _a;
396
- this._assertSendDirection();
396
+ this.assertSendDirection();
397
397
  const options = {
398
398
  negotiated: true,
399
399
  id: this._nextSendSctpStreamId,
@@ -416,7 +416,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
416
416
  const offerMediaObject = localSdpObject.media
417
417
  .find((m) => m.type === 'application');
418
418
  if (!this._transportReady) {
419
- await this._setupTransport({
419
+ await this.setupTransport({
420
420
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
421
421
  localSdpObject
422
422
  });
@@ -439,11 +439,11 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
439
439
  }
440
440
  async receive(optionsList) {
441
441
  var _a;
442
- this._assertRecvDirection();
442
+ this.assertRecvDirection();
443
443
  const results = [];
444
444
  const mapLocalId = new Map();
445
445
  for (const options of optionsList) {
446
- const { trackId, kind, rtpParameters } = options;
446
+ const { trackId, kind, rtpParameters, streamId } = options;
447
447
  logger.debug('receive() [trackId:%s, kind:%s]', trackId, kind);
448
448
  const localId = rtpParameters.mid || String(this._mapMidTransceiver.size);
449
449
  mapLocalId.set(trackId, localId);
@@ -451,7 +451,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
451
451
  mid: localId,
452
452
  kind,
453
453
  offerRtpParameters: rtpParameters,
454
- streamId: rtpParameters.rtcp.cname,
454
+ streamId: streamId || rtpParameters.rtcp.cname,
455
455
  trackId
456
456
  });
457
457
  }
@@ -474,7 +474,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
474
474
  }
475
475
  answer = { type: 'answer', sdp: sdpTransform.write(localSdpObject) };
476
476
  if (!this._transportReady) {
477
- await this._setupTransport({
477
+ await this.setupTransport({
478
478
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
479
479
  localSdpObject
480
480
  });
@@ -499,7 +499,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
499
499
  return results;
500
500
  }
501
501
  async stopReceiving(localIds) {
502
- this._assertRecvDirection();
502
+ this.assertRecvDirection();
503
503
  for (const localId of localIds) {
504
504
  logger.debug('stopReceiving() [localId:%s]', localId);
505
505
  const transceiver = this._mapMidTransceiver.get(localId);
@@ -528,7 +528,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
528
528
  // Unimplemented.
529
529
  }
530
530
  async getReceiverStats(localId) {
531
- this._assertRecvDirection();
531
+ this.assertRecvDirection();
532
532
  const transceiver = this._mapMidTransceiver.get(localId);
533
533
  if (!transceiver)
534
534
  throw new Error('associated RTCRtpTransceiver not found');
@@ -536,7 +536,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
536
536
  }
537
537
  async receiveDataChannel({ sctpStreamParameters, label, protocol }) {
538
538
  var _a;
539
- this._assertRecvDirection();
539
+ this.assertRecvDirection();
540
540
  const { streamId, ordered, maxPacketLifeTime, maxRetransmits } = sctpStreamParameters;
541
541
  const options = {
542
542
  negotiated: true,
@@ -559,7 +559,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
559
559
  const answer = await this._pc.createAnswer();
560
560
  if (!this._transportReady) {
561
561
  const localSdpObject = sdpTransform.parse(answer.sdp);
562
- await this._setupTransport({
562
+ await this.setupTransport({
563
563
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
564
564
  localSdpObject
565
565
  });
@@ -570,7 +570,7 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
570
570
  }
571
571
  return { dataChannel };
572
572
  }
573
- async _setupTransport({ localDtlsRole, localSdpObject }) {
573
+ async setupTransport({ localDtlsRole, localSdpObject }) {
574
574
  if (!localSdpObject)
575
575
  localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
576
576
  // Get our local DTLS parameters.
@@ -585,12 +585,12 @@ class Chrome70 extends HandlerInterface_1.HandlerInterface {
585
585
  });
586
586
  this._transportReady = true;
587
587
  }
588
- _assertSendDirection() {
588
+ assertSendDirection() {
589
589
  if (this._direction !== 'send') {
590
590
  throw new Error('method can just be called for handlers with "send" direction');
591
591
  }
592
592
  }
593
- _assertRecvDirection() {
593
+ assertRecvDirection() {
594
594
  if (this._direction !== 'recv') {
595
595
  throw new Error('method can just be called for handlers with "recv" direction');
596
596
  }
@@ -42,8 +42,8 @@ export declare class Chrome74 extends HandlerInterface {
42
42
  resumeReceiving(localIds: string[]): Promise<void>;
43
43
  getReceiverStats(localId: string): Promise<RTCStatsReport>;
44
44
  receiveDataChannel({ sctpStreamParameters, label, protocol }: HandlerReceiveDataChannelOptions): Promise<HandlerReceiveDataChannelResult>;
45
- private _setupTransport;
46
- private _assertSendDirection;
47
- private _assertRecvDirection;
45
+ private setupTransport;
46
+ private assertSendDirection;
47
+ private assertRecvDirection;
48
48
  }
49
49
  //# sourceMappingURL=Chrome74.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chrome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AAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAYxD,eAAe,CACpB,EACC,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,KAAK,EACL,QAAQ,EACR,EAAE,6BAA6B,GAC9B,OAAO,CAAC,4BAA4B,CAAC;IAsElC,OAAO,CACZ,WAAW,EAAE,qBAAqB,EAAE,GACjC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAkG7B,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsChD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCjD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkClD,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAY1D,kBAAkB,CACvB,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,gCAAgC,GACzE,OAAO,CAAC,+BAA+B,CAAC;YAgE7B,cAAc;IAuC5B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,mBAAmB;CAQ3B"}
@@ -199,7 +199,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
199
199
  }
200
200
  async send({ track, encodings, codecOptions, codec }) {
201
201
  var _a;
202
- this._assertSendDirection();
202
+ this.assertSendDirection();
203
203
  logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);
204
204
  if (encodings && encodings.length > 1) {
205
205
  encodings.forEach((encoding, idx) => {
@@ -224,7 +224,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
224
224
  let localSdpObject = sdpTransform.parse(offer.sdp);
225
225
  let offerMediaObject;
226
226
  if (!this._transportReady) {
227
- await this._setupTransport({
227
+ await this.setupTransport({
228
228
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
229
229
  localSdpObject
230
230
  });
@@ -305,7 +305,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
305
305
  };
306
306
  }
307
307
  async stopSending(localId) {
308
- this._assertSendDirection();
308
+ this.assertSendDirection();
309
309
  logger.debug('stopSending() [localId:%s]', localId);
310
310
  const transceiver = this._mapMidTransceiver.get(localId);
311
311
  if (!transceiver)
@@ -328,7 +328,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
328
328
  this._mapMidTransceiver.delete(localId);
329
329
  }
330
330
  async pauseSending(localId) {
331
- this._assertSendDirection();
331
+ this.assertSendDirection();
332
332
  logger.debug('pauseSending() [localId:%s]', localId);
333
333
  const transceiver = this._mapMidTransceiver.get(localId);
334
334
  if (!transceiver)
@@ -343,7 +343,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
343
343
  await this._pc.setRemoteDescription(answer);
344
344
  }
345
345
  async resumeSending(localId) {
346
- this._assertSendDirection();
346
+ this.assertSendDirection();
347
347
  logger.debug('resumeSending() [localId:%s]', localId);
348
348
  const transceiver = this._mapMidTransceiver.get(localId);
349
349
  this._remoteSdp.resumeSendingMediaSection(localId);
@@ -358,7 +358,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
358
358
  await this._pc.setRemoteDescription(answer);
359
359
  }
360
360
  async replaceTrack(localId, track) {
361
- this._assertSendDirection();
361
+ this.assertSendDirection();
362
362
  if (track) {
363
363
  logger.debug('replaceTrack() [localId:%s, track.id:%s]', localId, track.id);
364
364
  }
@@ -371,7 +371,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
371
371
  await transceiver.sender.replaceTrack(track);
372
372
  }
373
373
  async setMaxSpatialLayer(localId, spatialLayer) {
374
- this._assertSendDirection();
374
+ this.assertSendDirection();
375
375
  logger.debug('setMaxSpatialLayer() [localId:%s, spatialLayer:%s]', localId, spatialLayer);
376
376
  const transceiver = this._mapMidTransceiver.get(localId);
377
377
  if (!transceiver)
@@ -386,7 +386,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
386
386
  await transceiver.sender.setParameters(parameters);
387
387
  }
388
388
  async setRtpEncodingParameters(localId, params) {
389
- this._assertSendDirection();
389
+ this.assertSendDirection();
390
390
  logger.debug('setRtpEncodingParameters() [localId:%s, params:%o]', localId, params);
391
391
  const transceiver = this._mapMidTransceiver.get(localId);
392
392
  if (!transceiver)
@@ -398,7 +398,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
398
398
  await transceiver.sender.setParameters(parameters);
399
399
  }
400
400
  async getSenderStats(localId) {
401
- this._assertSendDirection();
401
+ this.assertSendDirection();
402
402
  const transceiver = this._mapMidTransceiver.get(localId);
403
403
  if (!transceiver)
404
404
  throw new Error('associated RTCRtpTransceiver not found');
@@ -406,7 +406,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
406
406
  }
407
407
  async sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol }) {
408
408
  var _a;
409
- this._assertSendDirection();
409
+ this.assertSendDirection();
410
410
  const options = {
411
411
  negotiated: true,
412
412
  id: this._nextSendSctpStreamId,
@@ -428,7 +428,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
428
428
  const offerMediaObject = localSdpObject.media
429
429
  .find((m) => m.type === 'application');
430
430
  if (!this._transportReady) {
431
- await this._setupTransport({
431
+ await this.setupTransport({
432
432
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
433
433
  localSdpObject
434
434
  });
@@ -451,11 +451,11 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
451
451
  }
452
452
  async receive(optionsList) {
453
453
  var _a;
454
- this._assertRecvDirection();
454
+ this.assertRecvDirection();
455
455
  const results = [];
456
456
  const mapLocalId = new Map();
457
457
  for (const options of optionsList) {
458
- const { trackId, kind, rtpParameters } = options;
458
+ const { trackId, kind, rtpParameters, streamId } = options;
459
459
  logger.debug('receive() [trackId:%s, kind:%s]', trackId, kind);
460
460
  const localId = rtpParameters.mid || String(this._mapMidTransceiver.size);
461
461
  mapLocalId.set(trackId, localId);
@@ -463,7 +463,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
463
463
  mid: localId,
464
464
  kind,
465
465
  offerRtpParameters: rtpParameters,
466
- streamId: rtpParameters.rtcp.cname,
466
+ streamId: streamId || rtpParameters.rtcp.cname,
467
467
  trackId
468
468
  });
469
469
  }
@@ -486,7 +486,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
486
486
  }
487
487
  answer = { type: 'answer', sdp: sdpTransform.write(localSdpObject) };
488
488
  if (!this._transportReady) {
489
- await this._setupTransport({
489
+ await this.setupTransport({
490
490
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
491
491
  localSdpObject
492
492
  });
@@ -514,7 +514,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
514
514
  return results;
515
515
  }
516
516
  async stopReceiving(localIds) {
517
- this._assertRecvDirection();
517
+ this.assertRecvDirection();
518
518
  for (const localId of localIds) {
519
519
  logger.debug('stopReceiving() [localId:%s]', localId);
520
520
  const transceiver = this._mapMidTransceiver.get(localId);
@@ -533,7 +533,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
533
533
  }
534
534
  }
535
535
  async pauseReceiving(localIds) {
536
- this._assertRecvDirection();
536
+ this.assertRecvDirection();
537
537
  for (const localId of localIds) {
538
538
  logger.debug('pauseReceiving() [localId:%s]', localId);
539
539
  const transceiver = this._mapMidTransceiver.get(localId);
@@ -550,7 +550,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
550
550
  await this._pc.setLocalDescription(answer);
551
551
  }
552
552
  async resumeReceiving(localIds) {
553
- this._assertRecvDirection();
553
+ this.assertRecvDirection();
554
554
  for (const localId of localIds) {
555
555
  logger.debug('resumeReceiving() [localId:%s]', localId);
556
556
  const transceiver = this._mapMidTransceiver.get(localId);
@@ -567,7 +567,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
567
567
  await this._pc.setLocalDescription(answer);
568
568
  }
569
569
  async getReceiverStats(localId) {
570
- this._assertRecvDirection();
570
+ this.assertRecvDirection();
571
571
  const transceiver = this._mapMidTransceiver.get(localId);
572
572
  if (!transceiver)
573
573
  throw new Error('associated RTCRtpTransceiver not found');
@@ -575,7 +575,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
575
575
  }
576
576
  async receiveDataChannel({ sctpStreamParameters, label, protocol }) {
577
577
  var _a;
578
- this._assertRecvDirection();
578
+ this.assertRecvDirection();
579
579
  const { streamId, ordered, maxPacketLifeTime, maxRetransmits } = sctpStreamParameters;
580
580
  const options = {
581
581
  negotiated: true,
@@ -597,7 +597,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
597
597
  const answer = await this._pc.createAnswer();
598
598
  if (!this._transportReady) {
599
599
  const localSdpObject = sdpTransform.parse(answer.sdp);
600
- await this._setupTransport({
600
+ await this.setupTransport({
601
601
  localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
602
602
  localSdpObject
603
603
  });
@@ -608,7 +608,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
608
608
  }
609
609
  return { dataChannel };
610
610
  }
611
- async _setupTransport({ localDtlsRole, localSdpObject }) {
611
+ async setupTransport({ localDtlsRole, localSdpObject }) {
612
612
  if (!localSdpObject)
613
613
  localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
614
614
  // Get our local DTLS parameters.
@@ -623,12 +623,12 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
623
623
  });
624
624
  this._transportReady = true;
625
625
  }
626
- _assertSendDirection() {
626
+ assertSendDirection() {
627
627
  if (this._direction !== 'send') {
628
628
  throw new Error('method can just be called for handlers with "send" direction');
629
629
  }
630
630
  }
631
- _assertRecvDirection() {
631
+ assertRecvDirection() {
632
632
  if (this._direction !== 'recv') {
633
633
  throw new Error('method can just be called for handlers with "recv" direction');
634
634
  }
@@ -47,9 +47,9 @@ export declare class Edge11 extends HandlerInterface {
47
47
  resumeReceiving(localIds: string[]): Promise<void>;
48
48
  getReceiverStats(localId: string): Promise<RTCStatsReport>;
49
49
  receiveDataChannel(options: HandlerReceiveDataChannelOptions): Promise<HandlerReceiveDataChannelResult>;
50
- private _setIceGatherer;
51
- private _setIceTransport;
52
- private _setDtlsTransport;
53
- private _setupTransport;
50
+ private setIceGatherer;
51
+ private setIceTransport;
52
+ private setDtlsTransport;
53
+ private setupTransport;
54
54
  }
55
55
  //# sourceMappingURL=Edge11.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edge11.d.ts","sourceRoot":"","sources":["../../src/handlers/Edge11.ts"],"names":[],"mappings":"AAKA,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,aAAa,EAIb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,qBAAa,MAAO,SAAQ,gBAAgB;IAG3C,OAAO,CAAC,2BAA2B,CAAC,CAAmC;IAEvE,OAAO,CAAC,oBAAoB,CAAC,CAAgB;IAE7C,OAAO,CAAC,oBAAoB,CAAC,CAAiB;IAE9C,OAAO,CAAC,qBAAqB,CAAC,CAAiB;IAE/C,OAAO,CAAC,YAAY,CAAC,CAAM;IAE3B,OAAO,CAAC,aAAa,CAAC,CAAM;IAE5B,OAAO,CAAC,cAAc,CAAC,CAAM;IAE7B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAwC;IAEpE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0C;IAExE,OAAO,CAAC,gBAAgB,CAAK;IAE7B,OAAO,C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