agora-electron-sdk 4.2.0 → 4.2.2-dev.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/AgoraSdk.js +7 -5
- package/js/Private/AgoraBase.js +394 -1292
- package/js/Private/AgoraMediaBase.js +76 -340
- package/js/Private/AgoraMediaPlayerTypes.js +25 -122
- package/js/Private/IAgoraLog.js +5 -14
- package/js/Private/IAgoraMediaEngine.js +5 -2
- package/js/Private/IAgoraMediaPlayer.js +10 -4
- package/js/Private/IAgoraMediaRecorder.js +5 -2
- package/js/Private/IAgoraMediaStreamingSource.js +5 -12
- package/js/Private/IAgoraMusicContentCenter.js +68 -125
- package/js/Private/IAgoraRhythmPlayer.js +5 -10
- package/js/Private/IAgoraRtcEngine.js +141 -932
- package/js/Private/IAgoraRtcEngineEx.js +29 -13
- package/js/Private/IAgoraSpatialAudio.js +40 -53
- package/js/Private/IAudioDeviceManager.js +5 -2
- package/js/Private/impl/IAgoraMediaEngineImpl.js +156 -139
- package/js/Private/impl/IAgoraMediaPlayerImpl.js +538 -526
- package/js/Private/impl/IAgoraMediaRecorderImpl.js +29 -26
- package/js/Private/impl/IAgoraMusicContentCenterImpl.js +264 -192
- package/js/Private/impl/IAgoraRtcEngineExImpl.js +419 -399
- package/js/Private/impl/IAgoraRtcEngineImpl.js +2352 -2207
- package/js/Private/impl/IAgoraSpatialAudioImpl.js +192 -169
- package/js/Private/impl/IAudioDeviceManagerImpl.js +235 -232
- package/js/Private/internal/AudioDeviceManagerInternal.js +44 -24
- package/js/Private/internal/IrisApiEngine.js +109 -76
- package/js/Private/internal/LocalSpatialAudioEngineInternal.js +49 -29
- package/js/Private/internal/MediaEngineInternal.js +82 -58
- package/js/Private/internal/MediaPlayerInternal.js +132 -111
- package/js/Private/internal/MediaRecorderInternal.js +64 -38
- package/js/Private/internal/MusicContentCenterInternal.js +130 -100
- package/js/Private/internal/RtcEngineExInternal.js +265 -219
- package/js/Private/ti/AgoraBase-ti.js +2 -2
- package/js/Private/ti/AgoraMediaBase-ti.js +15 -15
- package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +1 -1
- package/js/Private/ti/IAgoraLog-ti.js +1 -1
- package/js/Private/ti/IAgoraMediaEngine-ti.js +1 -1
- package/js/Private/ti/IAgoraMediaPlayer-ti.js +2 -2
- package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +2 -2
- package/js/Private/ti/IAgoraMediaRecorder-ti.js +1 -1
- package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +1 -1
- package/js/Private/ti/IAgoraMusicContentCenter-ti.js +5 -4
- package/js/Private/ti/IAgoraRhythmPlayer-ti.js +1 -1
- package/js/Private/ti/IAgoraRtcEngine-ti.js +2 -2
- package/js/Private/ti/IAgoraRtcEngineEx-ti.js +1 -1
- package/js/Private/ti/IAgoraSpatialAudio-ti.js +1 -1
- package/js/Private/ti/IAudioDeviceManager-ti.js +1 -1
- package/js/Renderer/AgoraView.js +145 -100
- package/js/Renderer/IRenderer.js +18 -17
- package/js/Renderer/IRendererManager.js +5 -2
- package/js/Renderer/RendererManager.js +208 -180
- package/js/Renderer/WebGLRenderer/index.js +111 -107
- package/js/Renderer/YUVCanvasRenderer/index.js +68 -51
- package/js/Utils.js +85 -36
- package/package.json +3 -3
- package/ts/AgoraSdk.ts +3 -1
- package/ts/Private/AgoraBase.ts +227 -86
- package/ts/Private/AgoraMediaBase.ts +69 -54
- package/ts/Private/AgoraMediaPlayerTypes.ts +4 -4
- package/ts/Private/IAgoraLog.ts +1 -1
- package/ts/Private/IAgoraMediaEngine.ts +42 -39
- package/ts/Private/IAgoraMediaPlayer.ts +98 -67
- package/ts/Private/IAgoraMediaPlayerSource.ts +15 -8
- package/ts/Private/IAgoraMusicContentCenter.ts +25 -4
- package/ts/Private/IAgoraRtcEngine.ts +951 -747
- package/ts/Private/IAgoraRtcEngineEx.ts +183 -157
- package/ts/Private/IAgoraSpatialAudio.ts +55 -32
- package/ts/Private/IAudioDeviceManager.ts +39 -25
- package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +72 -21
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +136 -15
- package/ts/Private/internal/RtcEngineExInternal.ts +8 -0
- package/ts/Private/ti/AgoraMediaBase-ti.ts +13 -13
- package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +3 -2
- package/types/AgoraSdk.d.ts +3 -1
- package/types/AgoraSdk.d.ts.map +1 -1
- package/types/Private/AgoraBase.d.ts +221 -86
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +69 -51
- package/types/Private/AgoraMediaBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaPlayerTypes.d.ts +4 -4
- package/types/Private/IAgoraLog.d.ts +1 -1
- package/types/Private/IAgoraMediaEngine.d.ts +42 -39
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayer.d.ts +98 -67
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts +15 -8
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
- package/types/Private/IAgoraMusicContentCenter.d.ts +17 -5
- package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngine.d.ts +936 -744
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngineEx.d.ts +183 -157
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
- package/types/Private/IAgoraSpatialAudio.d.ts +55 -32
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
- package/types/Private/IAudioDeviceManager.d.ts +39 -25
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts +9 -5
- package/types/Private/impl/IAgoraMusicContentCenterImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +18 -6
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
- package/types/Private/internal/RtcEngineExInternal.d.ts +1 -0
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
- package/types/Private/ti/IAgoraMusicContentCenter-ti.d.ts.map +1 -1
|
@@ -274,7 +274,7 @@ export enum ContentInspectType {
|
|
|
274
274
|
*/
|
|
275
275
|
export class ContentInspectModule {
|
|
276
276
|
/**
|
|
277
|
-
* Types of functional module. See ContentInspectType
|
|
277
|
+
* Types of functional module. See ContentInspectType.
|
|
278
278
|
*/
|
|
279
279
|
type?: ContentInspectType;
|
|
280
280
|
/**
|
|
@@ -292,7 +292,7 @@ export class ContentInspectConfig {
|
|
|
292
292
|
*/
|
|
293
293
|
extraInfo?: string;
|
|
294
294
|
/**
|
|
295
|
-
* Functional module. See ContentInspectModule
|
|
295
|
+
* Functional module. See ContentInspectModule.A maximum of 32 ContentInspectModule instances can be configured, and the value range of MAX_CONTENT_INSPECT_MODULE_COUNT is an integer in [1,32].A function module can only be configured with one instance at most. Currently only the video screenshot and upload function is supported.
|
|
296
296
|
*/
|
|
297
297
|
modules?: ContentInspectModule[];
|
|
298
298
|
/**
|
|
@@ -508,11 +508,11 @@ export enum VideoBufferType {
|
|
|
508
508
|
*/
|
|
509
509
|
export class ExternalVideoFrame {
|
|
510
510
|
/**
|
|
511
|
-
* The video type. See VideoBufferType
|
|
511
|
+
* The video type. See VideoBufferType.
|
|
512
512
|
*/
|
|
513
513
|
type?: VideoBufferType;
|
|
514
514
|
/**
|
|
515
|
-
* The pixel format. See VideoPixelFormat
|
|
515
|
+
* The pixel format. See VideoPixelFormat.
|
|
516
516
|
*/
|
|
517
517
|
format?: VideoPixelFormat;
|
|
518
518
|
/**
|
|
@@ -579,11 +579,12 @@ export class ExternalVideoFrame {
|
|
|
579
579
|
|
|
580
580
|
/**
|
|
581
581
|
* Configurations of the video frame.
|
|
582
|
+
*
|
|
582
583
|
* Note that the buffer provides a pointer to a pointer. This interface cannot modify the pointer of the buffer, but it can modify the content of the buffer.
|
|
583
584
|
*/
|
|
584
585
|
export class VideoFrame {
|
|
585
586
|
/**
|
|
586
|
-
* The pixel format. See VideoPixelFormat
|
|
587
|
+
* The pixel format. See VideoPixelFormat.
|
|
587
588
|
*/
|
|
588
589
|
type?: VideoPixelFormat;
|
|
589
590
|
/**
|
|
@@ -694,11 +695,13 @@ export enum VideoModulePosition {
|
|
|
694
695
|
|
|
695
696
|
/**
|
|
696
697
|
* This class is used to get raw PCM audio.
|
|
698
|
+
*
|
|
697
699
|
* You can inherit this class and implement the onFrame callback to get raw PCM audio.
|
|
698
700
|
*/
|
|
699
701
|
export interface IAudioPcmFrameSink {
|
|
700
702
|
/**
|
|
701
703
|
* Occurs each time the player receives an audio frame.
|
|
704
|
+
*
|
|
702
705
|
* After registering the audio frame observer, the callback occurs every time the player receives an audio frame, reporting the detailed information of the audio frame.
|
|
703
706
|
*
|
|
704
707
|
* @param frame The audio frame information. See AudioPcmFrame.
|
|
@@ -721,7 +724,7 @@ export enum AudioFrameType {
|
|
|
721
724
|
*/
|
|
722
725
|
export class AudioFrame {
|
|
723
726
|
/**
|
|
724
|
-
* The type of the audio frame. See AudioFrameType
|
|
727
|
+
* The type of the audio frame. See AudioFrameType.
|
|
725
728
|
*/
|
|
726
729
|
type?: AudioFrameType;
|
|
727
730
|
/**
|
|
@@ -752,6 +755,10 @@ export class AudioFrame {
|
|
|
752
755
|
* Reserved for future use.
|
|
753
756
|
*/
|
|
754
757
|
avsync_type?: number;
|
|
758
|
+
/**
|
|
759
|
+
* @ignore
|
|
760
|
+
*/
|
|
761
|
+
presentationMs?: number;
|
|
755
762
|
}
|
|
756
763
|
|
|
757
764
|
/**
|
|
@@ -786,7 +793,8 @@ export enum AudioFramePosition {
|
|
|
786
793
|
|
|
787
794
|
/**
|
|
788
795
|
* Audio data format.
|
|
789
|
-
*
|
|
796
|
+
*
|
|
797
|
+
* The SDK sets the audio data format in the following callbacks according to AudioParams . onRecordAudioFrame onPlaybackAudioFrame onMixedAudioFrame The SDK calculates the sampling interval through the samplesPerCall , sampleRate , and channel parameters in AudioParams , and triggers the onRecordAudioFrame , onPlaybackAudioFrame , onMixedAudioFrame , and onEarMonitoringAudioFrame callbacks according to the sampling interval. Sample interval (sec) = samplePerCall /( sampleRate × channel ) . Ensure that the sample interval ≥ 0.01 (s).
|
|
790
798
|
*/
|
|
791
799
|
export class AudioParams {
|
|
792
800
|
/**
|
|
@@ -798,7 +806,7 @@ export class AudioParams {
|
|
|
798
806
|
*/
|
|
799
807
|
channels?: number;
|
|
800
808
|
/**
|
|
801
|
-
* The use mode of the audio data. See RawAudioFrameOpModeType
|
|
809
|
+
* The use mode of the audio data. See RawAudioFrameOpModeType.
|
|
802
810
|
*/
|
|
803
811
|
mode?: RawAudioFrameOpModeType;
|
|
804
812
|
/**
|
|
@@ -813,50 +821,54 @@ export class AudioParams {
|
|
|
813
821
|
export interface IAudioFrameObserverBase {
|
|
814
822
|
/**
|
|
815
823
|
* Gets the captured audio frame.
|
|
824
|
+
*
|
|
816
825
|
* To ensure that the data format of captured audio frame is as expected, Agora recommends that you set the audio data format as follows: After calling setRecordingAudioFrameParameters to set the audio data format, call registerAudioFrameObserver to register the audio observer object, the SDK will calculate the sampling interval according to the parameters set in this method, and triggers the onRecordAudioFrame callback according to the sampling interval.
|
|
817
826
|
*
|
|
818
827
|
* @param channelId The channel ID.
|
|
819
|
-
* @param audioFrame The raw audio data. See AudioFrame
|
|
828
|
+
* @param audioFrame The raw audio data. See AudioFrame.
|
|
820
829
|
*
|
|
821
830
|
* @returns
|
|
822
831
|
* Reserved for future use.
|
|
823
832
|
*/
|
|
824
|
-
onRecordAudioFrame?(channelId: string, audioFrame: AudioFrame):
|
|
833
|
+
onRecordAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
|
|
825
834
|
|
|
826
835
|
/**
|
|
827
836
|
* Gets the raw audio frame for playback.
|
|
837
|
+
*
|
|
828
838
|
* To ensure that the data format of audio frame for playback is as expected, Agora recommends that you set the audio data format as follows: After calling setPlaybackAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onPlaybackAudioFrame callback according to the sampling interval.
|
|
829
839
|
*
|
|
830
840
|
* @param channelId The channel ID.
|
|
831
|
-
* @param audioFrame The raw audio data. See AudioFrame
|
|
841
|
+
* @param audioFrame The raw audio data. See AudioFrame.
|
|
832
842
|
*
|
|
833
843
|
* @returns
|
|
834
844
|
* Reserved for future use.
|
|
835
845
|
*/
|
|
836
|
-
onPlaybackAudioFrame?(channelId: string, audioFrame: AudioFrame):
|
|
846
|
+
onPlaybackAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
|
|
837
847
|
|
|
838
848
|
/**
|
|
839
849
|
* Retrieves the mixed captured and playback audio frame.
|
|
850
|
+
*
|
|
840
851
|
* To ensure that the data format of mixed captured and playback audio frame meets the expectations, Agora recommends that you set the data format as follows: After calling setMixedAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onMixedAudioFrame callback according to the sampling interval.
|
|
841
852
|
*
|
|
842
853
|
* @param channelId The channel ID.
|
|
843
|
-
* @param audioFrame The raw audio data. See AudioFrame
|
|
854
|
+
* @param audioFrame The raw audio data. See AudioFrame.
|
|
844
855
|
*
|
|
845
856
|
* @returns
|
|
846
857
|
* Reserved for future use.
|
|
847
858
|
*/
|
|
848
|
-
onMixedAudioFrame?(channelId: string, audioFrame: AudioFrame):
|
|
859
|
+
onMixedAudioFrame?(channelId: string, audioFrame: AudioFrame): void;
|
|
849
860
|
|
|
850
861
|
/**
|
|
851
862
|
* Gets the in-ear monitoring audio frame.
|
|
863
|
+
*
|
|
852
864
|
* In order to ensure that the obtained in-ear audio data meets the expectations, Agora recommends that you set the in-ear monitoring-ear audio data format as follows: After calling setEarMonitoringAudioFrameParameters to set the audio data format and registerAudioFrameObserver to register the audio frame observer object, the SDK calculates the sampling interval according to the parameters set in the methods, and triggers the onEarMonitoringAudioFrame callback according to the sampling interval.
|
|
853
865
|
*
|
|
854
|
-
* @param audioFrame The raw audio data. See AudioFrame
|
|
866
|
+
* @param audioFrame The raw audio data. See AudioFrame.
|
|
855
867
|
*
|
|
856
868
|
* @returns
|
|
857
869
|
* Reserved for future use.
|
|
858
870
|
*/
|
|
859
|
-
onEarMonitoringAudioFrame?(audioFrame: AudioFrame):
|
|
871
|
+
onEarMonitoringAudioFrame?(audioFrame: AudioFrame): void;
|
|
860
872
|
}
|
|
861
873
|
|
|
862
874
|
/**
|
|
@@ -868,7 +880,7 @@ export interface IAudioFrameObserver extends IAudioFrameObserverBase {
|
|
|
868
880
|
*
|
|
869
881
|
* @param channelId The channel ID.
|
|
870
882
|
* @param uid The user ID of the specified user.
|
|
871
|
-
* @param audioFrame The raw audio data. See AudioFrame
|
|
883
|
+
* @param audioFrame The raw audio data. See AudioFrame.
|
|
872
884
|
*
|
|
873
885
|
* @returns
|
|
874
886
|
* Reserved for future use.
|
|
@@ -877,7 +889,7 @@ export interface IAudioFrameObserver extends IAudioFrameObserverBase {
|
|
|
877
889
|
channelId: string,
|
|
878
890
|
uid: number,
|
|
879
891
|
audioFrame: AudioFrame
|
|
880
|
-
):
|
|
892
|
+
): void;
|
|
881
893
|
}
|
|
882
894
|
|
|
883
895
|
/**
|
|
@@ -903,7 +915,7 @@ export class UserAudioSpectrumInfo {
|
|
|
903
915
|
*/
|
|
904
916
|
uid?: number;
|
|
905
917
|
/**
|
|
906
|
-
* Audio spectrum information of the remote user. See AudioSpectrumData
|
|
918
|
+
* Audio spectrum information of the remote user. See AudioSpectrumData.
|
|
907
919
|
*/
|
|
908
920
|
spectrumData?: AudioSpectrumData;
|
|
909
921
|
}
|
|
@@ -914,29 +926,31 @@ export class UserAudioSpectrumInfo {
|
|
|
914
926
|
export interface IAudioSpectrumObserver {
|
|
915
927
|
/**
|
|
916
928
|
* Gets the statistics of a local audio spectrum.
|
|
929
|
+
*
|
|
917
930
|
* After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK will trigger the callback as the time interval you set to report the received remote audio data spectrum.
|
|
918
931
|
*
|
|
919
|
-
* @param data The audio spectrum data of the local user. See AudioSpectrumData
|
|
932
|
+
* @param data The audio spectrum data of the local user. See AudioSpectrumData.
|
|
920
933
|
*
|
|
921
934
|
* @returns
|
|
922
|
-
* Whether the spectrum data is received:true: Spectrum data is received.false: No spectrum data is received.
|
|
935
|
+
* Whether the spectrum data is received: true : Spectrum data is received. false : No spectrum data is received.
|
|
923
936
|
*/
|
|
924
|
-
onLocalAudioSpectrum?(data: AudioSpectrumData):
|
|
937
|
+
onLocalAudioSpectrum?(data: AudioSpectrumData): void;
|
|
925
938
|
|
|
926
939
|
/**
|
|
927
940
|
* Gets the remote audio spectrum.
|
|
941
|
+
*
|
|
928
942
|
* After successfully calling registerAudioSpectrumObserver to implement the onRemoteAudioSpectrum callback in the IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK will trigger the callback as the time interval you set to report the received remote audio data spectrum.
|
|
929
943
|
*
|
|
930
|
-
* @param spectrums The audio spectrum information of the remote user, see UserAudioSpectrumInfo
|
|
944
|
+
* @param spectrums The audio spectrum information of the remote user, see UserAudioSpectrumInfo. The number of arrays is the number of remote users monitored by the SDK. If the array is null, it means that no audio spectrum of remote users is detected.
|
|
931
945
|
* @param spectrumNumber The number of remote users.
|
|
932
946
|
*
|
|
933
947
|
* @returns
|
|
934
|
-
* Whether the spectrum data is received:true: Spectrum data is received.false: No spectrum data is received.
|
|
948
|
+
* Whether the spectrum data is received: true : Spectrum data is received. false : No spectrum data is received.
|
|
935
949
|
*/
|
|
936
950
|
onRemoteAudioSpectrum?(
|
|
937
951
|
spectrums: UserAudioSpectrumInfo[],
|
|
938
952
|
spectrumNumber: number
|
|
939
|
-
):
|
|
953
|
+
): void;
|
|
940
954
|
}
|
|
941
955
|
|
|
942
956
|
/**
|
|
@@ -945,12 +959,13 @@ export interface IAudioSpectrumObserver {
|
|
|
945
959
|
export interface IVideoEncodedFrameObserver {
|
|
946
960
|
/**
|
|
947
961
|
* Reports that the receiver has received the to-be-decoded video frame sent by the remote end.
|
|
948
|
-
*
|
|
962
|
+
*
|
|
963
|
+
* If you call the setRemoteVideoSubscriptionOptions method and set encodedFrameOnly to true , the SDK triggers this callback locally to report the received encoded video frame information.
|
|
949
964
|
*
|
|
950
965
|
* @param uid The user ID of the remote user.
|
|
951
966
|
* @param imageBuffer The encoded video image buffer.
|
|
952
967
|
* @param length The data length of the video image.
|
|
953
|
-
* @param videoEncodedFrameInfo For the information of the encoded video frame, see EncodedVideoFrameInfo
|
|
968
|
+
* @param videoEncodedFrameInfo For the information of the encoded video frame, see EncodedVideoFrameInfo.
|
|
954
969
|
*
|
|
955
970
|
* @returns
|
|
956
971
|
* Reserved for future use.
|
|
@@ -960,7 +975,7 @@ export interface IVideoEncodedFrameObserver {
|
|
|
960
975
|
imageBuffer: Uint8Array,
|
|
961
976
|
length: number,
|
|
962
977
|
videoEncodedFrameInfo: EncodedVideoFrameInfo
|
|
963
|
-
):
|
|
978
|
+
): void;
|
|
964
979
|
}
|
|
965
980
|
|
|
966
981
|
/**
|
|
@@ -982,70 +997,70 @@ export enum VideoFrameProcessMode {
|
|
|
982
997
|
*/
|
|
983
998
|
export interface IVideoFrameObserver {
|
|
984
999
|
/**
|
|
985
|
-
* Occurs each time the SDK receives a video frame captured by
|
|
986
|
-
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data captured by the local camera. You can then pre-process the data according to your scenarios.Once the pre-processing is complete, you can directly modify videoFrame in this callback, and set the return value to true to send the modified video data to the SDK.The video data that this callback gets has not been pre-processed, and is not watermarked, cropped, rotated or beautified.If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel.
|
|
1000
|
+
* Occurs each time the SDK receives a video frame captured by local devices.
|
|
987
1001
|
*
|
|
988
|
-
*
|
|
989
|
-
*
|
|
1002
|
+
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data captured by local devices. You can then pre-process the data according to your scenarios. Once the pre-processing is complete, you can directly modify videoFrame in this callback, and set the return value to true to send the modified video data to the SDK. The video data that this callback gets has not been pre-processed, and is not watermarked, cropped, rotated or beautified. If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel.
|
|
1003
|
+
*
|
|
1004
|
+
* @param sourceType Video source types, including cameras, screens, or media player. See VideoSourceType.
|
|
1005
|
+
* @param videoFrame The video frame. See VideoFrame.The default value of the video frame data format obtained through this callback is as follows:macOS: YUV 420Windows: YUV 420
|
|
990
1006
|
*
|
|
991
1007
|
* @returns
|
|
992
|
-
* When the video processing mode is ProcessModeReadOnly:true: Reserved for future use.false: Reserved for future use.When the video processing mode is ProcessModeReadWrite:true: Sets the SDK to receive the video frame.false: Sets the SDK to discard the video frame.
|
|
1008
|
+
* When the video processing mode is ProcessModeReadOnly : true : Reserved for future use. false : Reserved for future use. When the video processing mode is ProcessModeReadWrite : true : Sets the SDK to receive the video frame. false : Sets the SDK to discard the video frame.
|
|
993
1009
|
*/
|
|
994
1010
|
onCaptureVideoFrame?(
|
|
995
1011
|
sourceType: VideoSourceType,
|
|
996
1012
|
videoFrame: VideoFrame
|
|
997
|
-
):
|
|
1013
|
+
): void;
|
|
998
1014
|
|
|
999
1015
|
/**
|
|
1000
1016
|
* Occurs each time the SDK receives a video frame before encoding.
|
|
1001
|
-
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios.After processing, you can send the processed video data back to the SDK in this callback.The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
|
|
1002
1017
|
*
|
|
1003
|
-
*
|
|
1004
|
-
*
|
|
1018
|
+
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios. After processing, you can send the processed video data back to the SDK in this callback. The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
|
|
1019
|
+
*
|
|
1020
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
1021
|
+
* @param videoFrame The video frame. See VideoFrame.The default value of the video frame data format obtained through this callback is as follows:
|
|
1005
1022
|
* macOS: YUV 420
|
|
1006
1023
|
* Windows: YUV 420
|
|
1007
1024
|
*
|
|
1008
1025
|
* @returns
|
|
1009
|
-
* When the video processing mode is ProcessModeReadOnly:
|
|
1010
|
-
* true: Reserved for future use.
|
|
1011
|
-
* false: Reserved for future use. When the video processing mode is ProcessModeReadWrite:
|
|
1012
|
-
* true: Sets the SDK to receive the video frame.
|
|
1013
|
-
* false: Sets the SDK to discard the video frame.
|
|
1026
|
+
* When the video processing mode is ProcessModeReadOnly :
|
|
1027
|
+
* true : Reserved for future use.
|
|
1028
|
+
* false : Reserved for future use. When the video processing mode is ProcessModeReadWrite :
|
|
1029
|
+
* true : Sets the SDK to receive the video frame.
|
|
1030
|
+
* false : Sets the SDK to discard the video frame.
|
|
1014
1031
|
*/
|
|
1015
1032
|
onPreEncodeVideoFrame?(
|
|
1016
1033
|
sourceType: VideoSourceType,
|
|
1017
1034
|
videoFrame: VideoFrame
|
|
1018
|
-
):
|
|
1035
|
+
): void;
|
|
1019
1036
|
|
|
1020
1037
|
/**
|
|
1021
1038
|
* @ignore
|
|
1022
1039
|
*/
|
|
1023
|
-
onMediaPlayerVideoFrame?(
|
|
1024
|
-
videoFrame: VideoFrame,
|
|
1025
|
-
mediaPlayerId: number
|
|
1026
|
-
): boolean;
|
|
1040
|
+
onMediaPlayerVideoFrame?(videoFrame: VideoFrame, mediaPlayerId: number): void;
|
|
1027
1041
|
|
|
1028
1042
|
/**
|
|
1029
1043
|
* Occurs each time the SDK receives a video frame sent by the remote user.
|
|
1030
|
-
*
|
|
1044
|
+
*
|
|
1045
|
+
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data sent from the remote end before rendering, and then process it according to the particular scenarios. If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel.
|
|
1031
1046
|
*
|
|
1032
1047
|
* @param channelId The channel ID.
|
|
1033
1048
|
* @param remoteUid The user ID of the remote user who sends the current video frame.
|
|
1034
|
-
* @param videoFrame The video frame. See VideoFrame
|
|
1049
|
+
* @param videoFrame The video frame. See VideoFrame.The default value of the video frame data format obtained through this callback is as follows:macOS: YUV 420Windows: YUV 420
|
|
1035
1050
|
*
|
|
1036
1051
|
* @returns
|
|
1037
|
-
* When the video processing mode is ProcessModeReadOnly:true: Reserved for future use.false: Reserved for future use.When the video processing mode is ProcessModeReadWrite:true: Sets the SDK to receive the video frame.false: Sets the SDK to discard the video frame.
|
|
1052
|
+
* When the video processing mode is ProcessModeReadOnly : true : Reserved for future use. false : Reserved for future use. When the video processing mode is ProcessModeReadWrite : true : Sets the SDK to receive the video frame. false : Sets the SDK to discard the video frame.
|
|
1038
1053
|
*/
|
|
1039
1054
|
onRenderVideoFrame?(
|
|
1040
1055
|
channelId: string,
|
|
1041
1056
|
remoteUid: number,
|
|
1042
1057
|
videoFrame: VideoFrame
|
|
1043
|
-
):
|
|
1058
|
+
): void;
|
|
1044
1059
|
|
|
1045
1060
|
/**
|
|
1046
1061
|
* @ignore
|
|
1047
1062
|
*/
|
|
1048
|
-
onTranscodedVideoFrame?(videoFrame: VideoFrame):
|
|
1063
|
+
onTranscodedVideoFrame?(videoFrame: VideoFrame): void;
|
|
1049
1064
|
}
|
|
1050
1065
|
|
|
1051
1066
|
/**
|
|
@@ -1063,11 +1078,11 @@ export enum ExternalVideoSourceType {
|
|
|
1063
1078
|
}
|
|
1064
1079
|
|
|
1065
1080
|
/**
|
|
1066
|
-
*
|
|
1081
|
+
* @ignore
|
|
1067
1082
|
*/
|
|
1068
1083
|
export enum MediaRecorderContainerFormat {
|
|
1069
1084
|
/**
|
|
1070
|
-
*
|
|
1085
|
+
* @ignore
|
|
1071
1086
|
*/
|
|
1072
1087
|
FormatMp4 = 1,
|
|
1073
1088
|
}
|
|
@@ -270,7 +270,7 @@ export class PlayerStreamInfo {
|
|
|
270
270
|
*/
|
|
271
271
|
streamIndex?: number;
|
|
272
272
|
/**
|
|
273
|
-
* The type of the media stream. See MediaStreamType
|
|
273
|
+
* The type of the media stream. See MediaStreamType.
|
|
274
274
|
*/
|
|
275
275
|
streamType?: MediaStreamType;
|
|
276
276
|
/**
|
|
@@ -314,7 +314,7 @@ export class PlayerStreamInfo {
|
|
|
314
314
|
*/
|
|
315
315
|
audioBitsPerSample?: number;
|
|
316
316
|
/**
|
|
317
|
-
* The total duration (
|
|
317
|
+
* The total duration (ms) of the media stream.
|
|
318
318
|
*/
|
|
319
319
|
duration?: number;
|
|
320
320
|
}
|
|
@@ -378,7 +378,7 @@ export class PlayerUpdatedInfo {
|
|
|
378
378
|
*/
|
|
379
379
|
deviceId?: string;
|
|
380
380
|
/**
|
|
381
|
-
* The statistics about the media file being cached.If you call the openWithMediaSource method and set enableCache as true, the statistics about the media file being cached is updated every second after the media file is played. See CacheStatistics
|
|
381
|
+
* The statistics about the media file being cached.If you call the openWithMediaSource method and set enableCache as true, the statistics about the media file being cached is updated every second after the media file is played. See CacheStatistics.
|
|
382
382
|
*/
|
|
383
383
|
cacheStatistics?: CacheStatistics;
|
|
384
384
|
}
|
|
@@ -404,7 +404,7 @@ export class MediaSource {
|
|
|
404
404
|
*/
|
|
405
405
|
autoPlay?: boolean;
|
|
406
406
|
/**
|
|
407
|
-
* Whether to cache the media file when it is being played:true:Enables caching.false: (Default) Disables caching.Agora only supports caching on-demand audio and video streams that are not transmitted in HLS protocol.If you need to enable caching, pass in a value to uri; otherwise, caching is based on the url of the media file.If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See CacheStatistics
|
|
407
|
+
* Whether to cache the media file when it is being played:true:Enables caching.false: (Default) Disables caching.Agora only supports caching on-demand audio and video streams that are not transmitted in HLS protocol.If you need to enable caching, pass in a value to uri; otherwise, caching is based on the url of the media file.If you enable this function, the Media Player caches part of the media file being played on your local device, and you can play the cached media file without internet connection. The statistics about the media file being cached are updated every second after the media file is played. See CacheStatistics.
|
|
408
408
|
*/
|
|
409
409
|
enableCache?: boolean;
|
|
410
410
|
/**
|
package/ts/Private/IAgoraLog.ts
CHANGED
|
@@ -76,7 +76,7 @@ export class LogConfig {
|
|
|
76
76
|
*/
|
|
77
77
|
fileSizeInKB?: number;
|
|
78
78
|
/**
|
|
79
|
-
* The output level of the SDK log file. See LogLevel
|
|
79
|
+
* The output level of the SDK log file. See LogLevel.For example, if you set the log level to WARN, the SDK outputs the logs within levels FATAL, ERROR, and WARN.
|
|
80
80
|
*/
|
|
81
81
|
level?: LogLevel;
|
|
82
82
|
}
|
|
@@ -42,40 +42,37 @@ export enum AudioMixingDualMonoMode {
|
|
|
42
42
|
export abstract class IMediaEngine {
|
|
43
43
|
/**
|
|
44
44
|
* Registers an audio frame observer object.
|
|
45
|
-
* Call this method to register an audio frame observer object (register a callback). When you need the SDK to trigger onMixedAudioFrame , onRecordAudioFrame , onPlaybackAudioFrame or onEarMonitoringAudioFrame callback, you need to use this method to register the callbacks.Ensure that you call this method before joining a channel.
|
|
46
45
|
*
|
|
47
|
-
*
|
|
46
|
+
* Call this method to register an audio frame observer object (register a callback). When you need the SDK to trigger onMixedAudioFrame , onRecordAudioFrame , onPlaybackAudioFrame or onEarMonitoringAudioFrame callback, you need to use this method to register the callbacks. Ensure that you call this method before joining a channel.
|
|
47
|
+
*
|
|
48
|
+
* @param observer The observer object instance. See IAudioFrameObserver. Agora recommends calling this method after receiving onLeaveChannel to release the audio observer object.
|
|
48
49
|
*
|
|
49
50
|
* @returns
|
|
50
|
-
* 0: Success
|
|
51
|
+
* 0: Success. < 0: Failure.
|
|
51
52
|
*/
|
|
52
53
|
abstract registerAudioFrameObserver(observer: IAudioFrameObserver): number;
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* Registers a raw video frame observer object.
|
|
56
|
-
* If you want to obtain the original video data of some remote users (referred to as group A) and the encoded video data of other remote users (referred to as group B), you can refer to the following steps:
|
|
57
|
-
* Call registerVideoFrameObserver to register the raw video frame observer before joining the channel.
|
|
58
|
-
* Call registerVideoEncodedFrameObserver to register the encoded video frame observer before joining the channel.
|
|
59
|
-
* After joining the channel, get the user IDs of group B users through onUserJoined , and then call setRemoteVideoSubscriptionOptions to set the encodedFrameOnly of this group of users to true.
|
|
60
|
-
* Call muteAllRemoteVideoStreams (false) to start receiving the video streams of all remote users. Then:
|
|
61
|
-
* The raw video data of group A users can be obtained through the callback in IVideoFrameObserver , and the SDK renders the data by default.
|
|
62
|
-
* The encoded video data of group B users can be obtained through the callback in IVideoEncodedFrameObserver . If you want to observe raw video frames (such as YUV or RGBA format), Agora recommends that you implement one IVideoFrameObserver class with this method.When calling this method to register a video observer, you can register callbacks in the IVideoFrameObserver class as needed. After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received.Ensure that you call this method before joining a channel.When handling the video data returned in the callbacks, pay attention to the changes in the width and height parameters, which may be adapted under the following circumstances:When network conditions deteriorate, the video resolution decreases incrementally.If the user adjusts the video profile, the resolution of the video returned in the callbacks also changes.
|
|
63
57
|
*
|
|
64
|
-
*
|
|
58
|
+
* If you want to obtain the original video data of some remote users (referred to as group A) and the encoded video data of other remote users (referred to as group B), you can refer to the following steps: Call registerVideoFrameObserver to register the raw video frame observer before joining the channel. Call registerVideoEncodedFrameObserver to register the encoded video frame observer before joining the channel. After joining the channel, get the user IDs of group B users through onUserJoined , and then call setRemoteVideoSubscriptionOptions to set the encodedFrameOnly of this group of users to true . Call muteAllRemoteVideoStreams ( false ) to start receiving the video streams of all remote users. Then: The raw video data of group A users can be obtained through the callback in IVideoFrameObserver , and the SDK renders the data by default. The encoded video data of group B users can be obtained through the callback in IVideoEncodedFrameObserver . If you want to observe raw video frames (such as YUV or RGBA format), Agora recommends that you implement one IVideoFrameObserver class with this method. When calling this method to register a video observer, you can register callbacks in the IVideoFrameObserver class as needed. After you successfully register the video frame observer, the SDK triggers the registered callbacks each time a video frame is received. Ensure that you call this method before joining a channel. When handling the video data returned in the callbacks, pay attention to the changes in the width and height parameters, which may be adapted under the following circumstances: When network conditions deteriorate, the video resolution decreases incrementally. If the user adjusts the video profile, the resolution of the video returned in the callbacks also changes.
|
|
59
|
+
*
|
|
60
|
+
* @param observer The observer object instance. See IVideoFrameObserver.
|
|
65
61
|
*
|
|
66
62
|
* @returns
|
|
67
|
-
* 0: Success
|
|
63
|
+
* 0: Success. < 0: Failure.
|
|
68
64
|
*/
|
|
69
65
|
abstract registerVideoFrameObserver(observer: IVideoFrameObserver): number;
|
|
70
66
|
|
|
71
67
|
/**
|
|
72
68
|
* Registers a receiver object for the encoded video image.
|
|
73
|
-
* If you only want to observe encoded video frames (such as h.264 format) without decoding and rendering the video, Agora recommends that you implement one IVideoEncodedFrameObserver class through this method.If you want to obtain the original video data of some remote users (referred to as group A) and the encoded video data of other remote users (referred to as group B), you can refer to the following steps:Call registerVideoFrameObserver to register the raw video frame observer before joining the channel.Call registerVideoEncodedFrameObserver to register the encoded video frame observer before joining the channel.After joining the channel, get the user IDs of group B users through onUserJoined , and then call setRemoteVideoSubscriptionOptions to set the encodedFrameOnly of this group of users to true.Call muteAllRemoteVideoStreams (false) to start receiving the video streams of all remote users. Then:The raw video data of group A users can be obtained through the callback in IVideoFrameObserver , and the SDK renders the data by default.The encoded video data of group B users can be obtained through the callback in IVideoEncodedFrameObserver .Call this method before joining a channel.
|
|
74
69
|
*
|
|
75
|
-
*
|
|
70
|
+
* If you only want to observe encoded video frames (such as h.264 format) without decoding and rendering the video, Agora recommends that you implement one IVideoEncodedFrameObserver class through this method. If you want to obtain the original video data of some remote users (referred to as group A) and the encoded video data of other remote users (referred to as group B), you can refer to the following steps: Call registerVideoFrameObserver to register the raw video frame observer before joining the channel. Call registerVideoEncodedFrameObserver to register the encoded video frame observer before joining the channel. After joining the channel, get the user IDs of group B users through onUserJoined , and then call setRemoteVideoSubscriptionOptions to set the encodedFrameOnly of this group of users to true . Call muteAllRemoteVideoStreams ( false ) to start receiving the video streams of all remote users. Then: The raw video data of group A users can be obtained through the callback in IVideoFrameObserver , and the SDK renders the data by default. The encoded video data of group B users can be obtained through the callback in IVideoEncodedFrameObserver . Call this method before joining a channel.
|
|
71
|
+
*
|
|
72
|
+
* @param observer The video frame observer object. See IVideoEncodedFrameObserver.
|
|
76
73
|
*
|
|
77
74
|
* @returns
|
|
78
|
-
* 0: Success
|
|
75
|
+
* 0: Success. < 0: Failure.
|
|
79
76
|
*/
|
|
80
77
|
abstract registerVideoEncodedFrameObserver(
|
|
81
78
|
observer: IVideoEncodedFrameObserver
|
|
@@ -84,34 +81,36 @@ export abstract class IMediaEngine {
|
|
|
84
81
|
/**
|
|
85
82
|
* Pushes the external audio frame.
|
|
86
83
|
*
|
|
87
|
-
* @param frame The external audio frame. See AudioFrame
|
|
84
|
+
* @param frame The external audio frame. See AudioFrame.
|
|
88
85
|
* @param trackId The audio track ID. If you want to publish a custom external audio source, set this parameter to the ID of the corresponding custom audio track you want to publish.
|
|
89
86
|
*
|
|
90
87
|
* @returns
|
|
91
|
-
* 0: Success
|
|
88
|
+
* 0: Success. < 0: Failure.
|
|
92
89
|
*/
|
|
93
90
|
abstract pushAudioFrame(frame: AudioFrame, trackId?: number): number;
|
|
94
91
|
|
|
95
92
|
/**
|
|
96
93
|
* Pulls the remote audio data.
|
|
97
|
-
*
|
|
94
|
+
*
|
|
95
|
+
* Before calling this method, you need to call setExternalAudioSink to notify the app to enable and set the external rendering. After a successful method call, the app pulls the decoded and mixed audio data for playback. This method only supports pulling data from custom audio source. If you need to pull the data captured by the SDK, do not call this method. Call this method after joining a channel. Once you enable the external audio sink, the app will not retrieve any audio data from the onPlaybackAudioFrame callback. The difference between this method and the onPlaybackAudioFrame callback is as follows: The SDK sends the audio data to the app through the onPlaybackAudioFrame callback. Any delay in processing the audio frames may result in audio jitter. After a successful method call, the app automatically pulls the audio data from the SDK. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
|
|
98
96
|
*
|
|
99
97
|
* @returns
|
|
100
|
-
* The AudioFrame instance, if the method call succeeds.An error code, if the call fails,.
|
|
98
|
+
* The AudioFrame instance, if the method call succeeds. An error code, if the call fails,.
|
|
101
99
|
*/
|
|
102
100
|
abstract pullAudioFrame(): AudioFrame;
|
|
103
101
|
|
|
104
102
|
/**
|
|
105
103
|
* Configures the external video source.
|
|
104
|
+
*
|
|
106
105
|
* Call this method before joining a channel.
|
|
107
106
|
*
|
|
108
107
|
* @param enabled Whether to use the external video source:true: Use the external video source. The SDK prepares to accept the external video frame.false: (Default) Do not use the external video source.
|
|
109
108
|
* @param useTexture Whether to use the external video frame in the Texture format.true: Use the external video frame in the Texture format.false: (Default) Do not use the external video frame in the Texture format.
|
|
110
|
-
* @param sourceType Whether the external video frame is encoded. See ExternalVideoSourceType
|
|
109
|
+
* @param sourceType Whether the external video frame is encoded. See ExternalVideoSourceType.
|
|
111
110
|
* @param encodedVideoOption Video encoding options. This parameter needs to be set if sourceType is EncodedVideoFrame. To set this parameter, contact .
|
|
112
111
|
*
|
|
113
112
|
* @returns
|
|
114
|
-
* 0: Success
|
|
113
|
+
* 0: Success. < 0: Failure.
|
|
115
114
|
*/
|
|
116
115
|
abstract setExternalVideoSource(
|
|
117
116
|
enabled: boolean,
|
|
@@ -122,17 +121,18 @@ export abstract class IMediaEngine {
|
|
|
122
121
|
|
|
123
122
|
/**
|
|
124
123
|
* Sets the external audio source parameters.
|
|
124
|
+
*
|
|
125
125
|
* Call this method before joining a channel.
|
|
126
126
|
*
|
|
127
127
|
* @param enabled Whether to enable the external audio source:true: Enable the external audio source.false: (Default) Disable the external audio source.
|
|
128
128
|
* @param sampleRate The sample rate (Hz) of the external audio source which can be set as 8000, 16000, 32000, 44100, or 48000.
|
|
129
129
|
* @param channels The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
|
|
130
|
-
* @param sourceNumber The number of external audio sources. The value of this parameter should be larger than 0. The SDK creates a corresponding number of custom audio tracks based on this parameter value and names the audio tracks starting from 0. In ChannelMediaOptions
|
|
130
|
+
* @param sourceNumber The number of external audio sources. The value of this parameter should be larger than 0. The SDK creates a corresponding number of custom audio tracks based on this parameter value and names the audio tracks starting from 0. In ChannelMediaOptions, you can set publishCustomAudioSourceId to the audio track ID you want to publish.
|
|
131
131
|
* @param localPlayback Whether to play the external audio source:true: Play the external audio source.false: (Default) Do not play the external source.
|
|
132
132
|
* @param publish Whether to publish audio to the remote users:true: (Default) Publish audio to the remote users.false: Do not publish audio to the remote users.
|
|
133
133
|
*
|
|
134
134
|
* @returns
|
|
135
|
-
* 0: Success
|
|
135
|
+
* 0: Success. < 0: Failure.
|
|
136
136
|
*/
|
|
137
137
|
abstract setExternalAudioSource(
|
|
138
138
|
enabled: boolean,
|
|
@@ -144,13 +144,14 @@ export abstract class IMediaEngine {
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Creates a customized audio track.
|
|
147
|
-
* When you need to publish multiple custom captured audios in the channel, you can refer to the following steps:Call this method to create a custom audio track and get the audio track ID.In ChannelMediaOptions of each channel, set publishCustomAduioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true.If you call pushAudioFrame trackId as the audio track ID set in step 2, you can publish the corresponding custom audio source in multiple channels.
|
|
148
147
|
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
148
|
+
* When you need to publish multiple custom captured audios in the channel, you can refer to the following steps: Call this method to create a custom audio track and get the audio track ID. In ChannelMediaOptions of each channel, set publishCustomAduioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true . If you call pushAudioFrame trackId as the audio track ID set in step 2, you can publish the corresponding custom audio source in multiple channels.
|
|
149
|
+
*
|
|
150
|
+
* @param trackType The type of the custom audio track. See AudioTrackType.
|
|
151
|
+
* @param config The configuration of the custom audio track. See AudioTrackConfig.
|
|
151
152
|
*
|
|
152
153
|
* @returns
|
|
153
|
-
* If the method call is successful, the audio track ID is returned as the unique identifier of the audio track.If the method call fails, a negative value is returned.
|
|
154
|
+
* If the method call is successful, the audio track ID is returned as the unique identifier of the audio track. If the method call fails, a negative value is returned.
|
|
154
155
|
*/
|
|
155
156
|
abstract createCustomAudioTrack(
|
|
156
157
|
trackType: AudioTrackType,
|
|
@@ -160,15 +161,16 @@ export abstract class IMediaEngine {
|
|
|
160
161
|
/**
|
|
161
162
|
* Destroys the specified audio track.
|
|
162
163
|
*
|
|
163
|
-
* @param trackId The custom audio track ID returned in createCustomAudioTrack
|
|
164
|
+
* @param trackId The custom audio track ID returned in createCustomAudioTrack.
|
|
164
165
|
*
|
|
165
166
|
* @returns
|
|
166
|
-
* 0: Success
|
|
167
|
+
* 0: Success. < 0: Failure.
|
|
167
168
|
*/
|
|
168
169
|
abstract destroyCustomAudioTrack(trackId: number): number;
|
|
169
170
|
|
|
170
171
|
/**
|
|
171
172
|
* Sets the external audio sink.
|
|
173
|
+
*
|
|
172
174
|
* This method applies to scenarios where you want to use external audio data for playback. After you set the external audio sink, you can call pullAudioFrame to pull remote audio frames. The app can process the remote audio and play it with the audio effects that you want.
|
|
173
175
|
*
|
|
174
176
|
* @param enabled Whether to enable or disable the external audio sink:true: Enables the external audio sink.false: (Default) Disables the external audio sink.
|
|
@@ -176,7 +178,7 @@ export abstract class IMediaEngine {
|
|
|
176
178
|
* @param channels The number of audio channels of the external audio sink:1: Mono.2: Stereo.
|
|
177
179
|
*
|
|
178
180
|
* @returns
|
|
179
|
-
* 0: Success
|
|
181
|
+
* 0: Success. < 0: Failure.
|
|
180
182
|
*/
|
|
181
183
|
abstract setExternalAudioSink(
|
|
182
184
|
enabled: boolean,
|
|
@@ -194,13 +196,14 @@ export abstract class IMediaEngine {
|
|
|
194
196
|
|
|
195
197
|
/**
|
|
196
198
|
* Pushes the external raw video frame to the SDK.
|
|
197
|
-
* If you call createCustomVideoTrack method to get the video track ID, set the customVideoTrackId parameter to the video track ID you want to publish in the ChannelMediaOptions of each channel, and set the publishCustomVideoTrack parameter to true, you can call this method to push the unencoded external video frame to the SDK.
|
|
198
199
|
*
|
|
199
|
-
*
|
|
200
|
+
* If you call createCustomVideoTrack method to get the video track ID, set the customVideoTrackId parameter to the video track ID you want to publish in the ChannelMediaOptions of each channel, and set the publishCustomVideoTrack parameter to true , you can call this method to push the unencoded external video frame to the SDK.
|
|
201
|
+
*
|
|
202
|
+
* @param frame The external raw video frame to be pushed. See ExternalVideoFrame.
|
|
200
203
|
* @param videoTrackId The video track ID returned by calling the createCustomVideoTrack method. The default value is 0.
|
|
201
204
|
*
|
|
202
205
|
* @returns
|
|
203
|
-
* 0: Success
|
|
206
|
+
* 0: Success. < 0: Failure.
|
|
204
207
|
*/
|
|
205
208
|
abstract pushVideoFrame(
|
|
206
209
|
frame: ExternalVideoFrame,
|
|
@@ -225,30 +228,30 @@ export abstract class IMediaEngine {
|
|
|
225
228
|
/**
|
|
226
229
|
* Unregisters an audio frame observer.
|
|
227
230
|
*
|
|
228
|
-
* @param observer The audio frame observer, reporting the reception of each audio frame. See IAudioFrameObserver
|
|
231
|
+
* @param observer The audio frame observer, reporting the reception of each audio frame. See IAudioFrameObserver.
|
|
229
232
|
*
|
|
230
233
|
* @returns
|
|
231
|
-
* 0: Success
|
|
234
|
+
* 0: Success. < 0: Failure.
|
|
232
235
|
*/
|
|
233
236
|
abstract unregisterAudioFrameObserver(observer: IAudioFrameObserver): number;
|
|
234
237
|
|
|
235
238
|
/**
|
|
236
239
|
* Unregisters the video frame observer.
|
|
237
240
|
*
|
|
238
|
-
* @param observer The video observer, reporting the reception of each video frame. See IVideoFrameObserver
|
|
241
|
+
* @param observer The video observer, reporting the reception of each video frame. See IVideoFrameObserver.
|
|
239
242
|
*
|
|
240
243
|
* @returns
|
|
241
|
-
* 0: Success
|
|
244
|
+
* 0: Success. < 0: Failure.
|
|
242
245
|
*/
|
|
243
246
|
abstract unregisterVideoFrameObserver(observer: IVideoFrameObserver): number;
|
|
244
247
|
|
|
245
248
|
/**
|
|
246
249
|
* Unregisters a receiver object for the encoded video image.
|
|
247
250
|
*
|
|
248
|
-
* @param observer The video observer, reporting the reception of each video frame. See IVideoEncodedFrameObserver
|
|
251
|
+
* @param observer The video observer, reporting the reception of each video frame. See IVideoEncodedFrameObserver.
|
|
249
252
|
*
|
|
250
253
|
* @returns
|
|
251
|
-
* 0: Success
|
|
254
|
+
* 0: Success. < 0: Failure.
|
|
252
255
|
*/
|
|
253
256
|
abstract unregisterVideoEncodedFrameObserver(
|
|
254
257
|
observer: IVideoEncodedFrameObserver
|