@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 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) {
@@ -9404,7 +9432,8 @@ class SsrcIngressStreamSignaler {
9404
9432
  getReceiverId() {
9405
9433
  return Object.assign({ ssrc: this.ssrc }, (this.rtxSsrc ? { rtxSsrc: this.rtxSsrc } : {}));
9406
9434
  }
9407
- signalLocalStreams(_mLine) {
9435
+ signalLocalStreams(mLine) {
9436
+ mLine.extMaps = mLine.extMaps.filter((extMapLine) => !/^urn:ietf:params:rtp-hdrext:sdes:(?:mid|rtp-stream-id|repaired-rtp-stream-id)$/.test(extMapLine.uri));
9408
9437
  }
9409
9438
  signalRemoteStreams(mLine) {
9410
9439
  mLine.addLine(new SsrcLine(this.ssrc, 'cname', `${this.ssrc}-cname`));
@@ -13469,7 +13498,8 @@ class MultistreamConnection extends EventEmitter {
13469
13498
  publishTrack(track) {
13470
13499
  return __awaiter(this, void 0, void 0, function* () {
13471
13500
  let mediaContent;
13472
- if (track instanceof LocalDisplayTrack && this.options.floorControlledPresentation) {
13501
+ if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
13502
+ this.options.floorControlledPresentation) {
13473
13503
  mediaContent = MediaContent.Slides;
13474
13504
  }
13475
13505
  else {
@@ -13489,7 +13519,8 @@ class MultistreamConnection extends EventEmitter {
13489
13519
  unpublishTrack(track) {
13490
13520
  return __awaiter(this, void 0, void 0, function* () {
13491
13521
  let mediaContent;
13492
- if (track instanceof LocalDisplayTrack && this.options.floorControlledPresentation) {
13522
+ if ((track instanceof LocalDisplayTrack || track instanceof LocalSystemAudioTrack) &&
13523
+ this.options.floorControlledPresentation) {
13493
13524
  mediaContent = MediaContent.Slides;
13494
13525
  }
13495
13526
  else {
@@ -13988,6 +14019,7 @@ exports.JMPLogger = Logger$1;
13988
14019
  exports.LocalCameraTrack = LocalCameraTrack;
13989
14020
  exports.LocalDisplayTrack = LocalDisplayTrack;
13990
14021
  exports.LocalMicrophoneTrack = LocalMicrophoneTrack;
14022
+ exports.LocalSystemAudioTrack = LocalSystemAudioTrack;
13991
14023
  exports.LocalTrack = LocalTrack;
13992
14024
  exports.Logger = Logger;
13993
14025
  exports.MultistreamConnection = MultistreamConnection;
@@ -13999,6 +14031,7 @@ exports.WcmeError = WcmeError;
13999
14031
  exports.compareReceiveSlotIds = compareReceiveSlotIds;
14000
14032
  exports.createCameraTrack = createCameraTrack;
14001
14033
  exports.createDisplayTrack = createDisplayTrack;
14034
+ exports.createDisplayTrackWithAudio = createDisplayTrackWithAudio;
14002
14035
  exports.createMicrophoneTrack = createMicrophoneTrack;
14003
14036
  exports.getAudioInputDevices = getAudioInputDevices;
14004
14037
  exports.getAudioOutputDevices = getAudioOutputDevices;