@webex/web-client-media-engine 2.0.10 → 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 +34 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +33 -3
- 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) {
|
|
@@ -13465,7 +13493,8 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13465
13493
|
publishTrack(track) {
|
|
13466
13494
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13467
13495
|
let mediaContent;
|
|
13468
|
-
if (track instanceof LocalDisplayTrack
|
|
13496
|
+
if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
|
|
13497
|
+
this.options.floorControlledPresentation) {
|
|
13469
13498
|
mediaContent = MediaContent.Slides;
|
|
13470
13499
|
}
|
|
13471
13500
|
else {
|
|
@@ -13485,7 +13514,8 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13485
13514
|
unpublishTrack(track) {
|
|
13486
13515
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13487
13516
|
let mediaContent;
|
|
13488
|
-
if (track instanceof LocalDisplayTrack
|
|
13517
|
+
if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
|
|
13518
|
+
this.options.floorControlledPresentation) {
|
|
13489
13519
|
mediaContent = MediaContent.Slides;
|
|
13490
13520
|
}
|
|
13491
13521
|
else {
|
|
@@ -13980,5 +14010,5 @@ class StreamRequest {
|
|
|
13980
14010
|
}
|
|
13981
14011
|
}
|
|
13982
14012
|
|
|
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 };
|
|
14013
|
+
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
14014
|
//# sourceMappingURL=index.js.map
|