trtc-sdk-v5 5.10.2-beta.2 → 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 +58 -20
- package/package.json +1 -1
- package/plugins/cdn-streaming/package.json +1 -1
- package/plugins/cross-room/package.json +1 -1
- package/plugins/custom-encryption/package.json +1 -1
- package/plugins/device-detector/package.json +1 -1
- package/plugins/video-decoder/package.json +1 -1
- package/plugins/video-effect/basic-beauty/package.json +1 -1
- package/plugins/video-effect/beauty/package.json +1 -1
- package/plugins/video-effect/virtual-background/package.json +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/voice-changer/package.json +1 -1
- package/trtc.esm.js +28 -28
- package/trtc.js +1 -1
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
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
*
|
|
1373
|
-
*
|
|
1374
|
-
*
|
|
1375
|
-
*
|
|
1376
|
-
*
|
|
1377
|
-
*
|
|
1378
|
-
*
|
|
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
|
-
*
|
|
1382
|
-
* await trtc.
|
|
1383
|
-
*
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
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