@agora-js/media 4.22.1-100 → 4.22.2
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/AgoraRTC_N-media.esm.mjs +2 -2
- package/AgoraRTC_N-media.js +2 -2
- package/media.d.ts +111 -72
- package/package.json +3 -3
- package/rtc-sdk-media_en.d.ts +61 -37
package/media.d.ts
CHANGED
|
@@ -559,6 +559,48 @@ declare class AudioState extends EventEmitter {
|
|
|
559
559
|
|
|
560
560
|
export declare function audioTimerLoop(callback: (time: number) => any, frequency: number): () => void;
|
|
561
561
|
|
|
562
|
+
/**
|
|
563
|
+
* 创建音频轨道时的配置参数。
|
|
564
|
+
*/
|
|
565
|
+
/** @en
|
|
566
|
+
* Configurations for the audio track of screen sharing.
|
|
567
|
+
*/
|
|
568
|
+
export declare interface AudioTrackInitConfig {
|
|
569
|
+
/**
|
|
570
|
+
* 是否开启回声消除:
|
|
571
|
+
* - `true`: 开启回声消除。
|
|
572
|
+
* - `false`: 不开启回声消除。
|
|
573
|
+
*/
|
|
574
|
+
/** @en
|
|
575
|
+
* Whether to enable acoustic echo cancellation:
|
|
576
|
+
* - `true`: Enable acoustic echo cancellation.
|
|
577
|
+
* - `false`: Do not enable acoustic echo cancellation.
|
|
578
|
+
*/
|
|
579
|
+
AEC?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* 是否开启自动增益:
|
|
582
|
+
* - `true`: 开启自动增益。
|
|
583
|
+
* - `false`: 不开启自动增益。
|
|
584
|
+
*/
|
|
585
|
+
/** @en
|
|
586
|
+
* Whether to enable audio gain control:
|
|
587
|
+
* - `true`: Enable audio gain control.
|
|
588
|
+
* - `false`: Do not enable audio gain control.
|
|
589
|
+
*/
|
|
590
|
+
AGC?: boolean;
|
|
591
|
+
/**
|
|
592
|
+
* 是否开启噪声抑制:
|
|
593
|
+
* - `true`: 开启噪声抑制。
|
|
594
|
+
* - `false`: 不开启噪声抑制。
|
|
595
|
+
*/
|
|
596
|
+
/** @en
|
|
597
|
+
* Whether to enable automatic noise suppression:
|
|
598
|
+
* - `true`: Enable automatic noise suppression.
|
|
599
|
+
* - `false`: Do not automatic noise suppression.
|
|
600
|
+
*/
|
|
601
|
+
ANS?: boolean;
|
|
602
|
+
}
|
|
603
|
+
|
|
562
604
|
declare class AudioTrackSource extends AudioSource {
|
|
563
605
|
protected sourceNode: MediaStreamAudioSourceNode;
|
|
564
606
|
track: MediaStreamTrack;
|
|
@@ -818,11 +860,11 @@ export declare interface CameraVideoTrackInitConfig {
|
|
|
818
860
|
*
|
|
819
861
|
* @param mode 视频传输优化模式:
|
|
820
862
|
* - `"detail"`: 清晰优先。
|
|
821
|
-
* -
|
|
822
|
-
* -
|
|
823
|
-
* - `"motion"`: 自 4.21.0
|
|
824
|
-
* -
|
|
825
|
-
* -
|
|
863
|
+
* - 浏览器会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
|
|
864
|
+
* - 大部分情况下,浏览器不会降低发送分辨率,但是可能会降低帧率。
|
|
865
|
+
* - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式。
|
|
866
|
+
* - 浏览器不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
|
|
867
|
+
* - 大部分情况下,浏览器不会降低帧率,但是可能会降低发送分辨率。
|
|
826
868
|
*/
|
|
827
869
|
/** @en
|
|
828
870
|
* @since
|
|
@@ -836,11 +878,11 @@ export declare interface CameraVideoTrackInitConfig {
|
|
|
836
878
|
*
|
|
837
879
|
* @param mode The video transmission optimization mode:
|
|
838
880
|
* - `"detail"`: Prioritizes video quality.
|
|
839
|
-
* - The
|
|
840
|
-
* - In most cases, the
|
|
841
|
-
* - `"motion"`: Since
|
|
842
|
-
* - In poor network conditions, the
|
|
843
|
-
* - In most cases, the
|
|
881
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
882
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
883
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
884
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
885
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
844
886
|
*/
|
|
845
887
|
optimizationMode?: OptimizationMode;
|
|
846
888
|
/**
|
|
@@ -962,7 +1004,7 @@ export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfi
|
|
|
962
1004
|
|
|
963
1005
|
export declare function createScreenVideoTrack(config?: ScreenVideoTrackInitConfig, withAudio?: "disable"): Promise<LocalVideoTrack>;
|
|
964
1006
|
|
|
965
|
-
export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio: "auto"): Promise<[LocalVideoTrack, LocalAudioTrack] | LocalVideoTrack>;
|
|
1007
|
+
export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio: "auto" | ScreenAudioTrackInitConfig): Promise<[LocalVideoTrack, LocalAudioTrack] | LocalVideoTrack>;
|
|
966
1008
|
|
|
967
1009
|
/**
|
|
968
1010
|
* 创建自定义音频轨道时的配置参数,用于 [AgoraRTC.createCustomAudioTrack]{@link IAgoraRTC.createCustomAudioTrack}。
|
|
@@ -1100,12 +1142,12 @@ export declare interface CustomVideoTrackInitConfig {
|
|
|
1100
1142
|
*
|
|
1101
1143
|
* @param mode 视频传输优化模式:
|
|
1102
1144
|
* - `"balanced"`: 使用默认的传输优化模式:
|
|
1103
|
-
* -
|
|
1104
|
-
* -
|
|
1145
|
+
* - 对于屏幕共享视频流,浏览器默认的优化策略为清晰优先。
|
|
1146
|
+
* - 对于其他视频流,浏览器默认的优化策略为兼顾清晰和流畅,弱网条件下,帧率和分辨率都会被调整。
|
|
1105
1147
|
* - `"detail"`: 清晰优先。
|
|
1106
|
-
* -
|
|
1107
|
-
* -
|
|
1108
|
-
* - `"motion"`: 自 4.21.0
|
|
1148
|
+
* - 浏览器会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
|
|
1149
|
+
* - 大部分情况下,浏览器不会降低发送分辨率,但是可能会降低帧率。
|
|
1150
|
+
* - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式
|
|
1109
1151
|
* - SDK 不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
|
|
1110
1152
|
* - 大部分情况下,SDK 不会降低帧率,但是可能会降低发送分辨率。
|
|
1111
1153
|
*/
|
|
@@ -1653,10 +1695,14 @@ export declare function getBitrateFromResAndFps(width: number, height: number, f
|
|
|
1653
1695
|
|
|
1654
1696
|
export declare function getCompatibility(): AgoraRTCCompatibility;
|
|
1655
1697
|
|
|
1698
|
+
export declare function getConstraintsFromAudioConfig(config: AudioTrackInitConfig): MediaTrackConstraints;
|
|
1699
|
+
|
|
1656
1700
|
export declare function getConstraintsFromCameraConfig(config: CameraVideoTrackInitConfig): MediaTrackConstraints;
|
|
1657
1701
|
|
|
1658
1702
|
export declare function getConstraintsFromMicrophoneConfig(config: MicrophoneAudioTrackInitConfig): MediaTrackConstraints;
|
|
1659
1703
|
|
|
1704
|
+
export declare function getConstraintsFromScreenAudioConfig(config: ScreenAudioTrackInitConfig): MediaTrackConstraints;
|
|
1705
|
+
|
|
1660
1706
|
export declare function getConstraintsFromScreenConfig(config: ScreenVideoTrackInitConfig): ScreenConstraintsWithElectron;
|
|
1661
1707
|
|
|
1662
1708
|
export declare function getElectronScreenSources(type?: ScreenSourceType): Promise<ElectronDesktopCapturerSource[]>;
|
|
@@ -1708,8 +1754,7 @@ export declare interface GetUserMediaConfig {
|
|
|
1708
1754
|
screen?: ScreenConstraintsWithElectron;
|
|
1709
1755
|
videoSource?: MediaStreamTrack;
|
|
1710
1756
|
audioSource?: MediaStreamTrack;
|
|
1711
|
-
|
|
1712
|
-
screenAudio?: boolean;
|
|
1757
|
+
screenAudio?: boolean | MediaTrackConstraints;
|
|
1713
1758
|
}
|
|
1714
1759
|
|
|
1715
1760
|
export declare function getVideoEncoderConfiguration(profile: VideoEncoderConfigurationPreset | VideoEncoderConfiguration | undefined): VideoEncoderConfiguration;
|
|
@@ -2566,11 +2611,11 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
2566
2611
|
* - 对于屏幕共享视频流,SDK 默认的优化策略为清晰优先。
|
|
2567
2612
|
* - 对于其他视频流,SDK 默认的优化策略为兼顾清晰和流畅,弱网条件下,帧率和分辨率都会被调整。
|
|
2568
2613
|
* - `"detail"`: 清晰优先。
|
|
2569
|
-
* -
|
|
2614
|
+
* - 浏览器会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
|
|
2570
2615
|
* - 大部分情况下,SDK 不会降低发送分辨率,但是可能会降低帧率。
|
|
2571
|
-
* - `"motion"`: 自 4.21.0
|
|
2572
|
-
* -
|
|
2573
|
-
* -
|
|
2616
|
+
* - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式。
|
|
2617
|
+
* - 浏览器不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
|
|
2618
|
+
* - 大部分情况下,浏览器不会降低帧率,但是可能会降低发送分辨率。
|
|
2574
2619
|
*/
|
|
2575
2620
|
/** @en
|
|
2576
2621
|
* @since
|
|
@@ -2585,13 +2630,13 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
2585
2630
|
* @param mode The video transmission optimization mode:
|
|
2586
2631
|
* - `"balanced"`: Uses the default optimization mode.
|
|
2587
2632
|
* - For a screen-sharing video track, the default transmission optimization strategy is to prioritizes clarity.
|
|
2588
|
-
* - For the other types of video tracks, the
|
|
2633
|
+
* - For the other types of video tracks, the browser may reduce the frame rate or the sending resolution in poor network conditions.
|
|
2589
2634
|
* - `"detail"`: Prioritizes video quality.
|
|
2590
|
-
* - The
|
|
2591
|
-
* - In most cases, the
|
|
2592
|
-
* - `"motion"`: Since
|
|
2593
|
-
* - In poor network conditions, the
|
|
2594
|
-
* - In most cases, the
|
|
2635
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
2636
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
2637
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
2638
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
2639
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
2595
2640
|
*/
|
|
2596
2641
|
setOptimizationMode(mode: "balanced" | "motion" | "detail"): Promise<void>;
|
|
2597
2642
|
/**
|
|
@@ -3937,7 +3982,7 @@ export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMi
|
|
|
3937
3982
|
/** @en
|
|
3938
3983
|
* Configurations for the audio track from the audio captured by a microphone. Set these configurations when calling [AgoraRTC.createMicrophoneAudioTrack]{@link IAgoraRTC.createMicrophoneAudioTrack}.
|
|
3939
3984
|
*/
|
|
3940
|
-
export declare interface MicrophoneAudioTrackInitConfig {
|
|
3985
|
+
export declare interface MicrophoneAudioTrackInitConfig extends AudioTrackInitConfig {
|
|
3941
3986
|
/**
|
|
3942
3987
|
* 控制音频的编码配置。
|
|
3943
3988
|
*
|
|
@@ -3955,39 +4000,6 @@ export declare interface MicrophoneAudioTrackInitConfig {
|
|
|
3955
4000
|
* > Firefox does not support setting the audio encoding rate.
|
|
3956
4001
|
*/
|
|
3957
4002
|
encoderConfig?: AudioEncoderConfiguration | AudioEncoderConfigurationPreset;
|
|
3958
|
-
/**
|
|
3959
|
-
* 是否开启回声消除:
|
|
3960
|
-
* - `true`: 开启回声消除。
|
|
3961
|
-
* - `false`: 不开启回声消除。
|
|
3962
|
-
*/
|
|
3963
|
-
/** @en
|
|
3964
|
-
* Whether to enable acoustic echo cancellation:
|
|
3965
|
-
* - `true`: Enable acoustic echo cancellation.
|
|
3966
|
-
* - `false`: Do not enable acoustic echo cancellation.
|
|
3967
|
-
*/
|
|
3968
|
-
AEC?: boolean;
|
|
3969
|
-
/**
|
|
3970
|
-
* 是否开启自动增益:
|
|
3971
|
-
* - `true`: 开启自动增益。
|
|
3972
|
-
* - `false`: 不开启自动增益。
|
|
3973
|
-
*/
|
|
3974
|
-
/** @en
|
|
3975
|
-
* Whether to enable audio gain control:
|
|
3976
|
-
* - `true`: Enable audio gain control.
|
|
3977
|
-
* - `false`: Do not enable audio gain control.
|
|
3978
|
-
*/
|
|
3979
|
-
AGC?: boolean;
|
|
3980
|
-
/**
|
|
3981
|
-
* 是否开启噪声抑制:
|
|
3982
|
-
* - `true`: 开启噪声抑制。
|
|
3983
|
-
* - `false`: 不开启噪声抑制。
|
|
3984
|
-
*/
|
|
3985
|
-
/** @en
|
|
3986
|
-
* Whether to enable automatic noise suppression:
|
|
3987
|
-
* - `true`: Enable automatic noise suppression.
|
|
3988
|
-
* - `false`: Do not automatic noise suppression.
|
|
3989
|
-
*/
|
|
3990
|
-
ANS?: boolean;
|
|
3991
4003
|
/**
|
|
3992
4004
|
* @ignore
|
|
3993
4005
|
*/
|
|
@@ -4030,6 +4042,25 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
|
|
|
4030
4042
|
_updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
|
|
4031
4043
|
}
|
|
4032
4044
|
|
|
4045
|
+
/**
|
|
4046
|
+
* 视频传输优化模式:
|
|
4047
|
+
* - `"detail"`: 清晰优先。
|
|
4048
|
+
* - 浏览器会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
|
|
4049
|
+
* - 大部分情况下,浏览器不会降低发送分辨率,但是可能会降低帧率。
|
|
4050
|
+
* - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式。
|
|
4051
|
+
* - 浏览器不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
|
|
4052
|
+
* - 大部分情况下,浏览器不会降低帧率,但是可能会降低发送分辨率。
|
|
4053
|
+
* @public
|
|
4054
|
+
*/
|
|
4055
|
+
/** @en
|
|
4056
|
+
* The video transmission optimization mode:
|
|
4057
|
+
* - `"detail"`: Prioritizes video quality.
|
|
4058
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
4059
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
4060
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
4061
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
4062
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
4063
|
+
*/
|
|
4033
4064
|
export declare type OptimizationMode = "motion" | "detail";
|
|
4034
4065
|
|
|
4035
4066
|
/**
|
|
@@ -4563,6 +4594,14 @@ export declare interface Resolution {
|
|
|
4563
4594
|
*/
|
|
4564
4595
|
export declare const SAFARI_GLOBAL_GUM_LOCK: PromiseMutex;
|
|
4565
4596
|
|
|
4597
|
+
/**
|
|
4598
|
+
* 创建屏幕共享音频轨道时的配置参数。当使用 [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack} 创建屏幕共享视频轨道时,可以通过此配置共享音频轨道。
|
|
4599
|
+
*/
|
|
4600
|
+
/** @en
|
|
4601
|
+
* Configurations for the audio track of screen sharing. Set these configurations when calling [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack} to enable audio during screen sharing.
|
|
4602
|
+
*/
|
|
4603
|
+
export declare type ScreenAudioTrackInitConfig = AudioTrackInitConfig;
|
|
4604
|
+
|
|
4566
4605
|
export declare interface ScreenConstraintsWithElectron extends MediaTrackConstraints {
|
|
4567
4606
|
/**
|
|
4568
4607
|
* Electron 屏幕共享时用户传入的 sourceID。
|
|
@@ -4728,11 +4767,11 @@ export declare interface ScreenVideoTrackInitConfig {
|
|
|
4728
4767
|
*
|
|
4729
4768
|
* @param mode 视频传输优化模式:
|
|
4730
4769
|
* - `"detail"`: 清晰优先。
|
|
4731
|
-
* -
|
|
4732
|
-
* -
|
|
4733
|
-
* - `"motion"`: 自 4.21.0
|
|
4734
|
-
* -
|
|
4735
|
-
* -
|
|
4770
|
+
* - 浏览器会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
|
|
4771
|
+
* - 大部分情况下,浏览器不会降低发送分辨率,但是可能会降低帧率。
|
|
4772
|
+
* - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式。
|
|
4773
|
+
* - 浏览器不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
|
|
4774
|
+
* - 大部分情况下,浏览器不会降低帧率,但是可能会降低发送分辨率。
|
|
4736
4775
|
*/
|
|
4737
4776
|
/** @en
|
|
4738
4777
|
* @since
|
|
@@ -4746,11 +4785,11 @@ export declare interface ScreenVideoTrackInitConfig {
|
|
|
4746
4785
|
*
|
|
4747
4786
|
* @param mode The video transmission optimization mode:
|
|
4748
4787
|
* - `"detail"`: Prioritizes video quality.
|
|
4749
|
-
* - The
|
|
4750
|
-
* - In most cases, the
|
|
4751
|
-
* - `"motion"`: Since
|
|
4752
|
-
* - In poor network conditions, the
|
|
4753
|
-
* - In most cases, the
|
|
4788
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
4789
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
4790
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
4791
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
4792
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
4754
4793
|
*/
|
|
4755
4794
|
optimizationMode?: "motion" | "detail";
|
|
4756
4795
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agora-js/media",
|
|
3
|
-
"version": "4.22.
|
|
3
|
+
"version": "4.22.2",
|
|
4
4
|
"description": "media module across @agora-js packages",
|
|
5
5
|
"main": "AgoraRTC_N-media.js",
|
|
6
6
|
"module": "AgoraRTC_N-media.esm.mjs",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"homepage": "https://api-ref.agora.io/en/voice-sdk/web/4.x/index.html",
|
|
24
24
|
"peerDependencies": {},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agora-js/shared": "4.22.
|
|
27
|
-
"@agora-js/report": "4.22.
|
|
26
|
+
"@agora-js/shared": "4.22.2",
|
|
27
|
+
"@agora-js/report": "4.22.2",
|
|
28
28
|
"axios": "^1.7.7",
|
|
29
29
|
"agora-rte-extension": "^1.2.4",
|
|
30
30
|
"webrtc-adapter": "8.2.0"
|
package/rtc-sdk-media_en.d.ts
CHANGED
|
@@ -367,6 +367,30 @@ declare class AudioState extends EventEmitter {
|
|
|
367
367
|
|
|
368
368
|
export declare function audioTimerLoop(callback: (time: number) => any, frequency: number): () => void;
|
|
369
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Configurations for the audio track of screen sharing.
|
|
372
|
+
*/
|
|
373
|
+
export declare interface AudioTrackInitConfig {
|
|
374
|
+
/**
|
|
375
|
+
* Whether to enable acoustic echo cancellation:
|
|
376
|
+
* - `true`: Enable acoustic echo cancellation.
|
|
377
|
+
* - `false`: Do not enable acoustic echo cancellation.
|
|
378
|
+
*/
|
|
379
|
+
AEC?: boolean;
|
|
380
|
+
/**
|
|
381
|
+
* Whether to enable audio gain control:
|
|
382
|
+
* - `true`: Enable audio gain control.
|
|
383
|
+
* - `false`: Do not enable audio gain control.
|
|
384
|
+
*/
|
|
385
|
+
AGC?: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Whether to enable automatic noise suppression:
|
|
388
|
+
* - `true`: Enable automatic noise suppression.
|
|
389
|
+
* - `false`: Do not automatic noise suppression.
|
|
390
|
+
*/
|
|
391
|
+
ANS?: boolean;
|
|
392
|
+
}
|
|
393
|
+
|
|
370
394
|
declare class AudioTrackSource extends AudioSource {
|
|
371
395
|
protected sourceNode: MediaStreamAudioSourceNode;
|
|
372
396
|
track: MediaStreamTrack;
|
|
@@ -546,11 +570,11 @@ export declare interface CameraVideoTrackInitConfig {
|
|
|
546
570
|
*
|
|
547
571
|
* @param mode The video transmission optimization mode:
|
|
548
572
|
* - `"detail"`: Prioritizes video quality.
|
|
549
|
-
* - The
|
|
550
|
-
* - In most cases, the
|
|
551
|
-
* - `"motion"`: Since
|
|
552
|
-
* - In poor network conditions, the
|
|
553
|
-
* - In most cases, the
|
|
573
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
574
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
575
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
576
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
577
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
554
578
|
*/
|
|
555
579
|
optimizationMode?: OptimizationMode;
|
|
556
580
|
/**
|
|
@@ -631,7 +655,7 @@ export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfi
|
|
|
631
655
|
|
|
632
656
|
export declare function createScreenVideoTrack(config?: ScreenVideoTrackInitConfig, withAudio?: "disable"): Promise<LocalVideoTrack>;
|
|
633
657
|
|
|
634
|
-
export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio: "auto"): Promise<[LocalVideoTrack, LocalAudioTrack] | LocalVideoTrack>;
|
|
658
|
+
export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio: "auto" | ScreenAudioTrackInitConfig): Promise<[LocalVideoTrack, LocalAudioTrack] | LocalVideoTrack>;
|
|
635
659
|
|
|
636
660
|
/**
|
|
637
661
|
* Configurations for the custom audio track. Set these configurations when calling [AgoraRTC.createCustomAudioTrack]{@link IAgoraRTC.createCustomAudioTrack}.
|
|
@@ -1076,10 +1100,14 @@ export declare function getBitrateFromResAndFps(width: number, height: number, f
|
|
|
1076
1100
|
|
|
1077
1101
|
export declare function getCompatibility(): AgoraRTCCompatibility;
|
|
1078
1102
|
|
|
1103
|
+
export declare function getConstraintsFromAudioConfig(config: AudioTrackInitConfig): MediaTrackConstraints;
|
|
1104
|
+
|
|
1079
1105
|
export declare function getConstraintsFromCameraConfig(config: CameraVideoTrackInitConfig): MediaTrackConstraints;
|
|
1080
1106
|
|
|
1081
1107
|
export declare function getConstraintsFromMicrophoneConfig(config: MicrophoneAudioTrackInitConfig): MediaTrackConstraints;
|
|
1082
1108
|
|
|
1109
|
+
export declare function getConstraintsFromScreenAudioConfig(config: ScreenAudioTrackInitConfig): MediaTrackConstraints;
|
|
1110
|
+
|
|
1083
1111
|
export declare function getConstraintsFromScreenConfig(config: ScreenVideoTrackInitConfig): ScreenConstraintsWithElectron;
|
|
1084
1112
|
|
|
1085
1113
|
export declare function getElectronScreenSources(type?: ScreenSourceType): Promise<ElectronDesktopCapturerSource[]>;
|
|
@@ -1114,7 +1142,7 @@ export declare interface GetUserMediaConfig {
|
|
|
1114
1142
|
screen?: ScreenConstraintsWithElectron;
|
|
1115
1143
|
videoSource?: MediaStreamTrack;
|
|
1116
1144
|
audioSource?: MediaStreamTrack;
|
|
1117
|
-
screenAudio?: boolean;
|
|
1145
|
+
screenAudio?: boolean | MediaTrackConstraints;
|
|
1118
1146
|
}
|
|
1119
1147
|
|
|
1120
1148
|
export declare function getVideoEncoderConfiguration(profile: VideoEncoderConfigurationPreset | VideoEncoderConfiguration | undefined): VideoEncoderConfiguration;
|
|
@@ -1599,13 +1627,13 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
1599
1627
|
* @param mode The video transmission optimization mode:
|
|
1600
1628
|
* - `"balanced"`: Uses the default optimization mode.
|
|
1601
1629
|
* - For a screen-sharing video track, the default transmission optimization strategy is to prioritizes clarity.
|
|
1602
|
-
* - For the other types of video tracks, the
|
|
1630
|
+
* - For the other types of video tracks, the browser may reduce the frame rate or the sending resolution in poor network conditions.
|
|
1603
1631
|
* - `"detail"`: Prioritizes video quality.
|
|
1604
|
-
* - The
|
|
1605
|
-
* - In most cases, the
|
|
1606
|
-
* - `"motion"`: Since
|
|
1607
|
-
* - In poor network conditions, the
|
|
1608
|
-
* - In most cases, the
|
|
1632
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
1633
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
1634
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
1635
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
1636
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
1609
1637
|
*/
|
|
1610
1638
|
setOptimizationMode(mode: "balanced" | "motion" | "detail"): Promise<void>;
|
|
1611
1639
|
/**
|
|
@@ -2437,7 +2465,7 @@ export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMi
|
|
|
2437
2465
|
/**
|
|
2438
2466
|
* Configurations for the audio track from the audio captured by a microphone. Set these configurations when calling [AgoraRTC.createMicrophoneAudioTrack]{@link IAgoraRTC.createMicrophoneAudioTrack}.
|
|
2439
2467
|
*/
|
|
2440
|
-
export declare interface MicrophoneAudioTrackInitConfig {
|
|
2468
|
+
export declare interface MicrophoneAudioTrackInitConfig extends AudioTrackInitConfig {
|
|
2441
2469
|
/**
|
|
2442
2470
|
* The audio encoder configurations.
|
|
2443
2471
|
*
|
|
@@ -2448,24 +2476,6 @@ export declare interface MicrophoneAudioTrackInitConfig {
|
|
|
2448
2476
|
* > Firefox does not support setting the audio encoding rate.
|
|
2449
2477
|
*/
|
|
2450
2478
|
encoderConfig?: AudioEncoderConfiguration | AudioEncoderConfigurationPreset;
|
|
2451
|
-
/**
|
|
2452
|
-
* Whether to enable acoustic echo cancellation:
|
|
2453
|
-
* - `true`: Enable acoustic echo cancellation.
|
|
2454
|
-
* - `false`: Do not enable acoustic echo cancellation.
|
|
2455
|
-
*/
|
|
2456
|
-
AEC?: boolean;
|
|
2457
|
-
/**
|
|
2458
|
-
* Whether to enable audio gain control:
|
|
2459
|
-
* - `true`: Enable audio gain control.
|
|
2460
|
-
* - `false`: Do not enable audio gain control.
|
|
2461
|
-
*/
|
|
2462
|
-
AGC?: boolean;
|
|
2463
|
-
/**
|
|
2464
|
-
* Whether to enable automatic noise suppression:
|
|
2465
|
-
* - `true`: Enable automatic noise suppression.
|
|
2466
|
-
* - `false`: Do not automatic noise suppression.
|
|
2467
|
-
*/
|
|
2468
|
-
ANS?: boolean;
|
|
2469
2479
|
/**
|
|
2470
2480
|
* @ignore
|
|
2471
2481
|
*/
|
|
@@ -2496,6 +2506,15 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
|
|
|
2496
2506
|
_updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
|
|
2497
2507
|
}
|
|
2498
2508
|
|
|
2509
|
+
/**
|
|
2510
|
+
* The video transmission optimization mode:
|
|
2511
|
+
* - `"detail"`: Prioritizes video quality.
|
|
2512
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
2513
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
2514
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
2515
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
2516
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
2517
|
+
*/
|
|
2499
2518
|
export declare type OptimizationMode = "motion" | "detail";
|
|
2500
2519
|
|
|
2501
2520
|
export declare interface PlayerConfig extends VideoPlayerConfig {
|
|
@@ -2845,6 +2864,11 @@ export declare interface Resolution {
|
|
|
2845
2864
|
|
|
2846
2865
|
export declare const SAFARI_GLOBAL_GUM_LOCK: PromiseMutex;
|
|
2847
2866
|
|
|
2867
|
+
/**
|
|
2868
|
+
* Configurations for the audio track of screen sharing. Set these configurations when calling [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack} to enable audio during screen sharing.
|
|
2869
|
+
*/
|
|
2870
|
+
export declare type ScreenAudioTrackInitConfig = AudioTrackInitConfig;
|
|
2871
|
+
|
|
2848
2872
|
export declare interface ScreenConstraintsWithElectron extends MediaTrackConstraints {
|
|
2849
2873
|
sourceId?: string;
|
|
2850
2874
|
extensionId?: string;
|
|
@@ -2933,11 +2957,11 @@ export declare interface ScreenVideoTrackInitConfig {
|
|
|
2933
2957
|
*
|
|
2934
2958
|
* @param mode The video transmission optimization mode:
|
|
2935
2959
|
* - `"detail"`: Prioritizes video quality.
|
|
2936
|
-
* - The
|
|
2937
|
-
* - In most cases, the
|
|
2938
|
-
* - `"motion"`: Since
|
|
2939
|
-
* - In poor network conditions, the
|
|
2940
|
-
* - In most cases, the
|
|
2960
|
+
* - The browser ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
|
|
2961
|
+
* - In most cases, the browser does not reduce the sending resolution, but may reduce the frame rate.
|
|
2962
|
+
* - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
|
|
2963
|
+
* - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
|
|
2964
|
+
* - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
|
|
2941
2965
|
*/
|
|
2942
2966
|
optimizationMode?: "motion" | "detail";
|
|
2943
2967
|
/**
|