trtc-sdk-v5 5.10.2-beta.3 → 5.10.2-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
@@ -366,6 +366,13 @@ export interface PlayoutDelay {
366
366
  max: number;
367
367
  }
368
368
 
369
+ export declare interface SwitchRoomConfig {
370
+ roomId?: number,
371
+ strRoomId?: string;
372
+ privateMapKey?: string;
373
+ userSig?: string;
374
+ }
375
+
369
376
  export declare interface ScreenShareConfig {
370
377
  view?: string | HTMLElement | HTMLElement[] | null;
371
378
  publish?: boolean;
@@ -1365,27 +1372,58 @@ export declare class TRTC {
1365
1372
  * await trtc.switchRole(TRTC.TYPE.ROLE_ANCHOR, { privateMapKey: 'your new privateMapKey' });
1366
1373
  */
1367
1374
  switchRole(role: UserRole, option?: {
1368
- privateMapKey?: string;
1369
- latencyLevel?: number;
1370
- }): Promise<void>;
1371
- /**
1372
- * Destroy the TRTC instance <br/>
1373
- *
1374
- * After exiting the room, if the business side no longer needs to use trtc, you need to call this interface to destroy the trtc instance in time and release related resources.
1375
- *
1376
- * Note:
1377
- * - The trtc instance after destruction cannot be used again.
1378
- * - If you have entered the room, you need to call the {@link TRTC#exitRoom TRTC.exitRoom} interface to exit the room successfully before calling this interface to destroy trtc.
1379
- *
1375
+ privateMapKey?: string;
1376
+ latencyLevel?: number;
1377
+ }): Promise<void>;
1378
+ /**
1379
+ * Switch a video call room.<br>
1380
+ * - Switch the video call room that the audience is watching in live scene. It is faster than exit old room and then entering the new room, and can optimize the opening time in live broadcast and other scenarios.
1381
+ * - [Contact us](https://trtc.io/contact) to enable this API.
1382
+ *
1383
+ * @param {object} options Switch room parameters
1384
+ * @param {string} options.userSig UserSig signature <br>
1385
+ * Please refer to [UserSig related](https://www.tencentcloud.com/document/product/647/35166) for the calculation method of userSig.
1386
+ * <font color="red">Note: If you omit this parameter, SDK will reuse the userSig passed in {@link TRTC#enterRoom enterRoom()}. If it has expired, switching room will fail.</font>
1387
+ * @param {string=} options.strRoomId
1388
+ * @param {number=} options.roomId
1389
+ * the value must be an integer between 1 and 4294967294<br>
1390
+ * <font color="red">Note: The type of the new room must be the same as the old room. For example, both are numeric type roomId.</font>
1391
+ * @param {string=} options.strRoomId
1392
+ * String type room id, the length is limited to 64 bytes, and only supports the following characters:
1393
+ * - Uppercase and lowercase English letters (a-zA-Z)
1394
+ * - Numbers (0-9)
1395
+ * - Space ! # $ % & ( ) + - : ; < = . > ? @ [ ] ^ _ { } | ~ ,
1396
+ * <font color="red">Note: One of roomId and strRoomId must be passed in. If both are passed in, the numeric type roomId will be selected first.</font>
1397
+ * @param {boolean} [options.privateMapKey] Key for entering a room. If permission control is required, please carry this parameter (empty or incorrect value will cause a failure in entering the room).<br>[privateMapKey permission configuration](https://www.tencentcloud.com/document/product/647/35157?lang=en&pg=).
1398
+ * @throws
1399
+ * - {@link module:ERROR_CODE.INVALID_PARAMETER INVALID_PARAMETER}
1400
+ * - {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1401
+ * - {@link module:ERROR_CODE.OPERATION_ABORT OPERATION_ABORT}
1402
+ * - {@link module:ERROR_CODE.SERVER_ERROR SERVER_ERROR}
1380
1403
  * @example
1381
- * // When the call is over
1382
- * await trtc.exitRoom();
1383
- * // If the trtc is no longer needed, destroy the trtc and release the reference.
1384
- * trtc.destroy();
1385
- * trtc = null;
1386
- * @throws {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1387
- * @memberof TRTC
1388
- */
1404
+ * const trtc = TRTC.create();
1405
+ * await trtc.enterRoom({ roomId: 8888, sdkAppId, userId, userSig });
1406
+ * await trtc.switchRoom({ roomId: 9999 });
1407
+ */
1408
+ switchRoom(params: SwitchRoomConfig): Promise<void>;
1409
+ /**
1410
+ * Destroy the TRTC instance <br/>
1411
+ *
1412
+ * After exiting the room, if the business side no longer needs to use trtc, you need to call this interface to destroy the trtc instance in time and release related resources.
1413
+ *
1414
+ * Note:
1415
+ * - The trtc instance after destruction cannot be used again.
1416
+ * - If you have entered the room, you need to call the {@link TRTC#exitRoom TRTC.exitRoom} interface to exit the room successfully before calling this interface to destroy trtc.
1417
+ *
1418
+ * @example
1419
+ * // When the call is over
1420
+ * await trtc.exitRoom();
1421
+ * // If the trtc is no longer needed, destroy the trtc and release the reference.
1422
+ * trtc.destroy();
1423
+ * trtc = null;
1424
+ * @throws {@link module:ERROR_CODE.OPERATION_FAILED OPERATION_FAILED}
1425
+ * @memberof TRTC
1426
+ */
1389
1427
  destroy(): void;
1390
1428
  /**
1391
1429
  * Start collecting audio from the local microphone and publish it to the current room.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
5
  "main": "trtc.js",
6
6
  "types": "index.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cdn-streaming",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x CDN streaming plugin",
5
5
  "main": "./cdn-streaming.esm.js",
6
6
  "module": "./cdn-streaming.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cross-room",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x Cross Room plugin",
5
5
  "main": "./cross-room.esm.js",
6
6
  "module": "./cross-room.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/custom-encryption",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "main": "./custom-encryption.esm.js",
5
5
  "module": "./custom-encryption.esm.js",
6
6
  "types": "./custom-encryption.esm.d.ts"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/device-detector",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x device detector plugin",
5
5
  "main": "./device-detector.esm.js",
6
6
  "module": "./device-detector.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/video-decoder",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "Video decoder plugin for TRTC",
5
5
  "main": "./video-decoder.esm.js",
6
6
  "module": "./video-decoder.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/basic-beauty",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x basic-beauty plugin",
5
5
  "main": "./basic-beauty.esm.js",
6
6
  "module": "./basic-beauty.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/beauty",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x beauty plugin",
5
5
  "main": "./beauty.esm.js",
6
6
  "module": "./beauty.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/virtual-background",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x virtual background plugin",
5
5
  "main": "./virtual-background.esm.js",
6
6
  "module": "./virtual-background.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/watermark",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "TRTC Web SDK 5.x watermark plugin",
5
5
  "main": "./watermark.esm.js",
6
6
  "module": "./watermark.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/voice-changer",
3
- "version": "5.10.2-beta.3",
3
+ "version": "5.10.2-beta.4",
4
4
  "description": "",
5
5
  "main": "./voice-changer.esm.js",
6
6
  "keywords": [],