@webex/web-client-media-engine 2.0.10 → 2.1.1
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 +36 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +35 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -557,6 +557,28 @@ function createDisplayTrack(constructor, videoContentHint) {
|
|
|
557
557
|
return new constructor(stream, videoContentHint);
|
|
558
558
|
});
|
|
559
559
|
}
|
|
560
|
+
/**
|
|
561
|
+
* Creates a display video track and a system audio track.
|
|
562
|
+
*
|
|
563
|
+
* @param videoTrackConstructor - Constructor for the local display track.
|
|
564
|
+
* @param audioTrackConstructor - Constructor for the local system audio track.
|
|
565
|
+
* @param videoContentHint - An optional parameter to give a hint for the content of the track.
|
|
566
|
+
* @returns A Promise that resolves to a LocalDisplayTrack and a LocalSystemAudioTrack. If no system
|
|
567
|
+
* audio is available, the LocalSystemAudioTrack will be resolved as null instead.
|
|
568
|
+
*/
|
|
569
|
+
function createDisplayTrackWithAudio(videoTrackConstructor, audioTrackConstructor, videoContentHint) {
|
|
570
|
+
return __awaiter$1(this, void 0, void 0, function* () {
|
|
571
|
+
const stream = yield getDisplayMedia({ video: true, audio: true });
|
|
572
|
+
// eslint-disable-next-line new-cap
|
|
573
|
+
const videoTrack = new videoTrackConstructor(new MediaStream(stream.getVideoTracks()), videoContentHint);
|
|
574
|
+
let audioTrack = null;
|
|
575
|
+
if (stream.getAudioTracks().length > 0) {
|
|
576
|
+
// eslint-disable-next-line new-cap
|
|
577
|
+
audioTrack = new audioTrackConstructor(new MediaStream(stream.getAudioTracks()));
|
|
578
|
+
}
|
|
579
|
+
return [videoTrack, audioTrack];
|
|
580
|
+
});
|
|
581
|
+
}
|
|
560
582
|
/**
|
|
561
583
|
* Enumerates the media input and output devices available.
|
|
562
584
|
*
|
|
@@ -1410,6 +1432,12 @@ class LocalDisplayTrack extends LocalTrack {
|
|
|
1410
1432
|
class LocalMicrophoneTrack extends LocalTrack {
|
|
1411
1433
|
}
|
|
1412
1434
|
|
|
1435
|
+
/**
|
|
1436
|
+
* Represents a local track for system audio.
|
|
1437
|
+
*/
|
|
1438
|
+
class LocalSystemAudioTrack extends LocalTrack {
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1413
1441
|
// Overall connection state (based on the ICE and DTLS connection states)
|
|
1414
1442
|
var ConnectionState;
|
|
1415
1443
|
(function (ConnectionState) {
|
|
@@ -9400,7 +9428,8 @@ class SsrcIngressStreamSignaler {
|
|
|
9400
9428
|
getReceiverId() {
|
|
9401
9429
|
return Object.assign({ ssrc: this.ssrc }, (this.rtxSsrc ? { rtxSsrc: this.rtxSsrc } : {}));
|
|
9402
9430
|
}
|
|
9403
|
-
signalLocalStreams(
|
|
9431
|
+
signalLocalStreams(mLine) {
|
|
9432
|
+
mLine.extMaps = mLine.extMaps.filter((extMapLine) => !/^urn:ietf:params:rtp-hdrext:sdes:(?:mid|rtp-stream-id|repaired-rtp-stream-id)$/.test(extMapLine.uri));
|
|
9404
9433
|
}
|
|
9405
9434
|
signalRemoteStreams(mLine) {
|
|
9406
9435
|
mLine.addLine(new SsrcLine(this.ssrc, 'cname', `${this.ssrc}-cname`));
|
|
@@ -13465,7 +13494,8 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13465
13494
|
publishTrack(track) {
|
|
13466
13495
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13467
13496
|
let mediaContent;
|
|
13468
|
-
if (track instanceof LocalDisplayTrack
|
|
13497
|
+
if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
|
|
13498
|
+
this.options.floorControlledPresentation) {
|
|
13469
13499
|
mediaContent = MediaContent.Slides;
|
|
13470
13500
|
}
|
|
13471
13501
|
else {
|
|
@@ -13485,7 +13515,8 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13485
13515
|
unpublishTrack(track) {
|
|
13486
13516
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13487
13517
|
let mediaContent;
|
|
13488
|
-
if (track instanceof LocalDisplayTrack
|
|
13518
|
+
if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
|
|
13519
|
+
this.options.floorControlledPresentation) {
|
|
13489
13520
|
mediaContent = MediaContent.Slides;
|
|
13490
13521
|
}
|
|
13491
13522
|
else {
|
|
@@ -13980,5 +14011,5 @@ class StreamRequest {
|
|
|
13980
14011
|
}
|
|
13981
14012
|
}
|
|
13982
14013
|
|
|
13983
|
-
export { ConnectionState, Logger$1 as JMPLogger, LocalCameraTrack, LocalDisplayTrack, LocalMicrophoneTrack, LocalTrack, LocalTrackEvents, Logger, MediaCodecMimeType, MediaStreamTrackKind, MultistreamConnection, MultistreamConnectionEventNames, PeerConnection, ReceiveSlot, ReceiveSlotEvents, RecommendedOpusBitrates, SendOnlyTransceiver, StreamRequest, WcmeError, compareReceiveSlotIds, createCameraTrack, createDisplayTrack, createMicrophoneTrack, getAudioInputDevices, getAudioOutputDevices, getDevices, getLogLevel, getRecommendedMaxBitrateForFrameSize, getVideoInputDevices, logger, setLogHandler, setLogLevel, setOnDeviceChangeHandler };
|
|
14014
|
+
export { ConnectionState, Logger$1 as JMPLogger, LocalCameraTrack, LocalDisplayTrack, LocalMicrophoneTrack, LocalSystemAudioTrack, LocalTrack, LocalTrackEvents, Logger, MediaCodecMimeType, MediaStreamTrackKind, MultistreamConnection, MultistreamConnectionEventNames, PeerConnection, ReceiveSlot, ReceiveSlotEvents, RecommendedOpusBitrates, SendOnlyTransceiver, StreamRequest, WcmeError, compareReceiveSlotIds, createCameraTrack, createDisplayTrack, createDisplayTrackWithAudio, createMicrophoneTrack, getAudioInputDevices, getAudioOutputDevices, getDevices, getLogLevel, getRecommendedMaxBitrateForFrameSize, getVideoInputDevices, logger, setLogHandler, setLogLevel, setOnDeviceChangeHandler };
|
|
13984
14015
|
//# sourceMappingURL=index.js.map
|