@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 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 && this.options.floorControlledPresentation) {
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 && this.options.floorControlledPresentation) {
13521
+ if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
13522
+ this.options.floorControlledPresentation) {
13493
13523
  mediaContent = MediaContent.Slides;
13494
13524
  }
13495
13525
  else {
@@ -13988,6 +14018,7 @@ exports.JMPLogger = Logger$1;
13988
14018
  exports.LocalCameraTrack = LocalCameraTrack;
13989
14019
  exports.LocalDisplayTrack = LocalDisplayTrack;
13990
14020
  exports.LocalMicrophoneTrack = LocalMicrophoneTrack;
14021
+ exports.LocalSystemAudioTrack = LocalSystemAudioTrack;
13991
14022
  exports.LocalTrack = LocalTrack;
13992
14023
  exports.Logger = Logger;
13993
14024
  exports.MultistreamConnection = MultistreamConnection;
@@ -13999,6 +14030,7 @@ exports.WcmeError = WcmeError;
13999
14030
  exports.compareReceiveSlotIds = compareReceiveSlotIds;
14000
14031
  exports.createCameraTrack = createCameraTrack;
14001
14032
  exports.createDisplayTrack = createDisplayTrack;
14033
+ exports.createDisplayTrackWithAudio = createDisplayTrackWithAudio;
14002
14034
  exports.createMicrophoneTrack = createMicrophoneTrack;
14003
14035
  exports.getAudioInputDevices = getAudioInputDevices;
14004
14036
  exports.getAudioOutputDevices = getAudioOutputDevices;