mediasoup-client 3.13.0 → 3.14.0
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/DataConsumer.d.ts.map +1 -1
- package/lib/DataConsumer.js +5 -8
- package/lib/DataProducer.d.ts.map +1 -1
- package/lib/DataProducer.js +5 -7
- package/lib/Device.d.ts +2 -2
- package/lib/Device.d.ts.map +1 -1
- package/lib/Device.js +53 -70
- package/lib/RtpParameters.d.ts +8 -8
- package/lib/RtpParameters.d.ts.map +1 -1
- package/lib/Transport.d.ts +4 -4
- package/lib/Transport.d.ts.map +1 -1
- package/lib/Transport.js +6 -7
- package/lib/enhancedEvents.d.ts.map +1 -1
- package/lib/enhancedEvents.js +1 -0
- package/lib/handlers/Chrome111.d.ts +7 -12
- package/lib/handlers/Chrome111.d.ts.map +1 -1
- package/lib/handlers/Chrome111.js +130 -89
- package/lib/handlers/Chrome74.d.ts +7 -12
- package/lib/handlers/Chrome74.d.ts.map +1 -1
- package/lib/handlers/Chrome74.js +130 -85
- package/lib/handlers/FakeHandler.d.ts +6 -9
- package/lib/handlers/FakeHandler.d.ts.map +1 -1
- package/lib/handlers/FakeHandler.js +201 -60
- package/lib/handlers/Firefox120.d.ts +7 -12
- package/lib/handlers/Firefox120.d.ts.map +1 -1
- package/lib/handlers/Firefox120.js +154 -111
- package/lib/handlers/HandlerInterface.d.ts +11 -9
- package/lib/handlers/HandlerInterface.d.ts.map +1 -1
- package/lib/handlers/ReactNative106.d.ts +7 -12
- package/lib/handlers/ReactNative106.d.ts.map +1 -1
- package/lib/handlers/ReactNative106.js +136 -92
- package/lib/handlers/Safari12.d.ts +7 -12
- package/lib/handlers/Safari12.d.ts.map +1 -1
- package/lib/handlers/Safari12.js +132 -86
- package/lib/handlers/sdp/MediaSection.d.ts +5 -5
- package/lib/handlers/sdp/MediaSection.d.ts.map +1 -1
- package/lib/handlers/sdp/MediaSection.js +43 -45
- package/lib/handlers/sdp/RemoteSdp.d.ts +5 -6
- package/lib/handlers/sdp/RemoteSdp.d.ts.map +1 -1
- package/lib/handlers/sdp/RemoteSdp.js +5 -8
- package/lib/handlers/sdp/commonUtils.d.ts +5 -4
- package/lib/handlers/sdp/commonUtils.d.ts.map +1 -1
- package/lib/handlers/sdp/commonUtils.js +2 -2
- package/lib/handlers/sdp/plainRtpUtils.d.ts +4 -3
- package/lib/handlers/sdp/plainRtpUtils.d.ts.map +1 -1
- package/lib/handlers/sdp/plainRtpUtils.js +2 -2
- package/lib/handlers/sdp/unifiedPlanUtils.d.ts +3 -2
- package/lib/handlers/sdp/unifiedPlanUtils.d.ts.map +1 -1
- package/lib/handlers/sdp/unifiedPlanUtils.js +10 -8
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/ortc.d.ts +7 -6
- package/lib/ortc.d.ts.map +1 -1
- package/lib/ortc.js +13 -14
- package/lib/privateTypes.d.ts +27 -0
- package/lib/privateTypes.d.ts.map +1 -0
- package/lib/privateTypes.js +2 -0
- package/lib/test/test.js +18 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +5 -4
- package/package.json +1 -2
package/lib/handlers/Chrome74.js
CHANGED
|
@@ -5,13 +5,13 @@ const sdpTransform = require("sdp-transform");
|
|
|
5
5
|
const Logger_1 = require("../Logger");
|
|
6
6
|
const utils = require("../utils");
|
|
7
7
|
const ortc = require("../ortc");
|
|
8
|
+
const errors_1 = require("../errors");
|
|
9
|
+
const scalabilityModes_1 = require("../scalabilityModes");
|
|
8
10
|
const sdpCommonUtils = require("./sdp/commonUtils");
|
|
9
11
|
const sdpUnifiedPlanUtils = require("./sdp/unifiedPlanUtils");
|
|
10
12
|
const ortcUtils = require("./ortc/utils");
|
|
11
|
-
const errors_1 = require("../errors");
|
|
12
13
|
const HandlerInterface_1 = require("./HandlerInterface");
|
|
13
14
|
const RemoteSdp_1 = require("./sdp/RemoteSdp");
|
|
14
|
-
const scalabilityModes_1 = require("../scalabilityModes");
|
|
15
15
|
const logger = new Logger_1.Logger('Chrome74');
|
|
16
16
|
const NAME = 'Chrome74';
|
|
17
17
|
const SCTP_NUM_STREAMS = { OS: 1024, MIS: 1024 };
|
|
@@ -46,70 +46,52 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
46
46
|
* Creates a factory function.
|
|
47
47
|
*/
|
|
48
48
|
static createFactory() {
|
|
49
|
-
return () => new Chrome74();
|
|
50
|
-
}
|
|
51
|
-
constructor() {
|
|
52
|
-
super();
|
|
53
|
-
}
|
|
54
|
-
get name() {
|
|
55
|
-
return NAME;
|
|
56
|
-
}
|
|
57
|
-
close() {
|
|
58
|
-
logger.debug('close()');
|
|
59
|
-
if (this._closed) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
this._closed = true;
|
|
63
|
-
// Close RTCPeerConnection.
|
|
64
|
-
if (this._pc) {
|
|
65
|
-
try {
|
|
66
|
-
this._pc.close();
|
|
67
|
-
}
|
|
68
|
-
catch (error) { }
|
|
69
|
-
}
|
|
70
|
-
this.emit('@close');
|
|
71
|
-
}
|
|
72
|
-
async getNativeRtpCapabilities() {
|
|
73
|
-
logger.debug('getNativeRtpCapabilities()');
|
|
74
|
-
const pc = new RTCPeerConnection({
|
|
75
|
-
iceServers: [],
|
|
76
|
-
iceTransportPolicy: 'all',
|
|
77
|
-
bundlePolicy: 'max-bundle',
|
|
78
|
-
rtcpMuxPolicy: 'require',
|
|
79
|
-
sdpSemantics: 'unified-plan',
|
|
80
|
-
});
|
|
81
|
-
try {
|
|
82
|
-
pc.addTransceiver('audio');
|
|
83
|
-
pc.addTransceiver('video');
|
|
84
|
-
const offer = await pc.createOffer();
|
|
85
|
-
try {
|
|
86
|
-
pc.close();
|
|
87
|
-
}
|
|
88
|
-
catch (error) { }
|
|
89
|
-
const sdpObject = sdpTransform.parse(offer.sdp);
|
|
90
|
-
const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({
|
|
91
|
-
sdpObject,
|
|
92
|
-
});
|
|
93
|
-
// libwebrtc supports NACK for OPUS but doesn't announce it.
|
|
94
|
-
ortcUtils.addNackSupportForOpus(nativeRtpCapabilities);
|
|
95
|
-
return nativeRtpCapabilities;
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
try {
|
|
99
|
-
pc.close();
|
|
100
|
-
}
|
|
101
|
-
catch (error2) { }
|
|
102
|
-
throw error;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
async getNativeSctpCapabilities() {
|
|
106
|
-
logger.debug('getNativeSctpCapabilities()');
|
|
107
49
|
return {
|
|
108
|
-
|
|
50
|
+
name: NAME,
|
|
51
|
+
factory: (options) => new Chrome74(options),
|
|
52
|
+
getNativeRtpCapabilities: async () => {
|
|
53
|
+
logger.debug('getNativeRtpCapabilities()');
|
|
54
|
+
const pc = new RTCPeerConnection({
|
|
55
|
+
iceServers: [],
|
|
56
|
+
iceTransportPolicy: 'all',
|
|
57
|
+
bundlePolicy: 'max-bundle',
|
|
58
|
+
rtcpMuxPolicy: 'require',
|
|
59
|
+
});
|
|
60
|
+
try {
|
|
61
|
+
pc.addTransceiver('audio');
|
|
62
|
+
pc.addTransceiver('video');
|
|
63
|
+
const offer = await pc.createOffer();
|
|
64
|
+
try {
|
|
65
|
+
pc.close();
|
|
66
|
+
}
|
|
67
|
+
catch (error) { }
|
|
68
|
+
const sdpObject = sdpTransform.parse(offer.sdp);
|
|
69
|
+
const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({
|
|
70
|
+
sdpObject,
|
|
71
|
+
});
|
|
72
|
+
// libwebrtc supports NACK for OPUS but doesn't announce it.
|
|
73
|
+
ortcUtils.addNackSupportForOpus(nativeRtpCapabilities);
|
|
74
|
+
return nativeRtpCapabilities;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
try {
|
|
78
|
+
pc.close();
|
|
79
|
+
}
|
|
80
|
+
catch (error2) { }
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
getNativeSctpCapabilities: async () => {
|
|
85
|
+
logger.debug('getNativeSctpCapabilities()');
|
|
86
|
+
return {
|
|
87
|
+
numStreams: SCTP_NUM_STREAMS,
|
|
88
|
+
};
|
|
89
|
+
},
|
|
109
90
|
};
|
|
110
91
|
}
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
constructor({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, extendedRtpCapabilities, }) {
|
|
93
|
+
super();
|
|
94
|
+
logger.debug('constructor()');
|
|
113
95
|
this._direction = direction;
|
|
114
96
|
this._remoteSdp = new RemoteSdp_1.RemoteSdp({
|
|
115
97
|
iceParameters,
|
|
@@ -134,9 +116,8 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
134
116
|
iceTransportPolicy: iceTransportPolicy ?? 'all',
|
|
135
117
|
bundlePolicy: 'max-bundle',
|
|
136
118
|
rtcpMuxPolicy: 'require',
|
|
137
|
-
sdpSemantics: 'unified-plan',
|
|
138
119
|
...additionalSettings,
|
|
139
|
-
}
|
|
120
|
+
});
|
|
140
121
|
this._pc.addEventListener('icegatheringstatechange', () => {
|
|
141
122
|
this.emit('@icegatheringstatechange', this._pc.iceGatheringState);
|
|
142
123
|
});
|
|
@@ -177,6 +158,24 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
177
158
|
});
|
|
178
159
|
}
|
|
179
160
|
}
|
|
161
|
+
get name() {
|
|
162
|
+
return NAME;
|
|
163
|
+
}
|
|
164
|
+
close() {
|
|
165
|
+
logger.debug('close()');
|
|
166
|
+
if (this._closed) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
this._closed = true;
|
|
170
|
+
// Close RTCPeerConnection.
|
|
171
|
+
if (this._pc) {
|
|
172
|
+
try {
|
|
173
|
+
this._pc.close();
|
|
174
|
+
}
|
|
175
|
+
catch (error) { }
|
|
176
|
+
}
|
|
177
|
+
this.emit('@close');
|
|
178
|
+
}
|
|
180
179
|
async updateIceServers(iceServers) {
|
|
181
180
|
this.assertNotClosed();
|
|
182
181
|
logger.debug('updateIceServers()');
|
|
@@ -196,12 +195,18 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
196
195
|
const offer = await this._pc.createOffer({ iceRestart: true });
|
|
197
196
|
logger.debug('restartIce() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
198
197
|
await this._pc.setLocalDescription(offer);
|
|
199
|
-
const answer = {
|
|
198
|
+
const answer = {
|
|
199
|
+
type: 'answer',
|
|
200
|
+
sdp: this._remoteSdp.getSdp(),
|
|
201
|
+
};
|
|
200
202
|
logger.debug('restartIce() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
201
203
|
await this._pc.setRemoteDescription(answer);
|
|
202
204
|
}
|
|
203
205
|
else {
|
|
204
|
-
const offer = {
|
|
206
|
+
const offer = {
|
|
207
|
+
type: 'offer',
|
|
208
|
+
sdp: this._remoteSdp.getSdp(),
|
|
209
|
+
};
|
|
205
210
|
logger.debug('restartIce() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
206
211
|
await this._pc.setRemoteDescription(offer);
|
|
207
212
|
const answer = await this._pc.createAnswer();
|
|
@@ -236,8 +241,6 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
236
241
|
});
|
|
237
242
|
let offer = await this._pc.createOffer();
|
|
238
243
|
let localSdpObject = sdpTransform.parse(offer.sdp);
|
|
239
|
-
// @ts-expect-error --- sdpTransform.SessionDescription type doesn't
|
|
240
|
-
// define extmapAllowMixed field.
|
|
241
244
|
if (localSdpObject.extmapAllowMixed) {
|
|
242
245
|
this._remoteSdp.setSessionExtmapAllowMixed();
|
|
243
246
|
}
|
|
@@ -263,7 +266,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
263
266
|
offerMediaObject,
|
|
264
267
|
numStreams: layers.spatialLayers,
|
|
265
268
|
});
|
|
266
|
-
offer = {
|
|
269
|
+
offer = {
|
|
270
|
+
type: 'offer',
|
|
271
|
+
sdp: sdpTransform.write(localSdpObject),
|
|
272
|
+
};
|
|
267
273
|
}
|
|
268
274
|
logger.debug('send() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
269
275
|
await this._pc.setLocalDescription(offer);
|
|
@@ -321,7 +327,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
321
327
|
answerRtpParameters: sendingRemoteRtpParameters,
|
|
322
328
|
codecOptions,
|
|
323
329
|
});
|
|
324
|
-
const answer = {
|
|
330
|
+
const answer = {
|
|
331
|
+
type: 'answer',
|
|
332
|
+
sdp: this._remoteSdp.getSdp(),
|
|
333
|
+
};
|
|
325
334
|
logger.debug('send() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
326
335
|
await this._pc.setRemoteDescription(answer);
|
|
327
336
|
// Store in the map.
|
|
@@ -354,7 +363,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
354
363
|
const offer = await this._pc.createOffer();
|
|
355
364
|
logger.debug('stopSending() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
356
365
|
await this._pc.setLocalDescription(offer);
|
|
357
|
-
const answer = {
|
|
366
|
+
const answer = {
|
|
367
|
+
type: 'answer',
|
|
368
|
+
sdp: this._remoteSdp.getSdp(),
|
|
369
|
+
};
|
|
358
370
|
logger.debug('stopSending() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
359
371
|
await this._pc.setRemoteDescription(answer);
|
|
360
372
|
this._mapMidTransceiver.delete(localId);
|
|
@@ -372,7 +384,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
372
384
|
const offer = await this._pc.createOffer();
|
|
373
385
|
logger.debug('pauseSending() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
374
386
|
await this._pc.setLocalDescription(offer);
|
|
375
|
-
const answer = {
|
|
387
|
+
const answer = {
|
|
388
|
+
type: 'answer',
|
|
389
|
+
sdp: this._remoteSdp.getSdp(),
|
|
390
|
+
};
|
|
376
391
|
logger.debug('pauseSending() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
377
392
|
await this._pc.setRemoteDescription(answer);
|
|
378
393
|
}
|
|
@@ -389,7 +404,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
389
404
|
const offer = await this._pc.createOffer();
|
|
390
405
|
logger.debug('resumeSending() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
391
406
|
await this._pc.setLocalDescription(offer);
|
|
392
|
-
const answer = {
|
|
407
|
+
const answer = {
|
|
408
|
+
type: 'answer',
|
|
409
|
+
sdp: this._remoteSdp.getSdp(),
|
|
410
|
+
};
|
|
393
411
|
logger.debug('resumeSending() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
394
412
|
await this._pc.setRemoteDescription(answer);
|
|
395
413
|
}
|
|
@@ -430,7 +448,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
430
448
|
const offer = await this._pc.createOffer();
|
|
431
449
|
logger.debug('setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
432
450
|
await this._pc.setLocalDescription(offer);
|
|
433
|
-
const answer = {
|
|
451
|
+
const answer = {
|
|
452
|
+
type: 'answer',
|
|
453
|
+
sdp: this._remoteSdp.getSdp(),
|
|
454
|
+
};
|
|
434
455
|
logger.debug('setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
435
456
|
await this._pc.setRemoteDescription(answer);
|
|
436
457
|
}
|
|
@@ -451,7 +472,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
451
472
|
const offer = await this._pc.createOffer();
|
|
452
473
|
logger.debug('setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
453
474
|
await this._pc.setLocalDescription(offer);
|
|
454
|
-
const answer = {
|
|
475
|
+
const answer = {
|
|
476
|
+
type: 'answer',
|
|
477
|
+
sdp: this._remoteSdp.getSdp(),
|
|
478
|
+
};
|
|
455
479
|
logger.debug('setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
456
480
|
await this._pc.setRemoteDescription(answer);
|
|
457
481
|
}
|
|
@@ -485,7 +509,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
485
509
|
if (!this._hasDataChannelMediaSection) {
|
|
486
510
|
const offer = await this._pc.createOffer();
|
|
487
511
|
const localSdpObject = sdpTransform.parse(offer.sdp);
|
|
488
|
-
const offerMediaObject = localSdpObject.media.find(
|
|
512
|
+
const offerMediaObject = localSdpObject.media.find(m => m.type === 'application');
|
|
489
513
|
if (!this._transportReady) {
|
|
490
514
|
await this.setupTransport({
|
|
491
515
|
localDtlsRole: this._forcedLocalDtlsRole ?? 'client',
|
|
@@ -495,7 +519,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
495
519
|
logger.debug('sendDataChannel() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
496
520
|
await this._pc.setLocalDescription(offer);
|
|
497
521
|
this._remoteSdp.sendSctpAssociation({ offerMediaObject });
|
|
498
|
-
const answer = {
|
|
522
|
+
const answer = {
|
|
523
|
+
type: 'answer',
|
|
524
|
+
sdp: this._remoteSdp.getSdp(),
|
|
525
|
+
};
|
|
499
526
|
logger.debug('sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
500
527
|
await this._pc.setRemoteDescription(answer);
|
|
501
528
|
this._hasDataChannelMediaSection = true;
|
|
@@ -526,7 +553,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
526
553
|
trackId,
|
|
527
554
|
});
|
|
528
555
|
}
|
|
529
|
-
const offer = {
|
|
556
|
+
const offer = {
|
|
557
|
+
type: 'offer',
|
|
558
|
+
sdp: this._remoteSdp.getSdp(),
|
|
559
|
+
};
|
|
530
560
|
logger.debug('receive() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
531
561
|
await this._pc.setRemoteDescription(offer);
|
|
532
562
|
let answer = await this._pc.createAnswer();
|
|
@@ -534,7 +564,7 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
534
564
|
for (const options of optionsList) {
|
|
535
565
|
const { trackId, rtpParameters } = options;
|
|
536
566
|
const localId = mapLocalId.get(trackId);
|
|
537
|
-
const answerMediaObject = localSdpObject.media.find(
|
|
567
|
+
const answerMediaObject = localSdpObject.media.find(m => String(m.mid) === localId);
|
|
538
568
|
// May need to modify codec parameters in the answer based on codec
|
|
539
569
|
// parameters in the offer.
|
|
540
570
|
sdpCommonUtils.applyCodecParameters({
|
|
@@ -542,7 +572,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
542
572
|
answerMediaObject,
|
|
543
573
|
});
|
|
544
574
|
}
|
|
545
|
-
answer = {
|
|
575
|
+
answer = {
|
|
576
|
+
type: 'answer',
|
|
577
|
+
sdp: sdpTransform.write(localSdpObject),
|
|
578
|
+
};
|
|
546
579
|
if (!this._transportReady) {
|
|
547
580
|
await this.setupTransport({
|
|
548
581
|
localDtlsRole: this._forcedLocalDtlsRole ?? 'client',
|
|
@@ -585,7 +618,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
585
618
|
}
|
|
586
619
|
this._remoteSdp.closeMediaSection(transceiver.mid);
|
|
587
620
|
}
|
|
588
|
-
const offer = {
|
|
621
|
+
const offer = {
|
|
622
|
+
type: 'offer',
|
|
623
|
+
sdp: this._remoteSdp.getSdp(),
|
|
624
|
+
};
|
|
589
625
|
logger.debug('stopReceiving() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
590
626
|
await this._pc.setRemoteDescription(offer);
|
|
591
627
|
const answer = await this._pc.createAnswer();
|
|
@@ -607,7 +643,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
607
643
|
transceiver.direction = 'inactive';
|
|
608
644
|
this._remoteSdp.pauseMediaSection(localId);
|
|
609
645
|
}
|
|
610
|
-
const offer = {
|
|
646
|
+
const offer = {
|
|
647
|
+
type: 'offer',
|
|
648
|
+
sdp: this._remoteSdp.getSdp(),
|
|
649
|
+
};
|
|
611
650
|
logger.debug('pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
612
651
|
await this._pc.setRemoteDescription(offer);
|
|
613
652
|
const answer = await this._pc.createAnswer();
|
|
@@ -626,7 +665,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
626
665
|
transceiver.direction = 'recvonly';
|
|
627
666
|
this._remoteSdp.resumeReceivingMediaSection(localId);
|
|
628
667
|
}
|
|
629
|
-
const offer = {
|
|
668
|
+
const offer = {
|
|
669
|
+
type: 'offer',
|
|
670
|
+
sdp: this._remoteSdp.getSdp(),
|
|
671
|
+
};
|
|
630
672
|
logger.debug('resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
631
673
|
await this._pc.setRemoteDescription(offer);
|
|
632
674
|
const answer = await this._pc.createAnswer();
|
|
@@ -660,7 +702,10 @@ class Chrome74 extends HandlerInterface_1.HandlerInterface {
|
|
|
660
702
|
// m=application section.
|
|
661
703
|
if (!this._hasDataChannelMediaSection) {
|
|
662
704
|
this._remoteSdp.receiveSctpAssociation();
|
|
663
|
-
const offer = {
|
|
705
|
+
const offer = {
|
|
706
|
+
type: 'offer',
|
|
707
|
+
sdp: this._remoteSdp.getSdp(),
|
|
708
|
+
};
|
|
664
709
|
logger.debug('receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
665
710
|
await this._pc.setRemoteDescription(offer);
|
|
666
711
|
const answer = await this._pc.createAnswer();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HandlerInterface, type HandlerRunOptions, type HandlerSendOptions, type HandlerSendResult, type HandlerReceiveOptions, type HandlerReceiveResult, type HandlerSendDataChannelOptions, type HandlerSendDataChannelResult, type HandlerReceiveDataChannelOptions, type HandlerReceiveDataChannelResult } from './HandlerInterface';
|
|
2
1
|
import type { IceParameters, DtlsParameters, IceGatheringState, ConnectionState } from '../Transport';
|
|
3
2
|
import type { RtpCapabilities } from '../RtpParameters';
|
|
4
3
|
import type { SctpCapabilities } from '../SctpParameters';
|
|
4
|
+
import { type HandlerFactory, HandlerInterface, type HandlerSendOptions, type HandlerSendResult, type HandlerReceiveOptions, type HandlerReceiveResult, type HandlerSendDataChannelOptions, type HandlerSendDataChannelResult, type HandlerReceiveDataChannelOptions, type HandlerReceiveDataChannelResult } from './HandlerInterface';
|
|
5
5
|
export type FakeParameters = {
|
|
6
6
|
generateNativeRtpCapabilities: () => RtpCapabilities;
|
|
7
7
|
generateNativeSctpCapabilities: () => SctpCapabilities;
|
|
@@ -9,8 +9,8 @@ export type FakeParameters = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare class FakeHandler extends HandlerInterface {
|
|
11
11
|
private _closed;
|
|
12
|
-
private
|
|
13
|
-
private _rtpParametersByKind
|
|
12
|
+
private _fakeParameters;
|
|
13
|
+
private _rtpParametersByKind;
|
|
14
14
|
private _cname;
|
|
15
15
|
private _transportReady;
|
|
16
16
|
private _nextLocalId;
|
|
@@ -19,15 +19,12 @@ export declare class FakeHandler extends HandlerInterface {
|
|
|
19
19
|
/**
|
|
20
20
|
* Creates a factory function.
|
|
21
21
|
*/
|
|
22
|
-
static createFactory(fakeParameters: FakeParameters):
|
|
23
|
-
constructor(
|
|
22
|
+
static createFactory(fakeParameters: FakeParameters): HandlerFactory;
|
|
23
|
+
private constructor();
|
|
24
24
|
get name(): string;
|
|
25
25
|
close(): void;
|
|
26
26
|
setIceGatheringState(iceGatheringState: IceGatheringState): void;
|
|
27
27
|
setConnectionState(connectionState: ConnectionState): void;
|
|
28
|
-
getNativeRtpCapabilities(): Promise<RtpCapabilities>;
|
|
29
|
-
getNativeSctpCapabilities(): Promise<SctpCapabilities>;
|
|
30
|
-
run({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, proprietaryConstraints, extendedRtpCapabilities, }: HandlerRunOptions): void;
|
|
31
28
|
updateIceServers(iceServers: RTCIceServer[]): Promise<void>;
|
|
32
29
|
restartIce(iceParameters: IceParameters): Promise<void>;
|
|
33
30
|
getTransportStats(): Promise<RTCStatsReport>;
|
|
@@ -37,7 +34,7 @@ export declare class FakeHandler extends HandlerInterface {
|
|
|
37
34
|
resumeSending(localId: string): Promise<void>;
|
|
38
35
|
replaceTrack(localId: string, track: MediaStreamTrack | null): Promise<void>;
|
|
39
36
|
setMaxSpatialLayer(localId: string, spatialLayer: number): Promise<void>;
|
|
40
|
-
setRtpEncodingParameters(localId: string, params:
|
|
37
|
+
setRtpEncodingParameters(localId: string, params: Partial<RTCRtpEncodingParameters>): Promise<void>;
|
|
41
38
|
getSenderStats(localId: string): Promise<RTCStatsReport>;
|
|
42
39
|
sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol, }: HandlerSendDataChannelOptions): Promise<HandlerSendDataChannelResult>;
|
|
43
40
|
receive(optionsList: HandlerReceiveOptions[]): Promise<HandlerReceiveResult[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FakeHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/FakeHandler.ts"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"FakeHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/FakeHandler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACX,aAAa,EACb,cAAc,EAEd,iBAAiB,EACjB,eAAe,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,eAAe,EAGf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACN,KAAK,cAAc,EACnB,gBAAgB,EAEhB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EAC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