trtc-sdk-v5 5.11.2-beta.1 → 5.11.2-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 +17 -35
- 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/device-detector.esm.d.ts +1 -3
- package/plugins/device-detector/device-detector.esm.js +13 -13
- package/plugins/device-detector/device-detector.umd.js +2 -2
- 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-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 +32 -32
- package/trtc.js +1 -1
package/index.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ import { InitAudioProcessorOptions, UpdateAudioProcessorOptions } from 'trtc-js-
|
|
|
12
12
|
|
|
13
13
|
export { CDNStreamingOptions, DeviceDetectorOptions, VirtualBackgroundOptions, UpdateVirtualBackgroundOptions, WatermarkOptions, BeautyOptions, UpdateBeautyOptions, BasicBeautyOptions, StartCrossRoomOption, UpdateCrossRoomOption, StopCrossRoomOption, SmallStreamAutoSwitcherOptions, VideoMixerOptions };
|
|
14
14
|
type TRTCPlugin = typeof CrossRoom | typeof CDNStreaming | typeof DeviceDetector | typeof VirtualBackground | typeof Watermark | typeof Beauty | typeof BasicBeauty | typeof CustomEncryption | typeof SmallStreamAutoSwitcher | typeof VideoMixer;
|
|
15
|
-
export declare
|
|
16
|
-
'enableAudioFrameEvent'
|
|
15
|
+
export declare const enum ExperimentalAPIFunction {
|
|
16
|
+
EnableAudioFrameEvent = 'enableAudioFrameEvent'
|
|
17
17
|
}
|
|
18
18
|
export declare type PluginStartOptionsMap = {
|
|
19
19
|
'AudioMixer': AudioMixerOptions;
|
|
@@ -340,6 +340,8 @@ export declare interface LocalVideoConfig {
|
|
|
340
340
|
videoTrack?: MediaStreamTrack;
|
|
341
341
|
avoidCropping?: boolean;
|
|
342
342
|
rotation?: 0 | 90 | 180 | 270;
|
|
343
|
+
|
|
344
|
+
enableAutoSwitchWhenRecapturing?: boolean;
|
|
343
345
|
};
|
|
344
346
|
}
|
|
345
347
|
export interface TurnServerOptions {
|
|
@@ -441,6 +443,8 @@ export declare interface LocalAudioConfig {
|
|
|
441
443
|
echoCancellation?: boolean;
|
|
442
444
|
autoGainControl?: boolean;
|
|
443
445
|
noiseSuppression?: boolean;
|
|
446
|
+
|
|
447
|
+
enableAutoSwitchWhenRecapturing?: boolean;
|
|
444
448
|
};
|
|
445
449
|
}
|
|
446
450
|
export declare interface UpdateLocalAudioConfig extends LocalAudioConfig {
|
|
@@ -688,13 +692,6 @@ export declare interface VideoFrameConfig {
|
|
|
688
692
|
export declare const enum AutoStartPluginName {
|
|
689
693
|
Debug = 'Debug'
|
|
690
694
|
}
|
|
691
|
-
export declare interface EnableAudioFrameEventOptions {
|
|
692
|
-
enable: boolean
|
|
693
|
-
userId: string
|
|
694
|
-
sampleRate?: number
|
|
695
|
-
channelCount?: number
|
|
696
|
-
port?: MessagePort
|
|
697
|
-
}
|
|
698
695
|
|
|
699
696
|
/**
|
|
700
697
|
* @typedef TRTCStatistics TRTC statistics
|
|
@@ -733,14 +730,6 @@ export declare interface EnableAudioFrameEventOptions {
|
|
|
733
730
|
* @property {number} frameRate Video frameRate
|
|
734
731
|
* @property {'big'|'small'|'sub'} videoType Video type: big, small, sub.
|
|
735
732
|
*/
|
|
736
|
-
/** enableAudioFrameEvent Options
|
|
737
|
-
* @typedef EnableAudioFrameEventOptions
|
|
738
|
-
* @property {boolean} enable Whether to enable callback of audio frame
|
|
739
|
-
* @property {string} userId The userId of the monitored user. '' indicates local microphone data, '*' indicates monitoring the audio data of all remote users.
|
|
740
|
-
* @property {number=} [sampleRate=48000] Set the sampling rate of pcm data, the default is 48000. Support 8000, 16000, 32000, 44100, 48000
|
|
741
|
-
* @property {number=} [channelCount=1] Set the number of channels of pcm data, the default is 1. Support 1, 2
|
|
742
|
-
* @property {MessagePort=} port Set the MessagePort for the pcm callback
|
|
743
|
-
*/
|
|
744
733
|
/**
|
|
745
734
|
* **TRTC Event List**<br>
|
|
746
735
|
* <br>
|
|
@@ -1202,7 +1191,6 @@ export declare interface TRTCEventTypes {
|
|
|
1202
1191
|
result: {
|
|
1203
1192
|
userId: string;
|
|
1204
1193
|
volume: number;
|
|
1205
|
-
floatVolume: number;
|
|
1206
1194
|
}[];
|
|
1207
1195
|
}];
|
|
1208
1196
|
[TRTCEvent.AUDIO_FRAME]: [{
|
|
@@ -1876,7 +1864,7 @@ export declare class TRTC {
|
|
|
1876
1864
|
/**
|
|
1877
1865
|
* Used to control the playback volume of remote audio.<br>
|
|
1878
1866
|
*
|
|
1879
|
-
* -
|
|
1867
|
+
* - Since `v5.9.0`, iOS Safari is supported
|
|
1880
1868
|
* @param {string} userId - Remote user ID。'*' represents all remote users.
|
|
1881
1869
|
* @param {number} volume - Volume, ranging from 0 to 100. The default value is 100.<br>
|
|
1882
1870
|
* Since `v5.1.3+`, the volume can be set higher than 100.
|
|
@@ -2111,24 +2099,18 @@ export declare class TRTC {
|
|
|
2111
2099
|
/**
|
|
2112
2100
|
* call experimental API
|
|
2113
2101
|
*
|
|
2114
|
-
* |
|
|
2115
|
-
* |
|
|
2116
|
-
* |
|
|
2102
|
+
* | API name | options | description |
|
|
2103
|
+
* | ------------------- | ----------------------------------------------- | ------------------------------------------------------------ |
|
|
2104
|
+
* | enableAudioFrameEvent | - enable type: `boolean` <br></br> - userId type: `string` <br></br> - sampleRate type: `number` <br></br> - channelCount type: `number` <br></br>| Configure the callback data of {@link module:EVENT.AUDIO_FRAME AUDIO_FRAME} event |
|
|
2117
2105
|
* @private
|
|
2118
2106
|
* @param {string} name
|
|
2119
|
-
* @param {
|
|
2120
|
-
* @example
|
|
2121
|
-
*
|
|
2122
|
-
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '
|
|
2123
|
-
*
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '', port })
|
|
2127
|
-
* // Cancel callback of local microphone pcm data
|
|
2128
|
-
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: false, userId: '' })
|
|
2129
|
-
*/
|
|
2130
|
-
callExperimentalAPI<T extends keyof ExperimentalAPIFunctionMap, O extends ExperimentalAPIFunctionMap[T]>(name: O extends undefined ? never : T, options: O): Promise<void>;
|
|
2131
|
-
callExperimentalAPI<T extends keyof ExperimentalAPIFunctionMap, O extends ExperimentalAPIFunctionMap[T]>(name: O extends undefined ? T : never): Promise<void>;
|
|
2107
|
+
* @param {object} options
|
|
2108
|
+
* @example
|
|
2109
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: 'user_A'}) // 监听远端用户 user_A 的音频数据,默认 pcm 数据为 48kHZ,单声道
|
|
2110
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: true, userId: '*', sampleRate: 16000, channelCount: 2 }) // 监听所有远端音频数据,设置 pcm 数据为 16kHZ,双声道
|
|
2111
|
+
* await trtc.callExperimentalAPI('enableAudioFrameEvent', { enable: false, userId: '', sampleRate: 48000, channelCount: 1 }) // 取消监听本地麦克风数据
|
|
2112
|
+
*/
|
|
2113
|
+
callExperimentalAPI(name: ExperimentalAPIFunction, options: any): Promise<void>;
|
|
2132
2114
|
static EVENT: typeof TRTCEvent;
|
|
2133
2115
|
static ERROR_CODE: {
|
|
2134
2116
|
INVALID_PARAMETER: number;
|
package/package.json
CHANGED