@byteplus/rtc 4.61.3 → 4.62.0
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/extension-beauty/index.js +1 -1
- package/extension-beauty/index.umd.js +1 -1
- package/index.d.ts +198 -25
- package/index.esm.min.js +3 -3
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -66,7 +66,8 @@ declare const Config: {
|
|
|
66
66
|
SEI_TIME_OUT: number;
|
|
67
67
|
SEI_COUNT_FPS: number;
|
|
68
68
|
PRE_ICE: boolean;
|
|
69
|
-
|
|
69
|
+
STATS_LOOP_INTERVAL: number;
|
|
70
|
+
HIDDEN_STATS: boolean;
|
|
70
71
|
};
|
|
71
72
|
declare const _default: VERTC;
|
|
72
73
|
declare enum AudioMixingError {
|
|
@@ -827,9 +828,6 @@ declare enum ErrorCode {
|
|
|
827
828
|
*/
|
|
828
829
|
USER_FORBIDDEN = "USER_FORBIDDEN"
|
|
829
830
|
}
|
|
830
|
-
declare enum ExtendMediaType {
|
|
831
|
-
NONE = 0
|
|
832
|
-
}
|
|
833
831
|
declare enum SEIStreamEventType {
|
|
834
832
|
|
|
835
833
|
/**
|
|
@@ -1285,7 +1283,8 @@ export declare enum MirrorMode {
|
|
|
1285
1283
|
}
|
|
1286
1284
|
|
|
1287
1285
|
/**
|
|
1288
|
-
* @brief
|
|
1286
|
+
* @brief Whether to enable the mirror effect when rendering the video.
|
|
1287
|
+
* You cannot use mirror effect during transmission and encoding due to the restrictions of web explorer.
|
|
1289
1288
|
*/
|
|
1290
1289
|
export declare enum MirrorType {
|
|
1291
1290
|
|
|
@@ -1295,7 +1294,7 @@ export declare enum MirrorType {
|
|
|
1295
1294
|
MIRROR_TYPE_NONE = 0,
|
|
1296
1295
|
|
|
1297
1296
|
/**
|
|
1298
|
-
* @brief Enable mirror effect for the
|
|
1297
|
+
* @brief Enable mirror effect for the videos.
|
|
1299
1298
|
*/
|
|
1300
1299
|
MIRROR_TYPE_RENDER = 1
|
|
1301
1300
|
}
|
|
@@ -1745,6 +1744,27 @@ export declare enum VideoSourceType {
|
|
|
1745
1744
|
}
|
|
1746
1745
|
export declare type RTCExtension = any;
|
|
1747
1746
|
|
|
1747
|
+
/**
|
|
1748
|
+
* @brief Audio frames struct
|
|
1749
|
+
*/
|
|
1750
|
+
export interface AudioFrameData {
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* @brief Audio data in PCM format
|
|
1754
|
+
*/
|
|
1755
|
+
channels: Float32Array[];
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* @brief The number of channels
|
|
1759
|
+
*/
|
|
1760
|
+
channelCount: number;
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* @brief Sample rate in Hz.
|
|
1764
|
+
*/
|
|
1765
|
+
sampleRate: number;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1748
1768
|
/**
|
|
1749
1769
|
* Event of the state change of audio mixing
|
|
1750
1770
|
*/
|
|
@@ -2171,6 +2191,21 @@ export interface IAudioMixingManager {
|
|
|
2171
2191
|
*/
|
|
2172
2192
|
setAudioMixingPosition: (id: number, position: number) => void;
|
|
2173
2193
|
|
|
2194
|
+
/**
|
|
2195
|
+
* @brief Toggle the callbacks carrying the mixing audio frames.
|
|
2196
|
+
* @param mixingId Audio from microphone or device audio.
|
|
2197
|
+
* You will get the callback carrying the audio data as soon as the audio mixing starts.
|
|
2198
|
+
* @param callback The callback function to receive the audio frames. An empty value indicates disabling the callback.
|
|
2199
|
+
* When the user disconnects, the audio data is empty.
|
|
2200
|
+
* @param frameSize The number of samples per frame. The interval between callbacks increases as the frameSize gets larger.
|
|
2201
|
+
* It can be set to 256, 512, 1024, 2048, 4096, 8192, or 16384. It defaults to 4096. We recommend use the default value unless the application where the audio frames to be used requires a specific size.
|
|
2202
|
+
* @note + You can call this method after the engine is created. And you will receive the audio frame once mixing audio starts.
|
|
2203
|
+
* + Leave the room will not void the setting.
|
|
2204
|
+
* @group Audio Mixing
|
|
2205
|
+
* @order 45
|
|
2206
|
+
*/
|
|
2207
|
+
setAudioFrameCallback: (id: number, callback?: (data: AudioFrameData) => void, frameSize?: number) => void;
|
|
2208
|
+
|
|
2174
2209
|
/**
|
|
2175
2210
|
* @brief Start PCM mixing.
|
|
2176
2211
|
* To mix multiple PCM audio data, call this API multiple times with different ids.
|
|
@@ -2549,7 +2584,7 @@ export interface IEngineEvents {
|
|
|
2549
2584
|
[EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
|
|
2550
2585
|
|
|
2551
2586
|
/**
|
|
2552
|
-
* @brief After calling [enableAudioPropertiesReport](docs-104478#enableaudiopropertiesreport), you will
|
|
2587
|
+
* @brief After calling [enableAudioPropertiesReport](docs-104478#enableaudiopropertiesreport), you will receive the cycling callbacks, each providing instant information about the subscribed remote audio streams.
|
|
2553
2588
|
* The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism.
|
|
2554
2589
|
* @param event Information about remote audio.
|
|
2555
2590
|
* @group Audio Management
|
|
@@ -2783,7 +2818,7 @@ export interface IEngineEvents {
|
|
|
2783
2818
|
/**
|
|
2784
2819
|
* @brief Error message.
|
|
2785
2820
|
*/
|
|
2786
|
-
message?:
|
|
2821
|
+
message?: string;
|
|
2787
2822
|
}) => void;
|
|
2788
2823
|
|
|
2789
2824
|
/**
|
|
@@ -2811,7 +2846,7 @@ export interface IEngineEvents {
|
|
|
2811
2846
|
/**
|
|
2812
2847
|
* @brief Error message.
|
|
2813
2848
|
*/
|
|
2814
|
-
message?:
|
|
2849
|
+
message?: string;
|
|
2815
2850
|
}) => void;
|
|
2816
2851
|
|
|
2817
2852
|
/**
|
|
@@ -3415,7 +3450,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3415
3450
|
* @param streamIndex Video stream properties.
|
|
3416
3451
|
* @param videoPlayerOption View information and rendering mode. Since V4.61, call this API repeatedly with different playerIds to add the stream to different players.
|
|
3417
3452
|
* Since V4.56, you can set the rotation of the stream via the `rotation` property.
|
|
3418
|
-
* @notes You should bind the view after the user joins a room. This setting will sustain
|
|
3453
|
+
* @notes You should bind the view after the user joins a room. This setting will sustain until the user leaves the room.
|
|
3419
3454
|
* @group Video Management
|
|
3420
3455
|
* @order 21
|
|
3421
3456
|
*/
|
|
@@ -3429,6 +3464,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3429
3464
|
*/
|
|
3430
3465
|
setLocalVideoMirrorType: (mirrorType: MirrorType) => void;
|
|
3431
3466
|
|
|
3467
|
+
/**
|
|
3468
|
+
* @brief When using internal rendering, enable mirroring for the remote stream.
|
|
3469
|
+
* @param userId ID of the remote user
|
|
3470
|
+
* @param streamIndex Mainstream or screen-sharing stream.
|
|
3471
|
+
* @param mirrorType The mirror type for the remote stream.
|
|
3472
|
+
* @notes + In addition, you must also call [setRemoteVideoPlayer](docs-104478#rtcengine-setremotevideoplayer) to mirror the remote stream in the specified player.
|
|
3473
|
+
* @group Video Management
|
|
3474
|
+
* @order 32
|
|
3475
|
+
*/
|
|
3476
|
+
setRemoteVideoMirrorType: (userId: string, streamIndex: StreamIndex, mirrorType: MirrorType) => void;
|
|
3477
|
+
|
|
3432
3478
|
/**
|
|
3433
3479
|
* @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker.
|
|
3434
3480
|
* @param deviceId ID of the audio playback device. Call [enumerateDevices](#enumeratedevices) to get device ID.
|
|
@@ -3478,17 +3524,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3478
3524
|
* @param userId The user ID. The empty value indicates the local stream.
|
|
3479
3525
|
* @return If the specified stream does not exist, the volume values are `0`.
|
|
3480
3526
|
* + linear volume. The value is in linear relation to the original volume. The higher the value, the higher the volume. The range is [0,255]. <br>
|
|
3481
|
-
*   - [0, 25]: Silence
|
|
3482
|
-
*   - [26, 75]: Low volume
|
|
3483
|
-
*   - [76, 204]: Medium volume
|
|
3484
|
-
*   - [205, 255]: High volume
|
|
3527
|
+
*   - \[0, 25]: Silence
|
|
3528
|
+
*   - \[26, 75]: Low volume
|
|
3529
|
+
*   - \[76, 204]: Medium volume
|
|
3530
|
+
*   - \[205, 255]: High volume
|
|
3485
3531
|
* + non-linear volume in dB. The value is in proportion to the log value of the original volume. You can use the value to recognize the Active Speaker in the room. The range is [-127, 0].
|
|
3486
|
-
*   - [-127, -60]: Silence
|
|
3487
|
-
*   - [-59, -40]: Low volume
|
|
3488
|
-
*   - [-39, -20]: Medium volume
|
|
3489
|
-
*   - [-19, 0]: High volume
|
|
3532
|
+
*   - \[-127, -60]: Silence
|
|
3533
|
+
*   - \[-59, -40]: Low volume
|
|
3534
|
+
*   - \[-39, -20]: Medium volume
|
|
3535
|
+
*   - \[-19, 0]: High volume
|
|
3490
3536
|
* @notes + The interval for repeatedly calling this method should be at least 100 milliseconds.
|
|
3491
|
-
* + You can also get volume
|
|
3537
|
+
* + You can also get the audio volume via [onLocalAudioPropertiesReport](docs-104479#onlocalaudiopropertiesreport) and [onRemoteAudioPropertiesReport](docs-104479#onremoteaudiopropertiesreport).
|
|
3492
3538
|
* @group Audio Management
|
|
3493
3539
|
* @order 27
|
|
3494
3540
|
*/
|
|
@@ -3497,6 +3543,23 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3497
3543
|
nonlinearVolume: number;
|
|
3498
3544
|
};
|
|
3499
3545
|
|
|
3546
|
+
/**
|
|
3547
|
+
* @brief Toggle the callbacks carrying the audio frames.
|
|
3548
|
+
* @param streamIndex Audio from microphone or device audio.
|
|
3549
|
+
* @param userId ID of the remote user who published the audio. An empty value indicates the local audio.
|
|
3550
|
+
* When the Audio seclection enabled, only the local audio frames are available.
|
|
3551
|
+
* You will get the callback carrying the audio data as soon as the user starts publish audio.
|
|
3552
|
+
* @param callback The callback function to receive the audio frames. An empty value indicates disabling the callback.
|
|
3553
|
+
* When the user disconnects, the audio data is zero amplitude.
|
|
3554
|
+
* @param frameSize The number of samples per frame. The interval between callbacks increases as the frameSize gets larger.
|
|
3555
|
+
* It can be set to 256, 512, 1024, 2048, 4096, 8192, or 16384. It defaults to 4096. We recommend use the default value unless the application where the audio frames to be used requires a specific size.
|
|
3556
|
+
* @note + You can call this method after the engine is created. And you will receive the audio frame once the local audio starts capture, or the remote audio arrives.
|
|
3557
|
+
* + Neither rejoining the room nor republishing the stream will void the setting.
|
|
3558
|
+
* * @group Custom Stream Processing
|
|
3559
|
+
* @order 40
|
|
3560
|
+
*/
|
|
3561
|
+
setAudioFrameCallback: (streamIndex: StreamIndex, userId?: string, callback?: (data: AudioFrameData) => void, frameSize?: number) => void;
|
|
3562
|
+
|
|
3500
3563
|
/**
|
|
3501
3564
|
* @brief Pause receiving remote media streams.
|
|
3502
3565
|
* @param mediaType Media stream type subscribed to.
|
|
@@ -3673,7 +3736,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3673
3736
|
* @brief Starts pushing media streams to CDN and sets the relevant configurations.
|
|
3674
3737
|
* @param transcode Configurations to be set when pushing media streams to CDN.
|
|
3675
3738
|
* @return
|
|
3676
|
-
* @notes + After calling this API, you will receive the pushing a mixed stream to CDN events via [onStreamMixingEvent](104479#onstreammixingevent).
|
|
3739
|
+
* @notes + After calling this API, you will receive the pushing a mixed stream to CDN events via [onStreamMixingEvent](docs-104479#onstreammixingevent).
|
|
3677
3740
|
* + If you have subscribed to the push-to-CDN server callback in the [console](https://console.byteplus.com/rtc/cloudRTC?tab=callback), calling this API will receive a [TranscodeStarted](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodestarted) server callback notification. When calling this API repeatedly, subsequent calls to this API will trigger both [TranscodeStarted](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodestarted) and [TranscodeUpdated](https://docs.byteplus.com/en/byteplus-rtc/docs/75125#transcodeupdated) callbacks.
|
|
3678
3741
|
* + Call [stopLiveTranscoding](#stoplivetranscoding) to stop pushing mixed streams to CDN.
|
|
3679
3742
|
* @group Push to CDN
|
|
@@ -4194,7 +4257,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
4194
4257
|
* @brief Take a snapshot of the local video.
|
|
4195
4258
|
* @param streamIndex The specified video stream.
|
|
4196
4259
|
* @param playerId Player ID. An empty value indicates the default player. If the default player does not exist by then, the call will not take effect.
|
|
4197
|
-
* @notes + The snapshot is taken with all video effects on, including
|
|
4260
|
+
* @notes + The snapshot is taken with all video effects on, including the beauty effect, virtual background and mirroring.
|
|
4198
4261
|
* + You can take the snapshot either using SDK internal video capture or customized capture.
|
|
4199
4262
|
* @return `INVOKED_BEFORE_CAPTURE`: No such stream. Please make sure that the specified stream has been published.
|
|
4200
4263
|
* @group Video Snapshot
|
|
@@ -4279,7 +4342,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
4279
4342
|
|
|
4280
4343
|
/**
|
|
4281
4344
|
* @hidden
|
|
4282
|
-
|
|
4345
|
+
*/
|
|
4283
4346
|
connect: () => Promise<void>;
|
|
4284
4347
|
|
|
4285
4348
|
/**
|
|
@@ -4400,6 +4463,52 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
4400
4463
|
* @order 12
|
|
4401
4464
|
*/
|
|
4402
4465
|
setAudioSelectionConfig: (audioSelectionPriority: AudioSelectionPriority) => Promise<void>;
|
|
4466
|
+
|
|
4467
|
+
/**
|
|
4468
|
+
* @brief Gets the statistics of subscribed video streams and network states.
|
|
4469
|
+
* @return Include the camera video and the screen recording.
|
|
4470
|
+
* @notes The statistics obtained through this method within 1 second remain unchanged.
|
|
4471
|
+
* @group Audio & Video Transport
|
|
4472
|
+
* @order 66
|
|
4473
|
+
*/
|
|
4474
|
+
getRemoteVideoStats: () => Record<string, RemoteUserVideoStats[]>;
|
|
4475
|
+
|
|
4476
|
+
/**
|
|
4477
|
+
* @brief Gets the statistics of subscribed audio streams and network states.
|
|
4478
|
+
* @return Include the microphone audio and the device audio.
|
|
4479
|
+
* @notes The statistics obtained through this method within 1 second remain unchanged.
|
|
4480
|
+
* @group Audio & Video Transport
|
|
4481
|
+
* @order 67
|
|
4482
|
+
*/
|
|
4483
|
+
getRemoteAudioStats: () => Record<string, RemoteUserAudioStats[]>;
|
|
4484
|
+
|
|
4485
|
+
/**
|
|
4486
|
+
* @brief Gets the statistics of local video streams and network states.
|
|
4487
|
+
* @return Include the camera video and the screen recording.
|
|
4488
|
+
* @notes The statistics obtained through this method within 1 second remain unchanged.
|
|
4489
|
+
* @group Audio & Video Transport
|
|
4490
|
+
* @order 68
|
|
4491
|
+
*/
|
|
4492
|
+
getLocalVideoStats: () => LocalUserVideoStats;
|
|
4493
|
+
|
|
4494
|
+
/**
|
|
4495
|
+
* @brief Gets the statistics of local audio streams and network states.
|
|
4496
|
+
* @return Include the microphone audio and the device audio.
|
|
4497
|
+
* @notes The statistics obtained through this method within 1 second remain unchanged.
|
|
4498
|
+
* @group Audio & Video Transport
|
|
4499
|
+
* @order 69
|
|
4500
|
+
*/
|
|
4501
|
+
getLocalAudioStats: () => LocalUserAudioStats;
|
|
4502
|
+
|
|
4503
|
+
/**
|
|
4504
|
+
* @hidden for internal use
|
|
4505
|
+
*/
|
|
4506
|
+
getPublicVideoStats: () => Record<string, RemoteVideoStats>;
|
|
4507
|
+
|
|
4508
|
+
/**
|
|
4509
|
+
* @hidden for internal use
|
|
4510
|
+
*/
|
|
4511
|
+
getPublicAudioStats: () => Record<string, RemoteAudioStats>;
|
|
4403
4512
|
}
|
|
4404
4513
|
|
|
4405
4514
|
/**
|
|
@@ -4582,7 +4691,7 @@ export interface InitPublishState {
|
|
|
4582
4691
|
video: boolean;
|
|
4583
4692
|
|
|
4584
4693
|
/**
|
|
4585
|
-
* @brief
|
|
4694
|
+
* @brief Device audio
|
|
4586
4695
|
*/
|
|
4587
4696
|
screenAudio: boolean;
|
|
4588
4697
|
|
|
@@ -4894,6 +5003,38 @@ export interface LocalStreamStats {
|
|
|
4894
5003
|
rxQuality?: number;
|
|
4895
5004
|
}
|
|
4896
5005
|
|
|
5006
|
+
/**
|
|
5007
|
+
* State of the local media stream
|
|
5008
|
+
*/
|
|
5009
|
+
export interface LocalUserAudioStats {
|
|
5010
|
+
|
|
5011
|
+
/**
|
|
5012
|
+
* @brief State of the microphone audio stream
|
|
5013
|
+
*/
|
|
5014
|
+
mainAudioStats: LocalAudioStats;
|
|
5015
|
+
|
|
5016
|
+
/**
|
|
5017
|
+
* @brief State of the device audio stream
|
|
5018
|
+
*/
|
|
5019
|
+
screenAudioStats: LocalAudioStats;
|
|
5020
|
+
}
|
|
5021
|
+
|
|
5022
|
+
/**
|
|
5023
|
+
* Statistics of local video streams and network states in the cycle of 1s.
|
|
5024
|
+
*/
|
|
5025
|
+
export interface LocalUserVideoStats {
|
|
5026
|
+
|
|
5027
|
+
/**
|
|
5028
|
+
* @brief State of the camera video stream.
|
|
5029
|
+
*/
|
|
5030
|
+
mainVideoStats: LocalVideoStats;
|
|
5031
|
+
|
|
5032
|
+
/**
|
|
5033
|
+
* @brief State of the screen recording stream.
|
|
5034
|
+
*/
|
|
5035
|
+
screenVideoStats: LocalVideoStats;
|
|
5036
|
+
}
|
|
5037
|
+
|
|
4897
5038
|
/**
|
|
4898
5039
|
* Local video states
|
|
4899
5040
|
*/
|
|
@@ -5435,6 +5576,38 @@ export interface RemoteStreamSwitch {
|
|
|
5435
5576
|
reason: FallbackOrRecoverReason;
|
|
5436
5577
|
}
|
|
5437
5578
|
|
|
5579
|
+
/**
|
|
5580
|
+
* Statistics of subscribed audio streams and network states in the cycle of 1s.
|
|
5581
|
+
*/
|
|
5582
|
+
export interface RemoteUserAudioStats {
|
|
5583
|
+
|
|
5584
|
+
/**
|
|
5585
|
+
* @brief State of the microphone audio stream
|
|
5586
|
+
*/
|
|
5587
|
+
mainAudioStats: RemoteAudioStats;
|
|
5588
|
+
|
|
5589
|
+
/**
|
|
5590
|
+
* @brief State of the device audio stream
|
|
5591
|
+
*/
|
|
5592
|
+
screenAudioStats: RemoteAudioStats;
|
|
5593
|
+
}
|
|
5594
|
+
|
|
5595
|
+
/**
|
|
5596
|
+
* Statistics of subscribed video streams and network states in the cycle of 1s.
|
|
5597
|
+
*/
|
|
5598
|
+
export interface RemoteUserVideoStats {
|
|
5599
|
+
|
|
5600
|
+
/**
|
|
5601
|
+
* @brief State of the camera video stream.
|
|
5602
|
+
*/
|
|
5603
|
+
mainVideoStats: RemoteVideoStats;
|
|
5604
|
+
|
|
5605
|
+
/**
|
|
5606
|
+
* @brief State of the screen recording stream.
|
|
5607
|
+
*/
|
|
5608
|
+
screenVideoStats: RemoteVideoStats;
|
|
5609
|
+
}
|
|
5610
|
+
|
|
5438
5611
|
/**
|
|
5439
5612
|
* @brief Configuration of remote video stream
|
|
5440
5613
|
*/
|
|
@@ -5701,7 +5874,7 @@ export interface SetParamInterface {
|
|
|
5701
5874
|
SEI_COUNT_FPS: number;
|
|
5702
5875
|
/** 是否开启提前建连 */
|
|
5703
5876
|
PRE_ICE: boolean;
|
|
5704
|
-
|
|
5877
|
+
STATS_LOOP_INTERVAL: number;
|
|
5705
5878
|
}
|
|
5706
5879
|
|
|
5707
5880
|
/**
|
|
@@ -5978,7 +6151,7 @@ export interface VideoEncoderConfig {
|
|
|
5978
6151
|
export interface VideoPlayerOption {
|
|
5979
6152
|
|
|
5980
6153
|
/**
|
|
5981
|
-
* @brief
|
|
6154
|
+
* @brief Render window, as the parent element for video rendering. Video's `htmlVideoElement` will be attached under this parent element for rendering, and the width and height of the rendered video will be based on `renderDom`, and is determined whether to completely fill the entire area of the parent element depending on the rendering mode.
|
|
5982
6155
|
*/
|
|
5983
6156
|
renderDom?: string | HTMLElement;
|
|
5984
6157
|
|