trtc-sdk-v5 5.12.1-wasm.1 → 5.13.0-beta.12

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.
File without changes
File without changes
package/index.d.ts CHANGED
@@ -487,6 +487,15 @@ export declare const enum TRTCDeviceAction {
487
487
  Add = 'add',
488
488
  Active = 'active'
489
489
  }
490
+ export declare interface PermissionOption {
491
+ request?: boolean;
492
+ types?: ('camera' | 'microphone')[];
493
+ }
494
+
495
+ export declare interface PermissionResult {
496
+ camera: PermissionState | null;
497
+ microphone: PermissionState | null;
498
+ }
490
499
  export declare interface RTCErrorParams {
491
500
  code: number;
492
501
  extraCode?: number;
@@ -1176,6 +1185,32 @@ export declare const TRTCEvent: {
1176
1185
  * })
1177
1186
  */
1178
1187
  readonly FIRST_VIDEO_FRAME: 'first-video-frame';
1188
+
1189
+ /**
1190
+ * @since v5.13.0
1191
+ * @description Notification event for device permission changes.
1192
+ * @default 'permission-state-change'
1193
+ * @memberof module:EVENT
1194
+ * @example
1195
+ * trtc.on(TRTC.EVENT.PERMISSION_STATE_CHANGE, event => {
1196
+ * console.log(event.camera, event.microphone); // 'granted' | 'denied' | 'prompt' | null. null means the permission is not supported query.
1197
+ * });
1198
+ */
1199
+ readonly PERMISSION_STATE_CHANGE: 'permission-state-change';
1200
+ /**
1201
+ * @since v5.13.0
1202
+ * @description Video size changed event
1203
+ * @default 'video-size-changed'
1204
+ * @memberof module:EVENT
1205
+ * @example
1206
+ * trtc.on(TRTC.EVENT.VIDEO_SIZE_CHANGED, event => {
1207
+ * // event.newHeight: video height.
1208
+ * // event.newWidth: video width.
1209
+ * // event.streamType: video stream type.
1210
+ * // event.userId: The user ID of the local or a remote user. If it is empty, it indicates that video is the local video and the local user has not entered the room; if it is not empty, it indicates that video is remote video or local user enter room already.
1211
+ * })
1212
+ */
1213
+ readonly VIDEO_SIZE_CHANGED: 'video-size-changed'
1179
1214
  };
1180
1215
  export declare interface TRTCEventTypes {
1181
1216
  [TRTCEvent.ERROR]: [RtcError];
@@ -1262,6 +1297,16 @@ export declare interface TRTCEventTypes {
1262
1297
  sourceTrack: MediaStreamTrack;
1263
1298
  }];
1264
1299
  [TRTCEvent.CUSTOM_MESSAGE]: [CustomMessage];
1300
+ [TRTCEvent.PERMISSION_STATE_CHANGE]: [{
1301
+ camera: PermissionState;
1302
+ microphone: PermissionState;
1303
+ }];
1304
+ [TRTCEvent.VIDEO_SIZE_CHANGED]: [{
1305
+ newWidth: number;
1306
+ newHeight: number;
1307
+ streamType: TRTCStreamType;
1308
+ userId: string;
1309
+ }];
1265
1310
  }
1266
1311
 
1267
1312
  export declare interface CustomMessageData {
@@ -2192,6 +2237,22 @@ export declare class TRTC {
2192
2237
  * | checkResult.detail.isVp8DecodeSupported | boolean | Whether the current browser supports VP8 decoding for downlink |
2193
2238
  */
2194
2239
  static isSupported(): Promise<any>;
2240
+
2241
+ /**
2242
+ * Get the permission state of the camera and microphone. Since v5.13.0+.
2243
+ * @param {PermissionOption} option
2244
+ * @param {boolean} [option.request=true] Whether to request permission to use the camera and microphone.
2245
+ * @param {string[]} [option.types=['camera', 'microphone']] The types of permission to request.
2246
+ * @returns {Promise<PermissionResult>} Promise returns the permission state of the camera and microphone
2247
+ * @example
2248
+ * const { camera, microphone } = await TRTC.getPermissions({
2249
+ * request: true, // if true, will request permission to use the camera and microphone.
2250
+ * types: ['camera', 'microphone']
2251
+ * });
2252
+ * console.log(camera, microphone); // 'granted' | 'denied' | 'prompt' | null. null means the permission is not supported query.
2253
+ */
2254
+ static getPermissions(option: PermissionOption): Promise<PermissionResult>;
2255
+
2195
2256
  /**
2196
2257
  * Returns the list of camera devices
2197
2258
  * <br>
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "trtc-sdk-v5",
3
- "version": "5.12.1-wasm.1",
3
+ "version": "5.13.0-beta.12",
4
4
  "description": "Tencent Cloud RTC SDK for Web",
5
- "module": "trtc.esm.js",
6
- "type": "module",
5
+ "main": "trtc.js",
7
6
  "types": "index.d.ts",
7
+ "dependencies": {
8
+ "webrtc-adapter": "^8.2.3"
9
+ },
8
10
  "keywords": [
9
11
  "webrtc",
10
12
  "TRTC",
@@ -27,4 +29,4 @@
27
29
  },
28
30
  "author": "Tencent Cloud Client R&D Center",
29
31
  "license": "ISC"
30
- }
32
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/cdn-streaming",
3
- "version": "5.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
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/small-stream-auto-switcher",
3
- "version": "5.12.1-wasm.1",
3
+ "version": "5.12.0",
4
4
  "description": "",
5
5
  "main": "./small-stream-auto-switcher.esm.js",
6
6
  "keywords": [],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/video-decoder",
3
- "version": "5.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
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/video-mixer",
3
- "version": "5.12.1-wasm.1",
3
+ "version": "5.12.0",
4
4
  "description": "TRTC Web SDK 5.x videoMixer plugin",
5
5
  "main": "./video-mixer.esm.js",
6
6
  "module": "./video-mixer.esm.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rtc-plugin/virtual-background",
3
- "version": "5.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
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.12.1-wasm.1",
3
+ "version": "5.12.0",
4
4
  "description": "",
5
5
  "main": "./voice-changer.esm.js",
6
6
  "keywords": [],