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
|
@@ -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 sdpCommonUtils = require("./sdp/commonUtils");
|
|
9
|
-
const sdpUnifiedPlanUtils = require("./sdp/unifiedPlanUtils");
|
|
10
|
-
const ortcUtils = require("./ortc/utils");
|
|
11
8
|
const errors_1 = require("../errors");
|
|
9
|
+
const scalabilityModes_1 = require("../scalabilityModes");
|
|
12
10
|
const HandlerInterface_1 = require("./HandlerInterface");
|
|
13
11
|
const RemoteSdp_1 = require("./sdp/RemoteSdp");
|
|
14
|
-
const
|
|
12
|
+
const sdpCommonUtils = require("./sdp/commonUtils");
|
|
13
|
+
const sdpUnifiedPlanUtils = require("./sdp/unifiedPlanUtils");
|
|
14
|
+
const ortcUtils = require("./ortc/utils");
|
|
15
15
|
const logger = new Logger_1.Logger('ReactNative106');
|
|
16
16
|
const NAME = 'ReactNative106';
|
|
17
17
|
const SCTP_NUM_STREAMS = { OS: 1024, MIS: 1024 };
|
|
@@ -46,75 +46,52 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
46
46
|
* Creates a factory function.
|
|
47
47
|
*/
|
|
48
48
|
static createFactory() {
|
|
49
|
-
return () => new ReactNative106();
|
|
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
|
-
// Free/dispose native MediaStream but DO NOT free/dispose native
|
|
64
|
-
// MediaStreamTracks (that is parent's business).
|
|
65
|
-
// @ts-expect-error --- Proprietary API in react-native-webrtc.
|
|
66
|
-
this._sendStream.release(/* releaseTracks */ false);
|
|
67
|
-
// Close RTCPeerConnection.
|
|
68
|
-
if (this._pc) {
|
|
69
|
-
try {
|
|
70
|
-
this._pc.close();
|
|
71
|
-
}
|
|
72
|
-
catch (error) { }
|
|
73
|
-
}
|
|
74
|
-
this.emit('@close');
|
|
75
|
-
}
|
|
76
|
-
async getNativeRtpCapabilities() {
|
|
77
|
-
logger.debug('getNativeRtpCapabilities()');
|
|
78
|
-
const pc = new RTCPeerConnection({
|
|
79
|
-
iceServers: [],
|
|
80
|
-
iceTransportPolicy: 'all',
|
|
81
|
-
bundlePolicy: 'max-bundle',
|
|
82
|
-
rtcpMuxPolicy: 'require',
|
|
83
|
-
sdpSemantics: 'unified-plan',
|
|
84
|
-
});
|
|
85
|
-
try {
|
|
86
|
-
pc.addTransceiver('audio');
|
|
87
|
-
pc.addTransceiver('video');
|
|
88
|
-
const offer = await pc.createOffer();
|
|
89
|
-
try {
|
|
90
|
-
pc.close();
|
|
91
|
-
}
|
|
92
|
-
catch (error) { }
|
|
93
|
-
const sdpObject = sdpTransform.parse(offer.sdp);
|
|
94
|
-
const nativeRtpCapabilities = sdpCommonUtils.extractRtpCapabilities({
|
|
95
|
-
sdpObject,
|
|
96
|
-
});
|
|
97
|
-
// libwebrtc supports NACK for OPUS but doesn't announce it.
|
|
98
|
-
ortcUtils.addNackSupportForOpus(nativeRtpCapabilities);
|
|
99
|
-
return nativeRtpCapabilities;
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
try {
|
|
103
|
-
pc.close();
|
|
104
|
-
}
|
|
105
|
-
catch (error2) { }
|
|
106
|
-
throw error;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
async getNativeSctpCapabilities() {
|
|
110
|
-
logger.debug('getNativeSctpCapabilities()');
|
|
111
49
|
return {
|
|
112
|
-
|
|
50
|
+
name: NAME,
|
|
51
|
+
factory: (options) => new ReactNative106(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
|
+
},
|
|
113
90
|
};
|
|
114
91
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
logger.debug('
|
|
92
|
+
constructor({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, extendedRtpCapabilities, }) {
|
|
93
|
+
super();
|
|
94
|
+
logger.debug('constructor()');
|
|
118
95
|
this._direction = direction;
|
|
119
96
|
this._remoteSdp = new RemoteSdp_1.RemoteSdp({
|
|
120
97
|
iceParameters,
|
|
@@ -139,9 +116,8 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
139
116
|
iceTransportPolicy: iceTransportPolicy ?? 'all',
|
|
140
117
|
bundlePolicy: 'max-bundle',
|
|
141
118
|
rtcpMuxPolicy: 'require',
|
|
142
|
-
sdpSemantics: 'unified-plan',
|
|
143
119
|
...additionalSettings,
|
|
144
|
-
}
|
|
120
|
+
});
|
|
145
121
|
this._pc.addEventListener('icegatheringstatechange', () => {
|
|
146
122
|
this.emit('@icegatheringstatechange', this._pc.iceGatheringState);
|
|
147
123
|
});
|
|
@@ -182,6 +158,28 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
182
158
|
});
|
|
183
159
|
}
|
|
184
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
|
+
// Free/dispose native MediaStream but DO NOT free/dispose native
|
|
171
|
+
// MediaStreamTracks (that is parent's business).
|
|
172
|
+
// @ts-expect-error --- Proprietary API in react-native-webrtc.
|
|
173
|
+
this._sendStream.release(/* releaseTracks */ false);
|
|
174
|
+
// Close RTCPeerConnection.
|
|
175
|
+
if (this._pc) {
|
|
176
|
+
try {
|
|
177
|
+
this._pc.close();
|
|
178
|
+
}
|
|
179
|
+
catch (error) { }
|
|
180
|
+
}
|
|
181
|
+
this.emit('@close');
|
|
182
|
+
}
|
|
185
183
|
async updateIceServers(iceServers) {
|
|
186
184
|
this.assertNotClosed();
|
|
187
185
|
logger.debug('updateIceServers()');
|
|
@@ -201,12 +199,18 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
201
199
|
const offer = await this._pc.createOffer({ iceRestart: true });
|
|
202
200
|
logger.debug('restartIce() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
203
201
|
await this._pc.setLocalDescription(offer);
|
|
204
|
-
const answer = {
|
|
202
|
+
const answer = {
|
|
203
|
+
type: 'answer',
|
|
204
|
+
sdp: this._remoteSdp.getSdp(),
|
|
205
|
+
};
|
|
205
206
|
logger.debug('restartIce() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
206
207
|
await this._pc.setRemoteDescription(answer);
|
|
207
208
|
}
|
|
208
209
|
else {
|
|
209
|
-
const offer = {
|
|
210
|
+
const offer = {
|
|
211
|
+
type: 'offer',
|
|
212
|
+
sdp: this._remoteSdp.getSdp(),
|
|
213
|
+
};
|
|
210
214
|
logger.debug('restartIce() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
211
215
|
await this._pc.setRemoteDescription(offer);
|
|
212
216
|
const answer = await this._pc.createAnswer();
|
|
@@ -244,8 +248,6 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
244
248
|
}
|
|
245
249
|
let offer = await this._pc.createOffer();
|
|
246
250
|
let localSdpObject = sdpTransform.parse(offer.sdp);
|
|
247
|
-
// @ts-expect-error --- sdpTransform.SessionDescription type doesn't
|
|
248
|
-
// define extmapAllowMixed field.
|
|
249
251
|
if (localSdpObject.extmapAllowMixed) {
|
|
250
252
|
this._remoteSdp.setSessionExtmapAllowMixed();
|
|
251
253
|
}
|
|
@@ -271,7 +273,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
271
273
|
offerMediaObject,
|
|
272
274
|
numStreams: layers.spatialLayers,
|
|
273
275
|
});
|
|
274
|
-
offer = {
|
|
276
|
+
offer = {
|
|
277
|
+
type: 'offer',
|
|
278
|
+
sdp: sdpTransform.write(localSdpObject),
|
|
279
|
+
};
|
|
275
280
|
}
|
|
276
281
|
logger.debug('send() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
277
282
|
await this._pc.setLocalDescription(offer);
|
|
@@ -339,7 +344,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
339
344
|
answerRtpParameters: sendingRemoteRtpParameters,
|
|
340
345
|
codecOptions,
|
|
341
346
|
});
|
|
342
|
-
const answer = {
|
|
347
|
+
const answer = {
|
|
348
|
+
type: 'answer',
|
|
349
|
+
sdp: this._remoteSdp.getSdp(),
|
|
350
|
+
};
|
|
343
351
|
logger.debug('send() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
344
352
|
await this._pc.setRemoteDescription(answer);
|
|
345
353
|
// Follow up of iOS react-native-webrtc 111.0.0 issue told above. Now yes,
|
|
@@ -380,7 +388,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
380
388
|
const offer = await this._pc.createOffer();
|
|
381
389
|
logger.debug('stopSending() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
382
390
|
await this._pc.setLocalDescription(offer);
|
|
383
|
-
const answer = {
|
|
391
|
+
const answer = {
|
|
392
|
+
type: 'answer',
|
|
393
|
+
sdp: this._remoteSdp.getSdp(),
|
|
394
|
+
};
|
|
384
395
|
logger.debug('stopSending() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
385
396
|
await this._pc.setRemoteDescription(answer);
|
|
386
397
|
this._mapMidTransceiver.delete(localId);
|
|
@@ -398,7 +409,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
398
409
|
const offer = await this._pc.createOffer();
|
|
399
410
|
logger.debug('pauseSending() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
400
411
|
await this._pc.setLocalDescription(offer);
|
|
401
|
-
const answer = {
|
|
412
|
+
const answer = {
|
|
413
|
+
type: 'answer',
|
|
414
|
+
sdp: this._remoteSdp.getSdp(),
|
|
415
|
+
};
|
|
402
416
|
logger.debug('pauseSending() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
403
417
|
await this._pc.setRemoteDescription(answer);
|
|
404
418
|
}
|
|
@@ -415,7 +429,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
415
429
|
const offer = await this._pc.createOffer();
|
|
416
430
|
logger.debug('resumeSending() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
417
431
|
await this._pc.setLocalDescription(offer);
|
|
418
|
-
const answer = {
|
|
432
|
+
const answer = {
|
|
433
|
+
type: 'answer',
|
|
434
|
+
sdp: this._remoteSdp.getSdp(),
|
|
435
|
+
};
|
|
419
436
|
logger.debug('resumeSending() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
420
437
|
await this._pc.setRemoteDescription(answer);
|
|
421
438
|
}
|
|
@@ -456,7 +473,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
456
473
|
const offer = await this._pc.createOffer();
|
|
457
474
|
logger.debug('setMaxSpatialLayer() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
458
475
|
await this._pc.setLocalDescription(offer);
|
|
459
|
-
const answer = {
|
|
476
|
+
const answer = {
|
|
477
|
+
type: 'answer',
|
|
478
|
+
sdp: this._remoteSdp.getSdp(),
|
|
479
|
+
};
|
|
460
480
|
logger.debug('setMaxSpatialLayer() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
461
481
|
await this._pc.setRemoteDescription(answer);
|
|
462
482
|
}
|
|
@@ -477,7 +497,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
477
497
|
const offer = await this._pc.createOffer();
|
|
478
498
|
logger.debug('setRtpEncodingParameters() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
479
499
|
await this._pc.setLocalDescription(offer);
|
|
480
|
-
const answer = {
|
|
500
|
+
const answer = {
|
|
501
|
+
type: 'answer',
|
|
502
|
+
sdp: this._remoteSdp.getSdp(),
|
|
503
|
+
};
|
|
481
504
|
logger.debug('setRtpEncodingParameters() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
482
505
|
await this._pc.setRemoteDescription(answer);
|
|
483
506
|
}
|
|
@@ -511,7 +534,7 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
511
534
|
if (!this._hasDataChannelMediaSection) {
|
|
512
535
|
const offer = await this._pc.createOffer();
|
|
513
536
|
const localSdpObject = sdpTransform.parse(offer.sdp);
|
|
514
|
-
const offerMediaObject = localSdpObject.media.find(
|
|
537
|
+
const offerMediaObject = localSdpObject.media.find(m => m.type === 'application');
|
|
515
538
|
if (!this._transportReady) {
|
|
516
539
|
await this.setupTransport({
|
|
517
540
|
localDtlsRole: this._forcedLocalDtlsRole ?? 'client',
|
|
@@ -521,7 +544,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
521
544
|
logger.debug('sendDataChannel() | calling pc.setLocalDescription() [offer:%o]', offer);
|
|
522
545
|
await this._pc.setLocalDescription(offer);
|
|
523
546
|
this._remoteSdp.sendSctpAssociation({ offerMediaObject });
|
|
524
|
-
const answer = {
|
|
547
|
+
const answer = {
|
|
548
|
+
type: 'answer',
|
|
549
|
+
sdp: this._remoteSdp.getSdp(),
|
|
550
|
+
};
|
|
525
551
|
logger.debug('sendDataChannel() | calling pc.setRemoteDescription() [answer:%o]', answer);
|
|
526
552
|
await this._pc.setRemoteDescription(answer);
|
|
527
553
|
this._hasDataChannelMediaSection = true;
|
|
@@ -552,7 +578,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
552
578
|
trackId,
|
|
553
579
|
});
|
|
554
580
|
}
|
|
555
|
-
const offer = {
|
|
581
|
+
const offer = {
|
|
582
|
+
type: 'offer',
|
|
583
|
+
sdp: this._remoteSdp.getSdp(),
|
|
584
|
+
};
|
|
556
585
|
logger.debug('receive() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
557
586
|
await this._pc.setRemoteDescription(offer);
|
|
558
587
|
for (const options of optionsList) {
|
|
@@ -573,7 +602,7 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
573
602
|
for (const options of optionsList) {
|
|
574
603
|
const { trackId, rtpParameters } = options;
|
|
575
604
|
const localId = mapLocalId.get(trackId);
|
|
576
|
-
const answerMediaObject = localSdpObject.media.find(
|
|
605
|
+
const answerMediaObject = localSdpObject.media.find(m => String(m.mid) === localId);
|
|
577
606
|
// May need to modify codec parameters in the answer based on codec
|
|
578
607
|
// parameters in the offer.
|
|
579
608
|
sdpCommonUtils.applyCodecParameters({
|
|
@@ -581,7 +610,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
581
610
|
answerMediaObject,
|
|
582
611
|
});
|
|
583
612
|
}
|
|
584
|
-
answer = {
|
|
613
|
+
answer = {
|
|
614
|
+
type: 'answer',
|
|
615
|
+
sdp: sdpTransform.write(localSdpObject),
|
|
616
|
+
};
|
|
585
617
|
if (!this._transportReady) {
|
|
586
618
|
await this.setupTransport({
|
|
587
619
|
localDtlsRole: this._forcedLocalDtlsRole ?? 'client',
|
|
@@ -624,7 +656,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
624
656
|
}
|
|
625
657
|
this._remoteSdp.closeMediaSection(transceiver.mid);
|
|
626
658
|
}
|
|
627
|
-
const offer = {
|
|
659
|
+
const offer = {
|
|
660
|
+
type: 'offer',
|
|
661
|
+
sdp: this._remoteSdp.getSdp(),
|
|
662
|
+
};
|
|
628
663
|
logger.debug('stopReceiving() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
629
664
|
await this._pc.setRemoteDescription(offer);
|
|
630
665
|
const answer = await this._pc.createAnswer();
|
|
@@ -646,7 +681,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
646
681
|
transceiver.direction = 'inactive';
|
|
647
682
|
this._remoteSdp.pauseMediaSection(localId);
|
|
648
683
|
}
|
|
649
|
-
const offer = {
|
|
684
|
+
const offer = {
|
|
685
|
+
type: 'offer',
|
|
686
|
+
sdp: this._remoteSdp.getSdp(),
|
|
687
|
+
};
|
|
650
688
|
logger.debug('pauseReceiving() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
651
689
|
await this._pc.setRemoteDescription(offer);
|
|
652
690
|
const answer = await this._pc.createAnswer();
|
|
@@ -665,7 +703,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
665
703
|
transceiver.direction = 'recvonly';
|
|
666
704
|
this._remoteSdp.resumeReceivingMediaSection(localId);
|
|
667
705
|
}
|
|
668
|
-
const offer = {
|
|
706
|
+
const offer = {
|
|
707
|
+
type: 'offer',
|
|
708
|
+
sdp: this._remoteSdp.getSdp(),
|
|
709
|
+
};
|
|
669
710
|
logger.debug('resumeReceiving() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
670
711
|
await this._pc.setRemoteDescription(offer);
|
|
671
712
|
const answer = await this._pc.createAnswer();
|
|
@@ -699,7 +740,10 @@ class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
|
699
740
|
// m=application section.
|
|
700
741
|
if (!this._hasDataChannelMediaSection) {
|
|
701
742
|
this._remoteSdp.receiveSctpAssociation();
|
|
702
|
-
const offer = {
|
|
743
|
+
const offer = {
|
|
744
|
+
type: 'offer',
|
|
745
|
+
sdp: this._remoteSdp.getSdp(),
|
|
746
|
+
};
|
|
703
747
|
logger.debug('receiveDataChannel() | calling pc.setRemoteDescription() [offer:%o]', offer);
|
|
704
748
|
await this._pc.setRemoteDescription(offer);
|
|
705
749
|
const answer = await this._pc.createAnswer();
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { type HandlerFactory, 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 } from '../Transport';
|
|
3
|
-
import type
|
|
4
|
-
import type { SctpCapabilities } from '../SctpParameters';
|
|
2
|
+
import { type HandlerFactory, HandlerInterface, type HandlerOptions, type HandlerSendOptions, type HandlerSendResult, type HandlerReceiveOptions, type HandlerReceiveResult, type HandlerSendDataChannelOptions, type HandlerSendDataChannelResult, type HandlerReceiveDataChannelOptions, type HandlerReceiveDataChannelResult } from './HandlerInterface';
|
|
5
3
|
export declare class Safari12 extends HandlerInterface {
|
|
6
4
|
private _closed;
|
|
7
|
-
private _direction
|
|
8
|
-
private _remoteSdp
|
|
9
|
-
private _sendingRtpParametersByKind
|
|
10
|
-
private _sendingRemoteRtpParametersByKind
|
|
5
|
+
private _direction;
|
|
6
|
+
private _remoteSdp;
|
|
7
|
+
private _sendingRtpParametersByKind;
|
|
8
|
+
private _sendingRemoteRtpParametersByKind;
|
|
11
9
|
private _forcedLocalDtlsRole?;
|
|
12
10
|
private _pc;
|
|
13
11
|
private readonly _mapMidTransceiver;
|
|
@@ -19,12 +17,9 @@ export declare class Safari12 extends HandlerInterface {
|
|
|
19
17
|
* Creates a factory function.
|
|
20
18
|
*/
|
|
21
19
|
static createFactory(): HandlerFactory;
|
|
22
|
-
constructor();
|
|
20
|
+
constructor({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, extendedRtpCapabilities, }: HandlerOptions);
|
|
23
21
|
get name(): string;
|
|
24
22
|
close(): void;
|
|
25
|
-
getNativeRtpCapabilities(): Promise<RtpCapabilities>;
|
|
26
|
-
getNativeSctpCapabilities(): Promise<SctpCapabilities>;
|
|
27
|
-
run({ direction, iceParameters, iceCandidates, dtlsParameters, sctpParameters, iceServers, iceTransportPolicy, additionalSettings, proprietaryConstraints, extendedRtpCapabilities, }: HandlerRunOptions): void;
|
|
28
23
|
updateIceServers(iceServers: RTCIceServer[]): Promise<void>;
|
|
29
24
|
restartIce(iceParameters: IceParameters): Promise<void>;
|
|
30
25
|
getTransportStats(): Promise<RTCStatsReport>;
|
|
@@ -34,7 +29,7 @@ export declare class Safari12 extends HandlerInterface {
|
|
|
34
29
|
resumeSending(localId: string): Promise<void>;
|
|
35
30
|
replaceTrack(localId: string, track: MediaStreamTrack | null): Promise<void>;
|
|
36
31
|
setMaxSpatialLayer(localId: string, spatialLayer: number): Promise<void>;
|
|
37
|
-
setRtpEncodingParameters(localId: string, params:
|
|
32
|
+
setRtpEncodingParameters(localId: string, params: Partial<RTCRtpEncodingParameters>): Promise<void>;
|
|
38
33
|
getSenderStats(localId: string): Promise<RTCStatsReport>;
|
|
39
34
|
sendDataChannel({ ordered, maxPacketLifeTime, maxRetransmits, label, protocol, }: HandlerSendDataChannelOptions): Promise<HandlerSendDataChannelResult>;
|
|
40
35
|
receive(optionsList: HandlerReceiveOptions[]): Promise<HandlerReceiveResult[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Safari12.d.ts","sourceRoot":"","sources":["../../src/handlers/Safari12.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Safari12.d.ts","sourceRoot":"","sources":["../../src/handlers/Safari12.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,E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