trtc-sdk-v5 5.13.0-beta.13 → 5.13.0-beta.14
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 +41 -0
- 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/small-stream-auto-switcher/package.json +1 -1
- package/plugins/video-decoder/package.json +1 -1
- package/plugins/video-decoder/video-decoder.esm.js +1 -1
- package/plugins/video-effect/basic-beauty/basic-beauty.esm.js +1 -1
- package/plugins/video-effect/basic-beauty/basic-beauty.umd.js +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/video-mixer/package.json +1 -1
- package/plugins/video-effect/virtual-background/package.json +1 -1
- package/plugins/video-effect/virtual-background/virtual-background.esm.js +1 -1
- package/plugins/video-effect/virtual-background/virtual-background.umd.js +1 -1
- package/plugins/video-effect/watermark/package.json +1 -1
- package/plugins/voice-changer/package.json +1 -1
- package/trtc.esm.js +29 -29
- package/trtc.js +1 -1
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,18 @@ 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';
|
|
1179
1200
|
};
|
|
1180
1201
|
export declare interface TRTCEventTypes {
|
|
1181
1202
|
[TRTCEvent.ERROR]: [RtcError];
|
|
@@ -1262,6 +1283,10 @@ export declare interface TRTCEventTypes {
|
|
|
1262
1283
|
sourceTrack: MediaStreamTrack;
|
|
1263
1284
|
}];
|
|
1264
1285
|
[TRTCEvent.CUSTOM_MESSAGE]: [CustomMessage];
|
|
1286
|
+
[TRTCEvent.PERMISSION_STATE_CHANGE]: [{
|
|
1287
|
+
camera: PermissionState;
|
|
1288
|
+
microphone: PermissionState;
|
|
1289
|
+
}];
|
|
1265
1290
|
}
|
|
1266
1291
|
|
|
1267
1292
|
export declare interface CustomMessageData {
|
|
@@ -2192,6 +2217,22 @@ export declare class TRTC {
|
|
|
2192
2217
|
* | checkResult.detail.isVp8DecodeSupported | boolean | Whether the current browser supports VP8 decoding for downlink |
|
|
2193
2218
|
*/
|
|
2194
2219
|
static isSupported(): Promise<any>;
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* Get the permission state of the camera and microphone. Since v5.13.0+.
|
|
2223
|
+
* @param {PermissionOption} option
|
|
2224
|
+
* @param {boolean} [option.request=true] Whether to request permission to use the camera and microphone.
|
|
2225
|
+
* @param {string[]} [option.types=['camera', 'microphone']] The types of permission to request.
|
|
2226
|
+
* @returns {Promise<PermissionResult>} Promise returns the permission state of the camera and microphone
|
|
2227
|
+
* @example
|
|
2228
|
+
* const { camera, microphone } = await TRTC.getPermissions({
|
|
2229
|
+
* request: true, // if true, will request permission to use the camera and microphone.
|
|
2230
|
+
* types: ['camera', 'microphone']
|
|
2231
|
+
* });
|
|
2232
|
+
* console.log(camera, microphone); // 'granted' | 'denied' | 'prompt' | null. null means the permission is not supported query.
|
|
2233
|
+
*/
|
|
2234
|
+
static getPermissions(option: PermissionOption): Promise<PermissionResult>;
|
|
2235
|
+
|
|
2195
2236
|
/**
|
|
2196
2237
|
* Returns the list of camera devices
|
|
2197
2238
|
* <br>
|
package/package.json
CHANGED