@webex/web-client-media-engine 3.1.0 → 3.3.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/dist/cjs/index.js +216 -193
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +216 -193
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +10 -6
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -486,6 +486,175 @@ var media = /*#__PURE__*/Object.freeze({
|
|
|
486
486
|
ensureDevicePermissions: ensureDevicePermissions
|
|
487
487
|
});
|
|
488
488
|
|
|
489
|
+
var ErrorTypes;
|
|
490
|
+
(function (ErrorTypes) {
|
|
491
|
+
ErrorTypes["DEVICE_PERMISSION_DENIED"] = "DEVICE_PERMISSION_DENIED";
|
|
492
|
+
ErrorTypes["CREATE_STREAM_FAILED"] = "CREATE_CAMERA_STREAM";
|
|
493
|
+
})(ErrorTypes || (ErrorTypes = {}));
|
|
494
|
+
/**
|
|
495
|
+
* Represents a WCME error, which contains error type and error message.
|
|
496
|
+
*/
|
|
497
|
+
class WcmeError {
|
|
498
|
+
/**
|
|
499
|
+
* Creates new error.
|
|
500
|
+
*
|
|
501
|
+
* @param type - Error type.
|
|
502
|
+
* @param message - Error message.
|
|
503
|
+
*/
|
|
504
|
+
constructor(type, message = '') {
|
|
505
|
+
this.type = type;
|
|
506
|
+
this.message = message;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Creates a camera stream. Please note that the constraint params in second getUserMedia call would NOT take effect when:
|
|
511
|
+
*
|
|
512
|
+
* 1. Previous captured video stream from the same device is not stopped.
|
|
513
|
+
* 2. Previous createCameraStream() call for the same device is in progress.
|
|
514
|
+
*
|
|
515
|
+
* @param constructor - Constructor for the local camera stream.
|
|
516
|
+
* @param constraints - Video device constraints.
|
|
517
|
+
* @returns A LocalCameraStream object or an error.
|
|
518
|
+
*/
|
|
519
|
+
function createCameraStream(constructor, constraints) {
|
|
520
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
521
|
+
let stream;
|
|
522
|
+
try {
|
|
523
|
+
stream = yield getUserMedia({ video: Object.assign({}, constraints) });
|
|
524
|
+
}
|
|
525
|
+
catch (error) {
|
|
526
|
+
throw new WcmeError(ErrorTypes.CREATE_STREAM_FAILED, `Failed to create camera stream: ${error}`);
|
|
527
|
+
}
|
|
528
|
+
return new constructor(stream);
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Creates a LocalMicrophoneStream with the given constraints.
|
|
533
|
+
*
|
|
534
|
+
* @param constructor - Constructor for the local microphone stream.
|
|
535
|
+
* @param constraints - Audio device constraints.
|
|
536
|
+
* @returns A LocalMicrophoneStream object or an error.
|
|
537
|
+
*/
|
|
538
|
+
function createMicrophoneStream(constructor, constraints) {
|
|
539
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
540
|
+
let stream;
|
|
541
|
+
try {
|
|
542
|
+
stream = yield getUserMedia({ audio: Object.assign({}, constraints) });
|
|
543
|
+
}
|
|
544
|
+
catch (error) {
|
|
545
|
+
throw new WcmeError(ErrorTypes.CREATE_STREAM_FAILED, `Failed to create microphone stream: ${error}`);
|
|
546
|
+
}
|
|
547
|
+
return new constructor(stream);
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Creates a LocalDisplayStream with the given parameters.
|
|
552
|
+
*
|
|
553
|
+
* @param constructor - Constructor for the local display stream.
|
|
554
|
+
* @param videoContentHint - An optional parameter to give a hint for the content of the stream.
|
|
555
|
+
* @returns A Promise that resolves to a LocalDisplayStream or an error.
|
|
556
|
+
*/
|
|
557
|
+
function createDisplayStream(constructor, videoContentHint) {
|
|
558
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
559
|
+
let stream;
|
|
560
|
+
try {
|
|
561
|
+
stream = yield getDisplayMedia({ video: true });
|
|
562
|
+
}
|
|
563
|
+
catch (error) {
|
|
564
|
+
throw new WcmeError(ErrorTypes.CREATE_STREAM_FAILED, `Failed to create display stream: ${error}`);
|
|
565
|
+
}
|
|
566
|
+
const localDisplayStream = new constructor(stream);
|
|
567
|
+
if (videoContentHint) {
|
|
568
|
+
localDisplayStream.contentHint = videoContentHint;
|
|
569
|
+
}
|
|
570
|
+
return localDisplayStream;
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Creates a LocalDisplayStream and a LocalSystemAudioStream with the given parameters.
|
|
575
|
+
*
|
|
576
|
+
* @param displayStreamConstructor - Constructor for the local display stream.
|
|
577
|
+
* @param systemAudioStreamConstructor - Constructor for the local system audio stream.
|
|
578
|
+
* @param videoContentHint - An optional parameter to give a hint for the content of the stream.
|
|
579
|
+
* @returns A Promise that resolves to a LocalDisplayStream and a LocalSystemAudioStream or an
|
|
580
|
+
* error. If no system audio is available, the LocalSystemAudioStream will be resolved as null
|
|
581
|
+
* instead.
|
|
582
|
+
*/
|
|
583
|
+
function createDisplayStreamWithAudio(displayStreamConstructor, systemAudioStreamConstructor, videoContentHint) {
|
|
584
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
585
|
+
let stream;
|
|
586
|
+
try {
|
|
587
|
+
stream = yield getDisplayMedia({ video: true, audio: true });
|
|
588
|
+
}
|
|
589
|
+
catch (error) {
|
|
590
|
+
throw new WcmeError(ErrorTypes.CREATE_STREAM_FAILED, `Failed to create display and system audio streams: ${error}`);
|
|
591
|
+
}
|
|
592
|
+
// eslint-disable-next-line new-cap
|
|
593
|
+
const localDisplayStream = new displayStreamConstructor(new MediaStream(stream.getVideoTracks()));
|
|
594
|
+
if (videoContentHint) {
|
|
595
|
+
localDisplayStream.contentHint = videoContentHint;
|
|
596
|
+
}
|
|
597
|
+
let localSystemAudioStream = null;
|
|
598
|
+
if (stream.getAudioTracks().length > 0) {
|
|
599
|
+
// eslint-disable-next-line new-cap
|
|
600
|
+
localSystemAudioStream = new systemAudioStreamConstructor(new MediaStream(stream.getAudioTracks()));
|
|
601
|
+
}
|
|
602
|
+
return [localDisplayStream, localSystemAudioStream];
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Enumerates the media input and output devices available.
|
|
607
|
+
*
|
|
608
|
+
* @param deviceKind - Optional filter to return a specific device kind.
|
|
609
|
+
* @returns List of media devices in an array of MediaDeviceInfo objects.
|
|
610
|
+
*/
|
|
611
|
+
function getDevices(deviceKind) {
|
|
612
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
613
|
+
let devices;
|
|
614
|
+
try {
|
|
615
|
+
devices = yield ensureDevicePermissions([DeviceKind.AudioInput, DeviceKind.VideoInput], enumerateDevices);
|
|
616
|
+
}
|
|
617
|
+
catch (error) {
|
|
618
|
+
throw new WcmeError(ErrorTypes.DEVICE_PERMISSION_DENIED, 'Failed to ensure device permissions');
|
|
619
|
+
}
|
|
620
|
+
return devices.filter((v) => (deviceKind ? v.kind === deviceKind : true));
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* Helper function to get a list of microphone devices.
|
|
625
|
+
*
|
|
626
|
+
* @returns List of microphone devices in an array of MediaDeviceInfo objects.
|
|
627
|
+
*/
|
|
628
|
+
function getAudioInputDevices() {
|
|
629
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
630
|
+
return getDevices(DeviceKind.AudioInput);
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Helper function to get a list of speaker devices.
|
|
635
|
+
*
|
|
636
|
+
* @returns List of speaker devices in an array of MediaDeviceInfo objects.
|
|
637
|
+
*/
|
|
638
|
+
function getAudioOutputDevices() {
|
|
639
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
640
|
+
return getDevices(DeviceKind.AudioOutput);
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Helper function to get a list of camera devices.
|
|
645
|
+
*
|
|
646
|
+
* @returns List of camera devices in an array of MediaDeviceInfo objects.
|
|
647
|
+
*/
|
|
648
|
+
function getVideoInputDevices() {
|
|
649
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
650
|
+
return getDevices(DeviceKind.VideoInput);
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Export the setOnDeviceChangeHandler method directly from the core lib.
|
|
655
|
+
*/
|
|
656
|
+
const { setOnDeviceChangeHandler } = media;
|
|
657
|
+
|
|
489
658
|
var events$1$1 = {exports: {}};
|
|
490
659
|
|
|
491
660
|
var R$1$1 = typeof Reflect === 'object' ? Reflect : null;
|
|
@@ -1235,6 +1404,26 @@ class _LocalStream extends Stream {
|
|
|
1235
1404
|
_a$6 = exports.LocalStreamEventNames.ConstraintsChange, _b = exports.LocalStreamEventNames.OutputTrackChange;
|
|
1236
1405
|
const LocalStream = AddEvents(_LocalStream);
|
|
1237
1406
|
|
|
1407
|
+
/**
|
|
1408
|
+
* An audio LocalStream.
|
|
1409
|
+
*/
|
|
1410
|
+
class LocalAudioStream extends LocalStream {
|
|
1411
|
+
/**
|
|
1412
|
+
* Apply constraints to the stream.
|
|
1413
|
+
*
|
|
1414
|
+
* @param constraints - The constraints to apply.
|
|
1415
|
+
* @returns A promise which resolves when the constraints have been successfully applied.
|
|
1416
|
+
*/
|
|
1417
|
+
applyConstraints(constraints) {
|
|
1418
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1419
|
+
logger$3.log(`Applying constraints to local track:`, constraints);
|
|
1420
|
+
return this.inputTrack.applyConstraints(constraints).then(() => {
|
|
1421
|
+
this[exports.LocalStreamEventNames.ConstraintsChange].emit();
|
|
1422
|
+
});
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1238
1427
|
/**
|
|
1239
1428
|
* A video LocalStream.
|
|
1240
1429
|
*/
|
|
@@ -1302,26 +1491,6 @@ class LocalCameraStream extends LocalVideoStream {
|
|
|
1302
1491
|
class LocalDisplayStream extends LocalVideoStream {
|
|
1303
1492
|
}
|
|
1304
1493
|
|
|
1305
|
-
/**
|
|
1306
|
-
* An audio LocalStream.
|
|
1307
|
-
*/
|
|
1308
|
-
class LocalAudioStream extends LocalStream {
|
|
1309
|
-
/**
|
|
1310
|
-
* Apply constraints to the stream.
|
|
1311
|
-
*
|
|
1312
|
-
* @param constraints - The constraints to apply.
|
|
1313
|
-
* @returns A promise which resolves when the constraints have been successfully applied.
|
|
1314
|
-
*/
|
|
1315
|
-
applyConstraints(constraints) {
|
|
1316
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1317
|
-
logger$3.log(`Applying constraints to local track:`, constraints);
|
|
1318
|
-
return this.inputTrack.applyConstraints(constraints).then(() => {
|
|
1319
|
-
this[exports.LocalStreamEventNames.ConstraintsChange].emit();
|
|
1320
|
-
});
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
1494
|
/**
|
|
1326
1495
|
* A local microphone stream.
|
|
1327
1496
|
*/
|
|
@@ -1334,156 +1503,6 @@ class LocalMicrophoneStream extends LocalAudioStream {
|
|
|
1334
1503
|
class LocalSystemAudioStream extends LocalAudioStream {
|
|
1335
1504
|
}
|
|
1336
1505
|
|
|
1337
|
-
var ErrorTypes;
|
|
1338
|
-
(function (ErrorTypes) {
|
|
1339
|
-
ErrorTypes["DEVICE_PERMISSION_DENIED"] = "DEVICE_PERMISSION_DENIED";
|
|
1340
|
-
ErrorTypes["CREATE_CAMERA_STREAM_FAILED"] = "CREATE_CAMERA_STREAM_FAILED";
|
|
1341
|
-
ErrorTypes["CREATE_MICROPHONE_STREAM_FAILED"] = "CREATE_MICROPHONE_STREAM_FAILED";
|
|
1342
|
-
})(ErrorTypes || (ErrorTypes = {}));
|
|
1343
|
-
/**
|
|
1344
|
-
* Represents a WCME error, which contains error type and error message.
|
|
1345
|
-
*/
|
|
1346
|
-
class WcmeError {
|
|
1347
|
-
/**
|
|
1348
|
-
* Creates new error.
|
|
1349
|
-
*
|
|
1350
|
-
* @param type - Error type.
|
|
1351
|
-
* @param message - Error message.
|
|
1352
|
-
*/
|
|
1353
|
-
constructor(type, message = '') {
|
|
1354
|
-
this.type = type;
|
|
1355
|
-
this.message = message;
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Creates a camera stream. Please note that the constraint params in second getUserMedia call would NOT take effect when:
|
|
1360
|
-
*
|
|
1361
|
-
* 1. Previous captured video stream from the same device is not stopped.
|
|
1362
|
-
* 2. Previous createCameraStream() call for the same device is in progress.
|
|
1363
|
-
*
|
|
1364
|
-
* @param constraints - Video device constraints.
|
|
1365
|
-
* @returns A LocalCameraStream object or an error.
|
|
1366
|
-
*/
|
|
1367
|
-
function createCameraStream(constraints) {
|
|
1368
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1369
|
-
let stream;
|
|
1370
|
-
try {
|
|
1371
|
-
stream = yield getUserMedia({ video: Object.assign({}, constraints) });
|
|
1372
|
-
}
|
|
1373
|
-
catch (error) {
|
|
1374
|
-
throw new WcmeError(ErrorTypes.CREATE_CAMERA_STREAM_FAILED, `Failed to create camera stream ${error}`);
|
|
1375
|
-
}
|
|
1376
|
-
return new LocalCameraStream(stream);
|
|
1377
|
-
});
|
|
1378
|
-
}
|
|
1379
|
-
/**
|
|
1380
|
-
* Creates a LocalMicrophoneStream with the given constraints.
|
|
1381
|
-
*
|
|
1382
|
-
* @param constraints - Audio device constraints.
|
|
1383
|
-
* @returns A LocalMicrophoneStream object or an error.
|
|
1384
|
-
*/
|
|
1385
|
-
function createMicrophoneStream(constraints) {
|
|
1386
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1387
|
-
let stream;
|
|
1388
|
-
try {
|
|
1389
|
-
stream = yield getUserMedia({ audio: Object.assign({}, constraints) });
|
|
1390
|
-
}
|
|
1391
|
-
catch (error) {
|
|
1392
|
-
throw new WcmeError(ErrorTypes.CREATE_MICROPHONE_STREAM_FAILED, `Failed to create microphone stream ${error}`);
|
|
1393
|
-
}
|
|
1394
|
-
return new LocalMicrophoneStream(stream);
|
|
1395
|
-
});
|
|
1396
|
-
}
|
|
1397
|
-
/**
|
|
1398
|
-
* Creates a LocalDisplayStream with the given parameters.
|
|
1399
|
-
*
|
|
1400
|
-
* @param videoContentHint - An optional parameter to give a hint for the content of the stream.
|
|
1401
|
-
* @returns A Promise that resolves to a LocalDisplayStream.
|
|
1402
|
-
*/
|
|
1403
|
-
function createDisplayStream(videoContentHint) {
|
|
1404
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1405
|
-
const stream = yield getDisplayMedia({ video: true });
|
|
1406
|
-
const localDisplayStream = new LocalDisplayStream(stream);
|
|
1407
|
-
if (videoContentHint) {
|
|
1408
|
-
localDisplayStream.contentHint = videoContentHint;
|
|
1409
|
-
}
|
|
1410
|
-
return localDisplayStream;
|
|
1411
|
-
});
|
|
1412
|
-
}
|
|
1413
|
-
/**
|
|
1414
|
-
* Creates a LocalDisplayStream and a LocalSystemAudioStream with the given parameters.
|
|
1415
|
-
*
|
|
1416
|
-
* @param videoContentHint - An optional parameter to give a hint for the content of the stream.
|
|
1417
|
-
* @returns A Promise that resolves to a LocalDisplayStream and a LocalSystemAudioStream. If no system
|
|
1418
|
-
* audio is available, the LocalSystemAudioStream will be resolved as null instead.
|
|
1419
|
-
*/
|
|
1420
|
-
function createDisplayStreamWithAudio(videoContentHint) {
|
|
1421
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1422
|
-
const stream = yield getDisplayMedia({ video: true, audio: true });
|
|
1423
|
-
const localDisplayStream = new LocalDisplayStream(new MediaStream(stream.getVideoTracks()));
|
|
1424
|
-
if (videoContentHint) {
|
|
1425
|
-
localDisplayStream.contentHint = videoContentHint;
|
|
1426
|
-
}
|
|
1427
|
-
let localSystemAudioStream = null;
|
|
1428
|
-
if (stream.getAudioTracks().length > 0) {
|
|
1429
|
-
localSystemAudioStream = new LocalSystemAudioStream(new MediaStream(stream.getAudioTracks()));
|
|
1430
|
-
}
|
|
1431
|
-
return [localDisplayStream, localSystemAudioStream];
|
|
1432
|
-
});
|
|
1433
|
-
}
|
|
1434
|
-
/**
|
|
1435
|
-
* Enumerates the media input and output devices available.
|
|
1436
|
-
*
|
|
1437
|
-
* @param deviceKind - Optional filter to return a specific device kind.
|
|
1438
|
-
* @returns List of media devices in an array of MediaDeviceInfo objects.
|
|
1439
|
-
*/
|
|
1440
|
-
function getDevices(deviceKind) {
|
|
1441
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1442
|
-
let devices;
|
|
1443
|
-
try {
|
|
1444
|
-
devices = yield ensureDevicePermissions([DeviceKind.AudioInput, DeviceKind.VideoInput], enumerateDevices);
|
|
1445
|
-
}
|
|
1446
|
-
catch (error) {
|
|
1447
|
-
throw new WcmeError(ErrorTypes.DEVICE_PERMISSION_DENIED, 'Failed to ensure device permissions');
|
|
1448
|
-
}
|
|
1449
|
-
return devices.filter((v) => (deviceKind ? v.kind === deviceKind : true));
|
|
1450
|
-
});
|
|
1451
|
-
}
|
|
1452
|
-
/**
|
|
1453
|
-
* Helper function to get a list of microphone devices.
|
|
1454
|
-
*
|
|
1455
|
-
* @returns List of microphone devices in an array of MediaDeviceInfo objects.
|
|
1456
|
-
*/
|
|
1457
|
-
function getAudioInputDevices() {
|
|
1458
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1459
|
-
return getDevices(DeviceKind.AudioInput);
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
/**
|
|
1463
|
-
* Helper function to get a list of speaker devices.
|
|
1464
|
-
*
|
|
1465
|
-
* @returns List of speaker devices in an array of MediaDeviceInfo objects.
|
|
1466
|
-
*/
|
|
1467
|
-
function getAudioOutputDevices() {
|
|
1468
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1469
|
-
return getDevices(DeviceKind.AudioOutput);
|
|
1470
|
-
});
|
|
1471
|
-
}
|
|
1472
|
-
/**
|
|
1473
|
-
* Helper function to get a list of camera devices.
|
|
1474
|
-
*
|
|
1475
|
-
* @returns List of camera devices in an array of MediaDeviceInfo objects.
|
|
1476
|
-
*/
|
|
1477
|
-
function getVideoInputDevices() {
|
|
1478
|
-
return __awaiter$1(this, void 0, void 0, function* () {
|
|
1479
|
-
return getDevices(DeviceKind.VideoInput);
|
|
1480
|
-
});
|
|
1481
|
-
}
|
|
1482
|
-
/**
|
|
1483
|
-
* Export the setOnDeviceChangeHandler method directly from the core lib.
|
|
1484
|
-
*/
|
|
1485
|
-
const { setOnDeviceChangeHandler } = media;
|
|
1486
|
-
|
|
1487
1506
|
/**
|
|
1488
1507
|
* A stream originating from a remote peer.
|
|
1489
1508
|
*/
|
|
@@ -9848,6 +9867,11 @@ class TypedEvent {
|
|
|
9848
9867
|
}
|
|
9849
9868
|
}
|
|
9850
9869
|
|
|
9870
|
+
var OfferAnswerType;
|
|
9871
|
+
(function (OfferAnswerType) {
|
|
9872
|
+
OfferAnswerType[OfferAnswerType["LocalOnly"] = 0] = "LocalOnly";
|
|
9873
|
+
OfferAnswerType[OfferAnswerType["Remote"] = 1] = "Remote";
|
|
9874
|
+
})(OfferAnswerType || (OfferAnswerType = {}));
|
|
9851
9875
|
class SendOnlyTransceiver extends Transceiver {
|
|
9852
9876
|
constructor(rtcRtpTransceiver, mid, csi, signaler, mediaType) {
|
|
9853
9877
|
super(rtcRtpTransceiver, mid);
|
|
@@ -9939,7 +9963,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
9939
9963
|
this.direction = enabled ? 'sendrecv' : 'inactive';
|
|
9940
9964
|
this._rtcRtpTransceiver.direction = this.direction;
|
|
9941
9965
|
if (this._rtcRtpTransceiver.direction !== this._rtcRtpTransceiver.currentDirection) {
|
|
9942
|
-
this.negotiationNeeded.emit();
|
|
9966
|
+
this.negotiationNeeded.emit(OfferAnswerType.Remote);
|
|
9943
9967
|
}
|
|
9944
9968
|
}
|
|
9945
9969
|
getStats() {
|
|
@@ -9995,9 +10019,11 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
9995
10019
|
}
|
|
9996
10020
|
setCodecParameters(parameters) {
|
|
9997
10021
|
this.streamSignaler.setCodecParameters(parameters);
|
|
10022
|
+
this.negotiationNeeded.emit(OfferAnswerType.LocalOnly);
|
|
9998
10023
|
}
|
|
9999
10024
|
deleteCodecParameters(parameters) {
|
|
10000
10025
|
this.streamSignaler.deleteCodecParameters(parameters);
|
|
10026
|
+
this.negotiationNeeded.emit(OfferAnswerType.LocalOnly);
|
|
10001
10027
|
}
|
|
10002
10028
|
}
|
|
10003
10029
|
|
|
@@ -10024,6 +10050,16 @@ class SendSlot {
|
|
|
10024
10050
|
set active(active) {
|
|
10025
10051
|
this.sendTransceiver.setActive(active);
|
|
10026
10052
|
}
|
|
10053
|
+
setCodecParameters(parameters) {
|
|
10054
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10055
|
+
this.sendTransceiver.setCodecParameters(parameters);
|
|
10056
|
+
});
|
|
10057
|
+
}
|
|
10058
|
+
deleteCodecParameters(parameters) {
|
|
10059
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10060
|
+
this.sendTransceiver.deleteCodecParameters(parameters);
|
|
10061
|
+
});
|
|
10062
|
+
}
|
|
10027
10063
|
}
|
|
10028
10064
|
|
|
10029
10065
|
function generateSsrc() {
|
|
@@ -13899,15 +13935,20 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
13899
13935
|
this.sendSourceAdvertisement(mediaType);
|
|
13900
13936
|
this.sendMediaRequestStatus(mediaType);
|
|
13901
13937
|
});
|
|
13902
|
-
transceiver.negotiationNeeded.on(() => {
|
|
13903
|
-
|
|
13938
|
+
transceiver.negotiationNeeded.on((offerAnswerType) => {
|
|
13939
|
+
if (offerAnswerType === OfferAnswerType.Remote) {
|
|
13940
|
+
this.emit(exports.MultistreamConnectionEventNames.NegotiationNeeded);
|
|
13941
|
+
}
|
|
13942
|
+
else if (this.pc.getRemoteDescription()) {
|
|
13943
|
+
this.queueLocalOfferAnswer();
|
|
13944
|
+
}
|
|
13904
13945
|
});
|
|
13905
13946
|
this.sendTransceivers.set(mediaType, transceiver);
|
|
13906
13947
|
this.createJmpSession(mediaType);
|
|
13907
13948
|
}
|
|
13908
|
-
createSendSlot(mediaType) {
|
|
13949
|
+
createSendSlot(mediaType, active = true) {
|
|
13909
13950
|
const transceiver = this.getSendTransceiverOrThrow(mediaType);
|
|
13910
|
-
transceiver.setActive(
|
|
13951
|
+
transceiver.setActive(active);
|
|
13911
13952
|
return new SendSlot(transceiver);
|
|
13912
13953
|
}
|
|
13913
13954
|
createJmpSession(mediaType) {
|
|
@@ -14337,24 +14378,6 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14337
14378
|
}
|
|
14338
14379
|
return transceiver;
|
|
14339
14380
|
}
|
|
14340
|
-
setCodecParameters(mediaType, parameters) {
|
|
14341
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14342
|
-
const transceiver = this.sendTransceivers.get(mediaType);
|
|
14343
|
-
transceiver === null || transceiver === void 0 ? void 0 : transceiver.setCodecParameters(parameters);
|
|
14344
|
-
if (this.pc.getRemoteDescription()) {
|
|
14345
|
-
yield this.queueLocalOfferAnswer();
|
|
14346
|
-
}
|
|
14347
|
-
});
|
|
14348
|
-
}
|
|
14349
|
-
deleteCodecParameters(mediaType, parameters) {
|
|
14350
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14351
|
-
const transceiver = this.sendTransceivers.get(mediaType);
|
|
14352
|
-
transceiver === null || transceiver === void 0 ? void 0 : transceiver.deleteCodecParameters(parameters);
|
|
14353
|
-
if (this.pc.getRemoteDescription()) {
|
|
14354
|
-
yield this.queueLocalOfferAnswer();
|
|
14355
|
-
}
|
|
14356
|
-
});
|
|
14357
|
-
}
|
|
14358
14381
|
requestMedia(mediaType, streamRequests) {
|
|
14359
14382
|
var _a;
|
|
14360
14383
|
const task = () => {
|