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.
- package/lib/Consumer.d.ts +4 -3
- package/lib/Consumer.d.ts.map +1 -1
- package/lib/Consumer.js +9 -9
- package/lib/DataConsumer.d.ts +1 -1
- package/lib/DataConsumer.d.ts.map +1 -1
- package/lib/DataConsumer.js +2 -2
- package/lib/DataProducer.d.ts +1 -1
- package/lib/DataProducer.d.ts.map +1 -1
- package/lib/DataProducer.js +2 -2
- package/lib/Device.d.ts +1 -1
- package/lib/Device.d.ts.map +1 -1
- package/lib/Device.js +5 -5
- package/lib/Producer.d.ts +3 -3
- package/lib/Producer.d.ts.map +1 -1
- package/lib/Producer.js +11 -11
- package/lib/Transport.d.ts +10 -10
- package/lib/Transport.d.ts.map +1 -1
- package/lib/Transport.js +49 -43
- package/lib/handlers/Chrome55.d.ts +3 -3
- package/lib/handlers/Chrome55.d.ts.map +1 -1
- package/lib/handlers/Chrome55.js +16 -17
- package/lib/handlers/Chrome67.d.ts +3 -3
- package/lib/handlers/Chrome67.d.ts.map +1 -1
- package/lib/handlers/Chrome67.js +21 -23
- package/lib/handlers/Chrome70.d.ts +3 -3
- package/lib/handlers/Chrome70.d.ts.map +1 -1
- package/lib/handlers/Chrome70.js +20 -20
- package/lib/handlers/Chrome74.d.ts +3 -3
- package/lib/handlers/Chrome74.d.ts.map +1 -1
- package/lib/handlers/Chrome74.js +24 -24
- package/lib/handlers/Edge11.d.ts +4 -4
- package/lib/handlers/Edge11.d.ts.map +1 -1
- package/lib/handlers/Edge11.js +11 -11
- package/lib/handlers/FakeHandler.d.ts +1 -1
- package/lib/handlers/FakeHandler.d.ts.map +1 -1
- package/lib/handlers/FakeHandler.js +5 -5
- package/lib/handlers/Firefox60.d.ts +3 -3
- package/lib/handlers/Firefox60.d.ts.map +1 -1
- package/lib/handlers/Firefox60.js +23 -23
- package/lib/handlers/HandlerInterface.d.ts +7 -0
- package/lib/handlers/HandlerInterface.d.ts.map +1 -1
- package/lib/handlers/ReactNative.d.ts +3 -3
- package/lib/handlers/ReactNative.d.ts.map +1 -1
- package/lib/handlers/ReactNative.js +14 -14
- package/lib/handlers/ReactNativeUnifiedPlan.d.ts +3 -3
- package/lib/handlers/ReactNativeUnifiedPlan.d.ts.map +1 -1
- package/lib/handlers/ReactNativeUnifiedPlan.js +24 -24
- package/lib/handlers/Safari11.d.ts +3 -3
- package/lib/handlers/Safari11.d.ts.map +1 -1
- package/lib/handlers/Safari11.js +20 -20
- package/lib/handlers/Safari12.d.ts +3 -3
- package/lib/handlers/Safari12.d.ts.map +1 -1
- package/lib/handlers/Safari12.js +24 -24
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/npm-scripts.js +1 -1
- package/package.json +8 -8
|
@@ -203,7 +203,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
203
203
|
}
|
|
204
204
|
async send({ track, encodings, codecOptions, codec }) {
|
|
205
205
|
var _a;
|
|
206
|
-
this.
|
|
206
|
+
this.assertSendDirection();
|
|
207
207
|
logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);
|
|
208
208
|
if (encodings && encodings.length > 1) {
|
|
209
209
|
encodings.forEach((encoding, idx) => {
|
|
@@ -228,7 +228,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
228
228
|
let localSdpObject = sdpTransform.parse(offer.sdp);
|
|
229
229
|
let offerMediaObject;
|
|
230
230
|
if (!this._transportReady) {
|
|
231
|
-
await this.
|
|
231
|
+
await this.setupTransport({
|
|
232
232
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
233
233
|
localSdpObject
|
|
234
234
|
});
|
|
@@ -309,7 +309,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
async stopSending(localId) {
|
|
312
|
-
this.
|
|
312
|
+
this.assertSendDirection();
|
|
313
313
|
logger.debug('stopSending() [localId:%s]', localId);
|
|
314
314
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
315
315
|
if (!transceiver)
|
|
@@ -332,7 +332,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
332
332
|
this._mapMidTransceiver.delete(localId);
|
|
333
333
|
}
|
|
334
334
|
async pauseSending(localId) {
|
|
335
|
-
this.
|
|
335
|
+
this.assertSendDirection();
|
|
336
336
|
logger.debug('pauseSending() [localId:%s]', localId);
|
|
337
337
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
338
338
|
if (!transceiver)
|
|
@@ -347,7 +347,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
347
347
|
await this._pc.setRemoteDescription(answer);
|
|
348
348
|
}
|
|
349
349
|
async resumeSending(localId) {
|
|
350
|
-
this.
|
|
350
|
+
this.assertSendDirection();
|
|
351
351
|
logger.debug('resumeSending() [localId:%s]', localId);
|
|
352
352
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
353
353
|
this._remoteSdp.resumeSendingMediaSection(localId);
|
|
@@ -362,7 +362,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
362
362
|
await this._pc.setRemoteDescription(answer);
|
|
363
363
|
}
|
|
364
364
|
async replaceTrack(localId, track) {
|
|
365
|
-
this.
|
|
365
|
+
this.assertSendDirection();
|
|
366
366
|
if (track) {
|
|
367
367
|
logger.debug('replaceTrack() [localId:%s, track.id:%s]', localId, track.id);
|
|
368
368
|
}
|
|
@@ -375,7 +375,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
375
375
|
await transceiver.sender.replaceTrack(track);
|
|
376
376
|
}
|
|
377
377
|
async setMaxSpatialLayer(localId, spatialLayer) {
|
|
378
|
-
this.
|
|
378
|
+
this.assertSendDirection();
|
|
379
379
|
logger.debug('setMaxSpatialLayer() [localId:%s, spatialLayer:%s]', localId, spatialLayer);
|
|
380
380
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
381
381
|
if (!transceiver)
|
|
@@ -390,7 +390,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
390
390
|
await transceiver.sender.setParameters(parameters);
|
|
391
391
|
}
|
|
392
392
|
async setRtpEncodingParameters(localId, params) {
|
|
393
|
-
this.
|
|
393
|
+
this.assertSendDirection();
|
|
394
394
|
logger.debug('setRtpEncodingParameters() [localId:%s, params:%o]', localId, params);
|
|
395
395
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
396
396
|
if (!transceiver)
|
|
@@ -402,7 +402,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
402
402
|
await transceiver.sender.setParameters(parameters);
|
|
403
403
|
}
|
|
404
404
|
async getSenderStats(localId) {
|
|
405
|
-
this.
|
|
405
|
+
this.assertSendDirection();
|
|
406
406
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
407
407
|
if (!transceiver)
|
|
408
408
|
throw new Error('associated RTCRtpTransceiver not found');
|
|
@@ -410,7 +410,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
410
410
|
}
|
|
411
411
|
async sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol }) {
|
|
412
412
|
var _a;
|
|
413
|
-
this.
|
|
413
|
+
this.assertSendDirection();
|
|
414
414
|
const options = {
|
|
415
415
|
negotiated: true,
|
|
416
416
|
id: this._nextSendSctpStreamId,
|
|
@@ -432,7 +432,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
432
432
|
const offerMediaObject = localSdpObject.media
|
|
433
433
|
.find((m) => m.type === 'application');
|
|
434
434
|
if (!this._transportReady) {
|
|
435
|
-
await this.
|
|
435
|
+
await this.setupTransport({
|
|
436
436
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
437
437
|
localSdpObject
|
|
438
438
|
});
|
|
@@ -455,11 +455,11 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
455
455
|
}
|
|
456
456
|
async receive(optionsList) {
|
|
457
457
|
var _a;
|
|
458
|
-
this.
|
|
458
|
+
this.assertRecvDirection();
|
|
459
459
|
const results = [];
|
|
460
460
|
const mapLocalId = new Map();
|
|
461
461
|
for (const options of optionsList) {
|
|
462
|
-
const { trackId, kind, rtpParameters } = options;
|
|
462
|
+
const { trackId, kind, rtpParameters, streamId } = options;
|
|
463
463
|
logger.debug('receive() [trackId:%s, kind:%s]', trackId, kind);
|
|
464
464
|
const localId = rtpParameters.mid || String(this._mapMidTransceiver.size);
|
|
465
465
|
mapLocalId.set(trackId, localId);
|
|
@@ -467,7 +467,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
467
467
|
mid: localId,
|
|
468
468
|
kind,
|
|
469
469
|
offerRtpParameters: rtpParameters,
|
|
470
|
-
streamId: rtpParameters.rtcp.cname,
|
|
470
|
+
streamId: streamId || rtpParameters.rtcp.cname,
|
|
471
471
|
trackId
|
|
472
472
|
});
|
|
473
473
|
}
|
|
@@ -490,7 +490,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
490
490
|
}
|
|
491
491
|
answer = { type: 'answer', sdp: sdpTransform.write(localSdpObject) };
|
|
492
492
|
if (!this._transportReady) {
|
|
493
|
-
await this.
|
|
493
|
+
await this.setupTransport({
|
|
494
494
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
495
495
|
localSdpObject
|
|
496
496
|
});
|
|
@@ -518,7 +518,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
518
518
|
return results;
|
|
519
519
|
}
|
|
520
520
|
async stopReceiving(localIds) {
|
|
521
|
-
this.
|
|
521
|
+
this.assertRecvDirection();
|
|
522
522
|
for (const localId of localIds) {
|
|
523
523
|
logger.debug('stopReceiving() [localId:%s]', localId);
|
|
524
524
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
@@ -537,7 +537,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
async pauseReceiving(localIds) {
|
|
540
|
-
this.
|
|
540
|
+
this.assertRecvDirection();
|
|
541
541
|
for (const localId of localIds) {
|
|
542
542
|
logger.debug('pauseReceiving() [localId:%s]', localId);
|
|
543
543
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
@@ -554,7 +554,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
554
554
|
await this._pc.setLocalDescription(answer);
|
|
555
555
|
}
|
|
556
556
|
async resumeReceiving(localIds) {
|
|
557
|
-
this.
|
|
557
|
+
this.assertRecvDirection();
|
|
558
558
|
for (const localId of localIds) {
|
|
559
559
|
logger.debug('resumeReceiving() [localId:%s]', localId);
|
|
560
560
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
@@ -571,7 +571,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
571
571
|
await this._pc.setLocalDescription(answer);
|
|
572
572
|
}
|
|
573
573
|
async getReceiverStats(localId) {
|
|
574
|
-
this.
|
|
574
|
+
this.assertRecvDirection();
|
|
575
575
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
576
576
|
if (!transceiver)
|
|
577
577
|
throw new Error('associated RTCRtpTransceiver not found');
|
|
@@ -579,7 +579,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
579
579
|
}
|
|
580
580
|
async receiveDataChannel({ sctpStreamParameters, label, protocol }) {
|
|
581
581
|
var _a;
|
|
582
|
-
this.
|
|
582
|
+
this.assertRecvDirection();
|
|
583
583
|
const { streamId, ordered, maxPacketLifeTime, maxRetransmits } = sctpStreamParameters;
|
|
584
584
|
const options = {
|
|
585
585
|
negotiated: true,
|
|
@@ -601,7 +601,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
601
601
|
const answer = await this._pc.createAnswer();
|
|
602
602
|
if (!this._transportReady) {
|
|
603
603
|
const localSdpObject = sdpTransform.parse(answer.sdp);
|
|
604
|
-
await this.
|
|
604
|
+
await this.setupTransport({
|
|
605
605
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
606
606
|
localSdpObject
|
|
607
607
|
});
|
|
@@ -612,7 +612,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
612
612
|
}
|
|
613
613
|
return { dataChannel };
|
|
614
614
|
}
|
|
615
|
-
async
|
|
615
|
+
async setupTransport({ localDtlsRole, localSdpObject }) {
|
|
616
616
|
if (!localSdpObject)
|
|
617
617
|
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
|
|
618
618
|
// Get our local DTLS parameters.
|
|
@@ -627,12 +627,12 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
627
627
|
});
|
|
628
628
|
this._transportReady = true;
|
|
629
629
|
}
|
|
630
|
-
|
|
630
|
+
assertSendDirection() {
|
|
631
631
|
if (this._direction !== 'send') {
|
|
632
632
|
throw new Error('method can just be called for handlers with "send" direction');
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
assertRecvDirection() {
|
|
636
636
|
if (this._direction !== 'recv') {
|
|
637
637
|
throw new Error('method can just be called for handlers with "recv" direction');
|
|
638
638
|
}
|
|
@@ -44,8 +44,8 @@ export declare class Safari11 extends HandlerInterface {
|
|
|
44
44
|
pauseReceiving(localIds: string[]): Promise<void>;
|
|
45
45
|
resumeReceiving(localIds: string[]): Promise<void>;
|
|
46
46
|
receiveDataChannel({ sctpStreamParameters, label, protocol }: HandlerReceiveDataChannelOptions): Promise<HandlerReceiveDataChannelResult>;
|
|
47
|
-
private
|
|
48
|
-
private
|
|
49
|
-
private
|
|
47
|
+
private setupTransport;
|
|
48
|
+
private assertSendDirection;
|
|
49
|
+
private assertRecvDirection;
|
|
50
50
|
}
|
|
51
51
|
//# sourceMappingURL=Safari11.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Safari11.d.ts","sourceRoot":"","sources":["../../src/handlers/Safari11.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;AAE5B,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,CAAW;IAExC,OAAO,CAAC,GAAG,CAAM;IAEjB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAqB;IAEjD,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAC9B;IAEX,OAAO,CAAC,gBAAgB,CAAK;IAG7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAQrB;IAEf,OAAO,CAAC,2BAA2B,CAAS;IAE5C,OAAO,CAAC,qBAAqB,CAAK;IAElC,OAAO,CAAC,eAA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204
204
|
}
|
|
205
205
|
async send({ track, encodings, codecOptions, codec }) {
|
|
206
206
|
var _a;
|
|
207
|
-
this.
|
|
207
|
+
this.assertSendDirection();
|
|
208
208
|
logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);
|
|
209
209
|
if (codec) {
|
|
210
210
|
logger.warn('send() | codec selection is not available in %s handler', this.name);
|
|
@@ -221,7 +221,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
221
221
|
sendingRemoteRtpParameters.codecs =
|
|
222
222
|
ortc.reduceCodecs(sendingRemoteRtpParameters.codecs);
|
|
223
223
|
if (!this._transportReady) {
|
|
224
|
-
await this.
|
|
224
|
+
await this.setupTransport({
|
|
225
225
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
226
226
|
localSdpObject
|
|
227
227
|
});
|
|
@@ -285,7 +285,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
async stopSending(localId) {
|
|
288
|
-
this.
|
|
288
|
+
this.assertSendDirection();
|
|
289
289
|
const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
|
|
290
290
|
if (!rtpSender)
|
|
291
291
|
throw new Error('associated RTCRtpSender not found');
|
|
@@ -321,7 +321,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
321
321
|
// Unimplemented.
|
|
322
322
|
}
|
|
323
323
|
async replaceTrack(localId, track) {
|
|
324
|
-
this.
|
|
324
|
+
this.assertSendDirection();
|
|
325
325
|
if (track) {
|
|
326
326
|
logger.debug('replaceTrack() [localId:%s, track.id:%s]', localId, track.id);
|
|
327
327
|
}
|
|
@@ -341,7 +341,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
341
341
|
this._sendStream.addTrack(track);
|
|
342
342
|
}
|
|
343
343
|
async setMaxSpatialLayer(localId, spatialLayer) {
|
|
344
|
-
this.
|
|
344
|
+
this.assertSendDirection();
|
|
345
345
|
logger.debug('setMaxSpatialLayer() [localId:%s, spatialLayer:%s]', localId, spatialLayer);
|
|
346
346
|
const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
|
|
347
347
|
if (!rtpSender)
|
|
@@ -356,7 +356,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
356
356
|
await rtpSender.setParameters(parameters);
|
|
357
357
|
}
|
|
358
358
|
async setRtpEncodingParameters(localId, params) {
|
|
359
|
-
this.
|
|
359
|
+
this.assertSendDirection();
|
|
360
360
|
logger.debug('setRtpEncodingParameters() [localId:%s, params:%o]', localId, params);
|
|
361
361
|
const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
|
|
362
362
|
if (!rtpSender)
|
|
@@ -368,7 +368,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
368
368
|
await rtpSender.setParameters(parameters);
|
|
369
369
|
}
|
|
370
370
|
async getSenderStats(localId) {
|
|
371
|
-
this.
|
|
371
|
+
this.assertSendDirection();
|
|
372
372
|
const rtpSender = this._mapSendLocalIdRtpSender.get(localId);
|
|
373
373
|
if (!rtpSender)
|
|
374
374
|
throw new Error('associated RTCRtpSender not found');
|
|
@@ -376,7 +376,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
376
376
|
}
|
|
377
377
|
async sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol }) {
|
|
378
378
|
var _a;
|
|
379
|
-
this.
|
|
379
|
+
this.assertSendDirection();
|
|
380
380
|
const options = {
|
|
381
381
|
negotiated: true,
|
|
382
382
|
id: this._nextSendSctpStreamId,
|
|
@@ -398,7 +398,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
398
398
|
const offerMediaObject = localSdpObject.media
|
|
399
399
|
.find((m) => m.type === 'application');
|
|
400
400
|
if (!this._transportReady) {
|
|
401
|
-
await this.
|
|
401
|
+
await this.setupTransport({
|
|
402
402
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
403
403
|
localSdpObject
|
|
404
404
|
});
|
|
@@ -421,17 +421,17 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
421
421
|
}
|
|
422
422
|
async receive(optionsList) {
|
|
423
423
|
var _a;
|
|
424
|
-
this.
|
|
424
|
+
this.assertRecvDirection();
|
|
425
425
|
const results = [];
|
|
426
426
|
for (const options of optionsList) {
|
|
427
|
-
const { trackId, kind, rtpParameters } = options;
|
|
427
|
+
const { trackId, kind, rtpParameters, streamId } = options;
|
|
428
428
|
logger.debug('receive() [trackId:%s, kind:%s]', trackId, kind);
|
|
429
429
|
const mid = kind;
|
|
430
430
|
this._remoteSdp.receive({
|
|
431
431
|
mid,
|
|
432
432
|
kind,
|
|
433
433
|
offerRtpParameters: rtpParameters,
|
|
434
|
-
streamId: rtpParameters.rtcp.cname,
|
|
434
|
+
streamId: streamId || rtpParameters.rtcp.cname,
|
|
435
435
|
trackId
|
|
436
436
|
});
|
|
437
437
|
}
|
|
@@ -454,7 +454,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
454
454
|
}
|
|
455
455
|
answer = { type: 'answer', sdp: sdpTransform.write(localSdpObject) };
|
|
456
456
|
if (!this._transportReady) {
|
|
457
|
-
await this.
|
|
457
|
+
await this.setupTransport({
|
|
458
458
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
459
459
|
localSdpObject
|
|
460
460
|
});
|
|
@@ -480,7 +480,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
480
480
|
return results;
|
|
481
481
|
}
|
|
482
482
|
async stopReceiving(localIds) {
|
|
483
|
-
this.
|
|
483
|
+
this.assertRecvDirection();
|
|
484
484
|
for (const localId of localIds) {
|
|
485
485
|
logger.debug('stopReceiving() [localId:%s]', localId);
|
|
486
486
|
const { mid, rtpParameters } = this._mapRecvLocalIdInfo.get(localId) || {};
|
|
@@ -496,7 +496,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
496
496
|
await this._pc.setLocalDescription(answer);
|
|
497
497
|
}
|
|
498
498
|
async getReceiverStats(localId) {
|
|
499
|
-
this.
|
|
499
|
+
this.assertRecvDirection();
|
|
500
500
|
const { rtpReceiver } = this._mapRecvLocalIdInfo.get(localId) || {};
|
|
501
501
|
if (!rtpReceiver)
|
|
502
502
|
throw new Error('associated RTCRtpReceiver not found');
|
|
@@ -514,7 +514,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
514
514
|
}
|
|
515
515
|
async receiveDataChannel({ sctpStreamParameters, label, protocol }) {
|
|
516
516
|
var _a;
|
|
517
|
-
this.
|
|
517
|
+
this.assertRecvDirection();
|
|
518
518
|
const { streamId, ordered, maxPacketLifeTime, maxRetransmits } = sctpStreamParameters;
|
|
519
519
|
const options = {
|
|
520
520
|
negotiated: true,
|
|
@@ -536,7 +536,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
536
536
|
const answer = await this._pc.createAnswer();
|
|
537
537
|
if (!this._transportReady) {
|
|
538
538
|
const localSdpObject = sdpTransform.parse(answer.sdp);
|
|
539
|
-
await this.
|
|
539
|
+
await this.setupTransport({
|
|
540
540
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
541
541
|
localSdpObject
|
|
542
542
|
});
|
|
@@ -547,7 +547,7 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
547
547
|
}
|
|
548
548
|
return { dataChannel };
|
|
549
549
|
}
|
|
550
|
-
async
|
|
550
|
+
async setupTransport({ localDtlsRole, localSdpObject }) {
|
|
551
551
|
if (!localSdpObject)
|
|
552
552
|
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
|
|
553
553
|
// Get our local DTLS parameters.
|
|
@@ -562,12 +562,12 @@ class Safari11 extends HandlerInterface_1.HandlerInterface {
|
|
|
562
562
|
});
|
|
563
563
|
this._transportReady = true;
|
|
564
564
|
}
|
|
565
|
-
|
|
565
|
+
assertSendDirection() {
|
|
566
566
|
if (this._direction !== 'send') {
|
|
567
567
|
throw new Error('method can just be called for handlers with "send" direction');
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
|
|
570
|
+
assertRecvDirection() {
|
|
571
571
|
if (this._direction !== 'recv') {
|
|
572
572
|
throw new Error('method can just be called for handlers with "recv" direction');
|
|
573
573
|
}
|
|
@@ -42,8 +42,8 @@ export declare class Safari12 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
|
|
46
|
-
private
|
|
47
|
-
private
|
|
45
|
+
private setupTransport;
|
|
46
|
+
private assertSendDirection;
|
|
47
|
+
private assertRecvDirection;
|
|
48
48
|
}
|
|
49
49
|
//# sourceMappingURL=Safari12.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Safari12.d.ts","sourceRoot":"","sources":["../../src/handlers/Safari12.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;AAE5B,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;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C;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"}
|
package/lib/handlers/Safari12.js
CHANGED
|
@@ -196,7 +196,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
196
196
|
}
|
|
197
197
|
async send({ track, encodings, codecOptions, codec }) {
|
|
198
198
|
var _a;
|
|
199
|
-
this.
|
|
199
|
+
this.assertSendDirection();
|
|
200
200
|
logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id);
|
|
201
201
|
const sendingRtpParameters = utils.clone(this._sendingRtpParametersByKind[track.kind], {});
|
|
202
202
|
// This may throw.
|
|
@@ -212,7 +212,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
212
212
|
let localSdpObject = sdpTransform.parse(offer.sdp);
|
|
213
213
|
let offerMediaObject;
|
|
214
214
|
if (!this._transportReady) {
|
|
215
|
-
await this.
|
|
215
|
+
await this.setupTransport({
|
|
216
216
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
217
217
|
localSdpObject
|
|
218
218
|
});
|
|
@@ -276,7 +276,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
278
|
async stopSending(localId) {
|
|
279
|
-
this.
|
|
279
|
+
this.assertSendDirection();
|
|
280
280
|
logger.debug('stopSending() [localId:%s]', localId);
|
|
281
281
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
282
282
|
if (!transceiver)
|
|
@@ -300,7 +300,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
300
300
|
}
|
|
301
301
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
302
302
|
async pauseSending(localId) {
|
|
303
|
-
this.
|
|
303
|
+
this.assertSendDirection();
|
|
304
304
|
logger.debug('pauseSending() [localId:%s]', localId);
|
|
305
305
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
306
306
|
if (!transceiver)
|
|
@@ -316,7 +316,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
316
316
|
}
|
|
317
317
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
318
318
|
async resumeSending(localId) {
|
|
319
|
-
this.
|
|
319
|
+
this.assertSendDirection();
|
|
320
320
|
logger.debug('resumeSending() [localId:%s]', localId);
|
|
321
321
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
322
322
|
if (!transceiver)
|
|
@@ -331,7 +331,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
331
331
|
await this._pc.setRemoteDescription(answer);
|
|
332
332
|
}
|
|
333
333
|
async replaceTrack(localId, track) {
|
|
334
|
-
this.
|
|
334
|
+
this.assertSendDirection();
|
|
335
335
|
if (track) {
|
|
336
336
|
logger.debug('replaceTrack() [localId:%s, track.id:%s]', localId, track.id);
|
|
337
337
|
}
|
|
@@ -344,7 +344,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
344
344
|
await transceiver.sender.replaceTrack(track);
|
|
345
345
|
}
|
|
346
346
|
async setMaxSpatialLayer(localId, spatialLayer) {
|
|
347
|
-
this.
|
|
347
|
+
this.assertSendDirection();
|
|
348
348
|
logger.debug('setMaxSpatialLayer() [localId:%s, spatialLayer:%s]', localId, spatialLayer);
|
|
349
349
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
350
350
|
if (!transceiver)
|
|
@@ -359,7 +359,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
359
359
|
await transceiver.sender.setParameters(parameters);
|
|
360
360
|
}
|
|
361
361
|
async setRtpEncodingParameters(localId, params) {
|
|
362
|
-
this.
|
|
362
|
+
this.assertSendDirection();
|
|
363
363
|
logger.debug('setRtpEncodingParameters() [localId:%s, params:%o]', localId, params);
|
|
364
364
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
365
365
|
if (!transceiver)
|
|
@@ -371,7 +371,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
371
371
|
await transceiver.sender.setParameters(parameters);
|
|
372
372
|
}
|
|
373
373
|
async getSenderStats(localId) {
|
|
374
|
-
this.
|
|
374
|
+
this.assertSendDirection();
|
|
375
375
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
376
376
|
if (!transceiver)
|
|
377
377
|
throw new Error('associated RTCRtpTransceiver not found');
|
|
@@ -379,7 +379,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
379
379
|
}
|
|
380
380
|
async sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol }) {
|
|
381
381
|
var _a;
|
|
382
|
-
this.
|
|
382
|
+
this.assertSendDirection();
|
|
383
383
|
const options = {
|
|
384
384
|
negotiated: true,
|
|
385
385
|
id: this._nextSendSctpStreamId,
|
|
@@ -401,7 +401,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
401
401
|
const offerMediaObject = localSdpObject.media
|
|
402
402
|
.find((m) => m.type === 'application');
|
|
403
403
|
if (!this._transportReady) {
|
|
404
|
-
await this.
|
|
404
|
+
await this.setupTransport({
|
|
405
405
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
406
406
|
localSdpObject
|
|
407
407
|
});
|
|
@@ -424,11 +424,11 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
424
424
|
}
|
|
425
425
|
async receive(optionsList) {
|
|
426
426
|
var _a;
|
|
427
|
-
this.
|
|
427
|
+
this.assertRecvDirection();
|
|
428
428
|
const results = [];
|
|
429
429
|
const mapLocalId = new Map();
|
|
430
430
|
for (const options of optionsList) {
|
|
431
|
-
const { trackId, kind, rtpParameters } = options;
|
|
431
|
+
const { trackId, kind, rtpParameters, streamId } = options;
|
|
432
432
|
logger.debug('receive() [trackId:%s, kind:%s]', trackId, kind);
|
|
433
433
|
const localId = rtpParameters.mid || String(this._mapMidTransceiver.size);
|
|
434
434
|
mapLocalId.set(trackId, localId);
|
|
@@ -436,7 +436,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
436
436
|
mid: localId,
|
|
437
437
|
kind,
|
|
438
438
|
offerRtpParameters: rtpParameters,
|
|
439
|
-
streamId: rtpParameters.rtcp.cname,
|
|
439
|
+
streamId: streamId || rtpParameters.rtcp.cname,
|
|
440
440
|
trackId
|
|
441
441
|
});
|
|
442
442
|
}
|
|
@@ -459,7 +459,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
459
459
|
}
|
|
460
460
|
answer = { type: 'answer', sdp: sdpTransform.write(localSdpObject) };
|
|
461
461
|
if (!this._transportReady) {
|
|
462
|
-
await this.
|
|
462
|
+
await this.setupTransport({
|
|
463
463
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
464
464
|
localSdpObject
|
|
465
465
|
});
|
|
@@ -484,7 +484,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
484
484
|
return results;
|
|
485
485
|
}
|
|
486
486
|
async stopReceiving(localIds) {
|
|
487
|
-
this.
|
|
487
|
+
this.assertRecvDirection();
|
|
488
488
|
for (const localId of localIds) {
|
|
489
489
|
logger.debug('stopReceiving() [localId:%s]', localId);
|
|
490
490
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
@@ -503,7 +503,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
async pauseReceiving(localIds) {
|
|
506
|
-
this.
|
|
506
|
+
this.assertRecvDirection();
|
|
507
507
|
for (const localId of localIds) {
|
|
508
508
|
logger.debug('pauseReceiving() [localId:%s]', localId);
|
|
509
509
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
@@ -520,7 +520,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
520
520
|
await this._pc.setLocalDescription(answer);
|
|
521
521
|
}
|
|
522
522
|
async resumeReceiving(localIds) {
|
|
523
|
-
this.
|
|
523
|
+
this.assertRecvDirection();
|
|
524
524
|
for (const localId of localIds) {
|
|
525
525
|
logger.debug('resumeReceiving() [localId:%s]', localId);
|
|
526
526
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
@@ -537,7 +537,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
537
537
|
await this._pc.setLocalDescription(answer);
|
|
538
538
|
}
|
|
539
539
|
async getReceiverStats(localId) {
|
|
540
|
-
this.
|
|
540
|
+
this.assertRecvDirection();
|
|
541
541
|
const transceiver = this._mapMidTransceiver.get(localId);
|
|
542
542
|
if (!transceiver)
|
|
543
543
|
throw new Error('associated RTCRtpTransceiver not found');
|
|
@@ -545,7 +545,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
545
545
|
}
|
|
546
546
|
async receiveDataChannel({ sctpStreamParameters, label, protocol }) {
|
|
547
547
|
var _a;
|
|
548
|
-
this.
|
|
548
|
+
this.assertRecvDirection();
|
|
549
549
|
const { streamId, ordered, maxPacketLifeTime, maxRetransmits } = sctpStreamParameters;
|
|
550
550
|
const options = {
|
|
551
551
|
negotiated: true,
|
|
@@ -567,7 +567,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
567
567
|
const answer = await this._pc.createAnswer();
|
|
568
568
|
if (!this._transportReady) {
|
|
569
569
|
const localSdpObject = sdpTransform.parse(answer.sdp);
|
|
570
|
-
await this.
|
|
570
|
+
await this.setupTransport({
|
|
571
571
|
localDtlsRole: (_a = this._forcedLocalDtlsRole) !== null && _a !== void 0 ? _a : 'client',
|
|
572
572
|
localSdpObject
|
|
573
573
|
});
|
|
@@ -578,7 +578,7 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
578
578
|
}
|
|
579
579
|
return { dataChannel };
|
|
580
580
|
}
|
|
581
|
-
async
|
|
581
|
+
async setupTransport({ localDtlsRole, localSdpObject }) {
|
|
582
582
|
if (!localSdpObject)
|
|
583
583
|
localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp);
|
|
584
584
|
// Get our local DTLS parameters.
|
|
@@ -593,12 +593,12 @@ class Safari12 extends HandlerInterface_1.HandlerInterface {
|
|
|
593
593
|
});
|
|
594
594
|
this._transportReady = true;
|
|
595
595
|
}
|
|
596
|
-
|
|
596
|
+
assertSendDirection() {
|
|
597
597
|
if (this._direction !== 'send') {
|
|
598
598
|
throw new Error('method can just be called for handlers with "send" direction');
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
|
-
|
|
601
|
+
assertRecvDirection() {
|
|
602
602
|
if (this._direction !== 'recv') {
|
|
603
603
|
throw new Error('method can just be called for handlers with "recv" direction');
|
|
604
604
|
}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/npm-scripts.js
CHANGED