@agora-js/media 4.20.2-100 → 4.20.2-300

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.
@@ -1,17 +1,14 @@
1
1
  import { AgoraRTCError } from '@agora-js/shared';
2
2
  import { CheckVisibleResult } from '@agora-js/shared';
3
- import { ElectronDesktopCapturerSource } from '@agora-js/shared';
4
3
  import { EventEmitter } from '@agora-js/shared';
5
4
  import { IAudioProcessor } from 'agora-rte-extension';
6
5
  import type { IAudioProcessorContext } from 'agora-rte-extension';
7
6
  import { IBaseProcessor } from 'agora-rte-extension';
8
7
  import type { IProcessorContext } from 'agora-rte-extension';
9
- import { isElectron } from '@agora-js/shared';
10
8
  import type { Kind } from 'agora-rte-extension';
11
9
  import type { NetworkQuality } from '@agora-js/shared';
12
10
  import type { ProcessorStats } from 'agora-rte-extension';
13
11
  import { PromiseMutex } from '@agora-js/shared';
14
- import { RequiredOnlyOneOf } from '@agora-js/shared';
15
12
  import { SDKStore } from '@agora-js/shared';
16
13
  import { UID } from '@agora-js/shared';
17
14
  import { Usage } from 'agora-rte-extension';
@@ -109,53 +106,6 @@ export declare enum AUDIO_CONTEXT_EVENT {
109
106
  STATE_CHANGE = "state-change"
110
107
  }
111
108
 
112
- /**
113
- * @ignore
114
- */
115
- export declare const AUDIO_ENCODER_CONFIG_SETTINGS: {
116
- speech_low_quality: AudioEncoderConfiguration;
117
- speech_standard: AudioEncoderConfiguration;
118
- music_standard: AudioEncoderConfiguration;
119
- standard_stereo: AudioEncoderConfiguration;
120
- high_quality: AudioEncoderConfiguration;
121
- high_quality_stereo: AudioEncoderConfiguration;
122
- };
123
-
124
- export declare enum AUDIO_TRACK_EVENT {
125
- UPDATE_TRACK_SOURCE = "update-track-source"
126
- }
127
-
128
- declare class AudioBufferSource extends AudioSource {
129
- private audioBuffer;
130
- protected sourceNode?: AudioBufferSourceNode;
131
- private startPlayTime;
132
- private startPlayOffset;
133
- private pausePlayTime;
134
- private options;
135
- private currentLoopCount;
136
- private currentPlaybackSpeed;
137
- set currentState(state: AudioSourceState);
138
- get currentState(): AudioSourceState;
139
- private _currentState;
140
- constructor(buffer: AudioBuffer, options?: AudioSourceOptions);
141
- createWebAudioDiagram(): GainNode;
142
- get duration(): number;
143
- get playbackSpeed(): number;
144
- get currentTime(): number;
145
- updateOptions(options: AudioSourceOptions): void;
146
- startProcessAudioBuffer(): void;
147
- pauseProcessAudioBuffer(): void;
148
- seekAudioBuffer(time: number): void;
149
- resumeProcessAudioBuffer(): void;
150
- stopProcessAudioBuffer(): void;
151
- destroy(): void;
152
- setAudioBufferPlaybackSpeed(speed: number): void;
153
- private startSourceNode;
154
- private createSourceNode;
155
- private handleSourceNodeEnded;
156
- private reset;
157
- }
158
-
159
109
  export declare const audioContextState: AudioState;
160
110
 
161
111
  declare class AudioElementPlayCenter {
@@ -180,59 +130,6 @@ declare class AudioElementPlayCenter {
180
130
 
181
131
  export declare const audioElementPlayCenter: AudioElementPlayCenter;
182
132
 
183
- /**
184
- *
185
- * `AudioEncoderConfiguration` is the interface that defines the audio encoder configurations.
186
- *
187
- * You can customize the audio encoder configurations when calling [AgoraRTC.createCustomAudioTrack]{@link IAgoraRTC.createCustomAudioTrack}, [AgoraRTC.createMicrophoneAudioTrack]{@link IAgoraRTC.createMicrophoneAudioTrack} or [AgoraRTC.createBufferSourceAudioTrack]{@link IAgoraRTC.createBufferSourceAudioTrack}.
188
- */
189
- export declare interface AudioEncoderConfiguration {
190
- /**
191
- * Sample rate of the audio (Hz).
192
- */
193
- sampleRate?: number;
194
- /**
195
- * Sample size of the audio.
196
- */
197
- sampleSize?: number;
198
- /**
199
- * Whether to enable stereo.
200
- */
201
- stereo?: boolean;
202
- /**
203
- * Bitrate of the audio (Kbps).
204
- */
205
- bitrate?: number;
206
- }
207
-
208
- /**
209
- * The preset audio encoder configurations.
210
- *
211
- * You can pass the preset video encoder configurations when calling the following methods:
212
- * - [AgoraRTC.createCustomAudioTrack]{@link IAgoraRTC.createCustomAudioTrack}
213
- * - [AgoraRTC.createMicrophoneAudioTrack]{@link IAgoraRTC.createMicrophoneAudioTrack}
214
- * - [AgoraRTC.createBufferSourceAudioTrack]{@link IAgoraRTC.createBufferSourceAudioTrack}
215
- *
216
- * The following table lists all the preset audio profiles. The SDK uses `"music_standard"` by default.
217
- *
218
- * | Audio Profile | Configurations |
219
- * | -------- | --------------- |
220
- * |`"speech_low_quality"`|Sample rate 16 kHz, mono, encoding rate 24 Kbps|
221
- * |`"speech_standard"`|Sample rate 32 kHz, mono, encoding rate 24 Kbps|
222
- * |`"music_standard"`|Sample rate 48 kHz, mono, encoding rate 40 Kbps|
223
- * |`"standard_stereo"`|Sample rate 48 kHz, stereo, encoding rate 64 Kbps|
224
- * |`"high_quality"`|Sample rate 48 kHz, mono, encoding rate 128 Kbps|
225
- * |`"high_quality_stereo"`|Sample rate 48 kHz, stereo, encoding rate 192 Kbps| Kbps.
226
- * @public
227
- */
228
- export declare type AudioEncoderConfigurationPreset = keyof typeof AUDIO_ENCODER_CONFIG_SETTINGS;
229
-
230
- export declare interface AudioPlaybackOptions {
231
- origin?: boolean;
232
- mixing?: boolean;
233
- effect?: boolean;
234
- }
235
-
236
133
  export declare class AudioProcessorContext extends EventEmitter implements IAudioProcessorContext {
237
134
  private constraintsMap;
238
135
  private statsRegistry;
@@ -320,24 +217,6 @@ export declare enum AudioSourceEvents {
320
217
  UPDATE_SOURCE = "update_source"
321
218
  }
322
219
 
323
- /**
324
- * Options for processing the audio buffer. You need to set the options for processing the audio buffer when calling [startProcessAudioBuffer]{@link IBufferSourceAudioTrack.startProcessAudioBuffer}.
325
- */
326
- export declare interface AudioSourceOptions {
327
- /**
328
- * How many times the audio loops.
329
- */
330
- cycle?: number;
331
- /**
332
- * Whether to loop the audio infinitely.
333
- */
334
- loop?: boolean;
335
- /**
336
- * The playback position (seconds).
337
- */
338
- startPlayTime?: number;
339
- }
340
-
341
220
  /**
342
221
  * Processing state of the audio buffer:
343
222
  * - `"stopped"`: The SDK stops processing the audio buffer. Reasons may include:
@@ -355,12 +234,7 @@ declare class AudioState extends EventEmitter {
355
234
  curState: AudioContextState | "interrupted" | undefined;
356
235
  currentTime?: number;
357
236
  currentTimeStuckAt?: number;
358
- private interruptDetectorTrack?;
359
237
  get duringInterruption(): boolean;
360
- private onLocalAudioTrackMute;
361
- private onLocalAudioTrackUnmute;
362
- bindInterruptDetectorTrack(track: MicrophoneAudioTrack): void;
363
- unbindInterruptDetectorTrack(track: MicrophoneAudioTrack): void;
364
238
  }
365
239
 
366
240
  export declare function audioTimerLoop(callback: (time: number) => any, frequency: number): () => void;
@@ -390,189 +264,14 @@ declare class AutoPlayGestureEventEmitter extends EventEmitter {
390
264
 
391
265
  export declare const autoPlayGestureEventEmitter: AutoPlayGestureEventEmitter;
392
266
 
393
- /**
394
- * @ignore
395
- *
396
- * Image enhancement options. You need to set the image enhancement options when calling [setBeautyEffect]{@link ILocalVideoTrack.setBeautyEffect}.
397
- */
398
- export declare interface BeautyEffectOptions {
399
- /**
400
- *
401
- * The smoothness level.
402
- *
403
- * The value range is [0.0, 1.0]. The original smoothness level is 0.0. The default value is 0.5. This parameter is usually used to remove blemishes.
404
- */
405
- smoothnessLevel?: number;
406
- /**
407
- * The brightness level.
408
- *
409
- * The value range is [0.0, 1.0]. The original brightness level is 0.0. The default value is 0.7.
410
- */
411
- lighteningLevel?: number;
412
- /**
413
- * The redness level.
414
- *
415
- * The value range is [0.0, 1.0]. The original redness level is 0.0. The default value is 0.1. This parameter adjusts the red saturation level.
416
- */
417
- rednessLevel?: number;
418
- /**
419
- * The contrast level. Use this together with {@link lighteningLevel}.
420
- * - 0: Low contrast level.
421
- * - 1: (Default) The original contrast level.
422
- * - 2: High contrast level.
423
- */
424
- lighteningContrastLevel?: 0 | 1 | 2;
425
- }
426
-
427
- export declare interface BeautyWebGLParameters {
428
- denoiseLevel?: number;
429
- lightLevel?: number;
430
- rednessLevel?: number;
431
- lighteningContrastLevel?: number;
432
- }
433
-
434
267
  export declare const blob2Uint8Array: (blob: Blob) => Promise<Uint8Array>;
435
268
 
436
- export declare class BufferSourceAudioTrack extends LocalAudioTrack implements IBufferSourceAudioTrack {
437
- source: string | File | AudioBuffer | null;
438
- private _bufferSource;
439
- get __className__(): string;
440
- constructor(source: string | File | AudioBuffer, bufferSource: AudioBufferSource, encodingConfig?: AudioEncoderConfiguration, trackId?: string);
441
- get currentState(): AudioSourceState;
442
- get duration(): number;
443
- get playbackSpeed(): number;
444
- getCurrentTime(): number;
445
- startProcessAudioBuffer(options?: AudioSourceOptions): void;
446
- pauseProcessAudioBuffer(): void;
447
- seekAudioBuffer(time: number): void;
448
- resumeProcessAudioBuffer(): void;
449
- stopProcessAudioBuffer(): void;
450
- close(): void;
451
- setAudioBufferPlaybackSpeed(speed: number): void;
452
- }
453
-
454
- /**
455
- * Configurations for the audio track from an audio file or `AudioBuffer` object. Set these configurations when calling [AgoraRTC.createBufferSourceAudioTrack]{@link IAgoraRTC.createBufferSourceAudioTrack}.
456
- */
457
- export declare interface BufferSourceAudioTrackInitConfig {
458
- /**
459
- * The type of the audio source:
460
- * - `File`: An [File](https://developer.mozilla.org/en-US/docs/Web/API/File) object, representing a local audio file.
461
- * - `string`: The online audio file retrieved from an HTTPS address. Ensure the address supports HTTPS and CORS.
462
- * - `AudioBuffer`: An [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer) object, representing the raw data in PCM format.
463
- */
464
- source: File | string | AudioBuffer;
465
- /**
466
- * Whether to cache the online file:
467
- * - `true`: Cache the online file.
468
- * - `false`: (default) Do not cache the online file.
469
- */
470
- cacheOnlineFile?: boolean;
471
- /**
472
- * The audio encoder configurations.
473
- *
474
- * You can set the audio encoder configurations in either of the following ways:
475
- * - Pass the preset audio encoder configurations by using [[AudioEncoderConfigurationPreset]].
476
- * - Pass your customized audio encoder configurations by using [[AudioEncoderConfiguration]].
477
- *
478
- * > Firefox does not support setting the audio encoding rate.
479
- */
480
- encoderConfig?: AudioEncoderConfiguration | AudioEncoderConfigurationPreset;
481
- }
482
-
483
- export declare class CameraVideoTrack extends LocalVideoTrack implements ICameraVideoTrack {
484
- private _config;
485
- private _originalConstraints;
486
- private _constraints;
487
- _enabled: boolean;
488
- _deviceName: string;
489
- get __className__(): string;
490
- constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string);
491
- setDevice(deviceId: string | RequiredOnlyOneOf<{
492
- facingMode: VideoFacingModeEnum;
493
- deviceId: string;
494
- }>): Promise<void>;
495
- private _setDeviceById;
496
- private _setDeviceByFacingModel;
497
- setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
498
- setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, doNotRenegoation?: boolean): Promise<void>;
499
- protected _getDefaultPlayerConfig(): Partial<PlayerConfig>;
500
- protected onTrackEnded(): void;
501
- renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
502
- tryResumeVideoForIOS15_16WeChat: () => Promise<void>;
503
- close(): void;
504
- clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): CameraVideoTrack;
505
- bindProcessorContextEvents(): void;
506
- }
507
-
508
- /**
509
- * Configurations for the video track from the video captured by a camera. Set these configurations when calling [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack}.
510
- */
511
- export declare interface CameraVideoTrackInitConfig {
512
- /**
513
- * The video encoder configurations.
514
- *
515
- * You can set the video encoder configurations in either of the following ways:
516
- * - Pass the preset video encoder configurations by using [[VideoEncoderConfigurationPreset]].
517
- * - Pass your customized video encoder configurations by using [[VideoEncoderConfiguration]].
518
- * - Leave this property empty to use the SDK's default value, `"480p_1"` (resolution: 640 × 480, frame rate: 15 fps, bitrate: 500 Kbps).
519
- */
520
- encoderConfig?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset;
521
- /**
522
- * Whether to user the front camera or the rear camera.
523
- *
524
- * You can use this parameter to choose between the front camera and the rear camera on a mobile device:
525
- * - `"user"`: The front camera.
526
- * - `"environment"`: The rear camera.
527
- */
528
- facingMode?: VideoFacingModeEnum;
529
- /**
530
- * Specifies the camera ID.
531
- *
532
- * You can get a list of the available cameras by calling [AgoraRTC.getCameras]{@link IAgoraRTC.getCameras}.
533
- */
534
- cameraId?: string;
535
- /**
536
- * @since
537
- * <br>&emsp;&emsp;&emsp;*4.0.0*
538
- *
539
- * Transmission optimization mode. Whether to prioritize video quality or smoothness:
540
- * - `"detail"`: Prioritizes video quality.
541
- * - The SDK 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.
542
- * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
543
- * - `"motion"`: Prioritizes video smoothness.
544
- * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
545
- * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
546
- * - Empty: Uses the default transmission optimization mode. The SDK may reduce the frame rate or the sending resolution in poor network conditions.
547
- *
548
- * > Note: This method is only supported on Chrome.
549
- */
550
- optimizationMode?: "motion" | "detail";
551
- /**
552
- * @ignore
553
- *
554
- * @since
555
- * <br>&emsp;&emsp;&emsp;*4.18.0*
556
- *
557
- * Configurations for Scalable Video Coding (SVC).
558
- *
559
- * You can set the configurations using one of the following options:
560
- * - Use the preset SVC configurations provided by the SDK through {@link SVCConfigurationPreset}.
561
- * - Use your custom SVC configurations through {@link SVCConfiguration}.
562
- */
563
- scalabiltyMode?: SVCConfiguration | SVCConfigurationPreset;
564
- }
565
-
566
269
  export declare function checkMediaStreamTrackResolution(track: MediaStreamTrack): Promise<[number, number]>;
567
270
 
568
- export declare function checkTrackState(): (target: any, propertyKey: any, descriptor: PropertyDescriptor) => TypedPropertyDescriptor<any> | undefined;
569
-
570
271
  /**
571
272
  * The visibility of the `<video>` tag.
572
273
  *
573
274
  * Get the visibility of the `<video>` tag through the following methods and events:
574
- * - [localVideoTrack.on("video-element-visible-status")]{@link ILocalVideoTrack.event_video_element_visible_status}
575
- * - [localVideoTrack.getVideoElementVisibleStatus]{@link ILocalVideoTrack.getVideoElementVisibleStatus}
576
275
  * - [remoteVideoTrack.on("video-element-visible-status")]{@link IRemoteVideoTrack.event_video_element_visible_status}
577
276
  * - [remoteVideoTrack.getVideoElementVisibleStatus]{@link IRemoteVideoTrack.getVideoElementVisibleStatus}
578
277
  *
@@ -586,201 +285,8 @@ export declare function checkTrackState(): (target: any, propertyKey: any, descr
586
285
  */
587
286
  export declare type CheckVideoVisibleResult = CheckVisibleResult;
588
287
 
589
- /**
590
- * Specifies a constraint for a property, such as the resolution or bitrate for video capture in [[VideoEncoderConfiguration]].
591
- */
592
- export declare interface ConstrainLong {
593
- /**
594
- * The lower limit of the property.
595
- */
596
- min?: number;
597
- /**
598
- * The upper limit of the property.
599
- */
600
- max?: number;
601
- /**
602
- * An ideal value of a property. If the video capture device cannot output this value, it outputs the closest value instead.
603
- */
604
- ideal?: number;
605
- /**
606
- * A required value of a property. If the video capture device cannot output this value, the video capture fails.
607
- */
608
- exact?: number;
609
- }
610
-
611
- export declare function createBufferSourceAudioTrack(config: BufferSourceAudioTrackInitConfig): Promise<BufferSourceAudioTrack>;
612
-
613
- export declare function createCameraVideoTrack(config?: CameraVideoTrackInitConfig): Promise<CameraVideoTrack>;
614
-
615
- export declare function createCustomAudioTrack(config: CustomAudioTrackInitConfig): LocalAudioTrack;
616
-
617
- export declare function createCustomVideoTrack(config: CustomVideoTrackInitConfig): LocalVideoTrack;
618
-
619
- export declare function createMicrophoneAndCameraTracks(audioConfig?: MicrophoneAudioTrackInitConfig, videoConfig?: CameraVideoTrackInitConfig): Promise<[MicrophoneAudioTrack, CameraVideoTrack]>;
620
-
621
- export declare function createMicrophoneAudioTrack(config?: MicrophoneAudioTrackInitConfig): Promise<MicrophoneAudioTrack>;
622
-
623
- export declare function createMixingAudioTrack(trackList: LocalAudioTrack[]): MixingAudioTrack;
624
-
625
- export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio: "enable"): Promise<[LocalVideoTrack, LocalAudioTrack]>;
626
-
627
- export declare function createScreenVideoTrack(config?: ScreenVideoTrackInitConfig, withAudio?: "disable"): Promise<LocalVideoTrack>;
628
-
629
- export declare function createScreenVideoTrack(config: ScreenVideoTrackInitConfig, withAudio: "auto"): Promise<[LocalVideoTrack, LocalAudioTrack] | LocalVideoTrack>;
630
-
631
- /**
632
- * Configurations for the custom audio track. Set these configurations when calling [AgoraRTC.createCustomAudioTrack]{@link IAgoraRTC.createCustomAudioTrack}.
633
- */
634
- export declare interface CustomAudioTrackInitConfig {
635
- /**
636
- * Your [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
637
- */
638
- mediaStreamTrack: MediaStreamTrack;
639
- /**
640
- * The audio encoder configurations.
641
- *
642
- * You can set the audio encoder configurations in either of the following ways:
643
- * - Pass the preset audio encoder configurations by using [[AudioEncoderConfigurationPreset]].
644
- * - Pass your customized audio encoder configurations by using [[AudioEncoderConfiguration]].
645
- *
646
- * > Firefox does not support setting the audio encoding rate.
647
- */
648
- encoderConfig?: AudioEncoderConfiguration | AudioEncoderConfigurationPreset;
649
- }
650
-
651
- /**
652
- * Configurations for the custom video track. Set these configurations when calling [AgoraRTC.createCustomVideoTrack]{@link IAgoraRTC.createCustomVideoTrack}.
653
- */
654
- export declare interface CustomVideoTrackInitConfig {
655
- /**
656
- * Your [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
657
- */
658
- mediaStreamTrack: MediaStreamTrack;
659
- /**
660
- * @since
661
- * <br>&emsp;&emsp;&emsp;*4.17.1*
662
- *
663
- * Width of the video.
664
- *
665
- * You can pass a `number`, or a constraint such as `{ max: 1280, min: 720 }`.
666
- *
667
- * For more details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
668
- */
669
- width?: number | ConstrainLong;
670
- /**
671
- * @since
672
- * <br>&emsp;&emsp;&emsp;*4.17.1*
673
- *
674
- * Height of the video.
675
- *
676
- * You can pass a `number`, or a constraint such as `{ max: 1280, min: 720 }`.
677
- *
678
- * For more details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
679
- */
680
- height?: number | ConstrainLong;
681
- /**
682
- * @since
683
- * <br>&emsp;&emsp;&emsp;*4.17.1*
684
- *
685
- * Frame rate of the video (fps).
686
- *
687
- * You can pass a `number`, or a constraint such as `{ max: 30, min: 5 }`.
688
- *
689
- * For details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
690
- */
691
- frameRate?: number | ConstrainLong;
692
- /**
693
- * The minimum bitrate of sending the video track (Kbps).
694
- */
695
- bitrateMin?: number;
696
- /**
697
- * The maximum bitrate of sending the video track (Kbps).
698
- */
699
- bitrateMax?: number;
700
- /**
701
- * @since
702
- * <br>&emsp;&emsp;&emsp;*4.0.0*
703
- *
704
- * Transmission optimization mode. Whether to prioritize video quality or smoothness:
705
- * - `"detail"`: Prioritizes video quality.
706
- * - The SDK 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.
707
- * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
708
- * - `"motion"`: Prioritizes video smoothness.
709
- * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
710
- * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
711
- * - Empty: Uses the default transmission optimization mode. The SDK may reduce the frame rate or the sending resolution in poor network conditions.
712
- *
713
- * > Note: This method is only supported on Chrome.
714
- */
715
- optimizationMode?: "motion" | "detail";
716
- /**
717
- * @ignore
718
- *
719
- * @since
720
- * <br>&emsp;&emsp;&emsp;*4.18.0*
721
- *
722
- * Configurations for Scalable Video Coding (SVC).
723
- *
724
- * You can set `scalabiltyMode` using one of the following options:
725
- * - Use the preset SVC configurations provided by the SDK through {@link SVCConfigurationPreset}.
726
- * - Use your custom SVC configurations through {@link SVCConfiguration}.
727
- */
728
- scalabiltyMode?: SVCConfiguration | SVCConfigurationPreset;
729
- }
730
-
731
- export declare abstract class DataChannel extends EventEmitter implements IDataChannel {
732
- private _version;
733
- private _type;
734
- _config: IDataChannelConfig;
735
- _originDataChannel?: RTCDataChannel;
736
- protected _dataStreamPacketHeader: ArrayBuffer;
737
- protected _dataStreamPacketHandler: DataStream;
738
- private _datachannelEventMap;
739
- constructor(config: IDataChannelConfig, datachannel?: RTCDataChannel);
740
- get id(): number;
741
- get ordered(): boolean;
742
- get maxRetransmits(): number;
743
- get metadata(): string;
744
- get readyState(): RTCDataChannelState;
745
- get _originDataChannelId(): number | null;
746
- getChannelId(): number;
747
- getConfig(): IDataChannelConfig;
748
- _close(): void;
749
- _waitTillOpen(): Promise<void>;
750
- _updateOriginDataChannel(datachannel: RTCDataChannel): void;
751
- private _initPacketHeader;
752
- private _bandDataChannelEvents;
753
- private _unbindDataChannelEvents;
754
- }
755
-
756
- export declare enum DataChannelEvents {
757
- OPEN = "open",
758
- MESSAGE = "message",
759
- CLOSE = "close",
760
- CLOSING = "closing",
761
- ERROR = "error"
762
- }
763
-
764
- declare class DataStream {
765
- private _sequence;
766
- private _startTime;
767
- private isUseOneByte;
768
- private get startTime();
769
- private get sequence();
770
- serialize(payload: ArrayBuffer): ArrayBuffer;
771
- deserialize(packet: ArrayBuffer): ArrayBuffer;
772
- private serializeExtension;
773
- private deserializeExtension;
774
- private decompress;
775
- private compress;
776
- }
777
-
778
288
  export declare function decodeAudioData(buffer: ArrayBuffer): Promise<AudioBuffer>;
779
289
 
780
- export declare const DEFAULT_LOCAL_AUDIO_TRACK_STATS: LocalAudioTrackStats;
781
-
782
- export declare const DEFAULT_LOCAL_VIDEO_TRACK_STATS: LocalVideoTrackStats;
783
-
784
290
  export declare const DEFAULT_NETWORK_QUALITY_STATS: NetworkQuality;
785
291
 
786
292
  export declare const DEFAULT_REMOTE_AUDIO_TRACK_STATS: RemoteAudioTrackStats;
@@ -870,24 +376,6 @@ export declare type DeviceState = "ACTIVE" | "INACTIVE";
870
376
 
871
377
  export declare const emptyImage2TypedArray: (type: string) => Promise<ImageTypedData>;
872
378
 
873
- /**
874
- * @ignore
875
- *
876
- * Occurs when the device is overloaded after you call [setBeautyEffect]{@link ILocalVideoTrack.setBeautyEffect} to enable image enhancement.
877
- *
878
- * You can listen for this event to notify users of the device overload and disable image enhancement.
879
- *
880
- * ```javascript
881
- * localVideoTrack.on("beauty-effect-overload", () => {
882
- * console.log("beauty effect overload, disable beauty effect");
883
- * localVideoTrack.setBeautyEffect(false);
884
- * });
885
- * ```
886
- * @event
887
- * @asMemberOf ILocalVideoTrack
888
- */
889
- declare function event_beauty_effect_overload(): void;
890
-
891
379
  /**
892
380
  * Occurs when the first remote audio or video frame is decoded.
893
381
  *
@@ -908,48 +396,6 @@ declare function event_first_frame_decoded(): void;
908
396
  */
909
397
  declare function event_sei_received(sei: Uint8Array): void;
910
398
 
911
- /**
912
- * Occurs when the state of processing the audio buffer in [BufferSourceAudioTrack]{@link IBufferSourceAudioTrack} changes.
913
- *
914
- * @param currentState The state of processing the audio buffer:
915
- * - `"stopped"`: The SDK stops processing the audio buffer. Reasons may include:
916
- * - The SDK finishes processing the audio buffer.
917
- * - The user manually stops the processing of the audio buffer.
918
- * - `"paused"`: The SDK pauses the processing of the audio buffer.
919
- * - `"playing"`: The SDK is processing the audio buffer.
920
- *
921
- * @event
922
- * @asMemberOf IBufferSourceAudioTrack
923
- */
924
- declare function event_source_state_change(currentState: AudioSourceState): void;
925
-
926
- /**
927
- * Occurs when a audio or video track ends.
928
- *
929
- * Reasons may include:
930
- * - Camera is unplugged.
931
- * - Microphone is unplugged.
932
- * - The local user stops screen sharing.
933
- * - The local user closes the underlying `MediaStreamTrack`.
934
- * - A local media device malfunctions.
935
- * - The device permission is revoked.
936
- *
937
- * @event
938
- * @asMemberOf ILocalTrack
939
- */
940
- declare function event_track_ended(): void;
941
-
942
- /**
943
- * Occurs when the `RTCRtpTransceiver` instance of the current track is updated.
944
- *
945
- * @param transceiver The new `RTCRtpTransceiver` instance.
946
- * @param type The type of the video stream to which the current track belongs. See {@link StreamType}.
947
- *
948
- * @event
949
- * @asMemberOf ILocalTrack
950
- */
951
- declare function event_transceiver_updated(transceiver: RTCRtpTransceiver, type?: StreamType): void;
952
-
953
399
  /**
954
400
  * Occurs when the `RTCRtpTransceiver` instance of the current track is updated.
955
401
  *
@@ -957,43 +403,7 @@ declare function event_transceiver_updated(transceiver: RTCRtpTransceiver, type?
957
403
  * @event
958
404
  * @asMemberOf IRemoteTrack
959
405
  */
960
- declare function event_transceiver_updated_2(transceiver: RTCRtpTransceiver): void;
961
-
962
- /**
963
- * @ignore
964
- */
965
- declare function event_user_datachannel_close(): void;
966
-
967
- /**
968
- * @ignore
969
- */
970
- declare function event_user_datachannel_error(ev: Event): void;
971
-
972
- /**
973
- * @ignore
974
- */
975
- declare function event_user_datachannel_message(data: ArrayBuffer): void;
976
-
977
- /**
978
- * @ignore
979
- */
980
- declare function event_user_datachannel_open(): void;
981
-
982
- /**
983
- * @since
984
- * <br>&emsp;&emsp;&emsp;*4.8.0*
985
- *
986
- * Indicates the visibility of the `<video>` HTML tag.
987
- *
988
- * The SDK triggers this event every 30 seconds.
989
- *
990
- * After you call `localVideoTrack.play`, the SDK creates an [`<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) tag for playing video tracks. When `localVideoTrack.isPlaying` is `true` but you cannot see any video, this event helps you check whether the `<video>` tag is visible or not and learn the reason when the `<video>` tag is invisible.
991
- *
992
- * @param data The visibility of the `<video>` tag.
993
- * @asMemberOf ILocalVideoTrack
994
- * @event
995
- */
996
- declare function event_video_element_visible_status(data?: CheckVideoVisibleResult): void;
406
+ declare function event_transceiver_updated(transceiver: RTCRtpTransceiver): void;
997
407
 
998
408
  /**
999
409
  * @since
@@ -1009,7 +419,7 @@ declare function event_video_element_visible_status(data?: CheckVideoVisibleResu
1009
419
  * @asMemberOf IRemoteVideoTrack
1010
420
  * @event
1011
421
  */
1012
- declare function event_video_element_visible_status_2(data?: CheckVideoVisibleResult): void;
422
+ declare function event_video_element_visible_status(data?: CheckVideoVisibleResult): void;
1013
423
 
1014
424
  /**
1015
425
  * Occurs when the video state changes.
@@ -1056,254 +466,60 @@ declare class FakeTrackSource extends EventEmitter {
1056
466
  createMediaStreamSourceNode(): undefined;
1057
467
  }
1058
468
 
1059
- export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array>;
1060
-
1061
469
  export declare function getAudioContext(): AudioContext;
1062
470
 
1063
- export declare function getAudioEncoderConfiguration(profile: AudioEncoderConfigurationPreset | AudioEncoderConfiguration): AudioEncoderConfiguration;
1064
-
1065
- export declare function getBitrateConstrainRange(width: number, height: number, frameRate: number, bitrateMin?: number, bitrateMax?: number): DoubleRange;
1066
-
1067
471
  export declare function getCompatibility(): AgoraRTCCompatibility;
1068
472
 
1069
- export declare function getConstraintsFromCameraConfig(config: CameraVideoTrackInitConfig): MediaTrackConstraints;
1070
-
1071
- export declare function getConstraintsFromMicrophoneConfig(config: MicrophoneAudioTrackInitConfig): MediaTrackConstraints;
1072
-
1073
- export declare function getConstraintsFromScreenConfig(config: ScreenVideoTrackInitConfig): ScreenConstraintsWithElectron;
1074
-
1075
- export declare function getElectronScreenSources(type?: ScreenSourceType): Promise<ElectronDesktopCapturerSource[]>;
1076
-
1077
- export declare function getElectronScreenStream(sourceId: string, config: ScreenConstraintsWithElectron, captureAudio?: boolean): Promise<MediaStream>;
1078
-
1079
- export declare function getElectronScreenStreamByUserSelect(config: ScreenConstraintsWithElectron, captureAudio?: boolean): Promise<MediaStream>;
1080
-
1081
- export declare function getLocalStream(config: GetUserMediaConfig, id: string): Promise<MediaStream>;
1082
-
1083
- export declare function getScalabilityConfiguration(profile: SVCConfiguration | SVCConfigurationPreset): SVCConfiguration;
1084
-
1085
- export declare function getScreenEncoderConfiguration(profile: VideoEncoderConfiguration | ScreenEncoderConfigurationPreset | string): VideoEncoderConfiguration;
1086
-
1087
473
  export declare function getSilenceAudioTrack(): MediaStreamTrack;
1088
474
 
1089
475
  export declare function getSilenceSamplesDuration(buffer: AudioBuffer): number;
1090
476
 
1091
- export declare function getStaticTrackStream(track: MediaStreamTrack, interval?: number): MediaStreamTrack | void;
477
+ export declare function handleGetUserMediaError(errorName: string, message?: string): AgoraRTCError;
1092
478
 
1093
- export declare interface GetUserMediaConfig {
1094
- video?: MediaTrackConstraints;
1095
- audio?: MediaTrackConstraints;
1096
- screen?: ScreenConstraintsWithElectron;
1097
- videoSource?: MediaStreamTrack;
1098
- audioSource?: MediaStreamTrack;
1099
- screenAudio?: boolean;
1100
- }
479
+ export declare const HAS_GUM_AUDIO: boolean;
1101
480
 
1102
- export declare function getVideoEncoderConfiguration(profile: VideoEncoderConfigurationPreset | VideoEncoderConfiguration | undefined): VideoEncoderConfiguration;
1103
-
1104
- export declare function handleGetUserMediaError(errorName: string, message?: string): AgoraRTCError;
1105
-
1106
- export declare let HAS_GUM_AUDIO: boolean;
1107
-
1108
- export declare let HAS_GUM_VIDEO: boolean;
481
+ export declare const HAS_GUM_VIDEO: boolean;
1109
482
 
1110
483
  export declare function hasAudioContext(): boolean;
1111
484
 
1112
- /**
1113
- * Inherited from [LocalAudioTrack]{@link ILocalAudioTrack}, `BufferSourceAudioTrack` is an interface for the audio from a local audio file and adds several functions for controlling the processing of the audio buffer, such as starting processing, stopping processing, and seeking a specified time location.
1114
- *
1115
- * You can create an audio track from an audio file by calling [AgoraRTC.createBufferSourceAudioTrack]{@link IAgoraRTC.createBufferSourceAudioTrack}.
1116
- */
1117
- export declare interface IBufferSourceAudioTrack extends ILocalAudioTrack {
1118
- /**
1119
- * The [source]{@link BufferSourceAudioTrackInitConfig.source} specified when creating an audio track.
1120
- */
1121
- source: string | File | AudioBuffer | null;
1122
- /**
1123
- * The current state of audio processing, such as start, pause, or stop.
1124
- */
1125
- currentState: AudioSourceState;
1126
- /**
1127
- * The total duration of the audio (seconds).
1128
- */
1129
- duration: number;
1130
- /**
1131
- * @since
1132
- * <br>&emsp;&emsp;&emsp;*4.18.0*
1133
- *
1134
- * The playback speed of the current audio file. Valid range is [50, 400], where:
1135
- * - `50`: Half the original speed.
1136
- * - `100`: (Default) The original speed.
1137
- * - `400`: Four times the original speed.
1138
- */
1139
- playbackSpeed: number;
1140
- /**
1141
- * @param event The event name.
1142
- * @param listener See [source-state-change]{@link event_source_state_change}.
1143
- */
1144
- on(event: "source-state-change", listener: typeof event_source_state_change): void;
1145
- /**
1146
- * When the specified event happens, the SDK triggers the callback that you pass.
1147
- *
1148
- * @param event The event name.
1149
- * @param listener The callback function.
1150
- */
1151
- on(event: string, listener: Function): void;
1152
- /**
1153
- * Gets the progress (seconds) of the audio buffer processing.
1154
- *
1155
- * @returns The progress (seconds) of the audio buffer processing.
1156
- */
1157
- getCurrentTime(): number;
1158
- /**
1159
- * Starts processing the audio buffer.
1160
- *
1161
- * > Starting processing the audio buffer means that the processing unit in the SDK has received the audio data. If the audio track has been published, the remote user can hear the audio.
1162
- * > Whether the local user can hear the audio depends on whether the SDK calls the [[play]] method and sends the audio data to the sound card.
1163
- *
1164
- * @param options Options for processing the audio buffer. See [[AudioSourceOptions]].
1165
- */
1166
- startProcessAudioBuffer(options?: AudioSourceOptions): void;
1167
- /**
1168
- * Pauses processing the audio buffer.
1169
- */
1170
- pauseProcessAudioBuffer(): void;
1171
- /**
1172
- * Jumps to a specified time point.
1173
- *
1174
- * @param time The specified time point (seconds).
1175
- */
1176
- seekAudioBuffer(time: number): void;
1177
- /**
1178
- * Resumes processing the audio buffer.
1179
- */
1180
- resumeProcessAudioBuffer(): void;
1181
- /**
1182
- * Stops processing the audio buffer.
1183
- */
1184
- stopProcessAudioBuffer(): void;
1185
- /**
1186
- * @since
1187
- * <br>&emsp;&emsp;&emsp;*4.18.0*
1188
- *
1189
- * Sets the playback speed for the current audio file.
1190
- *
1191
- * You can call this method before or after joining a channel.
1192
- *
1193
- * @param speed The playback speed. Valid range is [50, 400], where:
1194
- * - `50`: Half the original speed.
1195
- * - `100`: (Default) The original speed.
1196
- * - `400`: Four times the original speed.
1197
- */
1198
- setAudioBufferPlaybackSpeed(speed: number): void;
485
+ export declare interface ImageTypedData {
486
+ buffer: Uint8Array;
487
+ width: number;
488
+ height: number;
1199
489
  }
1200
490
 
1201
491
  /**
492
+ * `RemoteAudioTrack` is the basic interface for the remote audio track.
1202
493
  *
1203
- * Inherited from [LocalVideoTrack]{@link ILocalVideoTrack}, `CameraVideoTrack` is an interface for the video captured by a local camera and adds functions such as switching devices and adjusting video encoder configurations.
1204
- *
1205
- * You can create a local camera video track by calling [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack}.
494
+ * You can get create a remote audio track by the [AgoraRTCRemoteUser.audioTrack]{@link IAgoraRTCRemoteUser.audioTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
1206
495
  */
1207
- export declare interface ICameraVideoTrack extends ILocalVideoTrack {
1208
- /**
1209
- * Sets the device for capturing video.
1210
- *
1211
- * > You can call this method either before or after publishing the video track.
1212
- *
1213
- * @param deviceId Device ID, which can be passed in using the following ways:
1214
- * - Pass a string: Pass the `deviceId` obtained using [AgoraRTC.getCameras]{@link IAgoraRTC.getCameras}.
1215
- * - Pass an object: Starting from version 4.19.0, you can pass an object
1216
- * containing `facingMode` or `deviceId`, but only one of these properties
1217
- * can be specified. `deviceId` can be obtained through [AgoraRTC.getCameras]{@link IAgoraRTC.getCameras}, and `facingMode` supports the following values:
1218
- * - `"environment"`: Use the rear camera.
1219
- * - `"user"`: Use the front camera.
1220
- */
1221
- setDevice(deviceId: string | RequiredOnlyOneOf<{
1222
- facingMode: VideoFacingModeEnum;
1223
- deviceId: string;
1224
- }>): Promise<void>;
1225
- /**
1226
- * @since
1227
- * <br>&emsp;&emsp;&emsp;*4.0.0*
1228
- *
1229
- * Enables/Disables the track.
1230
- *
1231
- * After a track is disabled, the SDK stops playing and publishing the track.
1232
- *
1233
- * > - Disabling a track does not trigger the [LocalTrack.on("track-ended")]{@link event_track_ended} event.
1234
- * > - If a track is published, disabling this track triggers the [user-unpublished]{@link IAgoraRTCClient.event_user_unpublished} event on the remote client, and re-enabling this track triggers the [user-published]{@link IAgoraRTCClient.event_user_published} event.
1235
- * > - Do not call `setEnabled` and `setMuted` together.
1236
- *
1237
- * @param enabled Whether to enable the track:
1238
- * - `true`: Enable the track.
1239
- * - `false`: Disable the track.
1240
- */
1241
- setEnabled(enabled: boolean): Promise<void>;
496
+ export declare interface IRemoteAudioTrack extends IRemoteTrack {
1242
497
  /**
1243
- * @since
1244
- * <br>&emsp;&emsp;&emsp;*4.19.0*
1245
- *
1246
- * Clones the current video track to create a new video track.
1247
- *
1248
- * In scenarios such as video conferencing and online education, you can use this method to display the same video stream with two sets of display parameters, including resolution, frame rate, and bitrate. For example, you can have one display set to high-definition and the other to low-definition.
498
+ * Gets the statistics of a remote audio track.
1249
499
  *
1250
- * @param config The encoding configuration for the new video track. You can pass in the SDK's built-in encoding configuration through [[VideoEncoderConfiguration]], or customize the video encoding configuration by passing in a [[VideoEncoderConfigurationPreset]].
1251
- * @param cloneTrack Whether to clone the current track. Default is `true`.
1252
- * @returns The newly generated video track.
500
+ * @return An [[RemoteAudioTrackStats]] object.
1253
501
  */
1254
- clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): ICameraVideoTrack;
1255
- }
1256
-
1257
- /**
1258
- * @ignore
1259
- */
1260
- export declare interface IDataChannel extends EventEmitter {
1261
- readonly id: number;
1262
- readonly maxRetransmits: number | null;
1263
- readonly ordered: boolean;
1264
- readonly readyState: RTCDataChannelState;
1265
- readonly metadata: string;
1266
- getChannelId(): number;
1267
- getConfig(): IDataChannelConfig;
1268
- }
1269
-
1270
- /**
1271
- * @ignore
1272
- */
1273
- export declare interface IDataChannelConfig {
1274
- id: number;
1275
- ordered: boolean;
1276
- metadata: string;
1277
- }
1278
-
1279
- /**
1280
- * `LocalAudioTrack` is the basic interface for local audio tracks, providing main methods of local audio tracks.
1281
- *
1282
- * You can create a local audio track by calling [AgoraRTC.createCustomAudioTrack]{@link IAgoraRTC.createCustomAudioTrack}.
1283
- *
1284
- * The following interfaces are inherited from `LocalAudioTrack`:
1285
- * - [MicrophoneAudioTrack]{@link IMicrophoneAudioTrack}, the interface for the audio sampled by a local microphone, which adds several microphone-related functions.
1286
- * - [BufferSourceAudioTrack]{@link IBufferSourceAudioTrack}, the interface for the audio from a local audio file, which adds several audio-file-related functions.
1287
- */
1288
- export declare interface ILocalAudioTrack extends ILocalTrack {
502
+ getStats(): RemoteAudioTrackStats;
1289
503
  /**
1290
- * Sets the volume of a local audio track.
504
+ * Plays a remote audio track.
1291
505
  *
1292
- * @param volume The volume. The value ranges from 0 (mute) to 1000 (maximum). A value of 100 is the original volume。 The volume change may not be obvious to human ear. If local track has been published, setting volume will affect the volume heard by remote users.
506
+ * > When playing the audio track, you do not need to pass any DOM element.
1293
507
  */
1294
- setVolume(volume: number): void;
508
+ play(): void;
1295
509
  /**
1296
- * Gets the audio level of a local audio track.
510
+ * @since
511
+ * <br>&emsp;&emsp;&emsp;*4.1.0*
1297
512
  *
1298
- * @returns The audio level. The value range is [0,1]. 1 is the highest audio level.
1299
- * Usually a user with audio level above 0.6 is a speaking user.
513
+ * Sets the audio playback device, for example, the speaker.
1300
514
  *
515
+ * > This method supports Chrome and Edge on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
516
+ * @param deviceId Device ID, which can be retrieved by calling [[getPlaybackDevices]].
1301
517
  */
1302
- getVolumeLevel(): number;
518
+ setPlaybackDevice(deviceId: string): Promise<void>;
1303
519
  /**
1304
520
  * Sets the callback for getting raw audio data in PCM format.
1305
521
  *
1306
- * After you successfully set the callback, the SDK constantly returns the audio frames of a local audio track in this callback by using [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer).
522
+ * After you successfully set the callback, the SDK constantly returns the audio frames of a remote audio track in this callback by using [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer).
1307
523
  *
1308
524
  * > You can set the `frameSize` parameter to determine the frame size in each callback, which affects the interval between the callbacks. The larger the frame size, the longer the interval between them.
1309
525
  *
@@ -1326,31 +542,23 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
1326
542
  */
1327
543
  setAudioFrameCallback(audioFrameCallback: null | ((buffer: AudioBuffer) => void), frameSize?: number): void;
1328
544
  /**
1329
- * Plays a local audio track.
545
+ * Sets the volume of a remote audio track.
1330
546
  *
1331
- * > When playing a audio track, you do not need to pass any DOM element.
547
+ * @param volume The volume. The value ranges from 0 (mute) to 100 (maximum). A value of 100 is the current volume.
1332
548
  */
1333
- play(): void;
549
+ setVolume(volume: number): void;
1334
550
  /**
1335
- * @since
1336
- * <br>&emsp;&emsp;&emsp;*4.1.0*
1337
- *
1338
- * > Note:
1339
- * > - As of v4.7.0, this method no longer takes effect. Use [IRemoteAudioTrack.setPlaybackDevice]{@link IRemoteAudioTrack.setPlaybackDevice} instead.
1340
- *
1341
- * Sets the playback device (speaker) for the remote audio stream.
551
+ * Gets the audio level of a remote audio track.
1342
552
  *
1343
- * @param deviceId The device ID, which can be retrieved by calling [[getPlaybackDevices]].
553
+ * @returns The audio level. The value range is [0,1]. 1 is the highest audio level.
554
+ * Usually a user with audio level above 0.6 is a speaking user.
1344
555
  */
1345
- setPlaybackDevice(deviceId: string): Promise<void>;
556
+ getVolumeLevel(): number;
1346
557
  /**
1347
- * Gets the statistics of a local audio track.
558
+ * @since
559
+ * <br>&emsp;&emsp;&emsp;*4.13.0*
1348
560
  *
1349
- * @deprecated from v4.1.0. Use [AgoraRTCClient.getLocalVideoStats]{@link IAgoraRTCClient.getLocalVideoStats} and [AgoraRTCClient.getLocalAudioStats]{@link IAgoraRTCClient.getLocalAudioStats} instead.
1350
- */
1351
- getStats(): LocalAudioTrackStats;
1352
- /**
1353
- * Inserts a `Processor` to the local audio track.
561
+ * Inserts a `Processor` to the remote audio track.
1354
562
  *
1355
563
  * @param processor The `Processor` instance. Each extension has a corresponding type of `Processor`.
1356
564
  *
@@ -1359,991 +567,199 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
1359
567
  pipe(processor: IAudioProcessor): IAudioProcessor;
1360
568
  /**
1361
569
  * @since
1362
- * <br>&emsp;&emsp;&emsp;*4.10.0*
570
+ * <br>&emsp;&emsp;&emsp;*4.13.0*
1363
571
  *
1364
- * Removes the `Processor` inserted to the local audio track.
572
+ * Removes the `Processor` inserted to the remote audio track.
1365
573
  */
1366
574
  unpipe(): void;
1367
575
  /**
1368
576
  * @since
1369
- * <br>&emsp;&emsp;&emsp;*4.10.0*
577
+ * <br>&emsp;&emsp;&emsp;*4.13.0*
1370
578
  *
1371
- * The destination of the current processing pipeline on the local audio track.
579
+ * The destination of the current processing pipeline on the remote audio track.
1372
580
  */
1373
581
  processorDestination: IAudioProcessor;
1374
582
  }
1375
583
 
1376
584
  /**
1377
- * @ignore
1378
- */
1379
- export declare interface ILocalDataChannel extends IDataChannel {
1380
- send(data: ArrayBuffer): void;
1381
- /** @internal */
1382
- on(event: "open", listener: typeof event_user_datachannel_open): void;
1383
- /** @internal */
1384
- on(event: "close", listener: typeof event_user_datachannel_close): void;
1385
- /** @internal */
1386
- on(event: "error", listener: typeof event_user_datachannel_error): void;
1387
- }
1388
-
1389
- /**
1390
- * `LocalTrack` is the basic interface for local tracks, providing public methods for [LocalAudioTrack]{@link ILocalAudioTrack} and [LocalVideoTrack]{@link ILocalVideoTrack}.
585
+ * `RemoteTrack` is the basic interface for remote tracks, providing public methods for [RemoteAudioTrack]{@link IRemoteAudioTrack} and [RemoteVideoTrack]{@link IRemoteVideoTrack}.
1391
586
  */
1392
- export declare interface ILocalTrack extends ITrack {
587
+ export declare interface IRemoteTrack extends ITrack {
1393
588
  /**
1394
589
  * @param event The event name.
1395
- * @param listener See [track-ended]{@link event_track_ended}.
590
+ * @param listener See [first-frame-decoded]{@link event_first_frame_decoded}.
1396
591
  */
1397
- on(event: "track-ended", listener: typeof event_track_ended): void;
592
+ on(event: "first-frame-decoded", listener: typeof event_first_frame_decoded): void;
1398
593
  /**
1399
594
  * Adds an event listener.
1400
595
  * @param event The event name.
1401
- * @param listener See [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}.
596
+ * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
1402
597
  */
1403
598
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
1404
599
  /**
1405
- * @since
1406
- * <br>&emsp;&emsp;&emsp;*4.0.0*
1407
- *
1408
- * Enables/Disables the track.
1409
- *
1410
- * After a track is disabled, the SDK stops playing and publishing the track.
1411
- *
1412
- * > - Disabling a track does not trigger the [LocalTrack.on("track-ended")]{@link event_track_ended} event.
1413
- * > - If a track is published, disabling this track triggers the [user-unpublished]{@link IAgoraRTCClient.event_user_unpublished} event on the remote client, and re-enabling this track triggers the [user-published]{@link IAgoraRTCClient.event_user_published} event.
1414
- * > - Do not call `setEnabled` and `setMuted` together.
1415
- *
1416
- * @param enabled Whether to enable the track:
1417
- * - `true`: Enable the track.
1418
- * - `false`: Disable the track.
1419
- */
1420
- setEnabled(enabled: boolean): Promise<void>;
1421
- /**
1422
- * @deprecated from v4.1.0. Use [AgoraRTCClient.getLocalVideoStats]{@link IAgoraRTCClient.getLocalVideoStats} and [AgoraRTCClient.getLocalAudioStats]{@link IAgoraRTCClient.getLocalAudioStats} instead.
1423
- *
1424
- * Gets the statistics of a local track.
1425
- *
1426
- * > Note: When getting the statistics of a local video track, you cannot get the `encodeDelay` property on iOS.
1427
- */
1428
- getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
1429
- /**
1430
- * Gets the label of a local track.
1431
- *
1432
- * @return The label that the SDK returns may include:
1433
- * - The [MediaDeviceInfo.label](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo/label) property, if the track is created by calling `createMicrophoneAudioTrack` or `createCameraVideoTrack`.
1434
- * - The `sourceId` property, if the track is created by calling `createScreenVideoTrack`.
1435
- * - The [MediaStreamTrack.label](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/label) property, if the track is created by calling `createCustomAudioTrack` or `createCustomVideoTrack`.
1436
- */
1437
- getTrackLabel(): string;
1438
- /**
1439
- * Sends or stops sending the media data of the track.
1440
- *
1441
- * @since
1442
- * <br>&emsp;&emsp;&emsp;*4.6.0*
1443
- *
1444
- * If the track is published, a successful call of `setMuted(true)` triggers the [user-unpublished]{@link IAgoraRTCClient.event_user_unpublished} event on the remote client, and a successful call of `setMuted(false)` triggers the [user-published]{@link IAgoraRTCClient.event_user_published} event.
1445
- *
1446
- * > - Calling `setMuted(true)` does not stop capturing audio or video and takes shorter time to take effect than [[setEnabled]]. For details, see [What are the differences between setEnabled and setMuted?](https://docs.agora.io/en/interactive-live-streaming/develop/product-workflow?platform=web#setenabled-and-setmuted).
1447
- * > - Do not call `setEnabled` and `setMuted` together.
600
+ * Gets the `uid` of the remote user who publishes the remote track.
1448
601
  *
1449
- * @param muted Whether to stop sending the media data of the track:
1450
- * - `true`: Stop sending the media data of the track.
1451
- * - `false`: Resume sending the media data of the track.
602
+ * @return The `uid` of the remote user.
1452
603
  */
1453
- setMuted(muted: boolean): Promise<void>;
604
+ getUserId(): UID;
1454
605
  /**
1455
- * Closes a local track and releases the audio and video resources that it occupies.
606
+ * Gets the statistics of a remote track.
1456
607
  *
1457
- * Once you close a local track, you can no longer reuse it.
608
+ * @deprecated from v4.1.0. Use [AgoraRTCClient.getRemoteVideoStats]{@link IAgoraRTCClient.getRemoteVideoStats} and [AgoraRTCClient.getRemoteAudioStats]{@link IAgoraRTCClient.getRemoteAudioStats} instead.
609
+ * @return An [[RemoteAudioTrackStats]] or [[RemoteVideoTrackStats]] object.
1458
610
  */
1459
- close(): void;
1460
- muted: boolean;
1461
- enabled: boolean;
611
+ getStats(): RemoteAudioTrackStats | RemoteVideoTrackStats;
1462
612
  }
1463
613
 
1464
614
  /**
1465
- * `LocalVideoTrack` is the basic interface for local video tracks, providing the main methods for local video tracks.
1466
- *
1467
- * You can get create a local video track by calling [AgoraRTC.createCustomVideoTrack]{@link IAgoraRTC.createCustomVideoTrack} or [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack} method.
615
+ * `RemoteVideoTrack` is the basic interface for the remote video track.
1468
616
  *
1469
- * Inherited from `LocalVideoTrack`, [CameraVideoTrack]{@link ICameraVideoTrack} is an interface for the video captured by a local camera and adds several camera-related functions.
617
+ * You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
1470
618
  */
1471
- export declare interface ILocalVideoTrack extends ILocalTrack {
1472
- /** @internal */
1473
- on(event: "beauty-effect-overload", listener: typeof event_beauty_effect_overload): void;
619
+ export declare interface IRemoteVideoTrack extends IRemoteTrack {
620
+ /**
621
+ * @param event The event name.
622
+ * @param listener See [video-state-changed]{@link event_video_state_changed}.
623
+ */
624
+ on(event: "video-state-changed", listener: typeof event_video_state_changed): void;
1474
625
  /**
1475
626
  * @param event The event name.
1476
- * @param listener See [track-ended]{@link event_track_ended}.
627
+ * @param listener See [first-frame-decoded]{@link event_first_frame_decoded}.
1477
628
  */
1478
- on(event: "track-ended", listener: typeof event_track_ended): void;
629
+ on(event: "first-frame-decoded", listener: typeof event_first_frame_decoded): void;
1479
630
  /**
1480
631
  * @param event The event name.
1481
- * @param listener See [video-element-visible-status]{@link event_video_element_visible_status}.
632
+ * @param listener See [video-element-visible-status]{@link event_video_element_visible_status_2}.
1482
633
  */
1483
634
  on(event: "video-element-visible-status", listener: typeof event_video_element_visible_status): void;
1484
635
  /**
1485
636
  * Adds an event listener.
1486
637
  * @param event The event name.
1487
- * @param listener See [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}.
638
+ * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
1488
639
  */
1489
640
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
1490
- /**
1491
- * Plays a remote video track on the web page.
1492
- *
1493
- * @param element Specifies a DOM element. The SDK will create a `<video>` element under the specified DOM element to play the video track. You can specify a DOM element in either of the following ways:
1494
- * - `string`: Specify the ID of the DOM element.
1495
- * - `HTMLElement`: Pass a DOM object.
1496
- * @param config Sets the playback configurations, such as display mode and mirror mode. See [[VideoPlayerConfig]]. By default, the SDK enables mirror mode for a local video track.
1497
- */
1498
- play(element: string | HTMLElement, config?: VideoPlayerConfig): void;
1499
- /**
1500
- * Gets the statistics of a local video track.
1501
- *
1502
- * @deprecated from v4.1.0. Use [AgoraRTCClient.getLocalVideoStats]{@link IAgoraRTCClient.getLocalVideoStats} and [AgoraRTCClient.getLocalAudioStats]{@link IAgoraRTCClient.getLocalAudioStats} instead.
1503
- */
1504
- getStats(): LocalVideoTrackStats;
1505
- /**
1506
- * @since
1507
- * <br>&emsp;&emsp;&emsp;*4.19.0*
1508
- *
1509
- * Clones the current video track to create a new video track.
1510
- *
1511
- * In scenarios such as video conferencing and online education, you can use this method to display the same video stream with two sets of display parameters, including resolution, frame rate, and bitrate. For example, you can have one display set to high-definition and the other to low-definition.
1512
- *
1513
- * @param config The encoding configuration for the new video track. You can pass in the SDK's built-in encoding configuration through [[VideoEncoderConfiguration]], or customize the video encoding configuration by passing in a [[VideoEncoderConfigurationPreset]].
1514
- * @param cloneTrack Whether to clone the current track. Default is `true`.
1515
- * @returns The newly generated video track.
1516
- */
1517
- clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): ILocalVideoTrack;
1518
- /**
1519
- * @ignore
1520
- *
1521
- * Enables/Disables image enhancement and sets the options.
1522
- *
1523
- * > Notes:
1524
- * > - Agora is planning to sunset this built-in image enhancement feature.
1525
- * You can use the upgraded Image Enhancement Extension instead. For details, see
1526
- * [Use the Image Enhancement Extension](https://docs.agora.io/en/Video/beauty_effect_web_ng?platform=Web).
1527
- * > - This method supports the following browsers:
1528
- * > - Safari 12 or later.
1529
- * > - Chrome 65 or later.
1530
- * > - Firefox 70.0.1 or later.
1531
- * > - This function is not supported on mobile devices.
1532
- * > - If you enable dual-stream mode, the image enhancement options only apply to the high-quality video stream.
1533
- *
1534
- * @param enabled Whether to enable image enhancement:
1535
- * - `true`: Enable image enhancement.
1536
- * - `false`: Disable image enhancement.
1537
- * @param options Sets image enhancement options. See [[BeautyEffectOptions]].
1538
- */
1539
- setBeautyEffect(enabled: boolean, options?: BeautyEffectOptions): Promise<void>;
1540
- /**
1541
- * @since
1542
- * <br>&emsp;&emsp;&emsp;*4.1.0*
1543
- *
1544
- * Gets the data of the video frame being rendered.
1545
- *
1546
- * > You should call this method after calling [[play]]. Otherwise, the method call returns null.
1547
- *
1548
- * @returns An `ImageData` object that stores RGBA data. `ImageData` is a web API supported by the browser. For details, see [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData).
1549
- */
1550
- getCurrentFrameData(): ImageData;
1551
- /**
1552
- *
1553
- * @ignore
1554
- */
1555
- getCurrentFrameImage(imageType: string, quality: number): Promise<ImageTypedData>;
1556
- /**
1557
- * @since
1558
- * <br>&emsp;&emsp;&emsp;*4.2.0*
1559
- *
1560
- * Sets the video transmission optimization mode.
1561
- *
1562
- * You can call this method during a video call, a live streaming or screen sharing to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from text to video, you can change the optimization mode from `"detail"` to `"motion"` to ensure smoothness in poor network conditions.
1563
- *
1564
- * > Note: This method supports Chrome only.
1565
- *
1566
- * @param mode The video transmission optimization mode:
1567
- * - `"balanced"`: Uses the default optimization mode.
1568
- * - For a screen-sharing video track, the default transmission optimization strategy is to prioritizes clarity.
1569
- * - For the other types of video tracks, the SDK may reduce the frame rate or the sending resolution in poor network conditions.
1570
- * - `"detail"`: Prioritizes video quality.
1571
- * - The SDK 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.
1572
- * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
1573
- * - `"motion"`: Prioritizes video smoothness.
1574
- * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
1575
- * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
1576
- */
1577
- setOptimizationMode(mode: "balanced" | "motion" | "detail"): Promise<void>;
1578
- /**
1579
- * @since
1580
- * <br>&emsp;&emsp;&emsp;*4.8.0*
1581
- *
1582
- * Gets the visibility of the `<video>` HTML tag.
1583
- *
1584
- * After you call `localVideoTrack.play`, the SDK creates an [`<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) tag for playing video tracks. When `localVideoTrack.isPlaying` is `true` but you cannot see any video, call this method to check whether the `<video>` tag is visible or not and learn the reason when the `<video>` tag is invisible.
1585
- *
1586
- * @returns The [[CheckVideoVisibleResult]] object. If this method returns `undefined`, it may be due to the following reasons:
1587
- * - `localVideoTrack.isPlaying` is `false`.
1588
- * - The `<video>` tag does not exist.
1589
- * - The `<video>` tag is not created by calling the `play` method.
1590
- */
1591
- getVideoElementVisibleStatus(): CheckVideoVisibleResult | undefined;
1592
- /**
1593
- * Inserts a `Processor` to the local video track.
1594
- *
1595
- * @param processor The `Processor` instance. Each extension has a corresponding type of `Processor`.
1596
- *
1597
- * @returns The `Processor` instance.
1598
- */
1599
- pipe(processor: IBaseProcessor): IBaseProcessor;
1600
- /**
1601
- * @since
1602
- * <br>&emsp;&emsp;&emsp;*4.10.0*
1603
- *
1604
- * Removes the `Processor` inserted to the local video track.
1605
- */
1606
- unpipe(): void;
1607
- /**
1608
- * @since
1609
- * <br>&emsp;&emsp;&emsp;*4.10.0*
1610
- *
1611
- * The destination of the current processing pipeline on the local video track.
1612
- */
1613
- processorDestination: IBaseProcessor;
1614
- /**
1615
- * @since
1616
- * <br>&emsp;&emsp;&emsp;*4.17.0*
1617
- *
1618
- * Replaces the local video track.
1619
- *
1620
- * You can call this method before or after publishing the local video stream:
1621
- * - If you call this method before publishing, the new video track is played locally.
1622
- * - If you call this method after publishing, the new video track is received by the remote user.
1623
- *
1624
- * The new video track can be retrieved by the {@link ILocalVideoTrack.getMediaStreamTrack} or `mediaStream.getVideoTracks` method. You can choose to either stop or retain the replaced track.
1625
- *
1626
- * > Notes:
1627
- * > - This method supports Chrome 65+, Safari, and the latest Firefox.
1628
- * > - This method might not take effect on some mobile devices.
1629
- * > - Agora recommends switching between video tracks that are of the same type and have the same encoder configurations for the following reasons:
1630
- * > - If the video track types are different, such as replacing a `CameraVideoTrack` object with a `ScreenVideoTrack` object, the video is flipped horizontally due to the mirror effect enabled by default on `CameraVideoTrack` (see {@link VideoPlayerConfig.mirror} for details).
1631
- * > - If the encoder configurations (`encoderConfig`) are different, the actual sending resolution or frame rate might be different from what you set.
1632
- * > - The subscriber will not be notified if the track gets replaced.
1633
- * > - To switch the media input devices, Agora recommends using {@link ICameraVideoTrack.setDevice}.
1634
- *
1635
- * **Example**
1636
- * ```javascript
1637
- * // Current video track
1638
- * const localVideoTrack = await AgoraRTC.createCameraVideoTrack();
1639
- * // Gets the new video track (option one)
1640
- * const newTrack = localVideoTrack.getMediaStreamTrack();
1641
- * // Gets the new video track (option two)
1642
- * const newTrack = await navigator.mediaDevices.getUserMedia({audio: true, video: true}).then(mediaStream => mediaStream.getVideoTracks()[0]);
1643
- * // Replaces and stops the current video track
1644
- * await localVideoTrack.replaceTrack(newTrack, true);
1645
- * ```
1646
- * @param track The new video track, which is a [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
1647
- * @param stopOldTrack Whether to stop the old video track:
1648
- * - true: Stops the old video track.
1649
- * - false: Retains the old video track.
1650
- */
1651
- replaceTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
1652
- /**
1653
- * Sets the video encoder configurations, such as resolution, frame rate, and bitrate.
1654
- *
1655
- * @param config The video encoder configurations. You can pass either [[VideoEncoderConfigurationPreset]] or a customized [[VideoEncoderConfiguration]] object.
1656
- */
1657
- setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset): Promise<void>;
1658
- /**
1659
- * Add the SEI data to the H.264 video stream.
1660
- *
1661
- * @param config SEI data.
1662
- */
1663
- sendSeiData(sei: Uint8Array): void;
1664
- }
1665
-
1666
- export declare interface ImageTypedData {
1667
- buffer: Uint8Array;
1668
- width: number;
1669
- height: number;
1670
- }
1671
-
1672
- /**
1673
- * Inherited from [LocalAudioTrack]{@link ILocalAudioTrack}, `MicrophoneAudioTrack` is an interface for the audio sampled by a local microphone and adds several functions such as switching devices.
1674
- *
1675
- * You can create a local microphone audio track by calling [AgoraRTC.createMicrophoneAudioTrack]{@link IAgoraRTC.createMicrophoneAudioTrack}.
1676
- */
1677
- export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
1678
- /**
1679
- * Sets the device for sampling audio.
1680
- *
1681
- * > You can call the method either before or after publishing an audio track.
1682
- *
1683
- * @param deviceId The ID of the specified device. You can get the `deviceId` by calling [AgoraRTC.getMicrophones]{@link IAgoraRTC.getMicrophones}.
1684
- */
1685
- setDevice(deviceId: string): Promise<void>;
1686
- /**
1687
- * @since
1688
- * <br>&emsp;&emsp;&emsp;*4.0.0*
1689
- *
1690
- * Enables/Disables the track.
1691
- *
1692
- * After a track is disabled, the SDK stops playing and publishing the track.
1693
- *
1694
- * > - Disabling a track does not trigger the [LocalTrack.on("track-ended")]{@link event_track_ended} event.
1695
- * > - If a track is published, disabling this track triggers the [user-unpublished]{@link IAgoraRTCClient.event_user_unpublished} event on the remote client, and re-enabling this track triggers the [user-published]{@link IAgoraRTCClient.event_user_published} event.
1696
- * > - Do not call `setEnabled` and `setMuted` together.
1697
- *
1698
- * @param enabled Whether to enable the track:
1699
- * - `true`: Enable the track.
1700
- * - `false`: Disable the track.
1701
- */
1702
- setEnabled(enabled: boolean): Promise<void>;
1703
- }
1704
-
1705
- export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
1706
-
1707
- export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
1708
-
1709
- export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
1710
-
1711
- export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
1712
-
1713
- declare interface InterceptVideoFrameOptions {
1714
- onSei?: (sei: Uint8Array) => void;
1715
- }
1716
-
1717
- /**
1718
- * `RemoteAudioTrack` is the basic interface for the remote audio track.
1719
- *
1720
- * You can get create a remote audio track by the [AgoraRTCRemoteUser.audioTrack]{@link IAgoraRTCRemoteUser.audioTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
1721
- */
1722
- export declare interface IRemoteAudioTrack extends IRemoteTrack {
1723
- /**
1724
- * Gets the statistics of a remote audio track.
1725
- *
1726
- * @return An [[RemoteAudioTrackStats]] object.
1727
- */
1728
- getStats(): RemoteAudioTrackStats;
1729
- /**
1730
- * Plays a remote audio track.
1731
- *
1732
- * > When playing the audio track, you do not need to pass any DOM element.
1733
- */
1734
- play(): void;
1735
- /**
1736
- * @since
1737
- * <br>&emsp;&emsp;&emsp;*4.1.0*
1738
- *
1739
- * Sets the audio playback device, for example, the speaker.
1740
- *
1741
- * > This method supports Chrome and Edge on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
1742
- * @param deviceId Device ID, which can be retrieved by calling [[getPlaybackDevices]].
1743
- */
1744
- setPlaybackDevice(deviceId: string): Promise<void>;
1745
- /**
1746
- * Sets the callback for getting raw audio data in PCM format.
1747
- *
1748
- * After you successfully set the callback, the SDK constantly returns the audio frames of a remote audio track in this callback by using [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer).
1749
- *
1750
- * > You can set the `frameSize` parameter to determine the frame size in each callback, which affects the interval between the callbacks. The larger the frame size, the longer the interval between them.
1751
- *
1752
- * ```js
1753
- * track.setAudioFrameCallback((buffer) => {
1754
- * for (let channel = 0; channel < buffer.numberOfChannels; channel += 1) {
1755
- * // Float32Array with PCM data
1756
- * const currentChannelData = buffer.getChannelData(channel);
1757
- * console.log("PCM data in channel", channel, currentChannelData);
1758
- * }
1759
- * }, 2048);
1760
- *
1761
- * // ....
1762
- * // Stop getting the raw audio data
1763
- * track.setAudioFrameCallback(null);
1764
- * ```
1765
- *
1766
- * @param audioFrameCallback The callback function for receiving the [AudioBuffer](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer) object. If you set `audioBufferCallback` as `null`, the SDK stops getting raw audio data.
1767
- * @param frameSize The number of samples of each audio channel that an `AudioBuffer` object contains. You can set `frameSize` as 256, 512, 1024, 2048, 4096, 8192, or 16384. The default value is 4096.
1768
- */
1769
- setAudioFrameCallback(audioFrameCallback: null | ((buffer: AudioBuffer) => void), frameSize?: number): void;
1770
- /**
1771
- * Sets the volume of a remote audio track.
1772
- *
1773
- * @param volume The volume. The value ranges from 0 (mute) to 100 (maximum). A value of 100 is the current volume.
1774
- */
1775
- setVolume(volume: number): void;
1776
- /**
1777
- * Gets the audio level of a remote audio track.
1778
- *
1779
- * @returns The audio level. The value range is [0,1]. 1 is the highest audio level.
1780
- * Usually a user with audio level above 0.6 is a speaking user.
1781
- */
1782
- getVolumeLevel(): number;
1783
- /**
1784
- * @since
1785
- * <br>&emsp;&emsp;&emsp;*4.13.0*
1786
- *
1787
- * Inserts a `Processor` to the remote audio track.
1788
- *
1789
- * @param processor The `Processor` instance. Each extension has a corresponding type of `Processor`.
1790
- *
1791
- * @returns The `Processor` instance.
1792
- */
1793
- pipe(processor: IAudioProcessor): IAudioProcessor;
1794
- /**
1795
- * @since
1796
- * <br>&emsp;&emsp;&emsp;*4.13.0*
1797
- *
1798
- * Removes the `Processor` inserted to the remote audio track.
1799
- */
1800
- unpipe(): void;
1801
- /**
1802
- * @since
1803
- * <br>&emsp;&emsp;&emsp;*4.13.0*
1804
- *
1805
- * The destination of the current processing pipeline on the remote audio track.
1806
- */
1807
- processorDestination: IAudioProcessor;
1808
- }
1809
-
1810
- /**
1811
- * @ignore
1812
- */
1813
- export declare interface IRemoteDataChannel extends IDataChannel {
1814
- /** @internal */
1815
- on(event: "open", listener: typeof event_user_datachannel_open): void;
1816
- /** @internal */
1817
- on(event: "close", listener: typeof event_user_datachannel_close): void;
1818
- /** @internal */
1819
- on(event: "error", listener: typeof event_user_datachannel_error): void;
1820
- /** @internal */
1821
- on(event: "message", listener: typeof event_user_datachannel_message): void;
1822
- }
1823
-
1824
- /**
1825
- * `RemoteTrack` is the basic interface for remote tracks, providing public methods for [RemoteAudioTrack]{@link IRemoteAudioTrack} and [RemoteVideoTrack]{@link IRemoteVideoTrack}.
1826
- */
1827
- export declare interface IRemoteTrack extends ITrack {
1828
- /**
1829
- * @param event The event name.
1830
- * @param listener See [first-frame-decoded]{@link event_first_frame_decoded}.
1831
- */
1832
- on(event: "first-frame-decoded", listener: typeof event_first_frame_decoded): void;
1833
- /**
1834
- * Adds an event listener.
1835
- * @param event The event name.
1836
- * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
1837
- */
1838
- on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
1839
- /**
1840
- * Gets the `uid` of the remote user who publishes the remote track.
1841
- *
1842
- * @return The `uid` of the remote user.
1843
- */
1844
- getUserId(): UID;
1845
- /**
1846
- * Gets the statistics of a remote track.
1847
- *
1848
- * @deprecated from v4.1.0. Use [AgoraRTCClient.getRemoteVideoStats]{@link IAgoraRTCClient.getRemoteVideoStats} and [AgoraRTCClient.getRemoteAudioStats]{@link IAgoraRTCClient.getRemoteAudioStats} instead.
1849
- * @return An [[RemoteAudioTrackStats]] or [[RemoteVideoTrackStats]] object.
1850
- */
1851
- getStats(): RemoteAudioTrackStats | RemoteVideoTrackStats;
1852
- }
1853
-
1854
- /**
1855
- * `RemoteVideoTrack` is the basic interface for the remote video track.
1856
- *
1857
- * You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
1858
- */
1859
- export declare interface IRemoteVideoTrack extends IRemoteTrack {
1860
- /**
1861
- * @param event The event name.
1862
- * @param listener See [video-state-changed]{@link event_video_state_changed}.
1863
- */
1864
- on(event: "video-state-changed", listener: typeof event_video_state_changed): void;
1865
- /**
1866
- * @param event The event name.
1867
- * @param listener See [first-frame-decoded]{@link event_first_frame_decoded}.
1868
- */
1869
- on(event: "first-frame-decoded", listener: typeof event_first_frame_decoded): void;
1870
- /**
1871
- * @param event The event name.
1872
- * @param listener See [video-element-visible-status]{@link event_video_element_visible_status_2}.
1873
- */
1874
- on(event: "video-element-visible-status", listener: typeof event_video_element_visible_status_2): void;
1875
- /**
1876
- * Adds an event listener.
1877
- * @param event The event name.
1878
- * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
1879
- */
1880
- on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
1881
641
  /**
1882
642
  * Adds an event listener.
1883
- * @param event The event name.
1884
- * @param listener See [ILocalTrack.sei-received]{@link event_sei_received}.
1885
- */
1886
- on(event: "sei-received", listener: typeof event_sei_received): void;
1887
- /**
1888
- * Gets the statistics of a remote video track.
1889
- *
1890
- * @return An [[RemoteVideoTrackStats]] object。
1891
- */
1892
- getStats(): RemoteVideoTrackStats;
1893
- /**
1894
- * Plays a remote video track on the web page.
1895
- *
1896
- * @param element Specifies a DOM element. The SDK will create a `<video>` element under the specified DOM element to play the video track. You can specify a DOM element in either of following ways:
1897
- * - `string`: Specify the ID of the DOM element.
1898
- * - `HTMLElement`: Pass a DOM object.
1899
- * @param config Sets the playback configurations, such as display mode and mirror mode. See [[VideoPlayerConfig]]. By default, the SDK enables mirror mode for a local video track.
1900
- */
1901
- play(element: string | HTMLElement, config?: VideoPlayerConfig): void;
1902
- /**
1903
- * @since
1904
- * <br>&emsp;&emsp;&emsp;*4.1.0*
1905
- *
1906
- * Gets the data of the video frame being rendered.
1907
- *
1908
- * > You should call this method after calling [[play]]. Otherwise, the method call returns null.
1909
- *
1910
- * @returns An `ImageData` object that stores RGBA data. `ImageData` is a web API supported by the browser. For details, see [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData).
1911
- */
1912
- getCurrentFrameData(): ImageData;
1913
- /**
1914
- * @since
1915
- * <br>&emsp;&emsp;&emsp;*4.8.0*
1916
- *
1917
- * Gets the visibility of the `<video>` HTML tag.
1918
- *
1919
- * After you call `remoteVideoTrack.play`, the SDK creates an [`<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) tag for playing video tracks. When `remoteVideoTrack.isPlaying` is `true` but you cannot see any video, call this method to check whether the `<video>` tag is visible or not and learn the reason when the `<video>` tag is invisible.
1920
- *
1921
- * @returns The [[CheckVideoVisibleResult]] object. If this method returns `undefined`, it may be due to the following reasons:
1922
- * - `localRemoteTrack.isPlaying` is `false`.
1923
- * - The `<video>` tag does not exist.
1924
- * - The `<video>` tag is not created by calling the `play` method.
1925
- */
1926
- getVideoElementVisibleStatus(): CheckVideoVisibleResult | undefined;
1927
- /**
1928
- * @since
1929
- * <br>&emsp;&emsp;&emsp;*4.13.0*
1930
- *
1931
- * Inserts a `Processor` to the remote video track.
1932
- *
1933
- * @param processor The `Processor` instance. Each extension has a corresponding type of `Processor`.
1934
- *
1935
- * @returns The `Processor` instance.
1936
- */
1937
- pipe(processor: IBaseProcessor): IBaseProcessor;
1938
- /**
1939
- * @since
1940
- * <br>&emsp;&emsp;&emsp;*4.13.0*
1941
- *
1942
- * Removes the `Processor` inserted to the remote video track.
1943
- */
1944
- unpipe(): void;
1945
- /**
1946
- * @since
1947
- * <br>&emsp;&emsp;&emsp;*4.13.0*
1948
- *
1949
- * The destination of the current processing pipeline on the remote video track.
1950
- */
1951
- processorDestination: IBaseProcessor;
1952
- }
1953
-
1954
- export declare function isAudioEncoderConfiguration(config: AudioEncoderConfiguration): config is AudioEncoderConfiguration;
1955
-
1956
- export declare function isAudioEncoderConfigurationOrPreset(profile: any): profile is AudioEncoderConfigurationPreset | AudioEncoderConfiguration;
1957
-
1958
- export declare function isBeautyEffectOptions(options: BeautyEffectOptions): options is BeautyEffectOptions;
1959
-
1960
- export { isElectron }
1961
-
1962
- export declare function isLowStreamParameter(streamParameter: any): streamParameter is LowStreamParameter;
1963
-
1964
- export declare function isScreenSourceType(mediaSource: any): mediaSource is ScreenSourceType;
1965
-
1966
- export declare function isVideoEncoderConfiguration(config: VideoEncoderConfiguration): config is VideoEncoderConfiguration;
1967
-
1968
- export declare function isVideoEncoderConfigurationOrPreset(profile: any): profile is VideoEncoderConfigurationPreset | VideoEncoderConfiguration;
1969
-
1970
- export declare interface ITrack extends EventEmitter {
1971
- /**
1972
- * The type of a media track:
1973
- * - `"audio"`: Audio track.
1974
- * - `"video"`: Video track.
1975
- */
1976
- trackMediaType: "audio" | "video";
1977
- /**
1978
- * Whether a media track is playing on the webpage:
1979
- * - `true`: The media track is playing on the webpage.
1980
- * - `false`: The media track is not playing on the webpage.
1981
- */
1982
- isPlaying: boolean;
1983
- /**
1984
- * Gets the ID of a media track, a unique identifier generated by the SDK.
1985
- *
1986
- * @return The media track ID.
1987
- */
1988
- getTrackId(): string;
1989
- /**
1990
- * Gets an [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
1991
- *
1992
- * @return An [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
1993
- */
1994
- getMediaStreamTrack(): MediaStreamTrack;
1995
- /**
1996
- * Gets the [RTCRtpTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver) instance of the current track.
1997
- *
1998
- * This method is currently mainly used for end-to-end encryption of video streams (Beta).
1999
- *
2000
- * > If the SDK experiences a reconnection, the `RTCRtpTransceiver` instance corresponding to the current track might change. You can obtain the new `RTCRtpTransceiver` instance through the following callbacks:
2001
- * > - For a local track: [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}
2002
- * > - For a remote track: [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}
2003
- *
2004
- * @param type The type of the video stream. See {@link StreamType}.
2005
- * @returns The [RTCRtpTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver) instance of the current track.
2006
- */
2007
- getRTCRtpTransceiver(type?: StreamType): RTCRtpTransceiver | undefined;
2008
- /**
2009
- * Plays a media track on the webpage.
2010
- *
2011
- * @param element Specifies a DOM element. The SDK will create a `<video>` element under the specified DOM element to play the video track. You can specify a DOM element in either of following ways:
2012
- * - `string`: Specify the ID of the DOM element.
2013
- * - `HTMLElement`: Pass a DOM object.
2014
- */
2015
- play(element?: string | HTMLElement): void;
2016
- /**
2017
- * Stops playing the media track.
2018
- */
2019
- stop(): void;
2020
- }
2021
-
2022
- export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTrack {
2023
- readonly trackMediaType: "audio" | "video";
2024
- _encoderConfig?: AudioEncoderConfiguration;
2025
- _trackSource: AudioTrackSource | FakeTrackSource;
2026
- get _source(): AudioTrackSource;
2027
- set _source(source: AudioTrackSource | FakeTrackSource);
2028
- _enabled: boolean;
2029
- private _volume;
2030
- _useAudioElement: boolean;
2031
- _bypassWebAudio: boolean;
2032
- protected processor?: IAudioProcessor;
2033
- protected _processorContext: AudioProcessorContext | undefined;
2034
- protected get processorContext(): AudioProcessorContext;
2035
- _processorDestination: AudioProcessorDestination | undefined;
2036
- get processorDestination(): AudioProcessorDestination;
2037
- protected _getOriginVolumeLevel: boolean;
2038
- get isPlaying(): boolean;
2039
- get __className__(): string;
2040
- constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean);
2041
- setVolume(volume: number): void;
2042
- getVolumeLevel(): number;
2043
- setPlaybackDevice(deviceId: string): Promise<void>;
2044
- setEnabled(enabled: boolean, _?: any, skipChangeState?: boolean): Promise<void>;
2045
- protected _setEnabled(enabled: boolean, _?: any, skipChangeState?: boolean): Promise<void>;
2046
- setMuted(muted: boolean): Promise<void>;
2047
- getStats(): LocalAudioTrackStats;
2048
- setAudioFrameCallback(callback: null | ((buffer: AudioBuffer) => void), frameSize?: number): void;
2049
- play(): void;
2050
- stop(): void;
2051
- close(): void;
2052
- protected _updatePlayerSource(updateWebAudioSource?: boolean): void;
2053
- protected _updateOriginMediaStreamTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
2054
- renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
2055
- pipe(processor: IAudioProcessor): IAudioProcessor;
2056
- unpipe(): void;
2057
- private bindProcessorDestinationEvents;
2058
- private unbindProcessorDestinationEvents;
2059
- protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2060
- protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2061
- private initWebAudio;
2062
- private initProcessor;
2063
- }
2064
-
2065
- /**
2066
- * Information of the local audio track, which can be retrieved by calling [AgoraRTCClient.getLocalAudioStats]{@link IAgoraRTCClient.getLocalAudioStats}.
2067
- */
2068
- export declare interface LocalAudioTrackStats {
2069
- /**
2070
- * The audio codec.
2071
- *
2072
- * - `"opus"`: The audio codec is OPUS。
2073
- * - `"aac"`: The audio codec is AAC。
2074
- * - `"pcmu"`: Reserved for future use.
2075
- * - `"pcma"`: Reserved for future use.
2076
- * - `"g722"`: Reserved for future use.
2077
- *
2078
- * > Firefox does not support this property.
2079
- */
2080
- codecType?: "opus" | "aac" | "PCMU" | "PCMA" | "G722";
2081
- /**
2082
- * The energy level of the sent audio.
2083
- *
2084
- * The value range is [0,32767].
2085
- *
2086
- * > This value is retrieved by calling WebRTC-Stats and may not be up-to-date. To get the real-time sound volume, call [LocalAudioTrack.getVolumeLevel]{@link ILocalAudioTrack.getVolumeLevel}.
2087
- */
2088
- sendVolumeLevel: number;
2089
- /**
2090
- * The bitrate (bps) of the sent audio.
2091
- */
2092
- sendBitrate: number;
2093
- /**
2094
- * The total bytes of the sent audio.
2095
- */
2096
- sendBytes: number;
2097
- /**
2098
- * The total packets of the sent audio.
2099
- */
2100
- sendPackets: number;
2101
- /**
2102
- * The total number of lost audio packets that were sent.
2103
- *
2104
- * > You can not get this property on Safari.
2105
- */
2106
- sendPacketsLost: number;
2107
- /**
2108
- * Jitter (ms) of the audio packets that were sent.
2109
- */
2110
- sendJitterMs: number;
2111
- /**
2112
- * Round-trip time delay (ms) of the audio packets that were sent.
2113
- */
2114
- sendRttMs: number;
2115
- /**
2116
- * The packet loss rate of the sent audio in 400ms.
2117
- */
2118
- currentPacketLossRate: number;
2119
- }
2120
-
2121
- export declare class LocalDataChannel extends DataChannel implements ILocalDataChannel {
2122
- send(data: ArrayBuffer): void;
2123
- }
2124
-
2125
- export declare abstract class LocalTrack extends Track implements ILocalTrack {
2126
- _enabled: boolean;
2127
- _muted: boolean;
2128
- _isExternalTrack: boolean;
2129
- get isExternalTrack(): boolean;
2130
- get muted(): boolean;
2131
- get enabled(): boolean;
2132
- _isClosed: boolean;
2133
- protected _enabledMutex: PromiseMutex;
2134
- protected processor?: IBaseProcessor;
2135
- protected abstract _processorContext: IProcessorContext | undefined;
2136
- protected get processorContext(): IProcessorContext | undefined;
2137
- abstract processorDestination: IBaseProcessor;
2138
- constructor(track: MediaStreamTrack, trackId?: string);
2139
- abstract getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
2140
- abstract setMuted(enabled: boolean): Promise<void>;
2141
- abstract setEnabled(enabled: boolean): Promise<void>;
2142
- getTrackLabel(): string;
2143
- close(): void;
2144
- protected _updateOriginMediaStreamTrack(track: MediaStreamTrack, stopOldTrack: boolean, isExternalTrack?: boolean): Promise<void>;
2145
- protected abstract _updatePlayerSource(): void;
2146
- protected _getDefaultPlayerConfig(): Partial<PlayerConfig>;
2147
- protected _handleTrackEnded: () => void;
2148
- protected onTrackEnded(): void;
2149
- protected stateCheck(stateName: "enabled" | "muted", state: boolean): void;
2150
- abstract renewMediaStreamTrack(): Promise<void>;
2151
- getProcessorStats(): ProcessorStats[];
2152
- getProcessorUsage(): Promise<UsageWithDirection[]>;
2153
- }
2154
-
2155
- export declare enum LocalTrackEvents {
2156
- SOURCE_STATE_CHANGE = "source-state-change",
2157
- TRACK_ENDED = "track-ended",
2158
- BEAUTY_EFFECT_OVERLOAD = "beauty-effect-overload",
2159
- VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
2160
- CLOSED = "closed"
2161
- }
2162
-
2163
- export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTrack {
2164
- readonly trackMediaType: "audio" | "video";
2165
- _player?: AgoraRTCPlayer | VideoPlayer;
2166
- isUseScaleResolutionDownBy: boolean;
2167
- private _videoVisibleTimer;
2168
- protected _statsTimer: number | null;
2169
- private _previousVideoVisibleStatus;
2170
- private _clearPreviousVideoVisibleStatus;
2171
- _encoderConfig?: Partial<VideoEncoderConfiguration>;
2172
- _scalabilityMode?: SVCConfiguration;
2173
- _optimizationMode?: "motion" | "detail" | "balanced";
2174
- _videoHeight?: number;
2175
- _videoWidth?: number;
2176
- _forceBitrateLimit?: {
2177
- max_bitrate: number;
2178
- min_bitrate: number;
2179
- };
2180
- _enabled: boolean;
2181
- get isPlaying(): boolean;
2182
- processorDestination: VideoProcessorDestination;
2183
- protected _processorContext: VideoProcessorContext;
2184
- protected get processorContext(): VideoProcessorContext;
2185
- protected set processorContext(ctx: VideoProcessorContext);
2186
- get __className__(): string;
2187
- constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string, hints?: TrackHint[]);
2188
- play(element: HTMLElement | HTMLVideoElement | string, config?: VideoPlayerConfig): void;
2189
- stop(): void;
2190
- setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
2191
- setMuted(muted: boolean): Promise<void>;
2192
- setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, doNotRenegoation?: boolean): Promise<void>;
2193
- getStats(): LocalVideoTrackStats;
2194
- setBeautyEffect(enabled: boolean, options?: BeautyEffectOptions): Promise<void>;
2195
- getCurrentFrameData(): ImageData;
2196
- getCurrentFrameImage(imageType: string, quality?: number): Promise<ImageTypedData>;
2197
- setBitrateLimit(bitrateLimit: {
2198
- max_bitrate: number;
2199
- min_bitrate: number;
2200
- }): Promise<void>;
2201
- setOptimizationMode(mode: "motion" | "detail" | "balanced"): Promise<void>;
2202
- setScalabiltyMode(mode: SVCConfiguration): void;
2203
- updateMediaStreamTrackResolution(): void;
2204
- protected _updatePlayerSource(): void;
2205
- protected _getDefaultPlayerConfig(): Partial<VideoPlayerConfig>;
2206
- protected setSenderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset): Promise<void>;
2207
- updateBitrateFromProfile(): void;
2208
- getVideoElementVisibleStatus(): CheckVideoVisibleResult | undefined;
2209
- renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
2210
- pipe(processor: IBaseProcessor): IBaseProcessor;
2211
- unpipe(): void;
2212
- close(): void;
2213
- clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): LocalVideoTrack;
2214
- replaceTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
2215
- startMonitorStats(): void;
2216
- sendSeiData(sei: Uint8Array): never;
2217
- private bindProcessorDestinationEvents;
2218
- private unbindProcessorDestinationEvents;
2219
- private unbindProcessorContextEvents;
2220
- }
2221
-
2222
- /**
2223
- * Information of the local video track, which can be retrieved by calling [AgoraRTCClient.getLocalVideoStats]{@link IAgoraRTCClient.getLocalVideoStats}.
2224
- */
2225
- export declare interface LocalVideoTrackStats {
2226
- /**
2227
- * The video codec.
2228
- *
2229
- * - `"H264"`: The video codec is H.264.
2230
- * - `"VP8"`: The video codec is VP8.
2231
- * - `"VP9"`: The video codec is VP9.
2232
- * - `"AV1X"`: Reserved for future use.
2233
- * - `"AV1"`: Reserved for future use.
2234
- *
2235
- * > You can not get this property on Firefox.
2236
- */
2237
- codecType?: "H264" | "H265" | "VP8" | "VP9" | "AV1X" | "AV1";
2238
- /**
2239
- * The total bytes of the sent video.
2240
- */
2241
- sendBytes: number;
2242
- /**
2243
- * The frame rate (fps) of the sent video.
2244
- *
2245
- * > You can not get this property on Firefox.
2246
- */
2247
- sendFrameRate?: number;
2248
- /**
2249
- * The frame rate (fps) of the captured video.
2250
- *
2251
- * > You can not get this property on Safari and Firefox.
2252
- */
2253
- captureFrameRate?: number;
2254
- /**
2255
- * The total packets of the sent video.
2256
- */
2257
- sendPackets: number;
2258
- /**
2259
- * The total number of lost video packets that were sent.
2260
- *
2261
- * > - You can not get this property on Safari.
2262
- * > - This property is inaccurate on Firefox.
2263
- */
2264
- sendPacketsLost: number;
2265
- /**
2266
- * Jitter (ms) of the video packets that were sent.
2267
- */
2268
- sendJitterMs: number;
2269
- /**
2270
- * Round-trip time delay (ms) of the video packets that were sent.
643
+ * @param event The event name.
644
+ * @param listener See [ILocalTrack.sei-received]{@link event_sei_received}.
2271
645
  */
2272
- sendRttMs: number;
646
+ on(event: "sei-received", listener: typeof event_sei_received): void;
2273
647
  /**
2274
- * The resolution height (pixel) of the sent video.
648
+ * Gets the statistics of a remote video track.
649
+ *
650
+ * @return An [[RemoteVideoTrackStats]] object。
2275
651
  */
2276
- sendResolutionHeight: number;
652
+ getStats(): RemoteVideoTrackStats;
2277
653
  /**
2278
- * The resolution width (pixel) of the sent video.
654
+ * Plays a remote video track on the web page.
655
+ *
656
+ * @param element Specifies a DOM element. The SDK will create a `<video>` element under the specified DOM element to play the video track. You can specify a DOM element in either of following ways:
657
+ * - `string`: Specify the ID of the DOM element.
658
+ * - `HTMLElement`: Pass a DOM object.
659
+ * @param config Sets the playback configurations, such as display mode and mirror mode. See [[VideoPlayerConfig]]. By default, the SDK enables mirror mode for a local video track.
2279
660
  */
2280
- sendResolutionWidth: number;
661
+ play(element: string | HTMLElement, config?: VideoPlayerConfig): void;
2281
662
  /**
2282
- * The resolution height (pixel) of the captured video.
663
+ * @since
664
+ * <br>&emsp;&emsp;&emsp;*4.1.0*
665
+ *
666
+ * Gets the data of the video frame being rendered.
667
+ *
668
+ * > You should call this method after calling [[play]]. Otherwise, the method call returns null.
669
+ *
670
+ * @returns An `ImageData` object that stores RGBA data. `ImageData` is a web API supported by the browser. For details, see [ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData).
2283
671
  */
2284
- captureResolutionHeight: number;
672
+ getCurrentFrameData(): ImageData;
2285
673
  /**
2286
- * The resolution width (pixel) of the captured video.
674
+ * @since
675
+ * <br>&emsp;&emsp;&emsp;*4.8.0*
676
+ *
677
+ * Gets the visibility of the `<video>` HTML tag.
678
+ *
679
+ * After you call `remoteVideoTrack.play`, the SDK creates an [`<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) tag for playing video tracks. When `remoteVideoTrack.isPlaying` is `true` but you cannot see any video, call this method to check whether the `<video>` tag is visible or not and learn the reason when the `<video>` tag is invisible.
680
+ *
681
+ * @returns The [[CheckVideoVisibleResult]] object. If this method returns `undefined`, it may be due to the following reasons:
682
+ * - `localRemoteTrack.isPlaying` is `false`.
683
+ * - The `<video>` tag does not exist.
684
+ * - The `<video>` tag is not created by calling the `play` method.
2287
685
  */
2288
- captureResolutionWidth: number;
686
+ getVideoElementVisibleStatus(): CheckVideoVisibleResult | undefined;
2289
687
  /**
2290
- * The time (ms) required for encoding the captured video.
688
+ * @since
689
+ * <br>&emsp;&emsp;&emsp;*4.13.0*
690
+ *
691
+ * Inserts a `Processor` to the remote video track.
692
+ *
693
+ * @param processor The `Processor` instance. Each extension has a corresponding type of `Processor`.
694
+ *
695
+ * @returns The `Processor` instance.
2291
696
  */
2292
- encodeDelay?: number;
697
+ pipe(processor: IBaseProcessor): IBaseProcessor;
2293
698
  /**
2294
- * The bitrate (bps) of the sent video.
699
+ * @since
700
+ * <br>&emsp;&emsp;&emsp;*4.13.0*
701
+ *
702
+ * Removes the `Processor` inserted to the remote video track.
2295
703
  */
2296
- sendBitrate: number;
704
+ unpipe(): void;
2297
705
  /**
2298
- * The target bitrate (bps) of the sent video, namely the bitrate set in {@link VideoEncoderConfiguration}.
706
+ * @since
707
+ * <br>&emsp;&emsp;&emsp;*4.13.0*
708
+ *
709
+ * The destination of the current processing pipeline on the remote video track.
2299
710
  */
2300
- targetSendBitrate: number;
711
+ processorDestination: IBaseProcessor;
712
+ }
713
+
714
+ export declare interface ITrack extends EventEmitter {
2301
715
  /**
2302
- * The total duration of the sent video in seconds.
716
+ * The type of a media track:
717
+ * - `"audio"`: Audio track.
718
+ * - `"video"`: Video track.
2303
719
  */
2304
- totalDuration: number;
720
+ trackMediaType: "audio" | "video";
2305
721
  /**
2306
- * The total freeze time of the encoded video in seconds.
722
+ * Whether a media track is playing on the webpage:
723
+ * - `true`: The media track is playing on the webpage.
724
+ * - `false`: The media track is not playing on the webpage.
2307
725
  */
2308
- totalFreezeTime: number;
726
+ isPlaying: boolean;
2309
727
  /**
2310
- * The packet loss rate of the sent video in 400ms.
728
+ * Gets the ID of a media track, a unique identifier generated by the SDK.
729
+ *
730
+ * @return The media track ID.
2311
731
  */
2312
- currentPacketLossRate: number;
2313
- }
2314
-
2315
- /**
2316
- * The video profile of the low-quality video stream. Set the the video profile of the low-quality video stream when calling [setLowStreamParameter]{@link IAgoraRTCClient.setLowStreamParameter}.
2317
- */
2318
- export declare interface LowStreamParameter {
732
+ getTrackId(): string;
2319
733
  /**
2320
- * Width of the video.
2321
- *
2322
- * You can pass a `number`, or a constraint such as `{ max: 1280, min: 720 }`.
734
+ * Gets an [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
2323
735
  *
2324
- * For more details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
736
+ * @return An [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object.
2325
737
  */
2326
- width: ConstrainULong;
738
+ getMediaStreamTrack(): MediaStreamTrack;
2327
739
  /**
2328
- * Height of the video.
740
+ * Gets the [RTCRtpTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver) instance of the current track.
741
+ *
742
+ * This method is currently mainly used for end-to-end encryption of video streams (Beta).
2329
743
  *
2330
- * You can pass a `number`, or a constraint such as `{ max: 1280, min: 720 }`.
744
+ * > If the SDK experiences a reconnection, the `RTCRtpTransceiver` instance corresponding to the current track might change. You can obtain the new `RTCRtpTransceiver` instance through the following callbacks:
745
+ * > - For a remote track: [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}
2331
746
  *
2332
- * For more details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
747
+ * @param type The type of the video stream. See {@link StreamType}.
748
+ * @returns The [RTCRtpTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver) instance of the current track.
2333
749
  */
2334
- height: ConstrainULong;
750
+ getRTCRtpTransceiver(type?: StreamType): RTCRtpTransceiver | undefined;
2335
751
  /**
2336
- * Frame rate of the video (fps).
2337
- *
2338
- * You can pass a `number`, or a constraint such as `{ max: 30, min: 5 }`.
752
+ * Plays a media track on the webpage.
2339
753
  *
2340
- * For details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
754
+ * @param element Specifies a DOM element. The SDK will create a `<video>` element under the specified DOM element to play the video track. You can specify a DOM element in either of following ways:
755
+ * - `string`: Specify the ID of the DOM element.
756
+ * - `HTMLElement`: Pass a DOM object.
2341
757
  */
2342
- framerate?: ConstrainULong;
758
+ play(element?: string | HTMLElement): void;
2343
759
  /**
2344
- * Bitrate of the video (Kbps).
760
+ * Stops playing the media track.
2345
761
  */
2346
- bitrate?: number;
762
+ stop(): void;
2347
763
  }
2348
764
 
2349
765
  export declare const MediaElementNumStatus: {
@@ -2371,85 +787,6 @@ export declare interface MediaStats {
2371
787
  resolution: Resolution;
2372
788
  }
2373
789
 
2374
- export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMicrophoneAudioTrack {
2375
- _config: MicrophoneAudioTrackInitConfig;
2376
- _deviceName: string;
2377
- private _constraints;
2378
- private readonly _originalConstraints;
2379
- _enabled: boolean;
2380
- get __className__(): string;
2381
- constructor(track: MediaStreamTrack, config: MicrophoneAudioTrackInitConfig, constraints: MediaTrackConstraints, trackId?: string);
2382
- setDevice(deviceId: string): Promise<void>;
2383
- setEnabled(enabled: boolean, notCloseDevice?: boolean, skipChangeState?: boolean): Promise<void>;
2384
- close(): void;
2385
- protected onTrackEnded(): void;
2386
- renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
2387
- protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2388
- protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2389
- }
2390
-
2391
- /**
2392
- * Configurations for the audio track from the audio captured by a microphone. Set these configurations when calling [AgoraRTC.createMicrophoneAudioTrack]{@link IAgoraRTC.createMicrophoneAudioTrack}.
2393
- */
2394
- export declare interface MicrophoneAudioTrackInitConfig {
2395
- /**
2396
- * The audio encoder configurations.
2397
- *
2398
- * You can set the audio encoder configurations in either of the following ways:
2399
- * - Pass the preset audio encoder configurations by using [[AudioEncoderConfigurationPreset]].
2400
- * - Pass your customized audio encoder configurations by using [[AudioEncoderConfiguration]].
2401
- *
2402
- * > Firefox does not support setting the audio encoding rate.
2403
- */
2404
- encoderConfig?: AudioEncoderConfiguration | AudioEncoderConfigurationPreset;
2405
- /**
2406
- * Whether to enable acoustic echo cancellation:
2407
- * - `true`: Enable acoustic echo cancellation.
2408
- * - `false`: Do not enable acoustic echo cancellation.
2409
- */
2410
- AEC?: boolean;
2411
- /**
2412
- * Whether to enable audio gain control:
2413
- * - `true`: Enable audio gain control.
2414
- * - `false`: Do not enable audio gain control.
2415
- */
2416
- AGC?: boolean;
2417
- /**
2418
- * Whether to enable automatic noise suppression:
2419
- * - `true`: Enable automatic noise suppression.
2420
- * - `false`: Do not automatic noise suppression.
2421
- */
2422
- ANS?: boolean;
2423
- /**
2424
- * @ignore
2425
- */
2426
- DTX?: boolean;
2427
- /**
2428
- * Specifies the microphone ID.
2429
- *
2430
- * You can get a list of the available microphones by calling [AgoraRTC.getMicrophones]{@link IAgoraRTC.getMicrophones}.
2431
- */
2432
- microphoneId?: string;
2433
- /**
2434
- * @ignore
2435
- * Specifies whether or not audio track pass through WebAudio.
2436
- */
2437
- bypassWebAudio?: boolean;
2438
- }
2439
-
2440
- export declare class MixingAudioTrack extends LocalAudioTrack {
2441
- get __className__(): string;
2442
- trackList: LocalAudioTrack[];
2443
- private destNode;
2444
- get isActive(): boolean;
2445
- constructor();
2446
- hasAudioTrack(track: LocalAudioTrack): boolean;
2447
- addAudioTrack(track: LocalAudioTrack): void;
2448
- removeAudioTrack(track: LocalAudioTrack): void;
2449
- private updateEncoderConfig;
2450
- _updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
2451
- }
2452
-
2453
790
  export declare interface PlayerConfig extends VideoPlayerConfig {
2454
791
  trackId: string;
2455
792
  element: HTMLElement;
@@ -2584,14 +921,6 @@ export declare interface RemoteAudioTrackStats {
2584
921
  publishDuration: number;
2585
922
  }
2586
923
 
2587
- export declare class RemoteDataChannel extends DataChannel implements IRemoteDataChannel {
2588
- private _messageListener;
2589
- constructor(config: IDataChannelConfig);
2590
- _updateOriginDataChannel(datachannel: RTCDataChannel): void;
2591
- _close(): void;
2592
- private _bandRemoteDataChannelEvents;
2593
- }
2594
-
2595
924
  /**
2596
925
  * The stream fallback option. Set the stream fallback option when calling [setStreamFallbackOption]{@link IAgoraRTCClient.setStreamFallbackOption}.
2597
926
  *
@@ -2781,166 +1110,6 @@ export declare interface Resolution {
2781
1110
 
2782
1111
  export declare const SAFARI_GLOBAL_GUM_LOCK: PromiseMutex;
2783
1112
 
2784
- export declare interface ScreenConstraintsWithElectron extends MediaTrackConstraints {
2785
- sourceId?: string;
2786
- extensionId?: string;
2787
- mandatory?: any;
2788
- mediaSource?: ScreenSourceType;
2789
- width?: ConstrainULong;
2790
- height?: ConstrainULong;
2791
- displaySurface?: "browser" | "window" | "monitor";
2792
- selfBrowserSurface?: "include" | "exclude";
2793
- surfaceSwitching?: "include" | "exclude";
2794
- systemAudio?: "include" | "exclude";
2795
- }
2796
-
2797
- /**
2798
- * The preset video encoder configurations for screen sharing.
2799
- *
2800
- * You can pass the preset video encoder configurations when calling [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack}.
2801
- *
2802
- * The following table lists all the preset video profiles for screen sharing.
2803
- *
2804
- * | Video Profile | Resolution (Width×Height) | Frame Rate (fps) |
2805
- * | -------- | --------------- | ----------- |
2806
- * | "480p" | 640 × 480 | 5 |
2807
- * | "480p_1" | 640 × 480 | 5 |
2808
- * | "480p_2" | 640 × 480 | 30 |
2809
- * | "480p_3" | 640 × 480 | 15 |
2810
- * | "720p" | 1280 × 720 | 5 |
2811
- * | "720p_1" | 1280 × 720 | 5 |
2812
- * | "720p_2" | 1280 × 720 | 30 |
2813
- * | "720p_3" | 1280 × 720 | 15 |
2814
- * | "720p_auto" <sup>①</sup> | 1280 × 720 | 30 |
2815
- * | "1080p" | 1920 × 1080 | 5 |
2816
- * | "1080p_1" | 1920 × 1080 | 5 |
2817
- * | "1080p_2" | 1920 × 1080 | 30 |
2818
- * | "1080p_3" | 1920 × 1080 | 15 |
2819
- *
2820
- * > <sup>①</sup> `"720p_auto"` is only recommended to be set on Safari to ensure dynamic adjustment of the encoding resolution. For details, see the release notes.
2821
- */
2822
- export declare type ScreenEncoderConfigurationPreset = keyof typeof SUPPORT_SCREEN_ENCODER_CONFIG_LIST;
2823
-
2824
- /**
2825
- * The type of the source for screen sharing.
2826
- * - `"screen"`: Sharing the whole screen.
2827
- * - `"application"`: Sharing all windows of an app.
2828
- * - `"window"`: Sharing a window of an app.
2829
- */
2830
- export declare type ScreenSourceType = "screen" | "window" | "application";
2831
-
2832
- /**
2833
- * Configurations for the video track for screen sharing. Set these configurations when calling [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack}.
2834
- */
2835
- export declare interface ScreenVideoTrackInitConfig {
2836
- /**
2837
- * The video encoder configurations for screen sharing.
2838
- *
2839
- * You can set the video encoder configurations in either of the following ways:
2840
- * - Pass the preset video encoder configurations by using [[ScreenEncoderConfigurationPreset]].
2841
- * - Pass your customized video encoder configurations by using [[VideoEncoderConfiguration]].
2842
- * - Leave this property empty to use the SDK's default value, `"1080p_2"` (resolution: 1920 × 1080, frame rate: 30 fps, bitrate: 3000 Kbps).
2843
- */
2844
- encoderConfig?: VideoEncoderConfiguration | ScreenEncoderConfigurationPreset;
2845
- /**
2846
- * The `sourceId` when you share the screen through Electron.
2847
- */
2848
- electronScreenSourceId?: string;
2849
- /**
2850
- * The `extensionId` when you share the screen with a Chrome extension.
2851
- */
2852
- extensionId?: string;
2853
- /**
2854
- *
2855
- * @deprecated from v4.17.1. Use {@link displaySurface} instead.
2856
- *
2857
- * The type of the source for screen sharing.
2858
- */
2859
- screenSourceType?: ScreenSourceType;
2860
- /**
2861
- * @since
2862
- * <br>&emsp;&emsp;&emsp;*4.0.0*
2863
- *
2864
- * Transmission optimization mode. Whether to prioritize video quality or smoothness:
2865
- * - `"detail"`: (Default) Prioritizes video quality.
2866
- * - The SDK 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.
2867
- * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
2868
- * - `"motion"`: Prioritizes video smoothness.
2869
- * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
2870
- * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
2871
- *
2872
- * > Note: This method is only supported on Chrome.
2873
- */
2874
- optimizationMode?: "motion" | "detail";
2875
- /**
2876
- * @ignore
2877
- *
2878
- * @since
2879
- * <br>&emsp;&emsp;&emsp;*4.18.0*
2880
- *
2881
- * Configurations for Scalable Video Coding (SVC).
2882
- *
2883
- * You can set the configurations using one of the following options:
2884
- * - Use the preset SVC configurations provided by the SDK through {@link SVCConfigurationPreset}.
2885
- * - Use your custom SVC configurations through {@link SVCConfiguration}.
2886
- */
2887
- scalabiltyMode?: SVCConfiguration | SVCConfigurationPreset;
2888
- /**
2889
- *
2890
- * @since
2891
- * <br>&emsp;&emsp;&emsp;*4.17.1*
2892
- *
2893
- * The pre-selected pane in the media picker. See [displaySurface](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#displaySurface) for details.
2894
- *
2895
- * > Note: This property is supported on Chrome 107 and later, as well as Edge 107 and later.
2896
- */
2897
- displaySurface?: "browser" | "window" | "monitor";
2898
- /**
2899
- *
2900
- * @since
2901
- * <br>&emsp;&emsp;&emsp;*4.17.1*
2902
- *
2903
- * Whether to allow the user to share the current tab:
2904
- * - `"include"`: (Default) Allows the user to share the current tab.
2905
- * - `"exclude"`: Prevents the user from sharing the current tab.
2906
- *
2907
- * See [displaySurface](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#displaySurface) for details.
2908
- *
2909
- * > Note:
2910
- * > - This property is defaulted to `"exclude"` on Chrome 107. For better compatibility with earlier versions, the SDK changes the default value to "include", which ensures that users can still share the current tab after upgrading to Chrome 107.
2911
- * > - This property is supported on Chrome 107 and later, as well as Edge 107 and later.
2912
- */
2913
- selfBrowserSurface?: "include" | "exclude";
2914
- /**
2915
- *
2916
- * @since
2917
- * <br>&emsp;&emsp;&emsp;*4.17.1*
2918
- *
2919
- * Whether to allow the user to dynamically switch between shared tabs:
2920
- * - `"include"`: (Default) The user can dynamically switch between shared tabs.
2921
- * - `"exclude"`: The user cannot dynamically switch between shared tabs.
2922
- *
2923
- * See [surfaceSwitching](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#surfaceSwitching) for details.
2924
- *
2925
- * > Note: This property is supported on Chrome 107 and later, as well as Edge 107 and later.
2926
- */
2927
- surfaceSwitching?: "include" | "exclude";
2928
- /**
2929
- *
2930
- * @since
2931
- * <br>&emsp;&emsp;&emsp;*4.17.1*
2932
- *
2933
- * Whether to capture system audio:
2934
- * - `"include"`: (Default) Captures system audio.
2935
- * - `"exclude"`: Avoids capturing system audio
2936
- *
2937
- * See [systemAudio](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#systemAudio) for details.
2938
- *
2939
- * > Note: This property is supported on Chrome 105 and later (Windows only), as well as Edge 105 and later (Windows only).
2940
- */
2941
- systemAudio?: "include" | "exclude";
2942
- }
2943
-
2944
1113
  export declare function silenceScriptProcessHandler(e: AudioProcessingEvent): AudioBuffer;
2945
1114
 
2946
1115
  export declare interface StatsRegistry {
@@ -2961,72 +1130,6 @@ export declare enum StreamType {
2961
1130
  LOW_STREAM = 1
2962
1131
  }
2963
1132
 
2964
- export declare const SUPPORT_720P_AUTO_CONFIG_LIST: Required<{
2965
- scaleResolutionDownBy: number;
2966
- width: number;
2967
- height: number;
2968
- frameRate: number;
2969
- bitrateMin: number;
2970
- bitrateMax: number;
2971
- }>[];
2972
-
2973
- /**
2974
- * @ignore
2975
- */
2976
- export declare const SUPPORT_SCREEN_ENCODER_CONFIG_LIST: Record<string, VideoEncoderConfiguration>;
2977
-
2978
- /**
2979
- * @ignore
2980
- */
2981
- export declare const SUPPORT_SVC_CONFIG_LIST: Record<string, SVCConfiguration>;
2982
-
2983
- /**
2984
- * @ignore
2985
- */
2986
- export declare const SUPPORT_VIDEO_ENCODER_CONFIG_LIST: Record<string, VideoEncoderConfiguration>;
2987
-
2988
- /**
2989
- * @ignore
2990
- * @since
2991
- * <br>&emsp;&emsp;&emsp;*4.18.0*
2992
- *
2993
- * Custom SVC encoding configurations.
2994
- *
2995
- * You can control the SVC configurations for local video by passing `SVCConfiguration` in the following methods:
2996
- * - [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack}
2997
- * - [AgoraRTC.createCustomVideoTrack]{@link IAgoraRTC.createCustomVideoTrack}
2998
- * - [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack}
2999
- */
3000
- export declare interface SVCConfiguration {
3001
- /**
3002
- * Specifies the number of spatial layer in SVC.
3003
- */
3004
- numSpatialLayers: 1 | 2 | 3;
3005
- /**
3006
- * Specifies the number of temporal layer in SVC.
3007
- */
3008
- numTemporalLayers: 1 | 3;
3009
- }
3010
-
3011
- /**
3012
- * @ignore
3013
- *
3014
- * @since
3015
- * <br>&emsp;&emsp;&emsp;*4.18.0*
3016
- *
3017
- * The preset SVC configurations provided by the SDK.
3018
- * - `"1SL1TL"`: 1 spatial layer, 1 temporal layer.
3019
- * - `"3SL3TL"`: 3 spatial layers, 3 temporal layers.
3020
- * - `"2SL3TL"`: 2 spatial layers, 3 temporal layers.
3021
- *
3022
- * You can control the SVC configurations for local video by passing these preset values in the following methods:
3023
- * - [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack}
3024
- * - [AgoraRTC.createCustomVideoTrack]{@link IAgoraRTC.createCustomVideoTrack}
3025
- * - [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack}
3026
- *
3027
- */
3028
- export declare type SVCConfigurationPreset = keyof typeof SUPPORT_SVC_CONFIG_LIST;
3029
-
3030
1133
  export declare abstract class Track extends EventEmitter implements ITrack {
3031
1134
  abstract readonly trackMediaType: "audio" | "video";
3032
1135
  private _ID;
@@ -3053,7 +1156,8 @@ export declare abstract class Track extends EventEmitter implements ITrack {
3053
1156
  export declare enum TrackEvents {
3054
1157
  TRANSCEIVER_UPDATED = "transceiver-updated",
3055
1158
  SEI_TO_SEND = "sei-to-send",
3056
- SEI_RECEIVED = "sei-received"
1159
+ SEI_RECEIVED = "sei-received",
1160
+ CLOSED = "closed"
3057
1161
  }
3058
1162
 
3059
1163
  export declare enum TrackHint {
@@ -3088,111 +1192,6 @@ export declare interface UsageRegistry {
3088
1192
  cb: () => Usage | Promise<Usage>;
3089
1193
  }
3090
1194
 
3091
- /**
3092
- * `VideoEncoderConfiguration` is the interface that defines the video encoder configurations.
3093
- *
3094
- * You can customize the video encoder configurations when calling [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack} or [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack}.
3095
- *
3096
- * The SDK provides the preset video encoder configurations. For more information, see [[VideoEncoderConfigurationPreset]].
3097
- *
3098
- * > The actual bitrate may differ slightly from the value you set due to the limitations of the operation system or the web browser. Agora recommends setting the bitrate between 100 Kbps and 5000 Kbps.
3099
- */
3100
- export declare interface VideoEncoderConfiguration {
3101
- /**
3102
- * Width of the video.
3103
- *
3104
- * You can pass a `number`, or a constraint such as `{ max: 1280, min: 720 }`.
3105
- *
3106
- * For more details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
3107
- */
3108
- width?: number | ConstrainLong;
3109
- /**
3110
- * Height of the video.
3111
- *
3112
- * You can pass a `number`, or a constraint such as `{ max: 1280, min: 720 }`.
3113
- *
3114
- * For more details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
3115
- */
3116
- height?: number | ConstrainLong;
3117
- /**
3118
- * Frame rate of the video (fps).
3119
- *
3120
- * You can pass a `number`, or a constraint such as `{ max: 30, min: 5 }`.
3121
- *
3122
- * For details about the constraint, see [ConstrainLong]{@link ConstrainLong}.
3123
- */
3124
- frameRate?: number | ConstrainLong;
3125
- /**
3126
- * The minimum bitrate of the video (Kbps).
3127
- */
3128
- bitrateMin?: number;
3129
- /**
3130
- * The maximum bitrate of the video (Kbps).
3131
- */
3132
- bitrateMax?: number;
3133
- /**
3134
- * @ignore
3135
- */
3136
- scaleResolutionDownBy?: number;
3137
- }
3138
-
3139
- /**
3140
- *
3141
- * The preset video encoder configurations.
3142
- *
3143
- * You can pass the preset video encoder configurations when calling [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack} or [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack}.
3144
- *
3145
- * The following table lists all the preset video profiles. The SDK uses `"480p_1"` by default.
3146
- *
3147
- * | Video Profile | Resolution (Width×Height) | Frame Rate (fps) | Bitrate (Kbps) | Chrome | Firefox | Safari |
3148
- * | -------- | --------------- | ----------- | ------------ | ------ | ------- | ------ |
3149
- * | 120p | 160 × 120 | 15 | 65 | ✓ | | |
3150
- * | 120p_1 | 160 × 120 | 15 | 65 | ✓ | | |
3151
- * | 120p_3 | 120 × 120 | 15 | 50 | ✓ | | |
3152
- * | 180p | 320 × 180 | 15 | 140 | ✓ | | |
3153
- * | 180p_1 | 320 × 180 | 15 | 140 | ✓ | | |
3154
- * | 180p_3 | 180 × 180 | 15 | 100 | ✓ | | |
3155
- * | 180p_4 | 240 × 180 | 15 | 120 | ✓ | | |
3156
- * | 240p | 320 × 240 | 15 | 200 | ✓ | | |
3157
- * | 240p_1 | 320 × 240 | 15 | 200 | ✓ | | |
3158
- * | 240p_3 | 240 × 240 | 15 | 140 | ✓ | | |
3159
- * | 240p_4 | 424 × 240 | 15 | 220 | ✓ | | |
3160
- * | 360p | 640 × 360 | 15 | 400 | ✓ | | |
3161
- * | 360p_1 | 640 × 360 | 15 | 400 | ✓ | | |
3162
- * | 360p_3 | 360 × 360 | 15 | 260 | ✓ | | |
3163
- * | 360p_4 | 640 × 360 | 30 | 600 | ✓ | | |
3164
- * | 360p_6 | 360 × 360 | 30 | 400 | ✓ | | |
3165
- * | 360p_7 | 480 × 360 | 15 | 320 | ✓ | | |
3166
- * | 360p_8 | 480 × 360 | 30 | 490 | ✓ | | |
3167
- * | 360p_9 | 640 × 360 | 15 | 800 | ✓ | | |
3168
- * | 360p_10 | 640 × 360 | 24 | 800 | ✓ | | |
3169
- * | 360p_11 | 640 × 360 | 24 | 1000 | ✓ | | |
3170
- * | 480p | 640 × 480 | 15 | 500 | ✓ | ✓ | ✓ |
3171
- * | 480p_1 | 640 × 480 | 15 | 500 | ✓ | ✓ | ✓ |
3172
- * | 480p_2 | 640 × 480 | 30 | 1000 | ✓ | ✓ | ✓ |
3173
- * | 480p_3 | 480 × 480 | 15 | 400 | ✓ | ✓ | ✓ |
3174
- * | 480p_4 | 640 × 480 | 30 | 750 | ✓ | ✓ | ✓ |
3175
- * | 480p_6 | 480 × 480 | 30 | 600 | ✓ | ✓ | ✓ |
3176
- * | 480p_8 | 848 × 480 | 15 | 610 | ✓ | ✓ | ✓ |
3177
- * | 480p_9 | 848 × 480 | 30 | 930 | ✓ | ✓ | ✓ |
3178
- * | 480p_10 | 640 × 480 | 10 | 400 | ✓ | ✓ | ✓ |
3179
- * | 720p | 1280 × 720 | 15 | 1130 | ✓ | ✓ | ✓ |
3180
- * | 720p_1 | 1280 × 720 | 15 | 1130 | ✓ | ✓ | ✓ |
3181
- * | 720p_2 | 1280 × 720 | 30 | 2000 | ✓ | ✓ | ✓ |
3182
- * | 720p_3 | 1280 × 720 | 30 | 1710 | ✓ | ✓ | ✓ |
3183
- * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 | 3000 | ✓ | ✓ | ✓ |
3184
- * | 720p_5 | 960 × 720 | 15 | 910 | ✓ | ✓ | ✓ |
3185
- * | 720p_6 | 960 × 720 | 30 | 1380 | ✓ | ✓ | ✓ |
3186
- * | 1080p | 1920 × 1080 | 15 | 2080 | ✓ | | ✓ |
3187
- * | 1080p_1 | 1920 × 1080 | 15 | 2080 | ✓ | | ✓ |
3188
- * | 1080p_2 | 1920 × 1080 | 30 | 3000 | ✓ | | ✓ |
3189
- * | 1080p_3 | 1920 × 1080 | 30 | 3150 | ✓ | | ✓ |
3190
- * | 1080p_5 | 1920 × 1080 | 60 | 4780 | ✓ | | ✓ |
3191
- *
3192
- * > <sup>①</sup> `"720p_auto"` is only recommended to be set on Safari to ensure dynamic adjustment of the encoding resolution. For details, see the release notes.
3193
- */
3194
- export declare type VideoEncoderConfigurationPreset = keyof typeof SUPPORT_VIDEO_ENCODER_CONFIG_LIST;
3195
-
3196
1195
  declare class VideoPlayer {
3197
1196
  trackId: string;
3198
1197
  config: PlayerConfig;