trtc-sdk-v5 5.4.3-beta.1 → 5.4.3-beta.4

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/index.d.ts CHANGED
@@ -1478,9 +1478,9 @@
1478
1478
  *
1479
1479
  * @param {string} [config] If not passed, get the local camera videoTrack
1480
1480
  * @param {string} [config.userId] If not passed or passed an empty string, get the local videoTrack. Pass the userId of the remote user to get the remote user's videoTrack.
1481
- * @param {STREAM_TYPE_MAIN|STREAM_TYPE_SUB} [config.streamType] - Remote stream type:
1482
- * - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (remote user's camera)(default)
1483
- * - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: Sub stream (remote user's screen sharing)
1481
+ * @param {STREAM_TYPE_MAIN|STREAM_TYPE_SUB} [config.streamType] - stream type:
1482
+ * - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (user's camera)(default)
1483
+ * - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: Sub stream (user's screen sharing)
1484
1484
  * @returns {MediaStreamTrack|null} Video track
1485
1485
  * @memberof TRTC
1486
1486
  * @example
@@ -1501,10 +1501,24 @@
1501
1501
  * Get audio track
1502
1502
  *
1503
1503
  * @returns {MediaStreamTrack?} Audio track
1504
- * @param {string} [userId] If not passed, get the local audioTrack
1504
+ * @param {Object|string} [config] If not passed, get the local microphone audioTrack
1505
+ * @param {string} [config.userId] If not passed or passed an empty string, get the local audioTrack. Pass the userId of the remote user to get the remote user's audioTrack.
1506
+ * @param {STREAM_TYPE_MAIN|STREAM_TYPE_SUB} [config.streamType] - stream type:
1507
+ * - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (user's microphone)(default)
1508
+ * - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: Sub stream (user's screen sharing audio). Only works for local screen sharing audio because there is only one remote audioTrack, and there is no distinction between Main and Sub for remote audioTrack.
1505
1509
  * @memberof TRTC
1510
+ * @example
1511
+ * // Version before v5.5.0
1512
+ * trtc.getAudioTrack(); // Get local microphone audioTrack, captured by trtc.startLocalAudio()
1513
+ * trtc.getAudioTrack('remoteUserId'); // Get remote audioTrack
1514
+ *
1515
+ * // Since v5.5.0+, you can get local screen audioTrack by passing the streamType = TRTC.STREAM_TYPE_SUB
1516
+ * trtc.getAudioTrack({ streamType: TRTC.STREAM_TYPE_SUB });
1506
1517
  */
1507
- getAudioTrack(userId?: string): MediaStreamTrack | null;
1518
+ getAudioTrack(configOrUserId?: {
1519
+ userId?: string;
1520
+ streamType?: TRTCStreamType;
1521
+ } | string): MediaStreamTrack | null;
1508
1522
  setCurrentSpeaker(speakerId: string): void;
1509
1523
  /**
1510
1524
  * Send SEI Message <br>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.4.3-beta.1",
3
+ "version": "5.4.3-beta.4",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
5
  "main": "trtc.js",
6
6
  "types": "index.d.ts",