@webex/web-client-media-engine 2.0.9 → 2.1.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 +39 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +38 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -561,6 +561,28 @@ function createDisplayTrack(constructor, videoContentHint) {
|
|
|
561
561
|
return new constructor(stream, videoContentHint);
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* Creates a display video track and a system audio track.
|
|
566
|
+
*
|
|
567
|
+
* @param videoTrackConstructor - Constructor for the local display track.
|
|
568
|
+
* @param audioTrackConstructor - Constructor for the local system audio track.
|
|
569
|
+
* @param videoContentHint - An optional parameter to give a hint for the content of the track.
|
|
570
|
+
* @returns A Promise that resolves to a LocalDisplayTrack and a LocalSystemAudioTrack. If no system
|
|
571
|
+
* audio is available, the LocalSystemAudioTrack will be resolved as null instead.
|
|
572
|
+
*/
|
|
573
|
+
function createDisplayTrackWithAudio(videoTrackConstructor, audioTrackConstructor, videoContentHint) {
|
|
574
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
575
|
+
const stream = yield getDisplayMedia({ video: true, audio: true });
|
|
576
|
+
// eslint-disable-next-line new-cap
|
|
577
|
+
const videoTrack = new videoTrackConstructor(new MediaStream(stream.getVideoTracks()), videoContentHint);
|
|
578
|
+
let audioTrack = null;
|
|
579
|
+
if (stream.getAudioTracks().length > 0) {
|
|
580
|
+
// eslint-disable-next-line new-cap
|
|
581
|
+
audioTrack = new audioTrackConstructor(new MediaStream(stream.getAudioTracks()));
|
|
582
|
+
}
|
|
583
|
+
return [videoTrack, audioTrack];
|
|
584
|
+
});
|
|
585
|
+
}
|
|
564
586
|
/**
|
|
565
587
|
* Enumerates the media input and output devices available.
|
|
566
588
|
*
|
|
@@ -1414,6 +1436,12 @@ class LocalDisplayTrack extends LocalTrack {
|
|
|
1414
1436
|
class LocalMicrophoneTrack extends LocalTrack {
|
|
1415
1437
|
}
|
|
1416
1438
|
|
|
1439
|
+
/**
|
|
1440
|
+
* Represents a local track for system audio.
|
|
1441
|
+
*/
|
|
1442
|
+
class LocalSystemAudioTrack extends LocalTrack {
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1417
1445
|
// Overall connection state (based on the ICE and DTLS connection states)
|
|
1418
1446
|
exports.ConnectionState = void 0;
|
|
1419
1447
|
(function (ConnectionState) {
|
|
@@ -13469,7 +13497,8 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13469
13497
|
publishTrack(track) {
|
|
13470
13498
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13471
13499
|
let mediaContent;
|
|
13472
|
-
if (track instanceof LocalDisplayTrack
|
|
13500
|
+
if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
|
|
13501
|
+
this.options.floorControlledPresentation) {
|
|
13473
13502
|
mediaContent = MediaContent.Slides;
|
|
13474
13503
|
}
|
|
13475
13504
|
else {
|
|
@@ -13489,7 +13518,8 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13489
13518
|
unpublishTrack(track) {
|
|
13490
13519
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13491
13520
|
let mediaContent;
|
|
13492
|
-
if (track instanceof LocalDisplayTrack
|
|
13521
|
+
if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
|
|
13522
|
+
this.options.floorControlledPresentation) {
|
|
13493
13523
|
mediaContent = MediaContent.Slides;
|
|
13494
13524
|
}
|
|
13495
13525
|
else {
|
|
@@ -13867,16 +13897,19 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13867
13897
|
this.initializePeerConnection();
|
|
13868
13898
|
this.streamSignalerManager = new StreamSignalerManager(this.options.streamSignalingMode);
|
|
13869
13899
|
const mainSceneId = generateSceneId();
|
|
13900
|
+
const slidesSceneId = generateSceneId();
|
|
13870
13901
|
this.sendTransceivers.forEach((transceiver, mediaType) => {
|
|
13871
13902
|
var _a;
|
|
13903
|
+
const mediaContent = getMediaContent(mediaType);
|
|
13904
|
+
const sceneId = mediaContent === MediaContent.Main ? mainSceneId : slidesSceneId;
|
|
13872
13905
|
this.addMid(mediaType);
|
|
13873
13906
|
transceiver.replaceTransceiver(this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
13874
13907
|
direction: 'sendrecv',
|
|
13875
13908
|
sendEncodings: getMediaFamily(mediaType) === MediaFamily.Video
|
|
13876
|
-
? this.getVideoEncodingOptions(
|
|
13909
|
+
? this.getVideoEncodingOptions(mediaContent)
|
|
13877
13910
|
: undefined,
|
|
13878
13911
|
}));
|
|
13879
|
-
transceiver.csi = generateCsi(getMediaFamily(mediaType),
|
|
13912
|
+
transceiver.csi = generateCsi(getMediaFamily(mediaType), sceneId);
|
|
13880
13913
|
(_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.close();
|
|
13881
13914
|
this.createJmpSession(mediaType);
|
|
13882
13915
|
});
|
|
@@ -13985,6 +14018,7 @@ exports.JMPLogger = Logger$1;
|
|
|
13985
14018
|
exports.LocalCameraTrack = LocalCameraTrack;
|
|
13986
14019
|
exports.LocalDisplayTrack = LocalDisplayTrack;
|
|
13987
14020
|
exports.LocalMicrophoneTrack = LocalMicrophoneTrack;
|
|
14021
|
+
exports.LocalSystemAudioTrack = LocalSystemAudioTrack;
|
|
13988
14022
|
exports.LocalTrack = LocalTrack;
|
|
13989
14023
|
exports.Logger = Logger;
|
|
13990
14024
|
exports.MultistreamConnection = MultistreamConnection;
|
|
@@ -13996,6 +14030,7 @@ exports.WcmeError = WcmeError;
|
|
|
13996
14030
|
exports.compareReceiveSlotIds = compareReceiveSlotIds;
|
|
13997
14031
|
exports.createCameraTrack = createCameraTrack;
|
|
13998
14032
|
exports.createDisplayTrack = createDisplayTrack;
|
|
14033
|
+
exports.createDisplayTrackWithAudio = createDisplayTrackWithAudio;
|
|
13999
14034
|
exports.createMicrophoneTrack = createMicrophoneTrack;
|
|
14000
14035
|
exports.getAudioInputDevices = getAudioInputDevices;
|
|
14001
14036
|
exports.getAudioOutputDevices = getAudioOutputDevices;
|