trtc-sdk-v5 5.4.0-beta.2 → 5.4.0-beta.3

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
@@ -80,6 +80,8 @@
80
80
  fillMode?: 'contain' | 'cover' | 'fill';
81
81
  mirror?: boolean;
82
82
  small?: boolean;
83
+ receiveWhenViewVisible?: boolean;
84
+ viewRoot?: HTMLElement;
83
85
  };
84
86
  }
85
87
  declare interface StopRemoteVideoConfig {
@@ -856,7 +858,7 @@
856
858
  }
857
859
  class TRTC extends EventEmitter<TRTCEventTypes> {
858
860
  /**
859
- * Create a TRTC object for implementing functions such as entering a room, previewing, pushing, and pulling streams.<br>
861
+ * Create a TRTC object for implementing functions such as entering a room, previewing, publishing, and subscribing streams.<br>
860
862
  *
861
863
  * **Note:**
862
864
  * - You must create a TRTC object first and call its methods and listen to its events to implement various functions required by the business.
@@ -912,7 +914,7 @@
912
914
  * - {@link module:TYPE.ROLE_AUDIENCE TRTC.TYPE.ROLE_AUDIENCE} Audience
913
915
  * Note: The audience role does not have the permission to publish local audio and video, only the permission to watch remote streams. If the audience wants to interact with the anchor by connecting to the microphone, please switch the role to the anchor through {@link TRTC#switchRole switchRole()} before publishing local audio and video.
914
916
  * @param {boolean} [options.autoReceiveAudio=true] Whether to automatically receive audio. When a remote user publishes audio, the SDK automatically plays the remote user's audio.
915
- * @param {boolean} [options.autoReceiveVideo=true] Whether to automatically receive video. When a remote user publishes video, the SDK automatically pulls and decodes the remote video. You need to call {@link TRTC#startLocalVideo startLocalVideo} to play the remote video.
917
+ * @param {boolean} [options.autoReceiveVideo=true] Whether to automatically receive video. When a remote user publishes video, the SDK automatically subscribes and decodes the remote video. You need to call {@link TRTC#startLocalVideo startLocalVideo} to play the remote video.
916
918
  * @param {boolean} [options.enableAutoPlayDialog] Whether to enable the SDK's automatic playback failure dialog box, default: true.
917
919
  * - Enabled by default. When automatic playback fails, the SDK will pop up a dialog box to guide the user to click the page to restore audio and video playback.
918
920
  * - Can be set to false in order to turn off. Refer to {@tutorial 21-advanced-auto-play-policy}.
@@ -1305,9 +1307,11 @@
1305
1307
  * - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (remote user's camera)
1306
1308
  * - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: Sub stream (remote user's screen sharing)
1307
1309
  * @param {object} [config.option] - Remote video configuration
1308
- * @param {boolean} [config.option.small] - Whether to pull small streams
1310
+ * @param {boolean} [config.option.small] - Whether to subscribe small streams
1309
1311
  * @param {boolean} [config.option.mirror] - Whether to enable mirror
1310
1312
  * @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - Video fill mode. Refer to the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit CSS object-fit} property.
1313
+ * @param {boolean} [config.option.receiveWhenViewVisible] - Since v5.4.0 <br>Subscribe video only when view is visible. Refer to: {@tutorial 27-advanced-small-stream}.
1314
+ * @param {HTMLElement} [config.option.viewRoot=document.body] - Since v5.4.0 <br>The root element is the parent element of the view and is used to calculate whether the view is visible relative to the root. The default value is document.body, and it is recommended that you use the first-level parent of the video view list. Refer to: {@tutorial 27-advanced-small-stream}.
1311
1315
  * @throws
1312
1316
  * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
1313
1317
  * - {@link module:ERROR_CODE.INVALID_OPERATION INVALID_OPERATION}
@@ -1334,9 +1338,11 @@
1334
1338
  * - {@link module:TYPE.STREAM_TYPE_MAIN TRTC.TYPE.STREAM_TYPE_MAIN}: Main stream (remote user's camera)
1335
1339
  * - {@link module:TYPE.STREAM_TYPE_SUB TRTC.TYPE.STREAM_TYPE_SUB}: Sub stream (remote user's screen sharing)
1336
1340
  * @param {object} [config.option] - Remote video configuration
1337
- * @param {boolean} [config.option.small] - Whether to pull small streams. Refer to: {@tutorial 27-advanced-small-stream}.
1341
+ * @param {boolean} [config.option.small] - Whether to subscribe small streams. Refer to: {@tutorial 27-advanced-small-stream}.
1338
1342
  * @param {boolean} [config.option.mirror] - Whether to enable mirror
1339
1343
  * @param {'contain' | 'cover' | 'fill'} [config.option.fillMode] - Video fill mode. Refer to the {@link https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit CSS object-fit} property.
1344
+ * @param {boolean} [config.option.receiveWhenViewVisible] - Since v5.4.0 <br>Subscribe video only when view is visible. Refer to: {@tutorial 27-advanced-small-stream}.
1345
+ * @param {HTMLElement} [config.option.viewRoot=document.body] - Since v5.4.0 <br>The root element is the parent element of the view and is used to calculate whether the view is visible relative to the root. The default value is document.body, and it is recommended that you use the first-level parent of the video view list. Refer to: {@tutorial 27-advanced-small-stream}.
1340
1346
  * @throws
1341
1347
  * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
1342
1348
  * - {@link module:ERROR_CODE.INVALID_OPERATION INVALID_OPERATION}
@@ -1365,13 +1371,13 @@
1365
1371
  */
1366
1372
  stopRemoteVideo(config: StopRemoteVideoConfig): Promise<void>;
1367
1373
  /**
1368
- * Mute a remote user and stop pulling audio data from that user. Only effective for the current user, other users in the room can still hear the muted user's voice.<br>
1374
+ * Mute a remote user and stop subscribing audio data from that user. Only effective for the current user, other users in the room can still hear the muted user's voice.<br>
1369
1375
  *
1370
1376
  * Note:
1371
1377
  * - By default, after entering the room, the SDK will automatically play remote audio. You can call this interface to mute or unmute remote users.
1372
1378
  * - If the parameter autoReceiveAudio = false is passed in when entering the room, remote audio will not be played automatically. When audio playback is required, you need to call this method (mute is passed in false) to play remote audio.
1373
1379
  * - This interface is effective before or after entering the room (enterRoom), and the mute state will be reset to false after exiting the room (exitRoom).
1374
- * - If you want to continue pulling audio data from the user but not play it, you can call setRemoteAudioVolume(userId, 0)
1380
+ * - If you want to continue subscribing audio data from the user but not play it, you can call setRemoteAudioVolume(userId, 0)
1375
1381
  * @param {string} userId - Remote user ID, '*' represents all users.
1376
1382
  * @param {boolean} mute - Whether to mute
1377
1383
  * @throws
@@ -1651,7 +1657,7 @@
1651
1657
  * <br>
1652
1658
  * **Note**
1653
1659
  * - This interface does not support use under the http protocol, please use the https protocol to deploy your website. {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Privacy_and_security Privacy and security}
1654
- * - Calling this method may temporarily open the camera to ensure that the camera list can be normally obtained, and the SDK will automatically release the camera capture later.
1660
+ * - Calling this method may temporarily open the camera to ensure that the camera list can be normally obtained, and the SDK will automatically stop the camera capture later.
1655
1661
  * - You can call the browser's native interface [getCapabilities](https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo/getCapabilities) to get the maximum resolutions supported by the camera, frame rate, mobile devices to distinguish between front and rear cameras, etc. This interface supports Chrome 67+, Edge 79+, Safari 17+, Opera 54+.
1656
1662
  * @example
1657
1663
  * const cameraList = await TRTC.getCameraList();
@@ -1674,7 +1680,7 @@
1674
1680
  * <br>
1675
1681
  * **Note**
1676
1682
  * - This interface does not support use under the http protocol, please use the https protocol to deploy your website. {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#Privacy_and_security Privacy and security}
1677
- * - Calling this method may temporarily open the microphone to ensure that the microphone list can be normally obtained, and the SDK will automatically release the microphone capture later.
1683
+ * - Calling this method may temporarily open the microphone to ensure that the microphone list can be normally obtained, and the SDK will automatically stop the microphone capture later.
1678
1684
  * - You can call the browser's native interface [getCapabilities](https://developer.mozilla.org/en-US/docs/Web/API/InputDeviceInfo/getCapabilities) to get information about the microphone's capabilities, e.g. the maximum number of channels supported, etc. This interface supports Chrome 67+, Edge 79+, Safari 17+, Opera 54+.
1679
1685
  * @example
1680
1686
  * const microphoneList = await TRTC.getMicrophoneList();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.4.0-beta.2",
3
+ "version": "5.4.0-beta.3",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
5
  "main": "trtc.js",
6
6
  "types": "index.d.ts",