mediasoup-client 3.12.5 → 3.13.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/Device.d.ts +1 -1
- package/lib/Device.d.ts.map +1 -1
- package/lib/Device.js +8 -81
- package/lib/handlers/{ReactNativeUnifiedPlan.d.ts → ReactNative106.d.ts} +2 -2
- package/lib/handlers/ReactNative106.d.ts.map +1 -0
- package/lib/handlers/{ReactNativeUnifiedPlan.js → ReactNative106.js} +6 -6
- package/lib/handlers/sdp/MediaSection.d.ts +3 -15
- package/lib/handlers/sdp/MediaSection.d.ts.map +1 -1
- package/lib/handlers/sdp/MediaSection.js +6 -113
- package/lib/handlers/sdp/RemoteSdp.d.ts +1 -7
- package/lib/handlers/sdp/RemoteSdp.d.ts.map +1 -1
- package/lib/handlers/sdp/RemoteSdp.js +18 -41
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/test/test.js +0 -112
- package/lib/test/uaTestCases.d.ts.map +1 -1
- package/lib/test/uaTestCases.js +0 -25
- package/npm-scripts.mjs +26 -14
- package/package.json +8 -8
- package/lib/handlers/Chrome55.d.ts +0 -51
- package/lib/handlers/Chrome55.d.ts.map +0 -1
- package/lib/handlers/Chrome55.js +0 -554
- package/lib/handlers/Chrome67.d.ts +0 -51
- package/lib/handlers/Chrome67.d.ts.map +0 -1
- package/lib/handlers/Chrome67.js +0 -609
- package/lib/handlers/Chrome70.d.ts +0 -49
- package/lib/handlers/Chrome70.d.ts.map +0 -1
- package/lib/handlers/Chrome70.js +0 -634
- package/lib/handlers/Edge11.d.ts +0 -55
- package/lib/handlers/Edge11.d.ts.map +0 -1
- package/lib/handlers/Edge11.js +0 -447
- package/lib/handlers/Firefox60.d.ts +0 -50
- package/lib/handlers/Firefox60.d.ts.map +0 -1
- package/lib/handlers/Firefox60.js +0 -721
- package/lib/handlers/ReactNative.d.ts +0 -51
- package/lib/handlers/ReactNative.d.ts.map +0 -1
- package/lib/handlers/ReactNative.js +0 -569
- package/lib/handlers/ReactNativeUnifiedPlan.d.ts.map +0 -1
- package/lib/handlers/Safari11.d.ts +0 -51
- package/lib/handlers/Safari11.d.ts.map +0 -1
- package/lib/handlers/Safari11.js +0 -604
- package/lib/handlers/ortc/edgeUtils.d.ts +0 -11
- package/lib/handlers/ortc/edgeUtils.d.ts.map +0 -1
- package/lib/handlers/ortc/edgeUtils.js +0 -70
- package/lib/handlers/sdp/planBUtils.d.ts +0 -14
- package/lib/handlers/sdp/planBUtils.d.ts.map +0 -1
- package/lib/handlers/sdp/planBUtils.js +0 -150
package/lib/Device.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { type HandlerFactory } from './handlers/HandlerInterface';
|
|
|
4
4
|
import type { RtpCapabilities, MediaKind } from './RtpParameters';
|
|
5
5
|
import type { SctpCapabilities } from './SctpParameters';
|
|
6
6
|
import type { AppData } from './types';
|
|
7
|
-
export type BuiltinHandlerName = 'Chrome111' | 'Chrome74' | '
|
|
7
|
+
export type BuiltinHandlerName = 'Chrome111' | 'Chrome74' | 'Firefox120' | 'Safari12' | 'ReactNative106';
|
|
8
8
|
export type DeviceOptions = {
|
|
9
9
|
/**
|
|
10
10
|
* The name of one of the builtin handlers.
|
package/lib/Device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,OAAO,EACN,SAAS,EACT,KAAK,gBAAgB,EAErB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,cAAc,EAEnB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../src/Device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAIxD,OAAO,EACN,SAAS,EACT,KAAK,gBA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vB"}
|
package/lib/Device.js
CHANGED
|
@@ -12,16 +12,9 @@ const ortc = require("./ortc");
|
|
|
12
12
|
const Transport_1 = require("./Transport");
|
|
13
13
|
const Chrome111_1 = require("./handlers/Chrome111");
|
|
14
14
|
const Chrome74_1 = require("./handlers/Chrome74");
|
|
15
|
-
const Chrome70_1 = require("./handlers/Chrome70");
|
|
16
|
-
const Chrome67_1 = require("./handlers/Chrome67");
|
|
17
|
-
const Chrome55_1 = require("./handlers/Chrome55");
|
|
18
15
|
const Firefox120_1 = require("./handlers/Firefox120");
|
|
19
|
-
const Firefox60_1 = require("./handlers/Firefox60");
|
|
20
16
|
const Safari12_1 = require("./handlers/Safari12");
|
|
21
|
-
const
|
|
22
|
-
const Edge11_1 = require("./handlers/Edge11");
|
|
23
|
-
const ReactNativeUnifiedPlan_1 = require("./handlers/ReactNativeUnifiedPlan");
|
|
24
|
-
const ReactNative_1 = require("./handlers/ReactNative");
|
|
17
|
+
const ReactNative106_1 = require("./handlers/ReactNative106");
|
|
25
18
|
const logger = new Logger_1.Logger('Device');
|
|
26
19
|
/**
|
|
27
20
|
* Async mediasoup-client Handler detection. More powerful than
|
|
@@ -121,44 +114,16 @@ class Device {
|
|
|
121
114
|
this._handlerFactory = Chrome74_1.Chrome74.createFactory();
|
|
122
115
|
break;
|
|
123
116
|
}
|
|
124
|
-
case 'Chrome70': {
|
|
125
|
-
this._handlerFactory = Chrome70_1.Chrome70.createFactory();
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
case 'Chrome67': {
|
|
129
|
-
this._handlerFactory = Chrome67_1.Chrome67.createFactory();
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
case 'Chrome55': {
|
|
133
|
-
this._handlerFactory = Chrome55_1.Chrome55.createFactory();
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
117
|
case 'Firefox120': {
|
|
137
118
|
this._handlerFactory = Firefox120_1.Firefox120.createFactory();
|
|
138
119
|
break;
|
|
139
120
|
}
|
|
140
|
-
case 'Firefox60': {
|
|
141
|
-
this._handlerFactory = Firefox60_1.Firefox60.createFactory();
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
121
|
case 'Safari12': {
|
|
145
122
|
this._handlerFactory = Safari12_1.Safari12.createFactory();
|
|
146
123
|
break;
|
|
147
124
|
}
|
|
148
|
-
case '
|
|
149
|
-
this._handlerFactory =
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
case 'Edge11': {
|
|
153
|
-
this._handlerFactory = Edge11_1.Edge11.createFactory();
|
|
154
|
-
break;
|
|
155
|
-
}
|
|
156
|
-
case 'ReactNativeUnifiedPlan': {
|
|
157
|
-
this._handlerFactory = ReactNativeUnifiedPlan_1.ReactNativeUnifiedPlan.createFactory();
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
case 'ReactNative': {
|
|
161
|
-
this._handlerFactory = ReactNative_1.ReactNative.createFactory();
|
|
125
|
+
case 'ReactNative106': {
|
|
126
|
+
this._handlerFactory = ReactNative106_1.ReactNative106.createFactory();
|
|
162
127
|
break;
|
|
163
128
|
}
|
|
164
129
|
default: {
|
|
@@ -370,23 +335,14 @@ class Device {
|
|
|
370
335
|
exports.Device = Device;
|
|
371
336
|
function detectDeviceImpl(uaParserResult) {
|
|
372
337
|
// React-Native.
|
|
373
|
-
// NOTE: react-native-webrtc >= 1.75.0 is required.
|
|
374
|
-
// NOTE: For Unified-Plan support, react-native-webrtc version >= 106.0.0 is
|
|
375
|
-
// required.
|
|
376
338
|
if (typeof navigator === 'object' && navigator.product === 'ReactNative') {
|
|
377
339
|
logger.debug('detectDeviceImpl() | React-Native detected');
|
|
378
|
-
if (typeof RTCPeerConnection === 'undefined'
|
|
379
|
-
|
|
340
|
+
if (typeof RTCPeerConnection === 'undefined' ||
|
|
341
|
+
typeof RTCRtpTransceiver === 'undefined') {
|
|
342
|
+
logger.warn('detectDeviceImpl() | unsupported react-native-webrtc without RTCPeerConnection or RTCRtpTransceiver, forgot to call registerGlobals() on it?');
|
|
380
343
|
return undefined;
|
|
381
344
|
}
|
|
382
|
-
|
|
383
|
-
logger.debug('detectDeviceImpl() | ReactNative UnifiedPlan handler chosen');
|
|
384
|
-
return 'ReactNativeUnifiedPlan';
|
|
385
|
-
}
|
|
386
|
-
else {
|
|
387
|
-
logger.debug('detectDeviceImpl() | ReactNative PlanB handler chosen');
|
|
388
|
-
return 'ReactNative';
|
|
389
|
-
}
|
|
345
|
+
return 'ReactNative106';
|
|
390
346
|
}
|
|
391
347
|
// Browser.
|
|
392
348
|
else {
|
|
@@ -422,22 +378,10 @@ function detectDeviceImpl(uaParserResult) {
|
|
|
422
378
|
(isEdge && !isIOS && browserVersion >= 88)) {
|
|
423
379
|
return 'Chrome74';
|
|
424
380
|
}
|
|
425
|
-
else if (isChrome && !isIOS && browserVersion >= 70) {
|
|
426
|
-
return 'Chrome70';
|
|
427
|
-
}
|
|
428
|
-
else if (isChrome && !isIOS && browserVersion >= 67) {
|
|
429
|
-
return 'Chrome67';
|
|
430
|
-
}
|
|
431
|
-
else if (isChrome && !isIOS && browserVersion >= 55) {
|
|
432
|
-
return 'Chrome55';
|
|
433
|
-
}
|
|
434
381
|
// Firefox.
|
|
435
382
|
else if (isFirefox && !isIOS && browserVersion >= 120) {
|
|
436
383
|
return 'Firefox120';
|
|
437
384
|
}
|
|
438
|
-
else if (isFirefox && !isIOS && browserVersion >= 60) {
|
|
439
|
-
return 'Firefox60';
|
|
440
|
-
}
|
|
441
385
|
// Firefox on iOS (so Safari).
|
|
442
386
|
else if (isFirefox && isIOS && osVersion >= 14.3) {
|
|
443
387
|
return 'Safari12';
|
|
@@ -449,14 +393,6 @@ function detectDeviceImpl(uaParserResult) {
|
|
|
449
393
|
RTCRtpTransceiver.prototype.hasOwnProperty('currentDirection')) {
|
|
450
394
|
return 'Safari12';
|
|
451
395
|
}
|
|
452
|
-
// Safari with Plab-B support.
|
|
453
|
-
else if (isSafari && browserVersion >= 11) {
|
|
454
|
-
return 'Safari11';
|
|
455
|
-
}
|
|
456
|
-
// Old Edge with ORTC support.
|
|
457
|
-
else if (isEdge && !isIOS && browserVersion >= 11 && browserVersion <= 18) {
|
|
458
|
-
return 'Edge11';
|
|
459
|
-
}
|
|
460
396
|
// Best effort for WebKit based browsers in iOS.
|
|
461
397
|
else if (engineName === 'webkit' &&
|
|
462
398
|
isIOS &&
|
|
@@ -473,17 +409,8 @@ function detectDeviceImpl(uaParserResult) {
|
|
|
473
409
|
if (version >= 111) {
|
|
474
410
|
return 'Chrome111';
|
|
475
411
|
}
|
|
476
|
-
else if (version >= 74) {
|
|
477
|
-
return 'Chrome74';
|
|
478
|
-
}
|
|
479
|
-
else if (version >= 70) {
|
|
480
|
-
return 'Chrome70';
|
|
481
|
-
}
|
|
482
|
-
else if (version >= 67) {
|
|
483
|
-
return 'Chrome67';
|
|
484
|
-
}
|
|
485
412
|
else {
|
|
486
|
-
return '
|
|
413
|
+
return 'Chrome74';
|
|
487
414
|
}
|
|
488
415
|
}
|
|
489
416
|
else {
|
|
@@ -2,7 +2,7 @@ import { type HandlerFactory, HandlerInterface, type HandlerRunOptions, type Han
|
|
|
2
2
|
import type { IceParameters } from '../Transport';
|
|
3
3
|
import type { RtpCapabilities } from '../RtpParameters';
|
|
4
4
|
import type { SctpCapabilities } from '../SctpParameters';
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class ReactNative106 extends HandlerInterface {
|
|
6
6
|
private _closed;
|
|
7
7
|
private _direction?;
|
|
8
8
|
private _remoteSdp?;
|
|
@@ -48,4 +48,4 @@ export declare class ReactNativeUnifiedPlan extends HandlerInterface {
|
|
|
48
48
|
private assertSendDirection;
|
|
49
49
|
private assertRecvDirection;
|
|
50
50
|
}
|
|
51
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=ReactNative106.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactNative106.d.ts","sourceRoot":"","sources":["../../src/handlers/ReactNative106.ts"],"names":[],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AAI,CAAC;IA0ChD,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCjD,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAoClD,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAa1D,kBAAkB,CAAC,EACxB,oBAAoB,EACpB,KAAK,EACL,QAAQ,GACR,EAAE,gCAAgC,GAAG,OAAO,CAAC,+BAA+B,CAAC;YA8DhE,cAAc;IAgC5B,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,mBAAmB;CAO3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ReactNative106 = void 0;
|
|
4
4
|
const sdpTransform = require("sdp-transform");
|
|
5
5
|
const Logger_1 = require("../Logger");
|
|
6
6
|
const utils = require("../utils");
|
|
@@ -12,10 +12,10 @@ const errors_1 = require("../errors");
|
|
|
12
12
|
const HandlerInterface_1 = require("./HandlerInterface");
|
|
13
13
|
const RemoteSdp_1 = require("./sdp/RemoteSdp");
|
|
14
14
|
const scalabilityModes_1 = require("../scalabilityModes");
|
|
15
|
-
const logger = new Logger_1.Logger('
|
|
16
|
-
const NAME = '
|
|
15
|
+
const logger = new Logger_1.Logger('ReactNative106');
|
|
16
|
+
const NAME = 'ReactNative106';
|
|
17
17
|
const SCTP_NUM_STREAMS = { OS: 1024, MIS: 1024 };
|
|
18
|
-
class
|
|
18
|
+
class ReactNative106 extends HandlerInterface_1.HandlerInterface {
|
|
19
19
|
// Closed flag.
|
|
20
20
|
_closed = false;
|
|
21
21
|
// Handler direction.
|
|
@@ -46,7 +46,7 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
46
46
|
* Creates a factory function.
|
|
47
47
|
*/
|
|
48
48
|
static createFactory() {
|
|
49
|
-
return () => new
|
|
49
|
+
return () => new ReactNative106();
|
|
50
50
|
}
|
|
51
51
|
constructor() {
|
|
52
52
|
super();
|
|
@@ -750,4 +750,4 @@ class ReactNativeUnifiedPlan extends HandlerInterface_1.HandlerInterface {
|
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
|
-
exports.
|
|
753
|
+
exports.ReactNative106 = ReactNative106;
|
|
@@ -4,12 +4,10 @@ import type { MediaKind, RtpParameters } from '../../RtpParameters';
|
|
|
4
4
|
import type { SctpParameters } from '../../SctpParameters';
|
|
5
5
|
export declare abstract class MediaSection {
|
|
6
6
|
protected readonly _mediaObject: any;
|
|
7
|
-
|
|
8
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, planB, }: {
|
|
7
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, }: {
|
|
9
8
|
iceParameters?: IceParameters;
|
|
10
9
|
iceCandidates?: IceCandidate[];
|
|
11
10
|
dtlsParameters?: DtlsParameters;
|
|
12
|
-
planB: boolean;
|
|
13
11
|
});
|
|
14
12
|
abstract setDtlsRole(role: DtlsRole): void;
|
|
15
13
|
get mid(): string;
|
|
@@ -22,13 +20,12 @@ export declare abstract class MediaSection {
|
|
|
22
20
|
close(): void;
|
|
23
21
|
}
|
|
24
22
|
export declare class AnswerMediaSection extends MediaSection {
|
|
25
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters,
|
|
23
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters, offerMediaObject, offerRtpParameters, answerRtpParameters, codecOptions, }: {
|
|
26
24
|
iceParameters?: IceParameters;
|
|
27
25
|
iceCandidates?: IceCandidate[];
|
|
28
26
|
dtlsParameters?: DtlsParameters;
|
|
29
27
|
sctpParameters?: SctpParameters;
|
|
30
28
|
plainRtpParameters?: PlainRtpParameters;
|
|
31
|
-
planB?: boolean;
|
|
32
29
|
offerMediaObject: any;
|
|
33
30
|
offerRtpParameters?: RtpParameters;
|
|
34
31
|
answerRtpParameters?: RtpParameters;
|
|
@@ -39,13 +36,12 @@ export declare class AnswerMediaSection extends MediaSection {
|
|
|
39
36
|
muxSimulcastStreams(encodings: RTCRtpEncodingParameters[]): void;
|
|
40
37
|
}
|
|
41
38
|
export declare class OfferMediaSection extends MediaSection {
|
|
42
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters,
|
|
39
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters, mid, kind, offerRtpParameters, streamId, trackId, oldDataChannelSpec, }: {
|
|
43
40
|
iceParameters?: IceParameters;
|
|
44
41
|
iceCandidates?: IceCandidate[];
|
|
45
42
|
dtlsParameters?: DtlsParameters;
|
|
46
43
|
sctpParameters?: SctpParameters;
|
|
47
44
|
plainRtpParameters?: PlainRtpParameters;
|
|
48
|
-
planB?: boolean;
|
|
49
45
|
mid: string;
|
|
50
46
|
kind: MediaKind | 'application';
|
|
51
47
|
offerRtpParameters?: RtpParameters;
|
|
@@ -55,13 +51,5 @@ export declare class OfferMediaSection extends MediaSection {
|
|
|
55
51
|
});
|
|
56
52
|
setDtlsRole(role: DtlsRole): void;
|
|
57
53
|
resume(): void;
|
|
58
|
-
planBReceive({ offerRtpParameters, streamId, trackId, }: {
|
|
59
|
-
offerRtpParameters: RtpParameters;
|
|
60
|
-
streamId: string;
|
|
61
|
-
trackId: string;
|
|
62
|
-
}): void;
|
|
63
|
-
planBStopReceiving({ offerRtpParameters, }: {
|
|
64
|
-
offerRtpParameters: RtpParameters;
|
|
65
|
-
}): void;
|
|
66
54
|
}
|
|
67
55
|
//# sourceMappingURL=MediaSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaSection.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/MediaSection.ts"],"names":[],"mappings":"AAEA,OAAO,KA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QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC7B;IAsJD,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAKjC,MAAM,IAAI,IAAI;CAGd"}
|
|
@@ -6,11 +6,8 @@ const utils = require("../../utils");
|
|
|
6
6
|
class MediaSection {
|
|
7
7
|
// SDP media object.
|
|
8
8
|
_mediaObject;
|
|
9
|
-
|
|
10
|
-
_planB;
|
|
11
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, planB = false, }) {
|
|
9
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, }) {
|
|
12
10
|
this._mediaObject = {};
|
|
13
|
-
this._planB = planB;
|
|
14
11
|
if (iceParameters) {
|
|
15
12
|
this.setIceParameters(iceParameters);
|
|
16
13
|
}
|
|
@@ -74,8 +71,8 @@ class MediaSection {
|
|
|
74
71
|
}
|
|
75
72
|
exports.MediaSection = MediaSection;
|
|
76
73
|
class AnswerMediaSection extends MediaSection {
|
|
77
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters,
|
|
78
|
-
super({ iceParameters, iceCandidates, dtlsParameters
|
|
74
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters, offerMediaObject, offerRtpParameters, answerRtpParameters, codecOptions, }) {
|
|
75
|
+
super({ iceParameters, iceCandidates, dtlsParameters });
|
|
79
76
|
this._mediaObject.mid = String(offerMediaObject.mid);
|
|
80
77
|
this._mediaObject.type = offerMediaObject.type;
|
|
81
78
|
this._mediaObject.protocol = offerMediaObject.protocol;
|
|
@@ -243,9 +240,6 @@ class AnswerMediaSection extends MediaSection {
|
|
|
243
240
|
}
|
|
244
241
|
this._mediaObject.rtcpMux = 'rtcp-mux';
|
|
245
242
|
this._mediaObject.rtcpRsize = 'rtcp-rsize';
|
|
246
|
-
if (this._planB && this._mediaObject.type === 'video') {
|
|
247
|
-
this._mediaObject.xGoogleFlag = 'conference';
|
|
248
|
-
}
|
|
249
243
|
break;
|
|
250
244
|
}
|
|
251
245
|
case 'application': {
|
|
@@ -311,8 +305,8 @@ class AnswerMediaSection extends MediaSection {
|
|
|
311
305
|
}
|
|
312
306
|
exports.AnswerMediaSection = AnswerMediaSection;
|
|
313
307
|
class OfferMediaSection extends MediaSection {
|
|
314
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters,
|
|
315
|
-
super({ iceParameters, iceCandidates, dtlsParameters
|
|
308
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters, mid, kind, offerRtpParameters, streamId, trackId, oldDataChannelSpec = false, }) {
|
|
309
|
+
super({ iceParameters, iceCandidates, dtlsParameters });
|
|
316
310
|
this._mediaObject.mid = String(mid);
|
|
317
311
|
this._mediaObject.type = kind;
|
|
318
312
|
if (!plainRtpParameters) {
|
|
@@ -343,9 +337,7 @@ class OfferMediaSection extends MediaSection {
|
|
|
343
337
|
this._mediaObject.rtp = [];
|
|
344
338
|
this._mediaObject.rtcpFb = [];
|
|
345
339
|
this._mediaObject.fmtp = [];
|
|
346
|
-
|
|
347
|
-
this._mediaObject.msid = `${streamId ?? '-'} ${trackId}`;
|
|
348
|
-
}
|
|
340
|
+
this._mediaObject.msid = `${streamId ?? '-'} ${trackId}`;
|
|
349
341
|
for (const codec of offerRtpParameters.codecs) {
|
|
350
342
|
const rtp = {
|
|
351
343
|
payload: codec.payloadType,
|
|
@@ -401,13 +393,6 @@ class OfferMediaSection extends MediaSection {
|
|
|
401
393
|
value: offerRtpParameters.rtcp.cname,
|
|
402
394
|
});
|
|
403
395
|
}
|
|
404
|
-
if (this._planB) {
|
|
405
|
-
this._mediaObject.ssrcs.push({
|
|
406
|
-
id: ssrc,
|
|
407
|
-
attribute: 'msid',
|
|
408
|
-
value: `${streamId ?? '-'} ${trackId}`,
|
|
409
|
-
});
|
|
410
|
-
}
|
|
411
396
|
if (rtxSsrc) {
|
|
412
397
|
if (offerRtpParameters.rtcp.cname) {
|
|
413
398
|
this._mediaObject.ssrcs.push({
|
|
@@ -416,13 +401,6 @@ class OfferMediaSection extends MediaSection {
|
|
|
416
401
|
value: offerRtpParameters.rtcp.cname,
|
|
417
402
|
});
|
|
418
403
|
}
|
|
419
|
-
if (this._planB) {
|
|
420
|
-
this._mediaObject.ssrcs.push({
|
|
421
|
-
id: rtxSsrc,
|
|
422
|
-
attribute: 'msid',
|
|
423
|
-
value: `${streamId ?? '-'} ${trackId}`,
|
|
424
|
-
});
|
|
425
|
-
}
|
|
426
404
|
// Associate original and retransmission SSRCs.
|
|
427
405
|
this._mediaObject.ssrcGroups.push({
|
|
428
406
|
semantics: 'FID',
|
|
@@ -459,91 +437,6 @@ class OfferMediaSection extends MediaSection {
|
|
|
459
437
|
resume() {
|
|
460
438
|
this._mediaObject.direction = 'sendonly';
|
|
461
439
|
}
|
|
462
|
-
planBReceive({ offerRtpParameters, streamId, trackId, }) {
|
|
463
|
-
const encoding = offerRtpParameters.encodings[0];
|
|
464
|
-
const ssrc = encoding.ssrc;
|
|
465
|
-
const rtxSsrc = encoding.rtx?.ssrc;
|
|
466
|
-
const payloads = this._mediaObject.payloads.split(' ');
|
|
467
|
-
for (const codec of offerRtpParameters.codecs) {
|
|
468
|
-
if (payloads.includes(String(codec.payloadType))) {
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
const rtp = {
|
|
472
|
-
payload: codec.payloadType,
|
|
473
|
-
codec: getCodecName(codec),
|
|
474
|
-
rate: codec.clockRate,
|
|
475
|
-
};
|
|
476
|
-
if (codec.channels > 1) {
|
|
477
|
-
rtp.encoding = codec.channels;
|
|
478
|
-
}
|
|
479
|
-
this._mediaObject.rtp.push(rtp);
|
|
480
|
-
const fmtp = {
|
|
481
|
-
payload: codec.payloadType,
|
|
482
|
-
config: '',
|
|
483
|
-
};
|
|
484
|
-
for (const key of Object.keys(codec.parameters)) {
|
|
485
|
-
if (fmtp.config) {
|
|
486
|
-
fmtp.config += ';';
|
|
487
|
-
}
|
|
488
|
-
fmtp.config += `${key}=${codec.parameters[key]}`;
|
|
489
|
-
}
|
|
490
|
-
if (fmtp.config) {
|
|
491
|
-
this._mediaObject.fmtp.push(fmtp);
|
|
492
|
-
}
|
|
493
|
-
for (const fb of codec.rtcpFeedback) {
|
|
494
|
-
this._mediaObject.rtcpFb.push({
|
|
495
|
-
payload: codec.payloadType,
|
|
496
|
-
type: fb.type,
|
|
497
|
-
subtype: fb.parameter,
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
this._mediaObject.payloads += ` ${offerRtpParameters.codecs
|
|
502
|
-
.filter((codec) => !this._mediaObject.payloads.includes(codec.payloadType))
|
|
503
|
-
.map((codec) => codec.payloadType)
|
|
504
|
-
.join(' ')}`;
|
|
505
|
-
this._mediaObject.payloads = this._mediaObject.payloads.trim();
|
|
506
|
-
if (offerRtpParameters.rtcp.cname) {
|
|
507
|
-
this._mediaObject.ssrcs.push({
|
|
508
|
-
id: ssrc,
|
|
509
|
-
attribute: 'cname',
|
|
510
|
-
value: offerRtpParameters.rtcp.cname,
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
this._mediaObject.ssrcs.push({
|
|
514
|
-
id: ssrc,
|
|
515
|
-
attribute: 'msid',
|
|
516
|
-
value: `${streamId ?? '-'} ${trackId}`,
|
|
517
|
-
});
|
|
518
|
-
if (rtxSsrc) {
|
|
519
|
-
if (offerRtpParameters.rtcp.cname) {
|
|
520
|
-
this._mediaObject.ssrcs.push({
|
|
521
|
-
id: rtxSsrc,
|
|
522
|
-
attribute: 'cname',
|
|
523
|
-
value: offerRtpParameters.rtcp.cname,
|
|
524
|
-
});
|
|
525
|
-
}
|
|
526
|
-
this._mediaObject.ssrcs.push({
|
|
527
|
-
id: rtxSsrc,
|
|
528
|
-
attribute: 'msid',
|
|
529
|
-
value: `${streamId ?? '-'} ${trackId}`,
|
|
530
|
-
});
|
|
531
|
-
// Associate original and retransmission SSRCs.
|
|
532
|
-
this._mediaObject.ssrcGroups.push({
|
|
533
|
-
semantics: 'FID',
|
|
534
|
-
ssrcs: `${ssrc} ${rtxSsrc}`,
|
|
535
|
-
});
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
planBStopReceiving({ offerRtpParameters, }) {
|
|
539
|
-
const encoding = offerRtpParameters.encodings[0];
|
|
540
|
-
const ssrc = encoding.ssrc;
|
|
541
|
-
const rtxSsrc = encoding.rtx?.ssrc;
|
|
542
|
-
this._mediaObject.ssrcs = this._mediaObject.ssrcs.filter((s) => s.id !== ssrc && s.id !== rtxSsrc);
|
|
543
|
-
if (rtxSsrc) {
|
|
544
|
-
this._mediaObject.ssrcGroups = this._mediaObject.ssrcGroups.filter((group) => group.ssrcs !== `${ssrc} ${rtxSsrc}`);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
440
|
}
|
|
548
441
|
exports.OfferMediaSection = OfferMediaSection;
|
|
549
442
|
function getCodecName(codec) {
|
|
@@ -9,18 +9,16 @@ export declare class RemoteSdp {
|
|
|
9
9
|
private readonly _dtlsParameters?;
|
|
10
10
|
private readonly _sctpParameters?;
|
|
11
11
|
private readonly _plainRtpParameters?;
|
|
12
|
-
private readonly _planB;
|
|
13
12
|
private readonly _mediaSections;
|
|
14
13
|
private readonly _midToIndex;
|
|
15
14
|
private _firstMid?;
|
|
16
15
|
private readonly _sdpObject;
|
|
17
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters,
|
|
16
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters, }: {
|
|
18
17
|
iceParameters?: IceParameters;
|
|
19
18
|
iceCandidates?: IceCandidate[];
|
|
20
19
|
dtlsParameters?: DtlsParameters;
|
|
21
20
|
sctpParameters?: SctpParameters;
|
|
22
21
|
plainRtpParameters?: PlainRtpParameters;
|
|
23
|
-
planB?: boolean;
|
|
24
22
|
});
|
|
25
23
|
updateIceParameters(iceParameters: IceParameters): void;
|
|
26
24
|
updateDtlsRole(role: DtlsRole): void;
|
|
@@ -59,10 +57,6 @@ export declare class RemoteSdp {
|
|
|
59
57
|
*/
|
|
60
58
|
closeMediaSection(mid: string): boolean;
|
|
61
59
|
muxMediaSectionSimulcast(mid: string, encodings: RTCRtpEncodingParameters[]): void;
|
|
62
|
-
planBStopReceiving({ mid, offerRtpParameters, }: {
|
|
63
|
-
mid: string;
|
|
64
|
-
offerRtpParameters: RtpParameters;
|
|
65
|
-
}): void;
|
|
66
60
|
sendSctpAssociation({ offerMediaObject }: {
|
|
67
61
|
offerMediaObject: any;
|
|
68
62
|
}): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteSdp.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/RemoteSdp.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,YAAY,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAM3D,qBAAa,SAAS;IAErB,OAAO,CAAC,cAAc,CAAC,CAAgB;IAEvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAiB;IAEjD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAiB;IAElD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAiB;IAElD,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAqB;IAE1D,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"RemoteSdp.d.ts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/C,MAAM,IAAI,MAAM;IAOhB,gBAAgB,CAAC,eAAe,EAAE,YAAY,GAAG,IAAI;IAkBrD,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAwC5E,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAU5C,qBAAqB,IAAI,IAAI;CAU7B"}
|
|
@@ -17,8 +17,6 @@ class RemoteSdp {
|
|
|
17
17
|
_sctpParameters;
|
|
18
18
|
// Parameters for plain RTP (no SRTP nor DTLS no BUNDLE).
|
|
19
19
|
_plainRtpParameters;
|
|
20
|
-
// Whether this is Plan-B SDP.
|
|
21
|
-
_planB;
|
|
22
20
|
// MediaSection instances with same order as in the SDP.
|
|
23
21
|
_mediaSections = [];
|
|
24
22
|
// MediaSection indices indexed by MID.
|
|
@@ -27,13 +25,12 @@ class RemoteSdp {
|
|
|
27
25
|
_firstMid;
|
|
28
26
|
// SDP object.
|
|
29
27
|
_sdpObject;
|
|
30
|
-
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters,
|
|
28
|
+
constructor({ iceParameters, iceCandidates, dtlsParameters, sctpParameters, plainRtpParameters, }) {
|
|
31
29
|
this._iceParameters = iceParameters;
|
|
32
30
|
this._iceCandidates = iceCandidates;
|
|
33
31
|
this._dtlsParameters = dtlsParameters;
|
|
34
32
|
this._sctpParameters = sctpParameters;
|
|
35
33
|
this._plainRtpParameters = plainRtpParameters;
|
|
36
|
-
this._planB = planB;
|
|
37
34
|
this._sdpObject = {
|
|
38
35
|
version: 0,
|
|
39
36
|
origin: {
|
|
@@ -108,7 +105,6 @@ class RemoteSdp {
|
|
|
108
105
|
iceCandidates: this._iceCandidates,
|
|
109
106
|
dtlsParameters: this._dtlsParameters,
|
|
110
107
|
plainRtpParameters: this._plainRtpParameters,
|
|
111
|
-
planB: this._planB,
|
|
112
108
|
offerMediaObject,
|
|
113
109
|
offerRtpParameters,
|
|
114
110
|
answerRtpParameters,
|
|
@@ -138,42 +134,28 @@ class RemoteSdp {
|
|
|
138
134
|
}
|
|
139
135
|
}
|
|
140
136
|
receive({ mid, kind, offerRtpParameters, streamId, trackId, }) {
|
|
141
|
-
const idx = this._midToIndex.get(mid);
|
|
142
|
-
let mediaSection;
|
|
143
|
-
if (idx !== undefined) {
|
|
144
|
-
mediaSection = this._mediaSections[idx];
|
|
145
|
-
}
|
|
146
137
|
// Allow both 1 byte and 2 bytes length header extensions since
|
|
147
138
|
// mediasoup can send both at any time.
|
|
148
139
|
this.setSessionExtmapAllowMixed();
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const oldMediaSection = this._mediaSections.find(m => m.closed);
|
|
166
|
-
if (oldMediaSection) {
|
|
167
|
-
this._replaceMediaSection(mediaSection, oldMediaSection.mid);
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
this._addMediaSection(mediaSection);
|
|
171
|
-
}
|
|
140
|
+
const mediaSection = new MediaSection_1.OfferMediaSection({
|
|
141
|
+
iceParameters: this._iceParameters,
|
|
142
|
+
iceCandidates: this._iceCandidates,
|
|
143
|
+
dtlsParameters: this._dtlsParameters,
|
|
144
|
+
plainRtpParameters: this._plainRtpParameters,
|
|
145
|
+
mid,
|
|
146
|
+
kind,
|
|
147
|
+
offerRtpParameters,
|
|
148
|
+
streamId,
|
|
149
|
+
trackId,
|
|
150
|
+
});
|
|
151
|
+
// Let's try to recycle a closed media section (if any).
|
|
152
|
+
// NOTE: Yes, we can recycle a closed m=audio section with a new m=video.
|
|
153
|
+
const oldMediaSection = this._mediaSections.find(m => m.closed);
|
|
154
|
+
if (oldMediaSection) {
|
|
155
|
+
this._replaceMediaSection(mediaSection, oldMediaSection.mid);
|
|
172
156
|
}
|
|
173
|
-
// Plan-B.
|
|
174
157
|
else {
|
|
175
|
-
|
|
176
|
-
this._replaceMediaSection(mediaSection);
|
|
158
|
+
this._addMediaSection(mediaSection);
|
|
177
159
|
}
|
|
178
160
|
}
|
|
179
161
|
pauseMediaSection(mid) {
|
|
@@ -218,11 +200,6 @@ class RemoteSdp {
|
|
|
218
200
|
mediaSection.muxSimulcastStreams(encodings);
|
|
219
201
|
this._replaceMediaSection(mediaSection);
|
|
220
202
|
}
|
|
221
|
-
planBStopReceiving({ mid, offerRtpParameters, }) {
|
|
222
|
-
const mediaSection = this._findMediaSection(mid);
|
|
223
|
-
mediaSection.planBStopReceiving({ offerRtpParameters });
|
|
224
|
-
this._replaceMediaSection(mediaSection);
|
|
225
|
-
}
|
|
226
203
|
sendSctpAssociation({ offerMediaObject }) {
|
|
227
204
|
const mediaSection = new MediaSection_1.AnswerMediaSection({
|
|
228
205
|
iceParameters: this._iceParameters,
|
package/lib/index.d.ts
CHANGED