diff --git a/.eslintignore b/.eslintignore index dec255e..1288c44 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,3 @@ build/ **/dist/* -**/node_modules/* -test/ \ No newline at end of file +**/node_modules/* \ No newline at end of file diff --git a/packages/@iris/rtc/.dist/@iris/web-rtc.d.mts b/packages/@iris/rtc/.dist/@iris/web-rtc.d.mts deleted file mode 100644 index cb49f9b..0000000 --- a/packages/@iris/rtc/.dist/@iris/web-rtc.d.mts +++ /dev/null @@ -1,2996 +0,0 @@ -import { CallApiReturnType } from 'iris-web-core'; - -declare enum VIDEO_SOURCE_TYPE { - VIDEO_SOURCE_CAMERA_PRIMARY = 0, - VIDEO_SOURCE_CAMERA = 0, - VIDEO_SOURCE_CAMERA_SECONDARY = 1, - VIDEO_SOURCE_SCREEN_PRIMARY = 2, - VIDEO_SOURCE_SCREEN = 2, - VIDEO_SOURCE_SCREEN_SECONDARY = 3, - VIDEO_SOURCE_CUSTOM = 4, - VIDEO_SOURCE_MEDIA_PLAYER = 5, - VIDEO_SOURCE_RTC_IMAGE_PNG = 6, - VIDEO_SOURCE_RTC_IMAGE_JPEG = 7, - VIDEO_SOURCE_RTC_IMAGE_GIF = 8, - VIDEO_SOURCE_REMOTE = 9, - VIDEO_SOURCE_TRANSCODED = 10, - VIDEO_SOURCE_CAMERA_THIRD = 11, - VIDEO_SOURCE_CAMERA_FOURTH = 12, - VIDEO_SOURCE_SCREEN_THIRD = 13, - VIDEO_SOURCE_SCREEN_FOURTH = 14, - VIDEO_SOURCE_UNKNOWN = 100 -} -declare enum AudioRoute { - ROUTE_DEFAULT = -1, - ROUTE_HEADSET = 0, - ROUTE_EARPIECE = 1, - ROUTE_HEADSETNOMIC = 2, - ROUTE_SPEAKERPHONE = 3, - ROUTE_LOUDSPEAKER = 4, - ROUTE_HEADSETBLUETOOTH = 5, - ROUTE_USB = 6, - ROUTE_HDMI = 7, - ROUTE_DISPLAYPORT = 8, - ROUTE_AIRPLAY = 9 -} -declare enum BYTES_PER_SAMPLE { - TWO_BYTES_PER_SAMPLE = 2 -} -declare class AudioParameters { - sample_rate?: number; - channels?: number; - frames_per_buffer?: number; -} -declare enum RAW_AUDIO_FRAME_OP_MODE_TYPE { - RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0, - RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2 -} -declare enum MEDIA_SOURCE_TYPE { - AUDIO_PLAYOUT_SOURCE = 0, - AUDIO_RECORDING_SOURCE = 1, - PRIMARY_CAMERA_SOURCE = 2, - SECONDARY_CAMERA_SOURCE = 3, - PRIMARY_SCREEN_SOURCE = 4, - SECONDARY_SCREEN_SOURCE = 5, - CUSTOM_VIDEO_SOURCE = 6, - MEDIA_PLAYER_SOURCE = 7, - RTC_IMAGE_PNG_SOURCE = 8, - RTC_IMAGE_JPEG_SOURCE = 9, - RTC_IMAGE_GIF_SOURCE = 10, - REMOTE_VIDEO_SOURCE = 11, - TRANSCODED_VIDEO_SOURCE = 12, - UNKNOWN_MEDIA_SOURCE = 100 -} -declare enum CONTENT_INSPECT_RESULT { - CONTENT_INSPECT_NEUTRAL = 1, - CONTENT_INSPECT_SEXY = 2, - CONTENT_INSPECT_PORN = 3 -} -declare enum CONTENT_INSPECT_TYPE { - CONTENT_INSPECT_INVALID = 0, - CONTENT_INSPECT_MODERATION = 1, - CONTENT_INSPECT_SUPERVISION = 2, - CONTENT_INSPECT_IMAGE_MODERATION = 3 -} -declare class ContentInspectModule { - type?: CONTENT_INSPECT_TYPE; - interval?: number; -} -declare class ContentInspectConfig { - extraInfo?: string; - serverConfig?: string; - modules?: ContentInspectModule; - moduleCount?: number; -} -declare class PacketOptions { - timestamp?: number; - audioLevelIndication?: number; -} -declare class AudioEncodedFrameInfo { - sendTs?: number; - codec?: number; -} -declare class AudioPcmFrame { - capture_timestamp?: number; - samples_per_channel_?: number; - sample_rate_hz_?: number; - num_channels_?: number; - bytes_per_sample?: BYTES_PER_SAMPLE; - data_?: number; -} -declare enum AUDIO_DUAL_MONO_MODE { - AUDIO_DUAL_MONO_STEREO = 0, - AUDIO_DUAL_MONO_L = 1, - AUDIO_DUAL_MONO_R = 2, - AUDIO_DUAL_MONO_MIX = 3 -} -declare enum VIDEO_PIXEL_FORMAT { - VIDEO_PIXEL_DEFAULT = 0, - VIDEO_PIXEL_I420 = 1, - VIDEO_PIXEL_BGRA = 2, - VIDEO_PIXEL_NV21 = 3, - VIDEO_PIXEL_RGBA = 4, - VIDEO_PIXEL_NV12 = 8, - VIDEO_TEXTURE_2D = 10, - VIDEO_TEXTURE_OES = 11, - VIDEO_CVPIXEL_NV12 = 12, - VIDEO_CVPIXEL_I420 = 13, - VIDEO_CVPIXEL_BGRA = 14, - VIDEO_PIXEL_I422 = 16, - VIDEO_TEXTURE_ID3D11TEXTURE2D = 17 -} -declare enum RENDER_MODE_TYPE { - RENDER_MODE_HIDDEN = 1, - RENDER_MODE_FIT = 2, - RENDER_MODE_ADAPTIVE = 3 -} -declare enum CAMERA_VIDEO_SOURCE_TYPE { - CAMERA_SOURCE_FRONT = 0, - CAMERA_SOURCE_BACK = 1, - VIDEO_SOURCE_UNSPECIFIED = 2 -} -declare enum EGL_CONTEXT_TYPE { - EGL_CONTEXT10 = 0, - EGL_CONTEXT14 = 1 -} -declare enum VIDEO_BUFFER_TYPE { - VIDEO_BUFFER_RAW_DATA = 1, - VIDEO_BUFFER_ARRAY = 2, - VIDEO_BUFFER_TEXTURE = 3 -} -declare class ExternalVideoFrame { - type?: VIDEO_BUFFER_TYPE; - format?: VIDEO_PIXEL_FORMAT; - buffer?: void[]; - stride?: number; - height?: number; - cropLeft?: number; - cropTop?: number; - cropRight?: number; - cropBottom?: number; - rotation?: number; - timestamp?: number; - eglType?: EGL_CONTEXT_TYPE; - textureId?: number; - matrix?: number; - metadata_buffer?: Uint8Array; - metadata_size?: number; - alphaBuffer?: Uint8Array; - texture_slice_index?: number; -} -declare class VideoFrame { - type?: VIDEO_PIXEL_FORMAT; - width?: number; - height?: number; - yStride?: number; - uStride?: number; - vStride?: number; - yBuffer?: Uint8Array; - uBuffer?: Uint8Array; - vBuffer?: Uint8Array; - rotation?: number; - renderTimeMs?: number; - avsync_type?: number; - metadata_buffer?: Uint8Array; - metadata_size?: number; - textureId?: number; - matrix?: number; - alphaBuffer?: Uint8Array; - pixelBuffer?: void[]; -} -declare enum MEDIA_PLAYER_SOURCE_TYPE { - MEDIA_PLAYER_SOURCE_DEFAULT = 0, - MEDIA_PLAYER_SOURCE_FULL_FEATURED = 1, - MEDIA_PLAYER_SOURCE_SIMPLE = 2 -} -declare enum VIDEO_MODULE_POSITION { - POSITION_POST_CAPTURER = 1, - POSITION_PRE_RENDERER = 1, - POSITION_PRE_ENCODER = 1 -} -interface IAudioPcmFrameSink { - onFrame(frame: AudioPcmFrame[]): void; -} -declare enum AUDIO_FRAME_TYPE { - FRAME_TYPE_PCM16 = 0 -} -declare class AudioFrame { - type?: AUDIO_FRAME_TYPE; - samplesPerChannel?: number; - bytesPerSample?: BYTES_PER_SAMPLE; - channels?: number; - samplesPerSec?: number; - buffer?: void[]; - renderTimeMs?: number; - avsync_type?: number; - presentationMs?: number; -} -declare enum AUDIO_FRAME_POSITION { - AUDIO_FRAME_POSITION_NONE = 0, - AUDIO_FRAME_POSITION_PLAYBACK = 1, - AUDIO_FRAME_POSITION_RECORD = 2, - AUDIO_FRAME_POSITION_MIXED = 4, - AUDIO_FRAME_POSITION_BEFORE_MIXING = 8, - AUDIO_FRAME_POSITION_EAR_MONITORING = 16 -} -declare class AudioParams { - sample_rate?: number; - channels?: number; - mode?: RAW_AUDIO_FRAME_OP_MODE_TYPE; - samples_per_call?: number; -} -interface IAudioFrameObserverBase { - onRecordAudioFrame(channelId: string, audioFrame: AudioFrame): boolean; - onPlaybackAudioFrame(channelId: string, audioFrame: AudioFrame): boolean; - onMixedAudioFrame(channelId: string, audioFrame: AudioFrame): boolean; - onEarMonitoringAudioFrame(audioFrame: AudioFrame): boolean; -} -interface IAudioFrameObserver extends IAudioFrameObserverBase { - onPlaybackAudioFrameBeforeMixing(channelId: string, uid: number, audioFrame: AudioFrame): boolean; -} -declare class AudioSpectrumData { - audioSpectrumData?: number[]; - dataLength?: number; -} -declare class UserAudioSpectrumInfo { - uid?: number; - spectrumData?: AudioSpectrumData; -} -interface IAudioSpectrumObserver { - onLocalAudioSpectrum(data: AudioSpectrumData): boolean; - onRemoteAudioSpectrum(spectrums: UserAudioSpectrumInfo[], spectrumNumber: number): boolean; -} -interface IVideoEncodedFrameObserver { - onEncodedVideoFrameReceived(uid: number, imageBuffer: Uint8Array, length: number, videoEncodedFrameInfo: EncodedVideoFrameInfo): boolean; -} -declare enum VIDEO_FRAME_PROCESS_MODE { - PROCESS_MODE_READ_ONLY = 0, - PROCESS_MODE_READ_WRITE = 1 -} -interface IVideoFrameObserver { - onCaptureVideoFrame(sourceType: VIDEO_SOURCE_TYPE, videoFrame: VideoFrame): boolean; - onPreEncodeVideoFrame(sourceType: VIDEO_SOURCE_TYPE, videoFrame: VideoFrame): boolean; - onMediaPlayerVideoFrame(videoFrame: VideoFrame, mediaPlayerId: number): boolean; - onRenderVideoFrame(channelId: string, remoteUid: number, videoFrame: VideoFrame): boolean; - onTranscodedVideoFrame(videoFrame: VideoFrame): boolean; -} -declare enum EXTERNAL_VIDEO_SOURCE_TYPE { - VIDEO_FRAME = 0, - ENCODED_VIDEO_FRAME = 1 -} -declare enum MediaRecorderContainerFormat { - FORMAT_MP4 = 1 -} -declare enum MediaRecorderStreamType { - STREAM_TYPE_AUDIO = 1, - STREAM_TYPE_VIDEO = 2, - STREAM_TYPE_BOTH = 3 -} -declare enum RecorderState { - RECORDER_STATE_ERROR = -1, - RECORDER_STATE_START = 2, - RECORDER_STATE_STOP = 3 -} -declare enum RecorderErrorCode { - RECORDER_ERROR_NONE = 0, - RECORDER_ERROR_WRITE_FAILED = 1, - RECORDER_ERROR_NO_STREAM = 2, - RECORDER_ERROR_OVER_MAX_DURATION = 3, - RECORDER_ERROR_CONFIG_CHANGED = 4 -} -declare class MediaRecorderConfiguration { - storagePath?: string; - containerFormat?: MediaRecorderContainerFormat; - streamType?: MediaRecorderStreamType; - maxDurationMs?: number; - recorderInfoUpdateInterval?: number; -} -declare class RecorderInfo { - fileName?: string; - durationMs?: number; - fileSize?: number; -} -interface IMediaRecorderObserver { - onRecorderStateChanged(channelId: string, uid: number, state: RecorderState, error: RecorderErrorCode): void; - onRecorderInfoUpdated(channelId: string, uid: number, info: RecorderInfo): void; -} - -declare enum CHANNEL_PROFILE_TYPE { - CHANNEL_PROFILE_COMMUNICATION = 0, - CHANNEL_PROFILE_LIVE_BROADCASTING = 1, - CHANNEL_PROFILE_GAME = 2, - CHANNEL_PROFILE_CLOUD_GAMING = 3, - CHANNEL_PROFILE_COMMUNICATION_1v1 = 4 -} -declare enum WARN_CODE_TYPE { - WARN_INVALID_VIEW = 8, - WARN_INIT_VIDEO = 16, - WARN_PENDING = 20, - WARN_NO_AVAILABLE_CHANNEL = 103, - WARN_LOOKUP_CHANNEL_TIMEOUT = 104, - WARN_LOOKUP_CHANNEL_REJECTED = 105, - WARN_OPEN_CHANNEL_TIMEOUT = 106, - WARN_OPEN_CHANNEL_REJECTED = 107, - WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111, - WARN_SET_CLIENT_ROLE_TIMEOUT = 118, - WARN_OPEN_CHANNEL_INVALID_TICKET = 121, - WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122, - WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131, - WARN_CHANNEL_CONNECTION_IP_CHANGED = 132, - WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133, - WARN_CHANNEL_SOCKET_ERROR = 134, - WARN_AUDIO_MIXING_OPEN_ERROR = 701, - WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014, - WARN_ADM_RUNTIME_RECORDING_WARNING = 1016, - WARN_ADM_RECORD_AUDIO_SILENCE = 1019, - WARN_ADM_PLAYOUT_MALFUNCTION = 1020, - WARN_ADM_RECORD_MALFUNCTION = 1021, - WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031, - WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032, - WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040, - WARN_APM_HOWLING = 1051, - WARN_ADM_GLITCH_STATE = 1052, - WARN_ADM_IMPROPER_SETTINGS = 1053, - WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, - WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, - WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324 -} -declare enum ERROR_CODE_TYPE { - ERR_OK = 0, - ERR_FAILED = 1, - ERR_INVALID_ARGUMENT = 2, - ERR_NOT_READY = 3, - ERR_NOT_SUPPORTED = 4, - ERR_REFUSED = 5, - ERR_BUFFER_TOO_SMALL = 6, - ERR_NOT_INITIALIZED = 7, - ERR_INVALID_STATE = 8, - ERR_NO_PERMISSION = 9, - ERR_TIMEDOUT = 10, - ERR_CANCELED = 11, - ERR_TOO_OFTEN = 12, - ERR_BIND_SOCKET = 13, - ERR_NET_DOWN = 14, - ERR_JOIN_CHANNEL_REJECTED = 17, - ERR_LEAVE_CHANNEL_REJECTED = 18, - ERR_ALREADY_IN_USE = 19, - ERR_ABORTED = 20, - ERR_INIT_NET_ENGINE = 21, - ERR_RESOURCE_LIMITED = 22, - ERR_INVALID_APP_ID = 101, - ERR_INVALID_CHANNEL_NAME = 102, - ERR_NO_SERVER_RESOURCES = 103, - ERR_TOKEN_EXPIRED = 109, - ERR_INVALID_TOKEN = 110, - ERR_CONNECTION_INTERRUPTED = 111, - ERR_CONNECTION_LOST = 112, - ERR_NOT_IN_CHANNEL = 113, - ERR_SIZE_TOO_LARGE = 114, - ERR_BITRATE_LIMIT = 115, - ERR_TOO_MANY_DATA_STREAMS = 116, - ERR_STREAM_MESSAGE_TIMEOUT = 117, - ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119, - ERR_DECRYPTION_FAILED = 120, - ERR_INVALID_USER_ID = 121, - ERR_CLIENT_IS_BANNED_BY_SERVER = 123, - ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130, - ERR_LICENSE_CREDENTIAL_INVALID = 131, - ERR_INVALID_USER_ACCOUNT = 134, - ERR_MODULE_NOT_FOUND = 157, - ERR_CERT_RAW = 157, - ERR_CERT_JSON_PART = 158, - ERR_CERT_JSON_INVAL = 159, - ERR_CERT_JSON_NOMEM = 160, - ERR_CERT_CUSTOM = 161, - ERR_CERT_CREDENTIAL = 162, - ERR_CERT_SIGN = 163, - ERR_CERT_FAIL = 164, - ERR_CERT_BUF = 165, - ERR_CERT_NULL = 166, - ERR_CERT_DUEDATE = 167, - ERR_CERT_REQUEST = 168, - ERR_PCMSEND_FORMAT = 200, - ERR_PCMSEND_BUFFEROVERFLOW = 201, - ERR_LOGIN_ALREADY_LOGIN = 428, - ERR_LOAD_MEDIA_ENGINE = 1001, - ERR_ADM_GENERAL_ERROR = 1005, - ERR_ADM_INIT_PLAYOUT = 1008, - ERR_ADM_START_PLAYOUT = 1009, - ERR_ADM_STOP_PLAYOUT = 1010, - ERR_ADM_INIT_RECORDING = 1011, - ERR_ADM_START_RECORDING = 1012, - ERR_ADM_STOP_RECORDING = 1013, - ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501, - ERR_ADM_APPLICATION_LOOPBACK = 2007 -} -declare enum LICENSE_ERROR_TYPE { - LICENSE_ERR_INVALID = 1, - LICENSE_ERR_EXPIRE = 2, - LICENSE_ERR_MINUTES_EXCEED = 3, - LICENSE_ERR_LIMITED_PERIOD = 4, - LICENSE_ERR_DIFF_DEVICES = 5, - LICENSE_ERR_INTERNAL = 99 -} -declare enum AUDIO_SESSION_OPERATION_RESTRICTION { - AUDIO_SESSION_OPERATION_RESTRICTION_NONE = 0, - AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY = 1, - AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION = 1, - AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION = 1, - AUDIO_SESSION_OPERATION_RESTRICTION_ALL = 1 -} -declare enum USER_OFFLINE_REASON_TYPE { - USER_OFFLINE_QUIT = 0, - USER_OFFLINE_DROPPED = 1, - USER_OFFLINE_BECOME_AUDIENCE = 2 -} -declare enum INTERFACE_ID_TYPE { - AGORA_IID_AUDIO_DEVICE_MANAGER = 1, - AGORA_IID_VIDEO_DEVICE_MANAGER = 2, - AGORA_IID_PARAMETER_ENGINE = 3, - AGORA_IID_MEDIA_ENGINE = 4, - AGORA_IID_AUDIO_ENGINE = 5, - AGORA_IID_VIDEO_ENGINE = 6, - AGORA_IID_RTC_CONNECTION = 7, - AGORA_IID_SIGNALING_ENGINE = 8, - AGORA_IID_MEDIA_ENGINE_REGULATOR = 9, - AGORA_IID_CLOUD_SPATIAL_AUDIO = 10, - AGORA_IID_LOCAL_SPATIAL_AUDIO = 11, - AGORA_IID_STATE_SYNC = 13, - AGORA_IID_METACHAT_SERVICE = 14, - AGORA_IID_MUSIC_CONTENT_CENTER = 15, - AGORA_IID_H265_TRANSCODER = 16 -} -declare enum QUALITY_TYPE { - QUALITY_UNKNOWN = 0, - QUALITY_EXCELLENT = 1, - QUALITY_GOOD = 2, - QUALITY_POOR = 3, - QUALITY_BAD = 4, - QUALITY_VBAD = 5, - QUALITY_DOWN = 6, - QUALITY_UNSUPPORTED = 7, - QUALITY_DETECTING = 8 -} -declare enum FIT_MODE_TYPE { - MODE_COVER = 1, - MODE_CONTAIN = 2 -} -declare enum VIDEO_ORIENTATION { - VIDEO_ORIENTATION_0 = 0, - VIDEO_ORIENTATION_90 = 90, - VIDEO_ORIENTATION_180 = 180, - VIDEO_ORIENTATION_270 = 270 -} -declare enum FRAME_RATE { - FRAME_RATE_FPS_1 = 1, - FRAME_RATE_FPS_7 = 7, - FRAME_RATE_FPS_10 = 10, - FRAME_RATE_FPS_15 = 15, - FRAME_RATE_FPS_24 = 24, - FRAME_RATE_FPS_30 = 30, - FRAME_RATE_FPS_60 = 60 -} -declare enum FRAME_WIDTH { - FRAME_WIDTH_960 = 960 -} -declare enum FRAME_HEIGHT { - FRAME_HEIGHT_540 = 540 -} -declare enum VIDEO_FRAME_TYPE { - VIDEO_FRAME_TYPE_BLANK_FRAME = 0, - VIDEO_FRAME_TYPE_KEY_FRAME = 3, - VIDEO_FRAME_TYPE_DELTA_FRAME = 4, - VIDEO_FRAME_TYPE_B_FRAME = 5, - VIDEO_FRAME_TYPE_DROPPABLE_FRAME = 6, - VIDEO_FRAME_TYPE_UNKNOW = 7 -} -declare enum ORIENTATION_MODE { - ORIENTATION_MODE_ADAPTIVE = 0, - ORIENTATION_MODE_FIXED_LANDSCAPE = 1, - ORIENTATION_MODE_FIXED_PORTRAIT = 2 -} -declare enum DEGRADATION_PREFERENCE { - MAINTAIN_QUALITY = 0, - MAINTAIN_FRAMERATE = 1, - MAINTAIN_BALANCED = 2, - MAINTAIN_RESOLUTION = 3, - DISABLED = 100 -} -declare class VideoDimensions { - width?: number; - height?: number; -} -declare enum SCREEN_CAPTURE_FRAMERATE_CAPABILITY { - SCREEN_CAPTURE_FRAMERATE_CAPABILITY_15_FPS = 0, - SCREEN_CAPTURE_FRAMERATE_CAPABILITY_30_FPS = 1, - SCREEN_CAPTURE_FRAMERATE_CAPABILITY_60_FPS = 2 -} -declare enum VIDEO_CODEC_CAPABILITY_LEVEL { - CODEC_CAPABILITY_LEVEL_UNSPECIFIED = -1, - CODEC_CAPABILITY_LEVEL_BASIC_SUPPORT = 5, - CODEC_CAPABILITY_LEVEL_1080P30FPS = 10, - CODEC_CAPABILITY_LEVEL_1080P60FPS = 20, - CODEC_CAPABILITY_LEVEL_4K60FPS = 30 -} -declare enum VIDEO_CODEC_TYPE { - VIDEO_CODEC_NONE = 0, - VIDEO_CODEC_VP8 = 1, - VIDEO_CODEC_H264 = 2, - VIDEO_CODEC_H265 = 3, - VIDEO_CODEC_GENERIC = 6, - VIDEO_CODEC_GENERIC_H264 = 7, - VIDEO_CODEC_AV1 = 12, - VIDEO_CODEC_VP9 = 13, - VIDEO_CODEC_GENERIC_JPEG = 20 -} -declare enum TCcMode { - CC_ENABLED = 0, - CC_DISABLED = 1 -} -declare class SenderOptions { - ccMode?: TCcMode; - codecType?: VIDEO_CODEC_TYPE; - targetBitrate?: number; -} -declare enum AUDIO_CODEC_TYPE { - AUDIO_CODEC_OPUS = 1, - AUDIO_CODEC_PCMA = 3, - AUDIO_CODEC_PCMU = 4, - AUDIO_CODEC_G722 = 5, - AUDIO_CODEC_AACLC = 8, - AUDIO_CODEC_HEAAC = 9, - AUDIO_CODEC_JC1 = 10, - AUDIO_CODEC_HEAAC2 = 11, - AUDIO_CODEC_LPCNET = 12 -} -declare enum AUDIO_ENCODING_TYPE { - AUDIO_ENCODING_TYPE_AAC_16000_LOW = 65793, - AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM = 65794, - AUDIO_ENCODING_TYPE_AAC_32000_LOW = 66049, - AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM = 66050, - AUDIO_ENCODING_TYPE_AAC_32000_HIGH = 66051, - AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM = 66306, - AUDIO_ENCODING_TYPE_AAC_48000_HIGH = 66307, - AUDIO_ENCODING_TYPE_OPUS_16000_LOW = 131329, - AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM = 131330, - AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM = 131842, - AUDIO_ENCODING_TYPE_OPUS_48000_HIGH = 131843 -} -declare enum WATERMARK_FIT_MODE { - FIT_MODE_COVER_POSITION = 0, - FIT_MODE_USE_IMAGE_RATIO = 1 -} -declare class EncodedAudioFrameAdvancedSettings { - speech?: boolean; - sendEvenIfEmpty?: boolean; -} -declare class EncodedAudioFrameInfo { - codec?: AUDIO_CODEC_TYPE; - sampleRateHz?: number; - samplesPerChannel?: number; - numberOfChannels?: number; - advancedSettings?: EncodedAudioFrameAdvancedSettings; - captureTimeMs?: number; -} -declare class AudioPcmDataInfo { - samplesPerChannel?: number; - channelNum?: number; - samplesOut?: number; - elapsedTimeMs?: number; - ntpTimeMs?: number; -} -declare enum H264PacketizeMode { - NonInterleaved = 0, - SingleNalUnit = 1 -} -declare enum VIDEO_STREAM_TYPE { - VIDEO_STREAM_HIGH = 0, - VIDEO_STREAM_LOW = 1 -} -declare class VideoSubscriptionOptions { - type?: VIDEO_STREAM_TYPE; - encodedFrameOnly?: boolean; -} -declare class EncodedVideoFrameInfo { - codecType?: VIDEO_CODEC_TYPE; - width?: number; - height?: number; - framesPerSecond?: number; - frameType?: VIDEO_FRAME_TYPE; - rotation?: VIDEO_ORIENTATION; - trackId?: number; - captureTimeMs?: number; - decodeTimeMs?: number; - uid?: number; - streamType?: VIDEO_STREAM_TYPE; -} -declare enum COMPRESSION_PREFERENCE { - PREFER_LOW_LATENCY = 0, - PREFER_QUALITY = 1 -} -declare enum ENCODING_PREFERENCE { - PREFER_AUTO = -1, - PREFER_SOFTWARE = 0, - PREFER_HARDWARE = 1 -} -declare class AdvanceOptions { - encodingPreference?: ENCODING_PREFERENCE; - compressionPreference?: COMPRESSION_PREFERENCE; -} -declare enum VIDEO_MIRROR_MODE_TYPE { - VIDEO_MIRROR_MODE_AUTO = 0, - VIDEO_MIRROR_MODE_ENABLED = 1, - VIDEO_MIRROR_MODE_DISABLED = 2 -} -declare enum CODEC_CAP_MASK { - CODEC_CAP_MASK_NONE = 0, - CODEC_CAP_MASK_HW_DEC = 1, - CODEC_CAP_MASK_HW_ENC = 1, - CODEC_CAP_MASK_SW_DEC = 1, - CODEC_CAP_MASK_SW_ENC = 1 -} -declare class CodecCapLevels { - hwDecodingLevel?: VIDEO_CODEC_CAPABILITY_LEVEL; - swDecodingLevel?: VIDEO_CODEC_CAPABILITY_LEVEL; -} -declare class CodecCapInfo { - codecType?: VIDEO_CODEC_TYPE; - codecCapMask?: number; - codecLevels?: CodecCapLevels; -} -declare class VideoEncoderConfiguration { - codecType?: VIDEO_CODEC_TYPE; - dimensions?: VideoDimensions; - frameRate?: number; - bitrate?: number; - minBitrate?: number; - orientationMode?: ORIENTATION_MODE; - degradationPreference?: DEGRADATION_PREFERENCE; - mirrorMode?: VIDEO_MIRROR_MODE_TYPE; - advanceOptions?: AdvanceOptions; -} -declare class DataStreamConfig { - syncWithAudio?: boolean; - ordered?: boolean; -} -declare enum SIMULCAST_STREAM_MODE { - AUTO_SIMULCAST_STREAM = -1, - DISABLE_SIMULCAST_STREAM = 0, - ENABLE_SIMULCAST_STREAM = 1 -} -declare class SimulcastStreamConfig { - dimensions?: VideoDimensions; - kBitrate?: number; - framerate?: number; -} -declare class Rectangle { - x?: number; - y?: number; - width?: number; - height?: number; -} -declare class WatermarkRatio { - xRatio?: number; - yRatio?: number; - widthRatio?: number; -} -declare class WatermarkOptions { - visibleInPreview?: boolean; - positionInLandscapeMode?: Rectangle; - positionInPortraitMode?: Rectangle; - watermarkRatio?: WatermarkRatio; - mode?: WATERMARK_FIT_MODE; -} -declare class RtcStats { - duration?: number; - txBytes?: number; - rxBytes?: number; - txAudioBytes?: number; - txVideoBytes?: number; - rxAudioBytes?: number; - rxVideoBytes?: number; - txKBitRate?: number; - rxKBitRate?: number; - rxAudioKBitRate?: number; - txAudioKBitRate?: number; - rxVideoKBitRate?: number; - txVideoKBitRate?: number; - lastmileDelay?: number; - userCount?: number; - cpuAppUsage?: number; - cpuTotalUsage?: number; - gatewayRtt?: number; - memoryAppUsageRatio?: number; - memoryTotalUsageRatio?: number; - memoryAppUsageInKbytes?: number; - connectTimeMs?: number; - firstAudioPacketDuration?: number; - firstVideoPacketDuration?: number; - firstVideoKeyFramePacketDuration?: number; - packetsBeforeFirstKeyFramePacket?: number; - firstAudioPacketDurationAfterUnmute?: number; - firstVideoPacketDurationAfterUnmute?: number; - firstVideoKeyFramePacketDurationAfterUnmute?: number; - firstVideoKeyFrameDecodedDurationAfterUnmute?: number; - firstVideoKeyFrameRenderedDurationAfterUnmute?: number; - txPacketLossRate?: number; - rxPacketLossRate?: number; -} -declare enum CLIENT_ROLE_TYPE { - CLIENT_ROLE_BROADCASTER = 1, - CLIENT_ROLE_AUDIENCE = 2 -} -declare enum QUALITY_ADAPT_INDICATION { - ADAPT_NONE = 0, - ADAPT_UP_BANDWIDTH = 1, - ADAPT_DOWN_BANDWIDTH = 2 -} -declare enum AUDIENCE_LATENCY_LEVEL_TYPE { - AUDIENCE_LATENCY_LEVEL_LOW_LATENCY = 1, - AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY = 2 -} -declare class ClientRoleOptions { - audienceLatencyLevel?: AUDIENCE_LATENCY_LEVEL_TYPE; -} -declare enum EXPERIENCE_QUALITY_TYPE { - EXPERIENCE_QUALITY_GOOD = 0, - EXPERIENCE_QUALITY_BAD = 1 -} -declare enum EXPERIENCE_POOR_REASON { - EXPERIENCE_REASON_NONE = 0, - REMOTE_NETWORK_QUALITY_POOR = 1, - LOCAL_NETWORK_QUALITY_POOR = 2, - WIRELESS_SIGNAL_POOR = 4, - WIFI_BLUETOOTH_COEXIST = 8 -} -declare enum AUDIO_AINS_MODE { - AINS_MODE_BALANCED = 0, - AINS_MODE_AGGRESSIVE = 1, - AINS_MODE_ULTRALOWLATENCY = 2 -} -declare enum AUDIO_PROFILE_TYPE { - AUDIO_PROFILE_DEFAULT = 0, - AUDIO_PROFILE_SPEECH_STANDARD = 1, - AUDIO_PROFILE_MUSIC_STANDARD = 2, - AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, - AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, - AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, - AUDIO_PROFILE_IOT = 6, - AUDIO_PROFILE_NUM = 7 -} -declare enum AUDIO_SCENARIO_TYPE { - AUDIO_SCENARIO_DEFAULT = 0, - AUDIO_SCENARIO_GAME_STREAMING = 3, - AUDIO_SCENARIO_CHATROOM = 5, - AUDIO_SCENARIO_CHORUS = 7, - AUDIO_SCENARIO_MEETING = 8, - AUDIO_SCENARIO_NUM = 9 -} -declare class VideoFormat { - width?: number; - height?: number; - fps?: number; -} -declare enum VIDEO_CONTENT_HINT { - CONTENT_HINT_NONE = 0, - CONTENT_HINT_MOTION = 1, - CONTENT_HINT_DETAILS = 2 -} -declare enum SCREEN_SCENARIO_TYPE { - SCREEN_SCENARIO_DOCUMENT = 1, - SCREEN_SCENARIO_GAMING = 2, - SCREEN_SCENARIO_VIDEO = 3, - SCREEN_SCENARIO_RDC = 4 -} -declare enum VIDEO_APPLICATION_SCENARIO_TYPE { - APPLICATION_SCENARIO_GENERAL = 0, - APPLICATION_SCENARIO_MEETING = 1 -} -declare enum CAPTURE_BRIGHTNESS_LEVEL_TYPE { - CAPTURE_BRIGHTNESS_LEVEL_INVALID = -1, - CAPTURE_BRIGHTNESS_LEVEL_NORMAL = 0, - CAPTURE_BRIGHTNESS_LEVEL_BRIGHT = 1, - CAPTURE_BRIGHTNESS_LEVEL_DARK = 2 -} -declare enum LOCAL_AUDIO_STREAM_STATE { - LOCAL_AUDIO_STREAM_STATE_STOPPED = 0, - LOCAL_AUDIO_STREAM_STATE_RECORDING = 1, - LOCAL_AUDIO_STREAM_STATE_ENCODING = 2, - LOCAL_AUDIO_STREAM_STATE_FAILED = 3 -} -declare enum LOCAL_AUDIO_STREAM_ERROR { - LOCAL_AUDIO_STREAM_ERROR_OK = 0, - LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1, - LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, - LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3, - LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4, - LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5, - LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE = 6, - LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE = 7, - LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED = 8, - LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID = 9, - LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID = 10 -} -declare enum LOCAL_VIDEO_STREAM_STATE { - LOCAL_VIDEO_STREAM_STATE_STOPPED = 0, - LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1, - LOCAL_VIDEO_STREAM_STATE_ENCODING = 2, - LOCAL_VIDEO_STREAM_STATE_FAILED = 3 -} -declare enum LOCAL_VIDEO_STREAM_ERROR { - LOCAL_VIDEO_STREAM_ERROR_OK = 0, - LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3, - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4, - LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5, - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND = 6, - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS = 7, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND = 8, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED = 9, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID = 10, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE = 101, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED = 11, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED = 12, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED = 13, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED = 20, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE = 21, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION = 22, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED = 23, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED = 24, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN = 25, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27 -} -declare enum REMOTE_AUDIO_STATE { - REMOTE_AUDIO_STATE_STOPPED = 0, - REMOTE_AUDIO_STATE_STARTING = 1, - REMOTE_AUDIO_STATE_DECODING = 2, - REMOTE_AUDIO_STATE_FROZEN = 3, - REMOTE_AUDIO_STATE_FAILED = 4 -} -declare enum REMOTE_AUDIO_STATE_REASON { - REMOTE_AUDIO_REASON_INTERNAL = 0, - REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1, - REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2, - REMOTE_AUDIO_REASON_LOCAL_MUTED = 3, - REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4, - REMOTE_AUDIO_REASON_REMOTE_MUTED = 5, - REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6, - REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7 -} -declare enum REMOTE_VIDEO_STATE { - REMOTE_VIDEO_STATE_STOPPED = 0, - REMOTE_VIDEO_STATE_STARTING = 1, - REMOTE_VIDEO_STATE_DECODING = 2, - REMOTE_VIDEO_STATE_FROZEN = 3, - REMOTE_VIDEO_STATE_FAILED = 4 -} -declare enum REMOTE_VIDEO_STATE_REASON { - REMOTE_VIDEO_STATE_REASON_INTERNAL = 0, - REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1, - REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2, - REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3, - REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4, - REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5, - REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6, - REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7, - REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8, - REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9, - REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW = 10, - REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH = 11, - REMOTE_VIDEO_STATE_REASON_SDK_IN_BACKGROUND = 12, - REMOTE_VIDEO_STATE_REASON_CODEC_NOT_SUPPORT = 13 -} -declare enum REMOTE_USER_STATE { - USER_STATE_MUTE_AUDIO = 1, - USER_STATE_MUTE_VIDEO = 2, - USER_STATE_ENABLE_VIDEO = 16, - USER_STATE_ENABLE_LOCAL_VIDEO = 256 -} -declare class VideoTrackInfo { - isLocal?: boolean; - ownerUid?: number; - trackId?: number; - channelId?: string; - streamType?: VIDEO_STREAM_TYPE; - codecType?: VIDEO_CODEC_TYPE; - encodedFrameOnly?: boolean; - sourceType?: VIDEO_SOURCE_TYPE; - observationPosition?: number; -} -declare enum REMOTE_VIDEO_DOWNSCALE_LEVEL { - REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE = 0, - REMOTE_VIDEO_DOWNSCALE_LEVEL_1 = 1, - REMOTE_VIDEO_DOWNSCALE_LEVEL_2 = 2, - REMOTE_VIDEO_DOWNSCALE_LEVEL_3 = 3, - REMOTE_VIDEO_DOWNSCALE_LEVEL_4 = 4 -} -declare class AudioVolumeInfo { - uid?: number; - volume?: number; - vad?: number; - voicePitch?: number; -} -declare class DeviceInfo { - isLowLatencyAudioSupported?: boolean; -} -declare class Packet { - buffer?: Uint8Array; - size?: number; -} -declare enum AUDIO_SAMPLE_RATE_TYPE { - AUDIO_SAMPLE_RATE_32000 = 32000, - AUDIO_SAMPLE_RATE_44100 = 44100, - AUDIO_SAMPLE_RATE_48000 = 48000 -} -declare enum VIDEO_CODEC_TYPE_FOR_STREAM { - VIDEO_CODEC_H264_FOR_STREAM = 1, - VIDEO_CODEC_H265_FOR_STREAM = 2 -} -declare enum VIDEO_CODEC_PROFILE_TYPE { - VIDEO_CODEC_PROFILE_BASELINE = 66, - VIDEO_CODEC_PROFILE_MAIN = 77, - VIDEO_CODEC_PROFILE_HIGH = 100 -} -declare enum AUDIO_CODEC_PROFILE_TYPE { - AUDIO_CODEC_PROFILE_LC_AAC = 0, - AUDIO_CODEC_PROFILE_HE_AAC = 1, - AUDIO_CODEC_PROFILE_HE_AAC_V2 = 2 -} -declare class LocalAudioStats { - numChannels?: number; - sentSampleRate?: number; - sentBitrate?: number; - internalCodec?: number; - txPacketLossRate?: number; - audioDeviceDelay?: number; -} -declare enum RTMP_STREAM_PUBLISH_STATE { - RTMP_STREAM_PUBLISH_STATE_IDLE = 0, - RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1, - RTMP_STREAM_PUBLISH_STATE_RUNNING = 2, - RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3, - RTMP_STREAM_PUBLISH_STATE_FAILURE = 4, - RTMP_STREAM_PUBLISH_STATE_DISCONNECTING = 5 -} -declare enum RTMP_STREAM_PUBLISH_ERROR_TYPE { - RTMP_STREAM_PUBLISH_ERROR_OK = 0, - RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1, - RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2, - RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3, - RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4, - RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5, - RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6, - RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7, - RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8, - RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9, - RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10, - RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER = 11, - RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM = 13, - RTMP_STREAM_PUBLISH_ERROR_NET_DOWN = 14, - RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID = 15, - RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE = 16, - RTMP_STREAM_UNPUBLISH_ERROR_OK = 100 -} -declare enum RTMP_STREAMING_EVENT { - RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE = 1, - RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE = 2, - RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT = 3, - RTMP_STREAMING_EVENT_REQUEST_TOO_OFTEN = 4 -} -declare class RtcImage { - url?: string; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; -} -declare class LiveStreamAdvancedFeature { - featureName?: string; - opened?: boolean; -} -declare enum CONNECTION_STATE_TYPE { - CONNECTION_STATE_DISCONNECTED = 1, - CONNECTION_STATE_CONNECTING = 2, - CONNECTION_STATE_CONNECTED = 3, - CONNECTION_STATE_RECONNECTING = 4, - CONNECTION_STATE_FAILED = 5 -} -declare class TranscodingUser { - uid?: number; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; - audioChannel?: number; -} -declare class LiveTranscoding { - width?: number; - height?: number; - videoBitrate?: number; - videoFramerate?: number; - lowLatency?: boolean; - videoGop?: number; - videoCodecProfile?: VIDEO_CODEC_PROFILE_TYPE; - backgroundColor?: number; - videoCodecType?: VIDEO_CODEC_TYPE_FOR_STREAM; - userCount?: number; - transcodingUsers?: TranscodingUser[]; - transcodingExtraInfo?: string; - metadata?: string; - watermark?: RtcImage[]; - watermarkCount?: number; - backgroundImage?: RtcImage[]; - backgroundImageCount?: number; - audioSampleRate?: AUDIO_SAMPLE_RATE_TYPE; - audioBitrate?: number; - audioChannels?: number; - audioCodecProfile?: AUDIO_CODEC_PROFILE_TYPE; - advancedFeatures?: LiveStreamAdvancedFeature[]; - advancedFeatureCount?: number; -} -declare class TranscodingVideoStream { - sourceType?: VIDEO_SOURCE_TYPE; - remoteUserUid?: number; - imageUrl?: string; - mediaPlayerId?: number; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; - mirror?: boolean; -} -declare class LocalTranscoderConfiguration { - streamCount?: number; - videoInputStreams?: TranscodingVideoStream[]; - videoOutputConfiguration?: VideoEncoderConfiguration; - syncWithPrimaryCamera?: boolean; -} -declare enum VIDEO_TRANSCODER_ERROR { - VT_ERR_OK = 0, - VT_ERR_VIDEO_SOURCE_NOT_READY = 1, - VT_ERR_INVALID_VIDEO_SOURCE_TYPE = 2, - VT_ERR_INVALID_IMAGE_PATH = 3, - VT_ERR_UNSUPPORT_IMAGE_FORMAT = 4, - VT_ERR_INVALID_LAYOUT = 5, - VT_ERR_INTERNAL = 20 -} -declare class LastmileProbeConfig { - probeUplink?: boolean; - probeDownlink?: boolean; - expectedUplinkBitrate?: number; - expectedDownlinkBitrate?: number; -} -declare enum LASTMILE_PROBE_RESULT_STATE { - LASTMILE_PROBE_RESULT_COMPLETE = 1, - LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2, - LASTMILE_PROBE_RESULT_UNAVAILABLE = 3 -} -declare class LastmileProbeOneWayResult { - packetLossRate?: number; - jitter?: number; - availableBandwidth?: number; -} -declare class LastmileProbeResult { - state?: LASTMILE_PROBE_RESULT_STATE; - uplinkReport?: LastmileProbeOneWayResult; - downlinkReport?: LastmileProbeOneWayResult; - rtt?: number; -} -declare enum CONNECTION_CHANGED_REASON_TYPE { - CONNECTION_CHANGED_CONNECTING = 0, - CONNECTION_CHANGED_JOIN_SUCCESS = 1, - CONNECTION_CHANGED_INTERRUPTED = 2, - CONNECTION_CHANGED_BANNED_BY_SERVER = 3, - CONNECTION_CHANGED_JOIN_FAILED = 4, - CONNECTION_CHANGED_LEAVE_CHANNEL = 5, - CONNECTION_CHANGED_INVALID_APP_ID = 6, - CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7, - CONNECTION_CHANGED_INVALID_TOKEN = 8, - CONNECTION_CHANGED_TOKEN_EXPIRED = 9, - CONNECTION_CHANGED_REJECTED_BY_SERVER = 10, - CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11, - CONNECTION_CHANGED_RENEW_TOKEN = 12, - CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13, - CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14, - CONNECTION_CHANGED_REJOIN_SUCCESS = 15, - CONNECTION_CHANGED_LOST = 16, - CONNECTION_CHANGED_ECHO_TEST = 17, - CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER = 18, - CONNECTION_CHANGED_SAME_UID_LOGIN = 19, - CONNECTION_CHANGED_TOO_MANY_BROADCASTERS = 20, - CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE = 21, - CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE = 22 -} -declare enum CLIENT_ROLE_CHANGE_FAILED_REASON { - CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS = 1, - CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED = 2, - CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT = 3, - CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED = 4 -} -declare enum WLACC_MESSAGE_REASON { - WLACC_MESSAGE_REASON_WEAK_SIGNAL = 0, - WLACC_MESSAGE_REASON_CHANNEL_CONGESTION = 1 -} -declare enum WLACC_SUGGEST_ACTION { - WLACC_SUGGEST_ACTION_CLOSE_TO_WIFI = 0, - WLACC_SUGGEST_ACTION_CONNECT_SSID = 1, - WLACC_SUGGEST_ACTION_CHECK_5G = 2, - WLACC_SUGGEST_ACTION_MODIFY_SSID = 3 -} -declare class WlAccStats { - e2eDelayPercent?: number; - frozenRatioPercent?: number; - lossRatePercent?: number; -} -declare enum NETWORK_TYPE { - NETWORK_TYPE_UNKNOWN = -1, - NETWORK_TYPE_DISCONNECTED = 0, - NETWORK_TYPE_LAN = 1, - NETWORK_TYPE_WIFI = 2, - NETWORK_TYPE_MOBILE_2G = 3, - NETWORK_TYPE_MOBILE_3G = 4, - NETWORK_TYPE_MOBILE_4G = 5, - NETWORK_TYPE_MOBILE_5G = 6 -} -declare enum VIDEO_VIEW_SETUP_MODE { - VIDEO_VIEW_SETUP_REPLACE = 0, - VIDEO_VIEW_SETUP_ADD = 1, - VIDEO_VIEW_SETUP_REMOVE = 2 -} -declare class VideoCanvas { - view?: any; - uid?: number; - backgroundColor?: number; - renderMode?: RENDER_MODE_TYPE; - mirrorMode?: VIDEO_MIRROR_MODE_TYPE; - setupMode?: VIDEO_VIEW_SETUP_MODE; - sourceType?: VIDEO_SOURCE_TYPE; - mediaPlayerId?: number; - cropArea?: Rectangle; - enableAlphaMask?: boolean; -} -declare enum LIGHTENING_CONTRAST_LEVEL { - LIGHTENING_CONTRAST_LOW = 0, - LIGHTENING_CONTRAST_NORMAL = 1, - LIGHTENING_CONTRAST_HIGH = 2 -} -declare class BeautyOptions { - lighteningContrastLevel?: LIGHTENING_CONTRAST_LEVEL; - lighteningLevel?: number; - smoothnessLevel?: number; - rednessLevel?: number; - sharpnessLevel?: number; -} -declare enum LOW_LIGHT_ENHANCE_MODE { - LOW_LIGHT_ENHANCE_AUTO = 0, - LOW_LIGHT_ENHANCE_MANUAL = 1 -} -declare enum LOW_LIGHT_ENHANCE_LEVEL { - LOW_LIGHT_ENHANCE_LEVEL_HIGH_QUALITY = 0, - LOW_LIGHT_ENHANCE_LEVEL_FAST = 1 -} -declare class LowlightEnhanceOptions { - mode?: LOW_LIGHT_ENHANCE_MODE; - level?: LOW_LIGHT_ENHANCE_LEVEL; -} -declare enum VIDEO_DENOISER_MODE { - VIDEO_DENOISER_AUTO = 0, - VIDEO_DENOISER_MANUAL = 1 -} -declare enum VIDEO_DENOISER_LEVEL { - VIDEO_DENOISER_LEVEL_HIGH_QUALITY = 0, - VIDEO_DENOISER_LEVEL_FAST = 1, - VIDEO_DENOISER_LEVEL_STRENGTH = 2 -} -declare class VideoDenoiserOptions { - mode?: VIDEO_DENOISER_MODE; - level?: VIDEO_DENOISER_LEVEL; -} -declare class ColorEnhanceOptions { - strengthLevel?: number; - skinProtectLevel?: number; -} -declare enum BACKGROUND_SOURCE_TYPE { - BACKGROUND_NONE = 0, - BACKGROUND_COLOR = 1, - BACKGROUND_IMG = 2, - BACKGROUND_BLUR = 3, - BACKGROUND_VIDEO = 4 -} -declare enum BACKGROUND_BLUR_DEGREE { - BLUR_DEGREE_LOW = 1, - BLUR_DEGREE_MEDIUM = 2, - BLUR_DEGREE_HIGH = 3 -} -declare class VirtualBackgroundSource { - background_source_type?: BACKGROUND_SOURCE_TYPE; - color?: number; - source?: string; - blur_degree?: BACKGROUND_BLUR_DEGREE; -} -declare enum SEG_MODEL_TYPE { - SEG_MODEL_AI = 1, - SEG_MODEL_GREEN = 2 -} -declare class SegmentationProperty { - modelType?: SEG_MODEL_TYPE; - greenCapacity?: number; -} -declare enum AUDIO_TRACK_TYPE { - AUDIO_TRACK_INVALID = -1, - AUDIO_TRACK_MIXABLE = 0, - AUDIO_TRACK_DIRECT = 1 -} -declare class AudioTrackConfig { - enableLocalPlayback?: boolean; -} -declare enum VOICE_BEAUTIFIER_PRESET { - VOICE_BEAUTIFIER_OFF = 0, - CHAT_BEAUTIFIER_MAGNETIC = 16843008, - CHAT_BEAUTIFIER_FRESH = 16843264, - CHAT_BEAUTIFIER_VITALITY = 16843520, - SINGING_BEAUTIFIER = 16908544, - TIMBRE_TRANSFORMATION_VIGOROUS = 16974080, - TIMBRE_TRANSFORMATION_DEEP = 16974336, - TIMBRE_TRANSFORMATION_MELLOW = 16974592, - TIMBRE_TRANSFORMATION_FALSETTO = 16974848, - TIMBRE_TRANSFORMATION_FULL = 16975104, - TIMBRE_TRANSFORMATION_CLEAR = 16975360, - TIMBRE_TRANSFORMATION_RESOUNDING = 16975616, - TIMBRE_TRANSFORMATION_RINGING = 16975872, - ULTRA_HIGH_QUALITY_VOICE = 17039616 -} -declare enum AUDIO_EFFECT_PRESET { - AUDIO_EFFECT_OFF = 0, - ROOM_ACOUSTICS_KTV = 33620224, - ROOM_ACOUSTICS_VOCAL_CONCERT = 33620480, - ROOM_ACOUSTICS_STUDIO = 33620736, - ROOM_ACOUSTICS_PHONOGRAPH = 33620992, - ROOM_ACOUSTICS_VIRTUAL_STEREO = 33621248, - ROOM_ACOUSTICS_SPACIAL = 33621504, - ROOM_ACOUSTICS_ETHEREAL = 33621760, - ROOM_ACOUSTICS_3D_VOICE = 33622016, - ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND = 33622272, - VOICE_CHANGER_EFFECT_UNCLE = 33685760, - VOICE_CHANGER_EFFECT_OLDMAN = 33686016, - VOICE_CHANGER_EFFECT_BOY = 33686272, - VOICE_CHANGER_EFFECT_SISTER = 33686528, - VOICE_CHANGER_EFFECT_GIRL = 33686784, - VOICE_CHANGER_EFFECT_PIGKING = 33687040, - VOICE_CHANGER_EFFECT_HULK = 33687296, - STYLE_TRANSFORMATION_RNB = 33751296, - STYLE_TRANSFORMATION_POPULAR = 33751552, - PITCH_CORRECTION = 33816832 -} -declare enum VOICE_CONVERSION_PRESET { - VOICE_CONVERSION_OFF = 0, - VOICE_CHANGER_NEUTRAL = 50397440, - VOICE_CHANGER_SWEET = 50397696, - VOICE_CHANGER_SOLID = 50397952, - VOICE_CHANGER_BASS = 50398208, - VOICE_CHANGER_CARTOON = 50398464, - VOICE_CHANGER_CHILDLIKE = 50398720, - VOICE_CHANGER_PHONE_OPERATOR = 50398976, - VOICE_CHANGER_MONSTER = 50399232, - VOICE_CHANGER_TRANSFORMERS = 50399488, - VOICE_CHANGER_GROOT = 50399744, - VOICE_CHANGER_DARTH_VADER = 50400000, - VOICE_CHANGER_IRON_LADY = 50400256, - VOICE_CHANGER_SHIN_CHAN = 50400512, - VOICE_CHANGER_GIRLISH_MAN = 50400768, - VOICE_CHANGER_CHIPMUNK = 50401024 -} -declare enum HEADPHONE_EQUALIZER_PRESET { - HEADPHONE_EQUALIZER_OFF = 0, - HEADPHONE_EQUALIZER_OVEREAR = 67108865, - HEADPHONE_EQUALIZER_INEAR = 67108866 -} -declare class ScreenCaptureParameters { - dimensions?: VideoDimensions; - frameRate?: number; - bitrate?: number; - captureMouseCursor?: boolean; - windowFocus?: boolean; - excludeWindowList?: any[]; - excludeWindowCount?: number; - highLightWidth?: number; - highLightColor?: number; - enableHighLight?: boolean; -} -declare enum AUDIO_RECORDING_QUALITY_TYPE { - AUDIO_RECORDING_QUALITY_LOW = 0, - AUDIO_RECORDING_QUALITY_MEDIUM = 1, - AUDIO_RECORDING_QUALITY_HIGH = 2, - AUDIO_RECORDING_QUALITY_ULTRA_HIGH = 3 -} -declare enum AUDIO_FILE_RECORDING_TYPE { - AUDIO_FILE_RECORDING_MIC = 1, - AUDIO_FILE_RECORDING_PLAYBACK = 2, - AUDIO_FILE_RECORDING_MIXED = 3 -} -declare enum AUDIO_ENCODED_FRAME_OBSERVER_POSITION { - AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD = 1, - AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK = 2, - AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED = 3 -} -declare class AudioRecordingConfiguration { - filePath?: string; - encode?: boolean; - sampleRate?: number; - fileRecordingType?: AUDIO_FILE_RECORDING_TYPE; - quality?: AUDIO_RECORDING_QUALITY_TYPE; - recordingChannel?: number; -} -declare class AudioEncodedFrameObserverConfig { - postionType?: AUDIO_ENCODED_FRAME_OBSERVER_POSITION; - encodingType?: AUDIO_ENCODING_TYPE; -} -interface IAudioEncodedFrameObserver { - onRecordAudioEncodedFrame(frameBuffer: Uint8Array, length: number, audioEncodedFrameInfo: EncodedAudioFrameInfo): void; - onPlaybackAudioEncodedFrame(frameBuffer: Uint8Array, length: number, audioEncodedFrameInfo: EncodedAudioFrameInfo): void; - onMixedAudioEncodedFrame(frameBuffer: Uint8Array, length: number, audioEncodedFrameInfo: EncodedAudioFrameInfo): void; -} -declare enum AREA_CODE { - AREA_CODE_CN = 1, - AREA_CODE_NA = 2, - AREA_CODE_EU = 4, - AREA_CODE_AS = 8, - AREA_CODE_JP = 16, - AREA_CODE_IN = 32, - AREA_CODE_GLOB = 4294967295 -} -declare enum AREA_CODE_EX { - AREA_CODE_OC = 64, - AREA_CODE_SA = 128, - AREA_CODE_AF = 256, - AREA_CODE_KR = 512, - AREA_CODE_HKMC = 1024, - AREA_CODE_US = 2048, - AREA_CODE_OVS = 4294967294 -} -declare enum CHANNEL_MEDIA_RELAY_ERROR { - RELAY_OK = 0, - RELAY_ERROR_SERVER_ERROR_RESPONSE = 1, - RELAY_ERROR_SERVER_NO_RESPONSE = 2, - RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3, - RELAY_ERROR_FAILED_JOIN_SRC = 4, - RELAY_ERROR_FAILED_JOIN_DEST = 5, - RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6, - RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7, - RELAY_ERROR_SERVER_CONNECTION_LOST = 8, - RELAY_ERROR_INTERNAL_ERROR = 9, - RELAY_ERROR_SRC_TOKEN_EXPIRED = 10, - RELAY_ERROR_DEST_TOKEN_EXPIRED = 11 -} -declare enum CHANNEL_MEDIA_RELAY_EVENT { - RELAY_EVENT_NETWORK_DISCONNECTED = 0, - RELAY_EVENT_NETWORK_CONNECTED = 1, - RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2, - RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3, - RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4, - RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5, - RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10, - RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11, - RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS = 12, - RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED = 13, - RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS = 14, - RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED = 15 -} -declare enum CHANNEL_MEDIA_RELAY_STATE { - RELAY_STATE_IDLE = 0, - RELAY_STATE_CONNECTING = 1, - RELAY_STATE_RUNNING = 2, - RELAY_STATE_FAILURE = 3 -} -declare class ChannelMediaInfo { - channelName?: string; - token?: string; - uid?: number; -} -declare class ChannelMediaRelayConfiguration { - srcInfo?: ChannelMediaInfo[]; - destInfos?: ChannelMediaInfo[]; - destCount?: number; -} -declare class UplinkNetworkInfo { - video_encoder_target_bitrate_bps?: number; -} -declare class PeerDownlinkInfo { - uid?: string; - stream_type?: VIDEO_STREAM_TYPE; - current_downscale_level?: REMOTE_VIDEO_DOWNSCALE_LEVEL; - expected_bitrate_bps?: number; -} -declare class DownlinkNetworkInfo { - lastmile_buffer_delay_time_ms?: number; - bandwidth_estimation_bps?: number; - total_downscale_level_count?: number; - peer_downlink_info?: PeerDownlinkInfo[]; - total_received_video_count?: number; -} -declare enum ENCRYPTION_MODE { - AES_128_XTS = 1, - AES_128_ECB = 2, - AES_256_XTS = 3, - SM4_128_ECB = 4, - AES_128_GCM = 5, - AES_256_GCM = 6, - AES_128_GCM2 = 7, - AES_256_GCM2 = 8, - MODE_END = 9 -} -declare class EncryptionConfig { - encryptionMode?: ENCRYPTION_MODE; - encryptionKey?: string; - encryptionKdfSalt?: number; -} -declare enum ENCRYPTION_ERROR_TYPE { - ENCRYPTION_ERROR_INTERNAL_FAILURE = 0, - ENCRYPTION_ERROR_DECRYPTION_FAILURE = 1, - ENCRYPTION_ERROR_ENCRYPTION_FAILURE = 2 -} -declare enum UPLOAD_ERROR_REASON { - UPLOAD_SUCCESS = 0, - UPLOAD_NET_ERROR = 1, - UPLOAD_SERVER_ERROR = 2 -} -declare enum PERMISSION_TYPE { - RECORD_AUDIO = 0, - CAMERA = 1, - SCREEN_CAPTURE = 2 -} -declare enum MAX_USER_ACCOUNT_LENGTH_TYPE { - MAX_USER_ACCOUNT_LENGTH = 256 -} -declare enum STREAM_SUBSCRIBE_STATE { - SUB_STATE_IDLE = 0, - SUB_STATE_NO_SUBSCRIBED = 1, - SUB_STATE_SUBSCRIBING = 2, - SUB_STATE_SUBSCRIBED = 3 -} -declare enum STREAM_PUBLISH_STATE { - PUB_STATE_IDLE = 0, - PUB_STATE_NO_PUBLISHED = 1, - PUB_STATE_PUBLISHING = 2, - PUB_STATE_PUBLISHED = 3 -} -declare class EchoTestConfiguration { - view?: any; - enableAudio?: boolean; - enableVideo?: boolean; - token?: string; - channelId?: string; - intervalInSeconds?: number; -} -declare class UserInfo { - uid?: number; - userAccount?: string; -} -declare enum EAR_MONITORING_FILTER_TYPE { - EAR_MONITORING_FILTER_NONE = 1, - EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS = 2, - EAR_MONITORING_FILTER_NOISE_SUPPRESSION = 4 -} -declare enum THREAD_PRIORITY_TYPE { - LOWEST = 0, - LOW = 1, - NORMAL = 2, - HIGH = 3, - HIGHEST = 4, - CRITICAL = 5 -} -declare class ScreenVideoParameters { - dimensions?: VideoDimensions; - frameRate?: number; - bitrate?: number; - contentHint?: VIDEO_CONTENT_HINT; -} -declare class ScreenAudioParameters { - sampleRate?: number; - channels?: number; - captureSignalVolume?: number; -} -declare class ScreenCaptureParameters2 { - captureAudio?: boolean; - audioParams?: ScreenAudioParameters; - captureVideo?: boolean; - videoParams?: ScreenVideoParameters; -} -declare enum MEDIA_TRACE_EVENT { - MEDIA_TRACE_EVENT_VIDEO_RENDERED = 0, - MEDIA_TRACE_EVENT_VIDEO_DECODED = 1 -} -declare class VideoRenderingTracingInfo { - elapsedTime?: number; - start2JoinChannel?: number; - join2JoinSuccess?: number; - joinSuccess2RemoteJoined?: number; - remoteJoined2SetView?: number; - remoteJoined2UnmuteVideo?: number; - remoteJoined2PacketReceived?: number; -} -declare enum CONFIG_FETCH_TYPE { - CONFIG_FETCH_TYPE_INITIALIZE = 1, - CONFIG_FETCH_TYPE_JOIN_CHANNEL = 2 -} -declare class RecorderStreamInfo { - channelId?: string; - uid?: number; -} -declare enum LOCAL_PROXY_MODE { - ConnectivityFirst = 0, - LocalOnly = 1 -} -declare class LogUploadServerInfo { - serverDomain?: string; - serverPath?: string; - serverPort?: number; - serverHttps?: boolean; -} -declare class AdvancedConfigInfo { - logUploadServer?: LogUploadServerInfo; -} -declare class LocalAccessPointConfiguration { - ipList?: string[]; - ipListSize?: number; - domainList?: string[]; - domainListSize?: number; - verifyDomainName?: string; - mode?: LOCAL_PROXY_MODE; - advancedConfig?: AdvancedConfigInfo; -} -declare class SpatialAudioParams { - speaker_azimuth?: number; - speaker_elevation?: number; - speaker_distance?: number; - speaker_orientation?: number; - enable_blur?: boolean; - enable_air_absorb?: boolean; - speaker_attenuation?: number; - enable_doppler?: boolean; -} - -declare enum MEDIA_PLAYER_STATE { - PLAYER_STATE_IDLE = 0, - PLAYER_STATE_OPENING = 1, - PLAYER_STATE_OPEN_COMPLETED = 2, - PLAYER_STATE_PLAYING = 3, - PLAYER_STATE_PAUSED = 4, - PLAYER_STATE_PLAYBACK_COMPLETED = 5, - PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED = 6, - PLAYER_STATE_STOPPED = 7, - PLAYER_STATE_PAUSING_INTERNAL = 50, - PLAYER_STATE_STOPPING_INTERNAL = 51, - PLAYER_STATE_SEEKING_INTERNAL = 52, - PLAYER_STATE_GETTING_INTERNAL = 53, - PLAYER_STATE_NONE_INTERNAL = 54, - PLAYER_STATE_DO_NOTHING_INTERNAL = 55, - PLAYER_STATE_SET_TRACK_INTERNAL = 56, - PLAYER_STATE_FAILED = 100 -} -declare enum MEDIA_PLAYER_ERROR { - PLAYER_ERROR_NONE = 0, - PLAYER_ERROR_INVALID_ARGUMENTS = -1, - PLAYER_ERROR_INTERNAL = -2, - PLAYER_ERROR_NO_RESOURCE = -3, - PLAYER_ERROR_INVALID_MEDIA_SOURCE = -4, - PLAYER_ERROR_UNKNOWN_STREAM_TYPE = -5, - PLAYER_ERROR_OBJ_NOT_INITIALIZED = -6, - PLAYER_ERROR_CODEC_NOT_SUPPORTED = -7, - PLAYER_ERROR_VIDEO_RENDER_FAILED = -8, - PLAYER_ERROR_INVALID_STATE = -9, - PLAYER_ERROR_URL_NOT_FOUND = -10, - PLAYER_ERROR_INVALID_CONNECTION_STATE = -11, - PLAYER_ERROR_SRC_BUFFER_UNDERFLOW = -12, - PLAYER_ERROR_INTERRUPTED = -13, - PLAYER_ERROR_NOT_SUPPORTED = -14, - PLAYER_ERROR_TOKEN_EXPIRED = -15, - PLAYER_ERROR_IP_EXPIRED = -16, - PLAYER_ERROR_UNKNOWN = -17 -} -declare enum MEDIA_STREAM_TYPE { - STREAM_TYPE_UNKNOWN = 0, - STREAM_TYPE_VIDEO = 1, - STREAM_TYPE_AUDIO = 2, - STREAM_TYPE_SUBTITLE = 3 -} -declare enum MEDIA_PLAYER_EVENT { - PLAYER_EVENT_SEEK_BEGIN = 0, - PLAYER_EVENT_SEEK_COMPLETE = 1, - PLAYER_EVENT_SEEK_ERROR = 2, - PLAYER_EVENT_AUDIO_TRACK_CHANGED = 5, - PLAYER_EVENT_BUFFER_LOW = 6, - PLAYER_EVENT_BUFFER_RECOVER = 7, - PLAYER_EVENT_FREEZE_START = 8, - PLAYER_EVENT_FREEZE_STOP = 9, - PLAYER_EVENT_SWITCH_BEGIN = 10, - PLAYER_EVENT_SWITCH_COMPLETE = 11, - PLAYER_EVENT_SWITCH_ERROR = 12, - PLAYER_EVENT_FIRST_DISPLAYED = 13, - PLAYER_EVENT_REACH_CACHE_FILE_MAX_COUNT = 14, - PLAYER_EVENT_REACH_CACHE_FILE_MAX_SIZE = 15, - PLAYER_EVENT_TRY_OPEN_START = 16, - PLAYER_EVENT_TRY_OPEN_SUCCEED = 17, - PLAYER_EVENT_TRY_OPEN_FAILED = 18 -} -declare enum PLAYER_PRELOAD_EVENT { - PLAYER_PRELOAD_EVENT_BEGIN = 0, - PLAYER_PRELOAD_EVENT_COMPLETE = 1, - PLAYER_PRELOAD_EVENT_ERROR = 2 -} -declare class PlayerStreamInfo { - streamIndex?: number; - streamType?: MEDIA_STREAM_TYPE; - codecName?: string; - language?: string; - videoFrameRate?: number; - videoBitRate?: number; - videoWidth?: number; - videoHeight?: number; - videoRotation?: number; - audioSampleRate?: number; - audioChannels?: number; - audioBitsPerSample?: number; - duration?: number; -} -declare class SrcInfo { - bitrateInKbps?: number; - name?: string; -} -declare enum MEDIA_PLAYER_METADATA_TYPE { - PLAYER_METADATA_TYPE_UNKNOWN = 0, - PLAYER_METADATA_TYPE_SEI = 1 -} -declare class CacheStatistics { - fileSize?: number; - cacheSize?: number; - downloadSize?: number; -} -declare class PlayerUpdatedInfo { - playerId?: string; - deviceId?: string; - cacheStatistics?: CacheStatistics; -} -declare class MediaSource { - url?: string; - uri?: string; - startPos?: number; - autoPlay?: boolean; - enableCache?: boolean; - isAgoraSource?: boolean; - isLiveSource?: boolean; -} - -declare enum LOG_LEVEL { - LOG_LEVEL_NONE = 0, - LOG_LEVEL_INFO = 1, - LOG_LEVEL_WARN = 2, - LOG_LEVEL_ERROR = 4, - LOG_LEVEL_FATAL = 8, - LOG_LEVEL_API_CALL = 16 -} -declare enum LOG_FILTER_TYPE { - LOG_FILTER_OFF = 0, - LOG_FILTER_DEBUG = 2063, - LOG_FILTER_INFO = 15, - LOG_FILTER_WARN = 14, - LOG_FILTER_ERROR = 12, - LOG_FILTER_CRITICAL = 8, - LOG_FILTER_MASK = 2063 -} -declare class LogConfig { - filePath?: string; - fileSizeInKB?: number; - level?: LOG_LEVEL; -} - -declare enum AUDIO_MIXING_DUAL_MONO_MODE { - AUDIO_MIXING_DUAL_MONO_AUTO = 0, - AUDIO_MIXING_DUAL_MONO_L = 1, - AUDIO_MIXING_DUAL_MONO_R = 2, - AUDIO_MIXING_DUAL_MONO_MIX = 3 -} -interface IMediaEngine { - registerAudioFrameObserver(observer: IAudioFrameObserver): CallApiReturnType; - registerVideoFrameObserver(observer: IVideoFrameObserver): CallApiReturnType; - registerVideoEncodedFrameObserver(observer: IVideoEncodedFrameObserver): CallApiReturnType; - pushAudioFrame(frame: AudioFrame, trackId: number): CallApiReturnType; - pullAudioFrame(frame: AudioFrame): CallApiReturnType; - setExternalVideoSource(enabled: boolean, useTexture: boolean, sourceType: EXTERNAL_VIDEO_SOURCE_TYPE, encodedVideoOption: SenderOptions): CallApiReturnType; - setExternalAudioSource(enabled: boolean, sampleRate: number, channels: number, localPlayback: boolean, publish: boolean): CallApiReturnType; - createCustomAudioTrack(trackType: AUDIO_TRACK_TYPE, config: AudioTrackConfig): CallApiReturnType; - destroyCustomAudioTrack(trackId: number): CallApiReturnType; - setExternalAudioSink(enabled: boolean, sampleRate: number, channels: number): CallApiReturnType; - enableCustomAudioLocalPlayback(trackId: number, enabled: boolean): CallApiReturnType; - pushVideoFrame(frame: ExternalVideoFrame, videoTrackId: number): CallApiReturnType; - pushEncodedVideoImage(imageBuffer: Uint8Array, length: number, videoEncodedFrameInfo: EncodedVideoFrameInfo, videoTrackId: number): CallApiReturnType; - release(): CallApiReturnType; -} - -interface IMediaPlayerSourceObserver { - onPlayerSourceStateChanged(state: MEDIA_PLAYER_STATE, ec: MEDIA_PLAYER_ERROR): void; - onPositionChanged(position_ms: number): void; - onPlayerEvent(eventCode: MEDIA_PLAYER_EVENT, elapsedTime: number, message: string): void; - onMetaData(data: void[], length: number): void; - onPlayBufferUpdated(playCachedBuffer: number): void; - onPreloadEvent(src: string, event: PLAYER_PRELOAD_EVENT): void; - onCompleted(): void; - onAgoraCDNTokenWillExpire(): void; - onPlayerSrcInfoChanged(from: SrcInfo, to: SrcInfo): void; - onPlayerInfoUpdated(info: PlayerUpdatedInfo): void; - onAudioVolumeIndication(volume: number): void; -} - -interface IMediaPlayer { - getMediaPlayerId(): CallApiReturnType; - open(url: string, startPos: number): CallApiReturnType; - openWithMediaSource(source: MediaSource): CallApiReturnType; - play(): CallApiReturnType; - pause(): CallApiReturnType; - stop(): CallApiReturnType; - resume(): CallApiReturnType; - seek(newPos: number): CallApiReturnType; - setAudioPitch(pitch: number): CallApiReturnType; - getDuration(duration: number): CallApiReturnType; - getPlayPosition(pos: number): CallApiReturnType; - getStreamCount(count: number): CallApiReturnType; - getStreamInfo(index: number, info: PlayerStreamInfo[]): CallApiReturnType; - setLoopCount(loopCount: number): CallApiReturnType; - setPlaybackSpeed(speed: number): CallApiReturnType; - selectAudioTrack(index: number): CallApiReturnType; - setPlayerOption(key: string, value: number): CallApiReturnType; - setPlayerOption2(key: string, value: string): CallApiReturnType; - takeScreenshot(filename: string): CallApiReturnType; - selectInternalSubtitle(index: number): CallApiReturnType; - setExternalSubtitle(url: string): CallApiReturnType; - getState(): CallApiReturnType; - mute(muted: boolean): CallApiReturnType; - getMute(muted: boolean): CallApiReturnType; - adjustPlayoutVolume(volume: number): CallApiReturnType; - getPlayoutVolume(volume: number): CallApiReturnType; - adjustPublishSignalVolume(volume: number): CallApiReturnType; - getPublishSignalVolume(volume: number): CallApiReturnType; - setView(view: any): CallApiReturnType; - setRenderMode(renderMode: RENDER_MODE_TYPE): CallApiReturnType; - registerPlayerSourceObserver(observer: IMediaPlayerSourceObserver): CallApiReturnType; - unregisterPlayerSourceObserver(observer: IMediaPlayerSourceObserver): CallApiReturnType; - registerAudioFrameObserver(observer: IAudioPcmFrameSink): CallApiReturnType; - registerAudioFrameObserver2(observer: IAudioPcmFrameSink, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE): CallApiReturnType; - unregisterAudioFrameObserver(observer: IAudioPcmFrameSink): CallApiReturnType; - registerVideoFrameObserver(observer: IVideoFrameObserver): CallApiReturnType; - unregisterVideoFrameObserver(observer: IVideoFrameObserver): CallApiReturnType; - registerMediaPlayerAudioSpectrumObserver(observer: IAudioSpectrumObserver, intervalInMS: number): CallApiReturnType; - unregisterMediaPlayerAudioSpectrumObserver(observer: IAudioSpectrumObserver): CallApiReturnType; - setAudioDualMonoMode(mode: AUDIO_DUAL_MONO_MODE): CallApiReturnType; - getPlayerSdkVersion(): CallApiReturnType; - getPlaySrc(): CallApiReturnType; - openWithAgoraCDNSrc(src: string, startPos: number): CallApiReturnType; - getAgoraCDNLineCount(): CallApiReturnType; - switchAgoraCDNLineByIndex(index: number): CallApiReturnType; - getCurrentAgoraCDNIndex(): CallApiReturnType; - enableAutoSwitchAgoraCDN(enable: boolean): CallApiReturnType; - renewAgoraCDNSrcToken(token: string, ts: number): CallApiReturnType; - switchAgoraCDNSrc(src: string, syncPts: boolean): CallApiReturnType; - switchSrc(src: string, syncPts: boolean): CallApiReturnType; - preloadSrc(src: string, startPos: number): CallApiReturnType; - playPreloadedSrc(src: string): CallApiReturnType; - unloadSrc(src: string): CallApiReturnType; - setSpatialAudioParams(params: SpatialAudioParams): CallApiReturnType; - setSoundPositionParams(pan: number, gain: number): CallApiReturnType; -} -interface IMediaPlayerCacheManager { - removeAllCaches(): CallApiReturnType; - removeOldCache(): CallApiReturnType; - removeCacheByUri(uri: string): CallApiReturnType; - setCacheDir(path: string): CallApiReturnType; - setMaxCacheFileCount(count: number): CallApiReturnType; - setMaxCacheFileSize(cacheSize: number): CallApiReturnType; - enableAutoRemoveCache(enable: boolean): CallApiReturnType; - getCacheDir(path: string, length: number): CallApiReturnType; - getMaxCacheFileCount(): CallApiReturnType; - getMaxCacheFileSize(): CallApiReturnType; - getCacheFileCount(): CallApiReturnType; -} - -interface IMediaRecorder { - setMediaRecorderObserver(callback: IMediaRecorderObserver): CallApiReturnType; - startRecording(config: MediaRecorderConfiguration): CallApiReturnType; - stopRecording(): CallApiReturnType; -} - -declare enum STREAMING_SRC_ERR { - STREAMING_SRC_ERR_NONE = 0, - STREAMING_SRC_ERR_UNKNOWN = 1, - STREAMING_SRC_ERR_INVALID_PARAM = 2, - STREAMING_SRC_ERR_BAD_STATE = 3, - STREAMING_SRC_ERR_NO_MEM = 4, - STREAMING_SRC_ERR_BUFFER_OVERFLOW = 5, - STREAMING_SRC_ERR_BUFFER_UNDERFLOW = 6, - STREAMING_SRC_ERR_NOT_FOUND = 7, - STREAMING_SRC_ERR_TIMEOUT = 8, - STREAMING_SRC_ERR_EXPIRED = 9, - STREAMING_SRC_ERR_UNSUPPORTED = 10, - STREAMING_SRC_ERR_NOT_EXIST = 11, - STREAMING_SRC_ERR_EXIST = 12, - STREAMING_SRC_ERR_OPEN = 13, - STREAMING_SRC_ERR_CLOSE = 14, - STREAMING_SRC_ERR_READ = 15, - STREAMING_SRC_ERR_WRITE = 16, - STREAMING_SRC_ERR_SEEK = 17, - STREAMING_SRC_ERR_EOF = 18, - STREAMING_SRC_ERR_CODECOPEN = 19, - STREAMING_SRC_ERR_CODECCLOSE = 20, - STREAMING_SRC_ERR_CODECPROC = 21 -} -declare enum STREAMING_SRC_STATE { - STREAMING_SRC_STATE_CLOSED = 0, - STREAMING_SRC_STATE_OPENING = 1, - STREAMING_SRC_STATE_IDLE = 2, - STREAMING_SRC_STATE_PLAYING = 3, - STREAMING_SRC_STATE_SEEKING = 4, - STREAMING_SRC_STATE_EOF = 5, - STREAMING_SRC_STATE_ERROR = 6 -} -declare class InputSeiData { - type?: number; - timestamp?: number; - frame_index?: number; - private_data?: Uint8Array; - data_size?: number; -} - -declare enum PreloadStatusCode { - kPreloadStatusCompleted = 0, - kPreloadStatusFailed = 1, - kPreloadStatusPreloading = 2, - kPreloadStatusRemoved = 3 -} -declare enum MusicContentCenterStatusCode { - kMusicContentCenterStatusOk = 0, - kMusicContentCenterStatusErr = 1, - kMusicContentCenterStatusErrGateway = 2, - kMusicContentCenterStatusErrPermissionAndResource = 3, - kMusicContentCenterStatusErrInternalDataParse = 4, - kMusicContentCenterStatusErrMusicLoading = 5, - kMusicContentCenterStatusErrMusicDecryption = 6, - kMusicContentCenterStatusErrHttpInternalError = 7 -} -declare class MusicChartInfo { - chartName?: string; - id?: number; -} -declare enum MUSIC_CACHE_STATUS_TYPE { - MUSIC_CACHE_STATUS_TYPE_CACHED = 0, - MUSIC_CACHE_STATUS_TYPE_CACHING = 1 -} -declare class MusicCacheInfo { - songCode?: number; - status?: MUSIC_CACHE_STATUS_TYPE; -} -interface MusicChartCollection { - getCount(): CallApiReturnType; - get(index: number): CallApiReturnType; -} -declare class MvProperty { - resolution?: string; - bandwidth?: string; -} -declare class ClimaxSegment { - startTimeMs?: number; - endTimeMs?: number; -} -declare class Music { - songCode?: number; - name?: string; - singer?: string; - poster?: string; - releaseTime?: string; - durationS?: number; - type?: number; - pitchType?: number; - lyricCount?: number; - lyricList?: number[]; - climaxSegmentCount?: number; - climaxSegmentList?: ClimaxSegment[]; - mvPropertyCount?: number; - mvPropertyList?: MvProperty[]; -} -interface MusicCollection { - getCount(): CallApiReturnType; - getTotal(): CallApiReturnType; - getPage(): CallApiReturnType; - getPageSize(): CallApiReturnType; - getMusic(index: number): CallApiReturnType; -} -interface IMusicContentCenterEventHandler { - onMusicChartsResult(requestId: string, result: MusicChartCollection, errorCode: MusicContentCenterStatusCode): void; - onMusicCollectionResult(requestId: string, result: MusicCollection, errorCode: MusicContentCenterStatusCode): void; - onLyricResult(requestId: string, songCode: number, lyricUrl: string, errorCode: MusicContentCenterStatusCode): void; - onSongSimpleInfoResult(requestId: string, songCode: number, simpleInfo: string, errorCode: MusicContentCenterStatusCode): void; - onPreLoadEvent(requestId: string, songCode: number, percent: number, lyricUrl: string, status: PreloadStatusCode, errorCode: MusicContentCenterStatusCode): void; -} -declare class MusicContentCenterConfiguration { - appId?: string; - token?: string; - mccUid?: number; - maxCacheSize?: number; - mccDomain?: string; -} -interface IMusicPlayer { -} -interface IMusicContentCenter { - initialize(configuration: MusicContentCenterConfiguration): CallApiReturnType; - renewToken(token: string): CallApiReturnType; - release(): CallApiReturnType; - registerEventHandler(eventHandler: IMusicContentCenterEventHandler): CallApiReturnType; - unregisterEventHandler(): CallApiReturnType; - createMusicPlayer(): CallApiReturnType; - getMusicCharts(requestId: string): CallApiReturnType; - getMusicCollectionByMusicChartId(requestId: string, musicChartId: number, page: number, pageSize: number, jsonOption: string): CallApiReturnType; - searchMusic(requestId: string, keyWord: string, page: number, pageSize: number, jsonOption: string): CallApiReturnType; - preload(songCode: number, jsonOption: string): CallApiReturnType; - preload2(requestId: string, songCode: number): CallApiReturnType; - removeCache(songCode: number): CallApiReturnType; - getCaches(cacheInfo: MusicCacheInfo[], cacheInfoSize: number[]): CallApiReturnType; - isPreloaded(songCode: number): CallApiReturnType; - getLyric(requestId: string, songCode: number, LyricType: number): CallApiReturnType; - getSongSimpleInfo(requestId: string, songCode: number): CallApiReturnType; - getInternalSongCode(songCode: number, jsonOption: string, internalSongCode: number): CallApiReturnType; -} - -declare enum RHYTHM_PLAYER_STATE_TYPE { - RHYTHM_PLAYER_STATE_IDLE = 810, - RHYTHM_PLAYER_STATE_OPENING = 811, - RHYTHM_PLAYER_STATE_DECODING = 812, - RHYTHM_PLAYER_STATE_PLAYING = 813, - RHYTHM_PLAYER_STATE_FAILED = 814 -} -declare enum RHYTHM_PLAYER_ERROR_TYPE { - RHYTHM_PLAYER_ERROR_OK = 0, - RHYTHM_PLAYER_ERROR_FAILED = 1, - RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN = 801, - RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY = 802, - RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT = 803 -} -declare class AgoraRhythmPlayerConfig { - beatsPerMeasure?: number; - beatsPerMinute?: number; -} - -declare enum MEDIA_DEVICE_TYPE { - UNKNOWN_AUDIO_DEVICE = -1, - AUDIO_PLAYOUT_DEVICE = 0, - AUDIO_RECORDING_DEVICE = 1, - VIDEO_RENDER_DEVICE = 2, - VIDEO_CAPTURE_DEVICE = 3, - AUDIO_APPLICATION_PLAYOUT_DEVICE = 4, - AUDIO_VIRTUAL_PLAYOUT_DEVICE = 5, - AUDIO_VIRTUAL_RECORDING_DEVICE = 6 -} -declare enum AUDIO_MIXING_STATE_TYPE { - AUDIO_MIXING_STATE_PLAYING = 710, - AUDIO_MIXING_STATE_PAUSED = 711, - AUDIO_MIXING_STATE_STOPPED = 713, - AUDIO_MIXING_STATE_FAILED = 714 -} -declare enum AUDIO_MIXING_REASON_TYPE { - AUDIO_MIXING_REASON_CAN_NOT_OPEN = 701, - AUDIO_MIXING_REASON_TOO_FREQUENT_CALL = 702, - AUDIO_MIXING_REASON_INTERRUPTED_EOF = 703, - AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED = 721, - AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED = 723, - AUDIO_MIXING_REASON_STOPPED_BY_USER = 724, - AUDIO_MIXING_REASON_OK = 0 -} -declare enum INJECT_STREAM_STATUS { - INJECT_STREAM_STATUS_START_SUCCESS = 0, - INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1, - INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2, - INJECT_STREAM_STATUS_START_TIMEDOUT = 3, - INJECT_STREAM_STATUS_START_FAILED = 4, - INJECT_STREAM_STATUS_STOP_SUCCESS = 5, - INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6, - INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7, - INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8, - INJECT_STREAM_STATUS_STOP_FAILED = 9, - INJECT_STREAM_STATUS_BROKEN = 10 -} -declare enum AUDIO_EQUALIZATION_BAND_FREQUENCY { - AUDIO_EQUALIZATION_BAND_31 = 0, - AUDIO_EQUALIZATION_BAND_62 = 1, - AUDIO_EQUALIZATION_BAND_125 = 2, - AUDIO_EQUALIZATION_BAND_250 = 3, - AUDIO_EQUALIZATION_BAND_500 = 4, - AUDIO_EQUALIZATION_BAND_1K = 5, - AUDIO_EQUALIZATION_BAND_2K = 6, - AUDIO_EQUALIZATION_BAND_4K = 7, - AUDIO_EQUALIZATION_BAND_8K = 8, - AUDIO_EQUALIZATION_BAND_16K = 9 -} -declare enum AUDIO_REVERB_TYPE { - AUDIO_REVERB_DRY_LEVEL = 0, - AUDIO_REVERB_WET_LEVEL = 1, - AUDIO_REVERB_ROOM_SIZE = 2, - AUDIO_REVERB_WET_DELAY = 3, - AUDIO_REVERB_STRENGTH = 4 -} -declare enum STREAM_FALLBACK_OPTIONS { - STREAM_FALLBACK_OPTION_DISABLED = 0, - STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW = 1, - STREAM_FALLBACK_OPTION_AUDIO_ONLY = 2 -} -declare enum PRIORITY_TYPE { - PRIORITY_HIGH = 50, - PRIORITY_NORMAL = 100 -} -declare class LocalVideoStats { - uid?: number; - sentBitrate?: number; - sentFrameRate?: number; - captureFrameRate?: number; - captureFrameWidth?: number; - captureFrameHeight?: number; - regulatedCaptureFrameRate?: number; - regulatedCaptureFrameWidth?: number; - regulatedCaptureFrameHeight?: number; - encoderOutputFrameRate?: number; - encodedFrameWidth?: number; - encodedFrameHeight?: number; - rendererOutputFrameRate?: number; - targetBitrate?: number; - targetFrameRate?: number; - qualityAdaptIndication?: QUALITY_ADAPT_INDICATION; - encodedBitrate?: number; - encodedFrameCount?: number; - codecType?: VIDEO_CODEC_TYPE; - txPacketLossRate?: number; - captureBrightnessLevel?: CAPTURE_BRIGHTNESS_LEVEL_TYPE; - dualStreamEnabled?: boolean; - hwEncoderAccelerating?: number; -} -declare class RemoteAudioStats { - uid?: number; - quality?: number; - networkTransportDelay?: number; - jitterBufferDelay?: number; - audioLossRate?: number; - numChannels?: number; - receivedSampleRate?: number; - receivedBitrate?: number; - totalFrozenTime?: number; - frozenRate?: number; - mosValue?: number; - frozenRateByCustomPlcCount?: number; - plcCount?: number; - totalActiveTime?: number; - publishDuration?: number; - qoeQuality?: number; - qualityChangedReason?: number; - rxAudioBytes?: number; -} -declare class RemoteVideoStats { - uid?: number; - delay?: number; - e2eDelay?: number; - width?: number; - height?: number; - receivedBitrate?: number; - decoderOutputFrameRate?: number; - rendererOutputFrameRate?: number; - frameLossRate?: number; - packetLossRate?: number; - rxStreamType?: VIDEO_STREAM_TYPE; - totalFrozenTime?: number; - frozenRate?: number; - avSyncTimeMs?: number; - totalActiveTime?: number; - publishDuration?: number; - mosValue?: number; - rxVideoBytes?: number; -} -declare class Region { - uid?: number; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; - renderMode?: RENDER_MODE_TYPE; -} -declare class VideoCompositingLayout { - canvasWidth?: number; - canvasHeight?: number; - backgroundColor?: string; - regions?: Region[]; - regionCount?: number; - appData?: string; - appDataLength?: number; -} -declare class InjectStreamConfig { - width?: number; - height?: number; - videoGop?: number; - videoFramerate?: number; - videoBitrate?: number; - audioSampleRate?: AUDIO_SAMPLE_RATE_TYPE; - audioBitrate?: number; - audioChannels?: number; -} -declare enum RTMP_STREAM_LIFE_CYCLE_TYPE { - RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1, - RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2 -} -declare class PublisherConfiguration { - width?: number; - height?: number; - framerate?: number; - bitrate?: number; - defaultLayout?: number; - lifecycle?: number; - owner?: boolean; - injectStreamWidth?: number; - injectStreamHeight?: number; - injectStreamUrl?: string; - publishUrl?: string; - rawStreamUrl?: string; - extraInfo?: string; -} -declare enum CAMERA_DIRECTION { - CAMERA_REAR = 0, - CAMERA_FRONT = 1 -} -declare enum CLOUD_PROXY_TYPE { - NONE_PROXY = 0, - UDP_PROXY = 1, - TCP_PROXY = 2 -} -declare class CameraCapturerConfiguration { - cameraDirection?: CAMERA_DIRECTION; - deviceId?: string; - format?: VideoFormat; - followEncodeDimensionRatio?: boolean; -} -declare class ScreenCaptureConfiguration { - isCaptureWindow?: boolean; - displayId?: number; - screenRect?: Rectangle; - windowId?: any; - params?: ScreenCaptureParameters; - regionRect?: Rectangle; -} -declare class SIZE { - width?: number; - height?: number; -} -declare class ThumbImageBuffer { - buffer?: string; - length?: number; - width?: number; - height?: number; -} -declare enum ScreenCaptureSourceType { - ScreenCaptureSourceType_Unknown = -1, - ScreenCaptureSourceType_Window = 0, - ScreenCaptureSourceType_Screen = 1, - ScreenCaptureSourceType_Custom = 2 -} -declare class ScreenCaptureSourceInfo { - type?: ScreenCaptureSourceType; - sourceId?: any; - sourceName?: string; - thumbImage?: ThumbImageBuffer; - iconImage?: ThumbImageBuffer; - processPath?: string; - sourceTitle?: string; - primaryMonitor?: boolean; - isOccluded?: boolean; - position?: Rectangle; - minimizeWindow?: boolean; - sourceDisplayId?: any; -} -declare class AdvancedAudioOptions { - audioProcessingChannels?: number; -} -declare class ImageTrackOptions { - imageUrl?: string; - fps?: number; - mirrorMode?: VIDEO_MIRROR_MODE_TYPE; -} -declare class ChannelMediaOptions { - publishCameraTrack?: boolean; - publishSecondaryCameraTrack?: boolean; - publishThirdCameraTrack?: boolean; - publishFourthCameraTrack?: boolean; - publishMicrophoneTrack?: boolean; - publishScreenCaptureVideo?: boolean; - publishScreenCaptureAudio?: boolean; - publishScreenTrack?: boolean; - publishSecondaryScreenTrack?: boolean; - publishThirdScreenTrack?: boolean; - publishFourthScreenTrack?: boolean; - publishCustomAudioTrack?: boolean; - publishCustomAudioTrackId?: number; - publishCustomVideoTrack?: boolean; - publishEncodedVideoTrack?: boolean; - publishMediaPlayerAudioTrack?: boolean; - publishMediaPlayerVideoTrack?: boolean; - publishTranscodedVideoTrack?: boolean; - autoSubscribeAudio?: boolean; - autoSubscribeVideo?: boolean; - enableAudioRecordingOrPlayout?: boolean; - publishMediaPlayerId?: number; - clientRoleType?: CLIENT_ROLE_TYPE; - audienceLatencyLevel?: AUDIENCE_LATENCY_LEVEL_TYPE; - defaultVideoStreamType?: VIDEO_STREAM_TYPE; - channelProfile?: CHANNEL_PROFILE_TYPE; - audioDelayMs?: number; - mediaPlayerAudioDelayMs?: number; - token?: string; - enableBuiltInMediaEncryption?: boolean; - publishRhythmPlayerTrack?: boolean; - isInteractiveAudience?: boolean; - customVideoTrackId?: number; - isAudioFilterable?: boolean; -} -declare enum PROXY_TYPE { - NONE_PROXY_TYPE = 0, - UDP_PROXY_TYPE = 1, - TCP_PROXY_TYPE = 2, - LOCAL_PROXY_TYPE = 3, - TCP_PROXY_AUTO_FALLBACK_TYPE = 4, - HTTP_PROXY_TYPE = 5, - HTTPS_PROXY_TYPE = 6 -} -declare enum FeatureType { - VIDEO_VIRTUAL_BACKGROUND = 1, - VIDEO_BEAUTY_EFFECT = 2 -} -declare class LeaveChannelOptions { - stopAudioMixing?: boolean; - stopAllEffect?: boolean; - stopMicrophoneRecording?: boolean; -} -interface IRtcEngineEventHandler { - onJoinChannelSuccess(channel: string, uid: number, elapsed: number): void; - onRejoinChannelSuccess(channel: string, uid: number, elapsed: number): void; - onProxyConnected(channel: string, uid: number, proxyType: PROXY_TYPE, localProxyIp: string, elapsed: number): void; - onError(err: ERROR_CODE_TYPE, msg: string): void; - onAudioQuality(uid: number, quality: number, delay: number, lost: number): void; - onLastmileProbeResult(result: LastmileProbeResult): void; - onAudioVolumeIndication(speakers: AudioVolumeInfo[], speakerNumber: number, totalVolume: number): void; - onLeaveChannel(stats: RtcStats): void; - onRtcStats(stats: RtcStats): void; - onAudioDeviceStateChanged(deviceId: string, deviceType: number, deviceState: number): void; - onAudioMixingPositionChanged(position: number): void; - onAudioMixingFinished(): void; - onAudioEffectFinished(soundId: number): void; - onVideoDeviceStateChanged(deviceId: string, deviceType: number, deviceState: number): void; - onNetworkQuality(uid: number, txQuality: number, rxQuality: number): void; - onIntraRequestReceived(): void; - onUplinkNetworkInfoUpdated(info: UplinkNetworkInfo): void; - onDownlinkNetworkInfoUpdated(info: DownlinkNetworkInfo): void; - onLastmileQuality(quality: number): void; - onFirstLocalVideoFrame(source: VIDEO_SOURCE_TYPE, width: number, height: number, elapsed: number): void; - onFirstLocalVideoFramePublished(source: VIDEO_SOURCE_TYPE, elapsed: number): void; - onFirstRemoteVideoDecoded(uid: number, width: number, height: number, elapsed: number): void; - onVideoSizeChanged(sourceType: VIDEO_SOURCE_TYPE, uid: number, width: number, height: number, rotation: number): void; - onLocalVideoStateChanged(source: VIDEO_SOURCE_TYPE, state: LOCAL_VIDEO_STREAM_STATE, error: LOCAL_VIDEO_STREAM_ERROR): void; - onRemoteVideoStateChanged(uid: number, state: REMOTE_VIDEO_STATE, reason: REMOTE_VIDEO_STATE_REASON, elapsed: number): void; - onFirstRemoteVideoFrame(userId: number, width: number, height: number, elapsed: number): void; - onUserJoined(uid: number, elapsed: number): void; - onUserOffline(uid: number, reason: USER_OFFLINE_REASON_TYPE): void; - onUserMuteAudio(uid: number, muted: boolean): void; - onUserMuteVideo(userId: number, muted: boolean): void; - onUserEnableVideo(uid: number, enabled: boolean): void; - onUserStateChanged(uid: number, state: number): void; - onUserEnableLocalVideo(uid: number, enabled: boolean): void; - onLocalAudioStats(stats: LocalAudioStats): void; - onRemoteAudioStats(stats: RemoteAudioStats): void; - onLocalVideoStats(source: VIDEO_SOURCE_TYPE, stats: LocalVideoStats): void; - onRemoteVideoStats(stats: RemoteVideoStats): void; - onCameraReady(): void; - onCameraFocusAreaChanged(x: number, y: number, width: number, height: number): void; - onCameraExposureAreaChanged(x: number, y: number, width: number, height: number): void; - onFacePositionChanged(imageWidth: number, imageHeight: number, vecRectangle: Rectangle[], vecDistance: number[], numFaces: number): void; - onVideoStopped(): void; - onAudioMixingStateChanged(state: AUDIO_MIXING_STATE_TYPE, reason: AUDIO_MIXING_REASON_TYPE): void; - onRhythmPlayerStateChanged(state: RHYTHM_PLAYER_STATE_TYPE, errorCode: RHYTHM_PLAYER_ERROR_TYPE): void; - onConnectionLost(): void; - onConnectionInterrupted(): void; - onConnectionBanned(): void; - onStreamMessage(userId: number, streamId: number, data: string, length: number, sentTs: number): void; - onStreamMessageError(userId: number, streamId: number, code: number, missed: number, cached: number): void; - onRequestToken(): void; - onTokenPrivilegeWillExpire(token: string): void; - onLicenseValidationFailure(error: LICENSE_ERROR_TYPE): void; - onFirstLocalAudioFramePublished(elapsed: number): void; - onFirstRemoteAudioFrame(uid: number, elapsed: number): void; - onFirstRemoteAudioDecoded(uid: number, elapsed: number): void; - onLocalAudioStateChanged(state: LOCAL_AUDIO_STREAM_STATE, error: LOCAL_AUDIO_STREAM_ERROR): void; - onRemoteAudioStateChanged(uid: number, state: REMOTE_AUDIO_STATE, reason: REMOTE_AUDIO_STATE_REASON, elapsed: number): void; - onActiveSpeaker(userId: number): void; - onContentInspectResult(result: CONTENT_INSPECT_RESULT): void; - onSnapshotTaken(uid: number, filePath: string, width: number, height: number, errCode: number): void; - onClientRoleChanged(oldRole: CLIENT_ROLE_TYPE, newRole: CLIENT_ROLE_TYPE, newRoleOptions: ClientRoleOptions): void; - onClientRoleChangeFailed(reason: CLIENT_ROLE_CHANGE_FAILED_REASON, currentRole: CLIENT_ROLE_TYPE): void; - onAudioDeviceVolumeChanged(deviceType: MEDIA_DEVICE_TYPE, volume: number, muted: boolean): void; - onRtmpStreamingStateChanged(url: string, state: RTMP_STREAM_PUBLISH_STATE, errCode: RTMP_STREAM_PUBLISH_ERROR_TYPE): void; - onRtmpStreamingEvent(url: string, eventCode: RTMP_STREAMING_EVENT): void; - onTranscodingUpdated(): void; - onAudioRoutingChanged(routing: number): void; - onChannelMediaRelayStateChanged(state: number, code: number): void; - onChannelMediaRelayEvent(code: number): void; - onLocalPublishFallbackToAudioOnly(isFallbackOrRecover: boolean): void; - onRemoteSubscribeFallbackToAudioOnly(uid: number, isFallbackOrRecover: boolean): void; - onRemoteAudioTransportStats(uid: number, delay: number, lost: number, rxKBitRate: number): void; - onRemoteVideoTransportStats(uid: number, delay: number, lost: number, rxKBitRate: number): void; - onConnectionStateChanged(state: CONNECTION_STATE_TYPE, reason: CONNECTION_CHANGED_REASON_TYPE): void; - onWlAccMessage(reason: WLACC_MESSAGE_REASON, action: WLACC_SUGGEST_ACTION, wlAccMsg: string): void; - onWlAccStats(currentStats: WlAccStats, averageStats: WlAccStats): void; - onNetworkTypeChanged(type: NETWORK_TYPE): void; - onEncryptionError(errorType: ENCRYPTION_ERROR_TYPE): void; - onPermissionError(permissionType: PERMISSION_TYPE): void; - onLocalUserRegistered(uid: number, userAccount: string): void; - onUserInfoUpdated(uid: number, info: UserInfo): void; - onUploadLogResult(requestId: string, success: boolean, reason: UPLOAD_ERROR_REASON): void; - onAudioSubscribeStateChanged(channel: string, uid: number, oldState: STREAM_SUBSCRIBE_STATE, newState: STREAM_SUBSCRIBE_STATE, elapseSinceLastState: number): void; - onVideoSubscribeStateChanged(channel: string, uid: number, oldState: STREAM_SUBSCRIBE_STATE, newState: STREAM_SUBSCRIBE_STATE, elapseSinceLastState: number): void; - onAudioPublishStateChanged(channel: string, oldState: STREAM_PUBLISH_STATE, newState: STREAM_PUBLISH_STATE, elapseSinceLastState: number): void; - onVideoPublishStateChanged(source: VIDEO_SOURCE_TYPE, channel: string, oldState: STREAM_PUBLISH_STATE, newState: STREAM_PUBLISH_STATE, elapseSinceLastState: number): void; - onExtensionEvent(provider: string, extension: string, key: string, value: string): void; - onExtensionStarted(provider: string, extension: string): void; - onExtensionStopped(provider: string, extension: string): void; - onExtensionError(provider: string, extension: string, error: number, message: string): void; - onUserAccountUpdated(uid: number, userAccount: string): void; - onLocalVideoTranscoderError(stream: TranscodingVideoStream, error: VIDEO_TRANSCODER_ERROR): void; - onVideoRenderingTracingResult(uid: number, currentEvent: MEDIA_TRACE_EVENT, tracingInfo: VideoRenderingTracingInfo): void; -} -interface IVideoDeviceManager { - enumerateVideoDevices(): CallApiReturnType; - setDevice(deviceIdUTF8: string): CallApiReturnType; - getDevice(): CallApiReturnType; - numberOfCapabilities(deviceIdUTF8: string): CallApiReturnType; - getCapability(deviceIdUTF8: string, deviceCapabilityNumber: number, capability: VideoFormat): CallApiReturnType; - startDeviceTest(hwnd: any): CallApiReturnType; - stopDeviceTest(): CallApiReturnType; - release(): CallApiReturnType; -} -declare class RtcEngineContext { - appId?: string; - channelProfile?: CHANNEL_PROFILE_TYPE; - license?: string; - audioScenario?: AUDIO_SCENARIO_TYPE; - areaCode?: number; - logConfig?: LogConfig; - threadPriority?: THREAD_PRIORITY_TYPE; - useExternalEglContext?: boolean; - domainLimit?: boolean; - autoRegisterAgoraExtensions?: boolean; -} -declare enum METADATA_TYPE { - UNKNOWN_METADATA = -1, - VIDEO_METADATA = 0 -} -declare enum MAX_METADATA_SIZE_TYPE { - INVALID_METADATA_SIZE_IN_BYTE = -1, - DEFAULT_METADATA_SIZE_IN_BYTE = 512, - MAX_METADATA_SIZE_IN_BYTE = 1024 -} -declare class Metadata { - uid?: number; - size?: number; - buffer?: Uint8Array; - timeStampMs?: number; -} -interface IMetadataObserver { - onMetadataReceived(metadata: Metadata): void; -} -declare enum DIRECT_CDN_STREAMING_ERROR { - DIRECT_CDN_STREAMING_ERROR_OK = 0, - DIRECT_CDN_STREAMING_ERROR_FAILED = 1, - DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION = 2, - DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION = 3, - DIRECT_CDN_STREAMING_ERROR_NET_CONNECT = 4, - DIRECT_CDN_STREAMING_ERROR_BAD_NAME = 5 -} -declare enum DIRECT_CDN_STREAMING_STATE { - DIRECT_CDN_STREAMING_STATE_IDLE = 0, - DIRECT_CDN_STREAMING_STATE_RUNNING = 1, - DIRECT_CDN_STREAMING_STATE_STOPPED = 2, - DIRECT_CDN_STREAMING_STATE_FAILED = 3, - DIRECT_CDN_STREAMING_STATE_RECOVERING = 4 -} -declare class DirectCdnStreamingStats { - videoWidth?: number; - videoHeight?: number; - fps?: number; - videoBitrate?: number; - audioBitrate?: number; -} -interface IDirectCdnStreamingEventHandler { - onDirectCdnStreamingStateChanged(state: DIRECT_CDN_STREAMING_STATE, error: DIRECT_CDN_STREAMING_ERROR, message: string): void; - onDirectCdnStreamingStats(stats: DirectCdnStreamingStats): void; -} -declare class DirectCdnStreamingMediaOptions { - publishCameraTrack?: boolean; - publishMicrophoneTrack?: boolean; - publishCustomAudioTrack?: boolean; - publishCustomVideoTrack?: boolean; - publishMediaPlayerAudioTrack?: boolean; - publishMediaPlayerId?: number; - customVideoTrackId?: number; -} -declare class ExtensionInfo { - mediaSourceType?: MEDIA_SOURCE_TYPE; - remoteUid?: number; - channelId?: string; - localUid?: number; -} -interface IRtcEngine { - release(sync: boolean): CallApiReturnType; - initialize(context: RtcEngineContext): CallApiReturnType; - getVersion(): CallApiReturnType; - getErrorDescription(code: number): CallApiReturnType; - queryCodecCapability(codecInfo: CodecCapInfo[], size: number): CallApiReturnType; - preloadChannel(token: string, channelId: string, uid: number): CallApiReturnType; - preloadChannel2(token: string, channelId: string, userAccount: string): CallApiReturnType; - updatePreloadChannelToken(token: string): CallApiReturnType; - joinChannel(token: string, channelId: string, info: string, uid: number): CallApiReturnType; - joinChannel2(token: string, channelId: string, uid: number, options: ChannelMediaOptions): CallApiReturnType; - updateChannelMediaOptions(options: ChannelMediaOptions): CallApiReturnType; - leaveChannel(): CallApiReturnType; - leaveChannel2(options: LeaveChannelOptions): CallApiReturnType; - renewToken(token: string): CallApiReturnType; - setChannelProfile(profile: CHANNEL_PROFILE_TYPE): CallApiReturnType; - setClientRole(role: CLIENT_ROLE_TYPE): CallApiReturnType; - setClientRole2(role: CLIENT_ROLE_TYPE, options: ClientRoleOptions): CallApiReturnType; - startEchoTest(): CallApiReturnType; - startEchoTest2(intervalInSeconds: number): CallApiReturnType; - startEchoTest3(config: EchoTestConfiguration): CallApiReturnType; - stopEchoTest(): CallApiReturnType; - enableMultiCamera(enabled: boolean, config: CameraCapturerConfiguration): CallApiReturnType; - enableVideo(): CallApiReturnType; - disableVideo(): CallApiReturnType; - startPreview(): CallApiReturnType; - startPreview2(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - stopPreview(): CallApiReturnType; - stopPreview2(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - startLastmileProbeTest(config: LastmileProbeConfig): CallApiReturnType; - stopLastmileProbeTest(): CallApiReturnType; - setVideoEncoderConfiguration(config: VideoEncoderConfiguration): CallApiReturnType; - setBeautyEffectOptions(enabled: boolean, options: BeautyOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setLowlightEnhanceOptions(enabled: boolean, options: LowlightEnhanceOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setVideoDenoiserOptions(enabled: boolean, options: VideoDenoiserOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setColorEnhanceOptions(enabled: boolean, options: ColorEnhanceOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - enableVirtualBackground(enabled: boolean, backgroundSource: VirtualBackgroundSource, segproperty: SegmentationProperty, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setupRemoteVideo(canvas: VideoCanvas): CallApiReturnType; - setupLocalVideo(canvas: VideoCanvas): CallApiReturnType; - setVideoScenario(scenarioType: VIDEO_APPLICATION_SCENARIO_TYPE): CallApiReturnType; - enableAudio(): CallApiReturnType; - disableAudio(): CallApiReturnType; - setAudioProfile(profile: AUDIO_PROFILE_TYPE, scenario: AUDIO_SCENARIO_TYPE): CallApiReturnType; - setAudioProfile2(profile: AUDIO_PROFILE_TYPE): CallApiReturnType; - setAudioScenario(scenario: AUDIO_SCENARIO_TYPE): CallApiReturnType; - enableLocalAudio(enabled: boolean): CallApiReturnType; - muteLocalAudioStream(mute: boolean): CallApiReturnType; - muteAllRemoteAudioStreams(mute: boolean): CallApiReturnType; - setDefaultMuteAllRemoteAudioStreams(mute: boolean): CallApiReturnType; - muteRemoteAudioStream(uid: number, mute: boolean): CallApiReturnType; - muteLocalVideoStream(mute: boolean): CallApiReturnType; - enableLocalVideo(enabled: boolean): CallApiReturnType; - muteAllRemoteVideoStreams(mute: boolean): CallApiReturnType; - setDefaultMuteAllRemoteVideoStreams(mute: boolean): CallApiReturnType; - muteRemoteVideoStream(uid: number, mute: boolean): CallApiReturnType; - setRemoteVideoStreamType(uid: number, streamType: VIDEO_STREAM_TYPE): CallApiReturnType; - setRemoteVideoSubscriptionOptions(uid: number, options: VideoSubscriptionOptions): CallApiReturnType; - setRemoteDefaultVideoStreamType(streamType: VIDEO_STREAM_TYPE): CallApiReturnType; - setSubscribeAudioBlocklist(uidList: number, uidNumber: number): CallApiReturnType; - setSubscribeAudioAllowlist(uidList: number, uidNumber: number): CallApiReturnType; - setSubscribeVideoBlocklist(uidList: number, uidNumber: number): CallApiReturnType; - setSubscribeVideoAllowlist(uidList: number, uidNumber: number): CallApiReturnType; - enableAudioVolumeIndication(interval: number, smooth: number, reportVad: boolean): CallApiReturnType; - startAudioRecording(filePath: string, quality: AUDIO_RECORDING_QUALITY_TYPE): CallApiReturnType; - startAudioRecording2(filePath: string, sampleRate: number, quality: AUDIO_RECORDING_QUALITY_TYPE): CallApiReturnType; - startAudioRecording3(config: AudioRecordingConfiguration): CallApiReturnType; - registerAudioEncodedFrameObserver(config: AudioEncodedFrameObserverConfig, observer: IAudioEncodedFrameObserver): CallApiReturnType; - stopAudioRecording(): CallApiReturnType; - createMediaPlayer(): CallApiReturnType; - destroyMediaPlayer(media_player: IMediaPlayer): CallApiReturnType; - createMediaRecorder(info: RecorderStreamInfo): CallApiReturnType; - destroyMediaRecorder(mediaRecorder: IMediaRecorder): CallApiReturnType; - startAudioMixing(filePath: string, loopback: boolean, cycle: number): CallApiReturnType; - startAudioMixing2(filePath: string, loopback: boolean, cycle: number, startPos: number): CallApiReturnType; - stopAudioMixing(): CallApiReturnType; - pauseAudioMixing(): CallApiReturnType; - resumeAudioMixing(): CallApiReturnType; - selectAudioTrack(index: number): CallApiReturnType; - getAudioTrackCount(): CallApiReturnType; - adjustAudioMixingVolume(volume: number): CallApiReturnType; - adjustAudioMixingPublishVolume(volume: number): CallApiReturnType; - getAudioMixingPublishVolume(): CallApiReturnType; - adjustAudioMixingPlayoutVolume(volume: number): CallApiReturnType; - getAudioMixingPlayoutVolume(): CallApiReturnType; - getAudioMixingDuration(): CallApiReturnType; - getAudioMixingCurrentPosition(): CallApiReturnType; - setAudioMixingPosition(pos: number): CallApiReturnType; - setAudioMixingDualMonoMode(mode: AUDIO_MIXING_DUAL_MONO_MODE): CallApiReturnType; - setAudioMixingPitch(pitch: number): CallApiReturnType; - getEffectsVolume(): CallApiReturnType; - setEffectsVolume(volume: number): CallApiReturnType; - preloadEffect(soundId: number, filePath: string, startPos: number): CallApiReturnType; - playEffect(soundId: number, filePath: string, loopCount: number, pitch: number, pan: number, gain: number, publish: boolean, startPos: number): CallApiReturnType; - playAllEffects(loopCount: number, pitch: number, pan: number, gain: number, publish: boolean): CallApiReturnType; - getVolumeOfEffect(soundId: number): CallApiReturnType; - setVolumeOfEffect(soundId: number, volume: number): CallApiReturnType; - pauseEffect(soundId: number): CallApiReturnType; - pauseAllEffects(): CallApiReturnType; - resumeEffect(soundId: number): CallApiReturnType; - resumeAllEffects(): CallApiReturnType; - stopEffect(soundId: number): CallApiReturnType; - stopAllEffects(): CallApiReturnType; - unloadEffect(soundId: number): CallApiReturnType; - unloadAllEffects(): CallApiReturnType; - getEffectDuration(filePath: string): CallApiReturnType; - setEffectPosition(soundId: number, pos: number): CallApiReturnType; - getEffectCurrentPosition(soundId: number): CallApiReturnType; - enableSoundPositionIndication(enabled: boolean): CallApiReturnType; - setRemoteVoicePosition(uid: number, pan: number, gain: number): CallApiReturnType; - enableSpatialAudio(enabled: boolean): CallApiReturnType; - setRemoteUserSpatialAudioParams(uid: number, params: SpatialAudioParams): CallApiReturnType; - setVoiceBeautifierPreset(preset: VOICE_BEAUTIFIER_PRESET): CallApiReturnType; - setAudioEffectPreset(preset: AUDIO_EFFECT_PRESET): CallApiReturnType; - setVoiceConversionPreset(preset: VOICE_CONVERSION_PRESET): CallApiReturnType; - setAudioEffectParameters(preset: AUDIO_EFFECT_PRESET, param1: number, param2: number): CallApiReturnType; - setVoiceBeautifierParameters(preset: VOICE_BEAUTIFIER_PRESET, param1: number, param2: number): CallApiReturnType; - setVoiceConversionParameters(preset: VOICE_CONVERSION_PRESET, param1: number, param2: number): CallApiReturnType; - setLocalVoicePitch(pitch: number): CallApiReturnType; - setLocalVoiceFormant(formantRatio: number): CallApiReturnType; - setLocalVoiceEqualization(bandFrequency: AUDIO_EQUALIZATION_BAND_FREQUENCY, bandGain: number): CallApiReturnType; - setLocalVoiceReverb(reverbKey: AUDIO_REVERB_TYPE, value: number): CallApiReturnType; - setHeadphoneEQPreset(preset: HEADPHONE_EQUALIZER_PRESET): CallApiReturnType; - setHeadphoneEQParameters(lowGain: number, highGain: number): CallApiReturnType; - setLogFile(filePath: string): CallApiReturnType; - setLogFilter(filter: number): CallApiReturnType; - setLogLevel(level: LOG_LEVEL): CallApiReturnType; - setLogFileSize(fileSizeInKBytes: number): CallApiReturnType; - uploadLogFile(requestId: string): CallApiReturnType; - setLocalRenderMode(renderMode: RENDER_MODE_TYPE, mirrorMode: VIDEO_MIRROR_MODE_TYPE): CallApiReturnType; - setRemoteRenderMode(uid: number, renderMode: RENDER_MODE_TYPE, mirrorMode: VIDEO_MIRROR_MODE_TYPE): CallApiReturnType; - setLocalRenderMode2(renderMode: RENDER_MODE_TYPE): CallApiReturnType; - setLocalVideoMirrorMode(mirrorMode: VIDEO_MIRROR_MODE_TYPE): CallApiReturnType; - enableDualStreamMode(enabled: boolean): CallApiReturnType; - enableDualStreamMode2(enabled: boolean, streamConfig: SimulcastStreamConfig): CallApiReturnType; - setDualStreamMode(mode: SIMULCAST_STREAM_MODE): CallApiReturnType; - setDualStreamMode2(mode: SIMULCAST_STREAM_MODE, streamConfig: SimulcastStreamConfig): CallApiReturnType; - enableCustomAudioLocalPlayback(trackId: number, enabled: boolean): CallApiReturnType; - setRecordingAudioFrameParameters(sampleRate: number, channel: number, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE, samplesPerCall: number): CallApiReturnType; - setPlaybackAudioFrameParameters(sampleRate: number, channel: number, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE, samplesPerCall: number): CallApiReturnType; - setMixedAudioFrameParameters(sampleRate: number, channel: number, samplesPerCall: number): CallApiReturnType; - setEarMonitoringAudioFrameParameters(sampleRate: number, channel: number, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE, samplesPerCall: number): CallApiReturnType; - setPlaybackAudioFrameBeforeMixingParameters(sampleRate: number, channel: number): CallApiReturnType; - enableAudioSpectrumMonitor(intervalInMS: number): CallApiReturnType; - disableAudioSpectrumMonitor(): CallApiReturnType; - registerAudioSpectrumObserver(observer: IAudioSpectrumObserver): CallApiReturnType; - unregisterAudioSpectrumObserver(observer: IAudioSpectrumObserver): CallApiReturnType; - adjustRecordingSignalVolume(volume: number): CallApiReturnType; - muteRecordingSignal(mute: boolean): CallApiReturnType; - adjustPlaybackSignalVolume(volume: number): CallApiReturnType; - adjustUserPlaybackSignalVolume(uid: number, volume: number): CallApiReturnType; - setLocalPublishFallbackOption(option: STREAM_FALLBACK_OPTIONS): CallApiReturnType; - setRemoteSubscribeFallbackOption(option: STREAM_FALLBACK_OPTIONS): CallApiReturnType; - setHighPriorityUserList(uidList: number, uidNum: number, option: STREAM_FALLBACK_OPTIONS): CallApiReturnType; - enableLoopbackRecording(enabled: boolean, deviceName: string): CallApiReturnType; - adjustLoopbackSignalVolume(volume: number): CallApiReturnType; - getLoopbackRecordingVolume(): CallApiReturnType; - enableInEarMonitoring(enabled: boolean, includeAudioFilters: number): CallApiReturnType; - setInEarMonitoringVolume(volume: number): CallApiReturnType; - loadExtensionProvider(path: string, unload_after_use: boolean): CallApiReturnType; - setExtensionProviderProperty(provider: string, key: string, value: string): CallApiReturnType; - registerExtension(provider: string, extension: string, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - enableExtension(provider: string, extension: string, enable: boolean, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - enableExtension2(provider: string, extension: string, extensionInfo: ExtensionInfo, enable: boolean): CallApiReturnType; - setExtensionProperty(provider: string, extension: string, key: string, value: string, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - getExtensionProperty(provider: string, extension: string, key: string, value: string, buf_len: number, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setExtensionProperty2(provider: string, extension: string, extensionInfo: ExtensionInfo, key: string, value: string): CallApiReturnType; - getExtensionProperty2(provider: string, extension: string, extensionInfo: ExtensionInfo, key: string, value: string, buf_len: number): CallApiReturnType; - setCameraCapturerConfiguration(config: CameraCapturerConfiguration): CallApiReturnType; - createCustomVideoTrack(): CallApiReturnType; - createCustomEncodedVideoTrack(sender_option: SenderOptions): CallApiReturnType; - destroyCustomVideoTrack(video_track_id: number): CallApiReturnType; - destroyCustomEncodedVideoTrack(video_track_id: number): CallApiReturnType; - switchCamera(): CallApiReturnType; - isCameraZoomSupported(): CallApiReturnType; - isCameraFaceDetectSupported(): CallApiReturnType; - isCameraTorchSupported(): CallApiReturnType; - isCameraFocusSupported(): CallApiReturnType; - isCameraAutoFocusFaceModeSupported(): CallApiReturnType; - setCameraZoomFactor(factor: number): CallApiReturnType; - enableFaceDetection(enabled: boolean): CallApiReturnType; - getCameraMaxZoomFactor(): CallApiReturnType; - setCameraFocusPositionInPreview(positionX: number, positionY: number): CallApiReturnType; - setCameraTorchOn(isOn: boolean): CallApiReturnType; - setCameraAutoFocusFaceModeEnabled(enabled: boolean): CallApiReturnType; - isCameraExposurePositionSupported(): CallApiReturnType; - setCameraExposurePosition(positionXinView: number, positionYinView: number): CallApiReturnType; - isCameraExposureSupported(): CallApiReturnType; - setCameraExposureFactor(factor: number): CallApiReturnType; - isCameraAutoExposureFaceModeSupported(): CallApiReturnType; - setCameraAutoExposureFaceModeEnabled(enabled: boolean): CallApiReturnType; - setDefaultAudioRouteToSpeakerphone(defaultToSpeaker: boolean): CallApiReturnType; - setEnableSpeakerphone(speakerOn: boolean): CallApiReturnType; - isSpeakerphoneEnabled(): CallApiReturnType; - setRouteInCommunicationMode(route: number): CallApiReturnType; - getScreenCaptureSources(thumbSize: SIZE, iconSize: SIZE, includeScreen: boolean): CallApiReturnType; - setAudioSessionOperationRestriction(restriction: AUDIO_SESSION_OPERATION_RESTRICTION): CallApiReturnType; - startScreenCaptureByDisplayId(displayId: number, regionRect: Rectangle, captureParams: ScreenCaptureParameters): CallApiReturnType; - startScreenCaptureByScreenRect(screenRect: Rectangle, regionRect: Rectangle, captureParams: ScreenCaptureParameters): CallApiReturnType; - getAudioDeviceInfo(deviceInfo: DeviceInfo): CallApiReturnType; - startScreenCaptureByWindowId(windowId: any, regionRect: Rectangle, captureParams: ScreenCaptureParameters): CallApiReturnType; - setScreenCaptureContentHint(contentHint: VIDEO_CONTENT_HINT): CallApiReturnType; - updateScreenCaptureRegion(regionRect: Rectangle): CallApiReturnType; - updateScreenCaptureParameters(captureParams: ScreenCaptureParameters): CallApiReturnType; - startScreenCapture(captureParams: ScreenCaptureParameters2): CallApiReturnType; - updateScreenCapture(captureParams: ScreenCaptureParameters2): CallApiReturnType; - queryScreenCaptureCapability(): CallApiReturnType; - setScreenCaptureScenario(screenScenario: SCREEN_SCENARIO_TYPE): CallApiReturnType; - stopScreenCapture(): CallApiReturnType; - getCallId(callId: string): CallApiReturnType; - rate(callId: string, rating: number, description: string): CallApiReturnType; - complain(callId: string, description: string): CallApiReturnType; - startRtmpStreamWithoutTranscoding(url: string): CallApiReturnType; - startRtmpStreamWithTranscoding(url: string, transcoding: LiveTranscoding): CallApiReturnType; - updateRtmpTranscoding(transcoding: LiveTranscoding): CallApiReturnType; - stopRtmpStream(url: string): CallApiReturnType; - startLocalVideoTranscoder(config: LocalTranscoderConfiguration): CallApiReturnType; - updateLocalTranscoderConfiguration(config: LocalTranscoderConfiguration): CallApiReturnType; - stopLocalVideoTranscoder(): CallApiReturnType; - startCameraCapture(sourceType: VIDEO_SOURCE_TYPE, config: CameraCapturerConfiguration): CallApiReturnType; - stopCameraCapture(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - setCameraDeviceOrientation(type: VIDEO_SOURCE_TYPE, orientation: VIDEO_ORIENTATION): CallApiReturnType; - setScreenCaptureOrientation(type: VIDEO_SOURCE_TYPE, orientation: VIDEO_ORIENTATION): CallApiReturnType; - startScreenCapture2(sourceType: VIDEO_SOURCE_TYPE, config: ScreenCaptureConfiguration): CallApiReturnType; - stopScreenCapture2(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - getConnectionState(): CallApiReturnType; - registerEventHandler(eventHandler: IRtcEngineEventHandler): CallApiReturnType; - unregisterEventHandler(eventHandler: IRtcEngineEventHandler): CallApiReturnType; - setRemoteUserPriority(uid: number, userPriority: PRIORITY_TYPE): CallApiReturnType; - setEncryptionMode(encryptionMode: string): CallApiReturnType; - setEncryptionSecret(secret: string): CallApiReturnType; - enableEncryption(enabled: boolean, config: EncryptionConfig): CallApiReturnType; - createDataStream(streamId: number[], reliable: boolean, ordered: boolean): CallApiReturnType; - createDataStream2(streamId: number[], config: DataStreamConfig): CallApiReturnType; - sendStreamMessage(streamId: number, data: string, length: number): CallApiReturnType; - addVideoWatermark(watermark: RtcImage): CallApiReturnType; - addVideoWatermark2(watermarkUrl: string, options: WatermarkOptions): CallApiReturnType; - clearVideoWatermarks(): CallApiReturnType; - pauseAudio(): CallApiReturnType; - resumeAudio(): CallApiReturnType; - enableWebSdkInteroperability(enabled: boolean): CallApiReturnType; - sendCustomReportMessage(id: string, category: string, event: string, label: string, value: number): CallApiReturnType; - registerMediaMetadataObserver(observer: IMetadataObserver, type: METADATA_TYPE): CallApiReturnType; - unregisterMediaMetadataObserver(observer: IMetadataObserver, type: METADATA_TYPE): CallApiReturnType; - startAudioFrameDump(channel_id: string, user_id: number, location: string, uuid: string, passwd: string, duration_ms: number, auto_upload: boolean): CallApiReturnType; - stopAudioFrameDump(channel_id: string, user_id: number, location: string): CallApiReturnType; - setAINSMode(enabled: boolean, mode: AUDIO_AINS_MODE): CallApiReturnType; - registerLocalUserAccount(appId: string, userAccount: string): CallApiReturnType; - joinChannelWithUserAccount(token: string, channelId: string, userAccount: string): CallApiReturnType; - joinChannelWithUserAccount2(token: string, channelId: string, userAccount: string, options: ChannelMediaOptions): CallApiReturnType; - joinChannelWithUserAccountEx(token: string, channelId: string, userAccount: string, options: ChannelMediaOptions): CallApiReturnType; - getUserInfoByUserAccount(userAccount: string, userInfo: UserInfo[]): CallApiReturnType; - getUserInfoByUid(uid: number, userInfo: UserInfo[]): CallApiReturnType; - startOrUpdateChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): CallApiReturnType; - startChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): CallApiReturnType; - updateChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): CallApiReturnType; - stopChannelMediaRelay(): CallApiReturnType; - pauseAllChannelMediaRelay(): CallApiReturnType; - resumeAllChannelMediaRelay(): CallApiReturnType; - setDirectCdnStreamingAudioConfiguration(profile: AUDIO_PROFILE_TYPE): CallApiReturnType; - setDirectCdnStreamingVideoConfiguration(config: VideoEncoderConfiguration): CallApiReturnType; - startDirectCdnStreaming(eventHandler: IDirectCdnStreamingEventHandler, publishUrl: string, options: DirectCdnStreamingMediaOptions): CallApiReturnType; - stopDirectCdnStreaming(): CallApiReturnType; - updateDirectCdnStreamingMediaOptions(options: DirectCdnStreamingMediaOptions): CallApiReturnType; - startRhythmPlayer(sound1: string, sound2: string, config: AgoraRhythmPlayerConfig): CallApiReturnType; - stopRhythmPlayer(): CallApiReturnType; - configRhythmPlayer(config: AgoraRhythmPlayerConfig): CallApiReturnType; - takeSnapshot(uid: number, filePath: string): CallApiReturnType; - enableContentInspect(enabled: boolean, config: ContentInspectConfig): CallApiReturnType; - adjustCustomAudioPublishVolume(trackId: number, volume: number): CallApiReturnType; - adjustCustomAudioPlayoutVolume(trackId: number, volume: number): CallApiReturnType; - setCloudProxy(proxyType: CLOUD_PROXY_TYPE): CallApiReturnType; - setLocalAccessPoint(config: LocalAccessPointConfiguration): CallApiReturnType; - setAdvancedAudioOptions(options: AdvancedAudioOptions, sourceType: number): CallApiReturnType; - setAVSyncSource(channelId: string, uid: number): CallApiReturnType; - enableVideoImageSource(enable: boolean, options: ImageTrackOptions): CallApiReturnType; - getCurrentMonotonicTimeInMs(): CallApiReturnType; - enableWirelessAccelerate(enabled: boolean): CallApiReturnType; - getNetworkType(): CallApiReturnType; - setParameters(parameters: string): CallApiReturnType; - startMediaRenderingTracing(): CallApiReturnType; - enableInstantMediaRendering(): CallApiReturnType; - getNtpWallTimeInMs(): CallApiReturnType; - isFeatureAvailableOnDevice(type: FeatureType): CallApiReturnType; -} -declare enum QUALITY_REPORT_FORMAT_TYPE { - QUALITY_REPORT_JSON = 0, - QUALITY_REPORT_HTML = 1 -} -declare enum MEDIA_DEVICE_STATE_TYPE { - MEDIA_DEVICE_STATE_IDLE = 0, - MEDIA_DEVICE_STATE_ACTIVE = 1, - MEDIA_DEVICE_STATE_DISABLED = 2, - MEDIA_DEVICE_STATE_NOT_PRESENT = 4, - MEDIA_DEVICE_STATE_UNPLUGGED = 8 -} -declare enum VIDEO_PROFILE_TYPE { - VIDEO_PROFILE_LANDSCAPE_120P = 0, - VIDEO_PROFILE_LANDSCAPE_120P_3 = 2, - VIDEO_PROFILE_LANDSCAPE_180P = 10, - VIDEO_PROFILE_LANDSCAPE_180P_3 = 12, - VIDEO_PROFILE_LANDSCAPE_180P_4 = 13, - VIDEO_PROFILE_LANDSCAPE_240P = 20, - VIDEO_PROFILE_LANDSCAPE_240P_3 = 22, - VIDEO_PROFILE_LANDSCAPE_240P_4 = 23, - VIDEO_PROFILE_LANDSCAPE_360P = 30, - VIDEO_PROFILE_LANDSCAPE_360P_3 = 32, - VIDEO_PROFILE_LANDSCAPE_360P_4 = 33, - VIDEO_PROFILE_LANDSCAPE_360P_6 = 35, - VIDEO_PROFILE_LANDSCAPE_360P_7 = 36, - VIDEO_PROFILE_LANDSCAPE_360P_8 = 37, - VIDEO_PROFILE_LANDSCAPE_360P_9 = 38, - VIDEO_PROFILE_LANDSCAPE_360P_10 = 39, - VIDEO_PROFILE_LANDSCAPE_360P_11 = 100, - VIDEO_PROFILE_LANDSCAPE_480P = 40, - VIDEO_PROFILE_LANDSCAPE_480P_3 = 42, - VIDEO_PROFILE_LANDSCAPE_480P_4 = 43, - VIDEO_PROFILE_LANDSCAPE_480P_6 = 45, - VIDEO_PROFILE_LANDSCAPE_480P_8 = 47, - VIDEO_PROFILE_LANDSCAPE_480P_9 = 48, - VIDEO_PROFILE_LANDSCAPE_480P_10 = 49, - VIDEO_PROFILE_LANDSCAPE_720P = 50, - VIDEO_PROFILE_LANDSCAPE_720P_3 = 52, - VIDEO_PROFILE_LANDSCAPE_720P_5 = 54, - VIDEO_PROFILE_LANDSCAPE_720P_6 = 55, - VIDEO_PROFILE_LANDSCAPE_1080P = 60, - VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62, - VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64, - VIDEO_PROFILE_LANDSCAPE_1440P = 66, - VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67, - VIDEO_PROFILE_LANDSCAPE_4K = 70, - VIDEO_PROFILE_LANDSCAPE_4K_3 = 72, - VIDEO_PROFILE_PORTRAIT_120P = 1000, - VIDEO_PROFILE_PORTRAIT_120P_3 = 1002, - VIDEO_PROFILE_PORTRAIT_180P = 1010, - VIDEO_PROFILE_PORTRAIT_180P_3 = 1012, - VIDEO_PROFILE_PORTRAIT_180P_4 = 1013, - VIDEO_PROFILE_PORTRAIT_240P = 1020, - VIDEO_PROFILE_PORTRAIT_240P_3 = 1022, - VIDEO_PROFILE_PORTRAIT_240P_4 = 1023, - VIDEO_PROFILE_PORTRAIT_360P = 1030, - VIDEO_PROFILE_PORTRAIT_360P_3 = 1032, - VIDEO_PROFILE_PORTRAIT_360P_4 = 1033, - VIDEO_PROFILE_PORTRAIT_360P_6 = 1035, - VIDEO_PROFILE_PORTRAIT_360P_7 = 1036, - VIDEO_PROFILE_PORTRAIT_360P_8 = 1037, - VIDEO_PROFILE_PORTRAIT_360P_9 = 1038, - VIDEO_PROFILE_PORTRAIT_360P_10 = 1039, - VIDEO_PROFILE_PORTRAIT_360P_11 = 1100, - VIDEO_PROFILE_PORTRAIT_480P = 1040, - VIDEO_PROFILE_PORTRAIT_480P_3 = 1042, - VIDEO_PROFILE_PORTRAIT_480P_4 = 1043, - VIDEO_PROFILE_PORTRAIT_480P_6 = 1045, - VIDEO_PROFILE_PORTRAIT_480P_8 = 1047, - VIDEO_PROFILE_PORTRAIT_480P_9 = 1048, - VIDEO_PROFILE_PORTRAIT_480P_10 = 1049, - VIDEO_PROFILE_PORTRAIT_720P = 1050, - VIDEO_PROFILE_PORTRAIT_720P_3 = 1052, - VIDEO_PROFILE_PORTRAIT_720P_5 = 1054, - VIDEO_PROFILE_PORTRAIT_720P_6 = 1055, - VIDEO_PROFILE_PORTRAIT_1080P = 1060, - VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062, - VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064, - VIDEO_PROFILE_PORTRAIT_1440P = 1066, - VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067, - VIDEO_PROFILE_PORTRAIT_4K = 1070, - VIDEO_PROFILE_PORTRAIT_4K_3 = 1072, - VIDEO_PROFILE_DEFAULT = 30 -} - -declare class RtcConnection { - channelId?: string; - localUid?: number; -} -interface IRtcEngineEventHandlerEx extends IRtcEngineEventHandler { - onJoinChannelSuccessEx(connection: RtcConnection, elapsed: number): void; - onRejoinChannelSuccessEx(connection: RtcConnection, elapsed: number): void; - onAudioQualityEx(connection: RtcConnection, remoteUid: number, quality: number, delay: number, lost: number): void; - onAudioVolumeIndicationEx(connection: RtcConnection, speakers: AudioVolumeInfo[], speakerNumber: number, totalVolume: number): void; - onLeaveChannelEx(connection: RtcConnection, stats: RtcStats): void; - onRtcStatsEx(connection: RtcConnection, stats: RtcStats): void; - onNetworkQualityEx(connection: RtcConnection, remoteUid: number, txQuality: number, rxQuality: number): void; - onIntraRequestReceivedEx(connection: RtcConnection): void; - onFirstRemoteVideoDecodedEx(connection: RtcConnection, remoteUid: number, width: number, height: number, elapsed: number): void; - onVideoSizeChangedEx(connection: RtcConnection, sourceType: VIDEO_SOURCE_TYPE, uid: number, width: number, height: number, rotation: number): void; - onRemoteVideoStateChangedEx(connection: RtcConnection, remoteUid: number, state: REMOTE_VIDEO_STATE, reason: REMOTE_VIDEO_STATE_REASON, elapsed: number): void; - onFirstRemoteVideoFrameEx(connection: RtcConnection, remoteUid: number, width: number, height: number, elapsed: number): void; - onUserJoinedEx(connection: RtcConnection, remoteUid: number, elapsed: number): void; - onUserOfflineEx(connection: RtcConnection, remoteUid: number, reason: USER_OFFLINE_REASON_TYPE): void; - onUserMuteAudioEx(connection: RtcConnection, remoteUid: number, muted: boolean): void; - onUserMuteVideoEx(connection: RtcConnection, remoteUid: number, muted: boolean): void; - onUserEnableVideoEx(connection: RtcConnection, remoteUid: number, enabled: boolean): void; - onUserEnableLocalVideoEx(connection: RtcConnection, remoteUid: number, enabled: boolean): void; - onUserStateChangedEx(connection: RtcConnection, remoteUid: number, state: number): void; - onLocalAudioStatsEx(connection: RtcConnection, stats: LocalAudioStats): void; - onRemoteAudioStatsEx(connection: RtcConnection, stats: RemoteAudioStats): void; - onRemoteVideoStatsEx(connection: RtcConnection, stats: RemoteVideoStats): void; - onConnectionLostEx(connection: RtcConnection): void; - onConnectionInterruptedEx(connection: RtcConnection): void; - onConnectionBannedEx(connection: RtcConnection): void; - onStreamMessageEx(connection: RtcConnection, remoteUid: number, streamId: number, data: string, length: number, sentTs: number): void; - onStreamMessageErrorEx(connection: RtcConnection, remoteUid: number, streamId: number, code: number, missed: number, cached: number): void; - onRequestTokenEx(connection: RtcConnection): void; - onLicenseValidationFailureEx(connection: RtcConnection, reason: LICENSE_ERROR_TYPE): void; - onTokenPrivilegeWillExpireEx(connection: RtcConnection, token: string): void; - onFirstLocalAudioFramePublishedEx(connection: RtcConnection, elapsed: number): void; - onFirstRemoteAudioFrameEx(connection: RtcConnection, userId: number, elapsed: number): void; - onFirstRemoteAudioDecodedEx(connection: RtcConnection, uid: number, elapsed: number): void; - onLocalAudioStateChangedEx(connection: RtcConnection, state: LOCAL_AUDIO_STREAM_STATE, error: LOCAL_AUDIO_STREAM_ERROR): void; - onRemoteAudioStateChangedEx(connection: RtcConnection, remoteUid: number, state: REMOTE_AUDIO_STATE, reason: REMOTE_AUDIO_STATE_REASON, elapsed: number): void; - onActiveSpeakerEx(connection: RtcConnection, uid: number): void; - onClientRoleChangedEx(connection: RtcConnection, oldRole: CLIENT_ROLE_TYPE, newRole: CLIENT_ROLE_TYPE, newRoleOptions: ClientRoleOptions): void; - onClientRoleChangeFailedEx(connection: RtcConnection, reason: CLIENT_ROLE_CHANGE_FAILED_REASON, currentRole: CLIENT_ROLE_TYPE): void; - onRemoteAudioTransportStatsEx(connection: RtcConnection, remoteUid: number, delay: number, lost: number, rxKBitRate: number): void; - onRemoteVideoTransportStatsEx(connection: RtcConnection, remoteUid: number, delay: number, lost: number, rxKBitRate: number): void; - onConnectionStateChangedEx(connection: RtcConnection, state: CONNECTION_STATE_TYPE, reason: CONNECTION_CHANGED_REASON_TYPE): void; - onWlAccMessageEx(connection: RtcConnection, reason: WLACC_MESSAGE_REASON, action: WLACC_SUGGEST_ACTION, wlAccMsg: string): void; - onWlAccStatsEx(connection: RtcConnection, currentStats: WlAccStats, averageStats: WlAccStats): void; - onNetworkTypeChangedEx(connection: RtcConnection, type: NETWORK_TYPE): void; - onEncryptionErrorEx(connection: RtcConnection, errorType: ENCRYPTION_ERROR_TYPE): void; - onUploadLogResultEx(connection: RtcConnection, requestId: string, success: boolean, reason: UPLOAD_ERROR_REASON): void; - onUserAccountUpdatedEx(connection: RtcConnection, remoteUid: number, userAccount: string): void; - onSnapshotTakenEx(connection: RtcConnection, uid: number, filePath: string, width: number, height: number, errCode: number): void; - onVideoRenderingTracingResultEx(connection: RtcConnection, uid: number, currentEvent: MEDIA_TRACE_EVENT, tracingInfo: VideoRenderingTracingInfo): void; -} -interface IRtcEngineEx { - joinChannelEx(token: string, connection: RtcConnection, options: ChannelMediaOptions): CallApiReturnType; - leaveChannelEx(connection: RtcConnection): CallApiReturnType; - leaveChannelEx2(connection: RtcConnection, options: LeaveChannelOptions): CallApiReturnType; - updateChannelMediaOptionsEx(options: ChannelMediaOptions, connection: RtcConnection): CallApiReturnType; - setVideoEncoderConfigurationEx(config: VideoEncoderConfiguration, connection: RtcConnection): CallApiReturnType; - setupRemoteVideoEx(canvas: VideoCanvas, connection: RtcConnection): CallApiReturnType; - muteRemoteAudioStreamEx(uid: number, mute: boolean, connection: RtcConnection): CallApiReturnType; - muteRemoteVideoStreamEx(uid: number, mute: boolean, connection: RtcConnection): CallApiReturnType; - setRemoteVideoStreamTypeEx(uid: number, streamType: VIDEO_STREAM_TYPE, connection: RtcConnection): CallApiReturnType; - muteLocalAudioStreamEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - muteLocalVideoStreamEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - muteAllRemoteAudioStreamsEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - muteAllRemoteVideoStreamsEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - setSubscribeAudioBlocklistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setSubscribeAudioAllowlistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setSubscribeVideoBlocklistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setSubscribeVideoAllowlistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setRemoteVideoSubscriptionOptionsEx(uid: number, options: VideoSubscriptionOptions, connection: RtcConnection): CallApiReturnType; - setRemoteVoicePositionEx(uid: number, pan: number, gain: number, connection: RtcConnection): CallApiReturnType; - setRemoteUserSpatialAudioParamsEx(uid: number, params: SpatialAudioParams, connection: RtcConnection): CallApiReturnType; - setRemoteRenderModeEx(uid: number, renderMode: RENDER_MODE_TYPE, mirrorMode: VIDEO_MIRROR_MODE_TYPE, connection: RtcConnection): CallApiReturnType; - enableLoopbackRecordingEx(connection: RtcConnection, enabled: boolean, deviceName: string): CallApiReturnType; - adjustRecordingSignalVolumeEx(volume: number, connection: RtcConnection): CallApiReturnType; - muteRecordingSignalEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - adjustUserPlaybackSignalVolumeEx(uid: number, volume: number, connection: RtcConnection): CallApiReturnType; - getConnectionStateEx(connection: RtcConnection): CallApiReturnType; - enableEncryptionEx(connection: RtcConnection, enabled: boolean, config: EncryptionConfig): CallApiReturnType; - createDataStreamEx(streamId: number[], reliable: boolean, ordered: boolean, connection: RtcConnection): CallApiReturnType; - createDataStreamEx2(streamId: number[], config: DataStreamConfig, connection: RtcConnection): CallApiReturnType; - sendStreamMessageEx(streamId: number, data: string, length: number, connection: RtcConnection): CallApiReturnType; - addVideoWatermarkEx(watermarkUrl: string, options: WatermarkOptions, connection: RtcConnection): CallApiReturnType; - clearVideoWatermarkEx(connection: RtcConnection): CallApiReturnType; - sendCustomReportMessageEx(id: string, category: string, event: string, label: string, value: number, connection: RtcConnection): CallApiReturnType; - enableAudioVolumeIndicationEx(interval: number, smooth: number, reportVad: boolean, connection: RtcConnection): CallApiReturnType; - startRtmpStreamWithoutTranscodingEx(url: string, connection: RtcConnection): CallApiReturnType; - startRtmpStreamWithTranscodingEx(url: string, transcoding: LiveTranscoding, connection: RtcConnection): CallApiReturnType; - updateRtmpTranscodingEx(transcoding: LiveTranscoding, connection: RtcConnection): CallApiReturnType; - stopRtmpStreamEx(url: string, connection: RtcConnection): CallApiReturnType; - startOrUpdateChannelMediaRelayEx(configuration: ChannelMediaRelayConfiguration, connection: RtcConnection): CallApiReturnType; - startChannelMediaRelayEx(configuration: ChannelMediaRelayConfiguration, connection: RtcConnection): CallApiReturnType; - updateChannelMediaRelayEx(configuration: ChannelMediaRelayConfiguration, connection: RtcConnection): CallApiReturnType; - stopChannelMediaRelayEx(connection: RtcConnection): CallApiReturnType; - pauseAllChannelMediaRelayEx(connection: RtcConnection): CallApiReturnType; - resumeAllChannelMediaRelayEx(connection: RtcConnection): CallApiReturnType; - getUserInfoByUserAccountEx(userAccount: string, userInfo: UserInfo[], connection: RtcConnection): CallApiReturnType; - getUserInfoByUidEx(uid: number, userInfo: UserInfo[], connection: RtcConnection): CallApiReturnType; - enableDualStreamModeEx(enabled: boolean, streamConfig: SimulcastStreamConfig, connection: RtcConnection): CallApiReturnType; - setDualStreamModeEx(mode: SIMULCAST_STREAM_MODE, streamConfig: SimulcastStreamConfig, connection: RtcConnection): CallApiReturnType; - setHighPriorityUserListEx(uidList: number, uidNum: number, option: STREAM_FALLBACK_OPTIONS, connection: RtcConnection): CallApiReturnType; - takeSnapshotEx(connection: RtcConnection, uid: number, filePath: string): CallApiReturnType; - enableContentInspectEx(enabled: boolean, config: ContentInspectConfig, connection: RtcConnection): CallApiReturnType; - startMediaRenderingTracingEx(connection: RtcConnection): CallApiReturnType; -} - -declare class RemoteVoicePositionInfo { - position?: number; - forward?: number; -} -declare class SpatialAudioZone { - zoneSetId?: number; - position?: number; - forward?: number; - right?: number; - up?: number; - forwardLength?: number; - rightLength?: number; - upLength?: number; - audioAttenuation?: number; -} -interface IBaseSpatialAudioEngine { - release(): CallApiReturnType; - setMaxAudioRecvCount(maxCount: number): CallApiReturnType; - setAudioRecvRange(range: number): CallApiReturnType; - setDistanceUnit(unit: number): CallApiReturnType; - updateSelfPosition(position: number, axisForward: number, axisRight: number, axisUp: number): CallApiReturnType; - updateSelfPositionEx(position: number, axisForward: number, axisRight: number, axisUp: number, connection: RtcConnection): CallApiReturnType; - updatePlayerPositionInfo(playerId: number, positionInfo: RemoteVoicePositionInfo): CallApiReturnType; - setParameters(params: string): CallApiReturnType; - muteLocalAudioStream(mute: boolean): CallApiReturnType; - muteAllRemoteAudioStreams(mute: boolean): CallApiReturnType; - setZones(zones: SpatialAudioZone[], zoneCount: number): CallApiReturnType; - setPlayerAttenuation(playerId: number, attenuation: number, forceSet: boolean): CallApiReturnType; - muteRemoteAudioStream(uid: number, mute: boolean): CallApiReturnType; -} -interface ILocalSpatialAudioEngine { - initialize(): CallApiReturnType; - updateRemotePosition(uid: number, posInfo: RemoteVoicePositionInfo): CallApiReturnType; - updateRemotePositionEx(uid: number, posInfo: RemoteVoicePositionInfo, connection: RtcConnection): CallApiReturnType; - removeRemotePosition(uid: number): CallApiReturnType; - removeRemotePositionEx(uid: number, connection: RtcConnection): CallApiReturnType; - clearRemotePositions(): CallApiReturnType; - clearRemotePositionsEx(connection: RtcConnection): CallApiReturnType; - setRemoteAudioAttenuation(uid: number, attenuation: number, forceSet: boolean): CallApiReturnType; -} - -declare enum MAX_DEVICE_ID_LENGTH_TYPE { - MAX_DEVICE_ID_LENGTH = 512 -} -interface IAudioDeviceManager { - enumeratePlaybackDevices(): CallApiReturnType; - enumerateRecordingDevices(): CallApiReturnType; - setPlaybackDevice(deviceId: string[]): CallApiReturnType; - getPlaybackDevice(deviceId: string): CallApiReturnType; - getPlaybackDeviceInfo(): CallApiReturnType; - setPlaybackDeviceVolume(volume: number): CallApiReturnType; - getPlaybackDeviceVolume(volume: number[]): CallApiReturnType; - setRecordingDevice(deviceId: string[]): CallApiReturnType; - getRecordingDevice(deviceId: string): CallApiReturnType; - getRecordingDeviceInfo(): CallApiReturnType; - setRecordingDeviceVolume(volume: number): CallApiReturnType; - getRecordingDeviceVolume(volume: number[]): CallApiReturnType; - setLoopbackDevice(deviceId: string[]): CallApiReturnType; - getLoopbackDevice(deviceId: string): CallApiReturnType; - setPlaybackDeviceMute(mute: boolean): CallApiReturnType; - getPlaybackDeviceMute(mute: boolean): CallApiReturnType; - setRecordingDeviceMute(mute: boolean): CallApiReturnType; - getRecordingDeviceMute(mute: boolean): CallApiReturnType; - startPlaybackDeviceTest(testAudioFilePath: string): CallApiReturnType; - stopPlaybackDeviceTest(): CallApiReturnType; - startRecordingDeviceTest(indicationInterval: number): CallApiReturnType; - stopRecordingDeviceTest(): CallApiReturnType; - startAudioDeviceLoopbackTest(indicationInterval: number): CallApiReturnType; - stopAudioDeviceLoopbackTest(): CallApiReturnType; - followSystemPlaybackDevice(enable: boolean): CallApiReturnType; - followSystemRecordingDevice(enable: boolean): CallApiReturnType; - followSystemLoopbackDevice(enable: boolean): CallApiReturnType; - release(): CallApiReturnType; -} - -export { AREA_CODE, AREA_CODE_EX, AUDIENCE_LATENCY_LEVEL_TYPE, AUDIO_AINS_MODE, AUDIO_CODEC_PROFILE_TYPE, AUDIO_CODEC_TYPE, AUDIO_DUAL_MONO_MODE, AUDIO_EFFECT_PRESET, AUDIO_ENCODED_FRAME_OBSERVER_POSITION, AUDIO_ENCODING_TYPE, AUDIO_EQUALIZATION_BAND_FREQUENCY, AUDIO_FILE_RECORDING_TYPE, AUDIO_FRAME_POSITION, AUDIO_FRAME_TYPE, AUDIO_MIXING_DUAL_MONO_MODE, AUDIO_MIXING_REASON_TYPE, AUDIO_MIXING_STATE_TYPE, AUDIO_PROFILE_TYPE, AUDIO_RECORDING_QUALITY_TYPE, AUDIO_REVERB_TYPE, AUDIO_SAMPLE_RATE_TYPE, AUDIO_SCENARIO_TYPE, AUDIO_SESSION_OPERATION_RESTRICTION, AUDIO_TRACK_TYPE, AdvanceOptions, AdvancedAudioOptions, AdvancedConfigInfo, AgoraRhythmPlayerConfig, AudioEncodedFrameInfo, AudioEncodedFrameObserverConfig, AudioFrame, AudioParameters, AudioParams, AudioPcmDataInfo, AudioPcmFrame, AudioRecordingConfiguration, AudioRoute, AudioSpectrumData, AudioTrackConfig, AudioVolumeInfo, BACKGROUND_BLUR_DEGREE, BACKGROUND_SOURCE_TYPE, BYTES_PER_SAMPLE, BeautyOptions, CAMERA_DIRECTION, CAMERA_VIDEO_SOURCE_TYPE, CAPTURE_BRIGHTNESS_LEVEL_TYPE, CHANNEL_MEDIA_RELAY_ERROR, CHANNEL_MEDIA_RELAY_EVENT, CHANNEL_MEDIA_RELAY_STATE, CHANNEL_PROFILE_TYPE, CLIENT_ROLE_CHANGE_FAILED_REASON, CLIENT_ROLE_TYPE, CLOUD_PROXY_TYPE, CODEC_CAP_MASK, COMPRESSION_PREFERENCE, CONFIG_FETCH_TYPE, CONNECTION_CHANGED_REASON_TYPE, CONNECTION_STATE_TYPE, CONTENT_INSPECT_RESULT, CONTENT_INSPECT_TYPE, CacheStatistics, CameraCapturerConfiguration, ChannelMediaInfo, ChannelMediaOptions, ChannelMediaRelayConfiguration, ClientRoleOptions, ClimaxSegment, CodecCapInfo, CodecCapLevels, ColorEnhanceOptions, ContentInspectConfig, ContentInspectModule, DEGRADATION_PREFERENCE, DIRECT_CDN_STREAMING_ERROR, DIRECT_CDN_STREAMING_STATE, DataStreamConfig, DeviceInfo, DirectCdnStreamingMediaOptions, DirectCdnStreamingStats, DownlinkNetworkInfo, EAR_MONITORING_FILTER_TYPE, EGL_CONTEXT_TYPE, ENCODING_PREFERENCE, ENCRYPTION_ERROR_TYPE, ENCRYPTION_MODE, ERROR_CODE_TYPE, EXPERIENCE_POOR_REASON, EXPERIENCE_QUALITY_TYPE, EXTERNAL_VIDEO_SOURCE_TYPE, EchoTestConfiguration, EncodedAudioFrameAdvancedSettings, EncodedAudioFrameInfo, EncodedVideoFrameInfo, EncryptionConfig, ExtensionInfo, ExternalVideoFrame, FIT_MODE_TYPE, FRAME_HEIGHT, FRAME_RATE, FRAME_WIDTH, FeatureType, H264PacketizeMode, HEADPHONE_EQUALIZER_PRESET, IAudioDeviceManager, IAudioEncodedFrameObserver, IAudioFrameObserver, IAudioFrameObserverBase, IAudioPcmFrameSink, IAudioSpectrumObserver, IBaseSpatialAudioEngine, IDirectCdnStreamingEventHandler, ILocalSpatialAudioEngine, IMediaEngine, IMediaPlayer, IMediaPlayerCacheManager, IMediaPlayerSourceObserver, IMediaRecorder, IMediaRecorderObserver, IMetadataObserver, IMusicContentCenter, IMusicContentCenterEventHandler, IMusicPlayer, INJECT_STREAM_STATUS, INTERFACE_ID_TYPE, IRtcEngine, IRtcEngineEventHandler, IRtcEngineEventHandlerEx, IRtcEngineEx, IVideoDeviceManager, IVideoEncodedFrameObserver, IVideoFrameObserver, ImageTrackOptions, InjectStreamConfig, InputSeiData, LASTMILE_PROBE_RESULT_STATE, LICENSE_ERROR_TYPE, LIGHTENING_CONTRAST_LEVEL, LOCAL_AUDIO_STREAM_ERROR, LOCAL_AUDIO_STREAM_STATE, LOCAL_PROXY_MODE, LOCAL_VIDEO_STREAM_ERROR, LOCAL_VIDEO_STREAM_STATE, LOG_FILTER_TYPE, LOG_LEVEL, LOW_LIGHT_ENHANCE_LEVEL, LOW_LIGHT_ENHANCE_MODE, LastmileProbeConfig, LastmileProbeOneWayResult, LastmileProbeResult, LeaveChannelOptions, LiveStreamAdvancedFeature, LiveTranscoding, LocalAccessPointConfiguration, LocalAudioStats, LocalTranscoderConfiguration, LocalVideoStats, LogConfig, LogUploadServerInfo, LowlightEnhanceOptions, MAX_DEVICE_ID_LENGTH_TYPE, MAX_METADATA_SIZE_TYPE, MAX_USER_ACCOUNT_LENGTH_TYPE, MEDIA_DEVICE_STATE_TYPE, MEDIA_DEVICE_TYPE, MEDIA_PLAYER_ERROR, MEDIA_PLAYER_EVENT, MEDIA_PLAYER_METADATA_TYPE, MEDIA_PLAYER_SOURCE_TYPE, MEDIA_PLAYER_STATE, MEDIA_SOURCE_TYPE, MEDIA_STREAM_TYPE, MEDIA_TRACE_EVENT, METADATA_TYPE, MUSIC_CACHE_STATUS_TYPE, MediaRecorderConfiguration, MediaRecorderContainerFormat, MediaRecorderStreamType, MediaSource, Metadata, Music, MusicCacheInfo, MusicChartCollection, MusicChartInfo, MusicCollection, MusicContentCenterConfiguration, MusicContentCenterStatusCode, MvProperty, NETWORK_TYPE, ORIENTATION_MODE, PERMISSION_TYPE, PLAYER_PRELOAD_EVENT, PRIORITY_TYPE, PROXY_TYPE, Packet, PacketOptions, PeerDownlinkInfo, PlayerStreamInfo, PlayerUpdatedInfo, PreloadStatusCode, PublisherConfiguration, QUALITY_ADAPT_INDICATION, QUALITY_REPORT_FORMAT_TYPE, QUALITY_TYPE, RAW_AUDIO_FRAME_OP_MODE_TYPE, REMOTE_AUDIO_STATE, REMOTE_AUDIO_STATE_REASON, REMOTE_USER_STATE, REMOTE_VIDEO_DOWNSCALE_LEVEL, REMOTE_VIDEO_STATE, REMOTE_VIDEO_STATE_REASON, RENDER_MODE_TYPE, RHYTHM_PLAYER_ERROR_TYPE, RHYTHM_PLAYER_STATE_TYPE, RTMP_STREAMING_EVENT, RTMP_STREAM_LIFE_CYCLE_TYPE, RTMP_STREAM_PUBLISH_ERROR_TYPE, RTMP_STREAM_PUBLISH_STATE, RecorderErrorCode, RecorderInfo, RecorderState, RecorderStreamInfo, Rectangle, Region, RemoteAudioStats, RemoteVideoStats, RemoteVoicePositionInfo, RtcConnection, RtcEngineContext, RtcImage, RtcStats, SCREEN_CAPTURE_FRAMERATE_CAPABILITY, SCREEN_SCENARIO_TYPE, SEG_MODEL_TYPE, SIMULCAST_STREAM_MODE, SIZE, STREAMING_SRC_ERR, STREAMING_SRC_STATE, STREAM_FALLBACK_OPTIONS, STREAM_PUBLISH_STATE, STREAM_SUBSCRIBE_STATE, ScreenAudioParameters, ScreenCaptureConfiguration, ScreenCaptureParameters, ScreenCaptureParameters2, ScreenCaptureSourceInfo, ScreenCaptureSourceType, ScreenVideoParameters, SegmentationProperty, SenderOptions, SimulcastStreamConfig, SpatialAudioParams, SpatialAudioZone, SrcInfo, TCcMode, THREAD_PRIORITY_TYPE, ThumbImageBuffer, TranscodingUser, TranscodingVideoStream, UPLOAD_ERROR_REASON, USER_OFFLINE_REASON_TYPE, UplinkNetworkInfo, UserAudioSpectrumInfo, UserInfo, VIDEO_APPLICATION_SCENARIO_TYPE, VIDEO_BUFFER_TYPE, VIDEO_CODEC_CAPABILITY_LEVEL, VIDEO_CODEC_PROFILE_TYPE, VIDEO_CODEC_TYPE, VIDEO_CODEC_TYPE_FOR_STREAM, VIDEO_CONTENT_HINT, VIDEO_DENOISER_LEVEL, VIDEO_DENOISER_MODE, VIDEO_FRAME_PROCESS_MODE, VIDEO_FRAME_TYPE, VIDEO_MIRROR_MODE_TYPE, VIDEO_MODULE_POSITION, VIDEO_ORIENTATION, VIDEO_PIXEL_FORMAT, VIDEO_PROFILE_TYPE, VIDEO_SOURCE_TYPE, VIDEO_STREAM_TYPE, VIDEO_TRANSCODER_ERROR, VIDEO_VIEW_SETUP_MODE, VOICE_BEAUTIFIER_PRESET, VOICE_CONVERSION_PRESET, VideoCanvas, VideoCompositingLayout, VideoDenoiserOptions, VideoDimensions, VideoEncoderConfiguration, VideoFormat, VideoFrame, VideoRenderingTracingInfo, VideoSubscriptionOptions, VideoTrackInfo, VirtualBackgroundSource, WARN_CODE_TYPE, WATERMARK_FIT_MODE, WLACC_MESSAGE_REASON, WLACC_SUGGEST_ACTION, WatermarkOptions, WatermarkRatio, WlAccStats }; diff --git a/packages/@iris/rtc/.dist/@iris/web-rtc.d.ts b/packages/@iris/rtc/.dist/@iris/web-rtc.d.ts deleted file mode 100644 index cb49f9b..0000000 --- a/packages/@iris/rtc/.dist/@iris/web-rtc.d.ts +++ /dev/null @@ -1,2996 +0,0 @@ -import { CallApiReturnType } from 'iris-web-core'; - -declare enum VIDEO_SOURCE_TYPE { - VIDEO_SOURCE_CAMERA_PRIMARY = 0, - VIDEO_SOURCE_CAMERA = 0, - VIDEO_SOURCE_CAMERA_SECONDARY = 1, - VIDEO_SOURCE_SCREEN_PRIMARY = 2, - VIDEO_SOURCE_SCREEN = 2, - VIDEO_SOURCE_SCREEN_SECONDARY = 3, - VIDEO_SOURCE_CUSTOM = 4, - VIDEO_SOURCE_MEDIA_PLAYER = 5, - VIDEO_SOURCE_RTC_IMAGE_PNG = 6, - VIDEO_SOURCE_RTC_IMAGE_JPEG = 7, - VIDEO_SOURCE_RTC_IMAGE_GIF = 8, - VIDEO_SOURCE_REMOTE = 9, - VIDEO_SOURCE_TRANSCODED = 10, - VIDEO_SOURCE_CAMERA_THIRD = 11, - VIDEO_SOURCE_CAMERA_FOURTH = 12, - VIDEO_SOURCE_SCREEN_THIRD = 13, - VIDEO_SOURCE_SCREEN_FOURTH = 14, - VIDEO_SOURCE_UNKNOWN = 100 -} -declare enum AudioRoute { - ROUTE_DEFAULT = -1, - ROUTE_HEADSET = 0, - ROUTE_EARPIECE = 1, - ROUTE_HEADSETNOMIC = 2, - ROUTE_SPEAKERPHONE = 3, - ROUTE_LOUDSPEAKER = 4, - ROUTE_HEADSETBLUETOOTH = 5, - ROUTE_USB = 6, - ROUTE_HDMI = 7, - ROUTE_DISPLAYPORT = 8, - ROUTE_AIRPLAY = 9 -} -declare enum BYTES_PER_SAMPLE { - TWO_BYTES_PER_SAMPLE = 2 -} -declare class AudioParameters { - sample_rate?: number; - channels?: number; - frames_per_buffer?: number; -} -declare enum RAW_AUDIO_FRAME_OP_MODE_TYPE { - RAW_AUDIO_FRAME_OP_MODE_READ_ONLY = 0, - RAW_AUDIO_FRAME_OP_MODE_READ_WRITE = 2 -} -declare enum MEDIA_SOURCE_TYPE { - AUDIO_PLAYOUT_SOURCE = 0, - AUDIO_RECORDING_SOURCE = 1, - PRIMARY_CAMERA_SOURCE = 2, - SECONDARY_CAMERA_SOURCE = 3, - PRIMARY_SCREEN_SOURCE = 4, - SECONDARY_SCREEN_SOURCE = 5, - CUSTOM_VIDEO_SOURCE = 6, - MEDIA_PLAYER_SOURCE = 7, - RTC_IMAGE_PNG_SOURCE = 8, - RTC_IMAGE_JPEG_SOURCE = 9, - RTC_IMAGE_GIF_SOURCE = 10, - REMOTE_VIDEO_SOURCE = 11, - TRANSCODED_VIDEO_SOURCE = 12, - UNKNOWN_MEDIA_SOURCE = 100 -} -declare enum CONTENT_INSPECT_RESULT { - CONTENT_INSPECT_NEUTRAL = 1, - CONTENT_INSPECT_SEXY = 2, - CONTENT_INSPECT_PORN = 3 -} -declare enum CONTENT_INSPECT_TYPE { - CONTENT_INSPECT_INVALID = 0, - CONTENT_INSPECT_MODERATION = 1, - CONTENT_INSPECT_SUPERVISION = 2, - CONTENT_INSPECT_IMAGE_MODERATION = 3 -} -declare class ContentInspectModule { - type?: CONTENT_INSPECT_TYPE; - interval?: number; -} -declare class ContentInspectConfig { - extraInfo?: string; - serverConfig?: string; - modules?: ContentInspectModule; - moduleCount?: number; -} -declare class PacketOptions { - timestamp?: number; - audioLevelIndication?: number; -} -declare class AudioEncodedFrameInfo { - sendTs?: number; - codec?: number; -} -declare class AudioPcmFrame { - capture_timestamp?: number; - samples_per_channel_?: number; - sample_rate_hz_?: number; - num_channels_?: number; - bytes_per_sample?: BYTES_PER_SAMPLE; - data_?: number; -} -declare enum AUDIO_DUAL_MONO_MODE { - AUDIO_DUAL_MONO_STEREO = 0, - AUDIO_DUAL_MONO_L = 1, - AUDIO_DUAL_MONO_R = 2, - AUDIO_DUAL_MONO_MIX = 3 -} -declare enum VIDEO_PIXEL_FORMAT { - VIDEO_PIXEL_DEFAULT = 0, - VIDEO_PIXEL_I420 = 1, - VIDEO_PIXEL_BGRA = 2, - VIDEO_PIXEL_NV21 = 3, - VIDEO_PIXEL_RGBA = 4, - VIDEO_PIXEL_NV12 = 8, - VIDEO_TEXTURE_2D = 10, - VIDEO_TEXTURE_OES = 11, - VIDEO_CVPIXEL_NV12 = 12, - VIDEO_CVPIXEL_I420 = 13, - VIDEO_CVPIXEL_BGRA = 14, - VIDEO_PIXEL_I422 = 16, - VIDEO_TEXTURE_ID3D11TEXTURE2D = 17 -} -declare enum RENDER_MODE_TYPE { - RENDER_MODE_HIDDEN = 1, - RENDER_MODE_FIT = 2, - RENDER_MODE_ADAPTIVE = 3 -} -declare enum CAMERA_VIDEO_SOURCE_TYPE { - CAMERA_SOURCE_FRONT = 0, - CAMERA_SOURCE_BACK = 1, - VIDEO_SOURCE_UNSPECIFIED = 2 -} -declare enum EGL_CONTEXT_TYPE { - EGL_CONTEXT10 = 0, - EGL_CONTEXT14 = 1 -} -declare enum VIDEO_BUFFER_TYPE { - VIDEO_BUFFER_RAW_DATA = 1, - VIDEO_BUFFER_ARRAY = 2, - VIDEO_BUFFER_TEXTURE = 3 -} -declare class ExternalVideoFrame { - type?: VIDEO_BUFFER_TYPE; - format?: VIDEO_PIXEL_FORMAT; - buffer?: void[]; - stride?: number; - height?: number; - cropLeft?: number; - cropTop?: number; - cropRight?: number; - cropBottom?: number; - rotation?: number; - timestamp?: number; - eglType?: EGL_CONTEXT_TYPE; - textureId?: number; - matrix?: number; - metadata_buffer?: Uint8Array; - metadata_size?: number; - alphaBuffer?: Uint8Array; - texture_slice_index?: number; -} -declare class VideoFrame { - type?: VIDEO_PIXEL_FORMAT; - width?: number; - height?: number; - yStride?: number; - uStride?: number; - vStride?: number; - yBuffer?: Uint8Array; - uBuffer?: Uint8Array; - vBuffer?: Uint8Array; - rotation?: number; - renderTimeMs?: number; - avsync_type?: number; - metadata_buffer?: Uint8Array; - metadata_size?: number; - textureId?: number; - matrix?: number; - alphaBuffer?: Uint8Array; - pixelBuffer?: void[]; -} -declare enum MEDIA_PLAYER_SOURCE_TYPE { - MEDIA_PLAYER_SOURCE_DEFAULT = 0, - MEDIA_PLAYER_SOURCE_FULL_FEATURED = 1, - MEDIA_PLAYER_SOURCE_SIMPLE = 2 -} -declare enum VIDEO_MODULE_POSITION { - POSITION_POST_CAPTURER = 1, - POSITION_PRE_RENDERER = 1, - POSITION_PRE_ENCODER = 1 -} -interface IAudioPcmFrameSink { - onFrame(frame: AudioPcmFrame[]): void; -} -declare enum AUDIO_FRAME_TYPE { - FRAME_TYPE_PCM16 = 0 -} -declare class AudioFrame { - type?: AUDIO_FRAME_TYPE; - samplesPerChannel?: number; - bytesPerSample?: BYTES_PER_SAMPLE; - channels?: number; - samplesPerSec?: number; - buffer?: void[]; - renderTimeMs?: number; - avsync_type?: number; - presentationMs?: number; -} -declare enum AUDIO_FRAME_POSITION { - AUDIO_FRAME_POSITION_NONE = 0, - AUDIO_FRAME_POSITION_PLAYBACK = 1, - AUDIO_FRAME_POSITION_RECORD = 2, - AUDIO_FRAME_POSITION_MIXED = 4, - AUDIO_FRAME_POSITION_BEFORE_MIXING = 8, - AUDIO_FRAME_POSITION_EAR_MONITORING = 16 -} -declare class AudioParams { - sample_rate?: number; - channels?: number; - mode?: RAW_AUDIO_FRAME_OP_MODE_TYPE; - samples_per_call?: number; -} -interface IAudioFrameObserverBase { - onRecordAudioFrame(channelId: string, audioFrame: AudioFrame): boolean; - onPlaybackAudioFrame(channelId: string, audioFrame: AudioFrame): boolean; - onMixedAudioFrame(channelId: string, audioFrame: AudioFrame): boolean; - onEarMonitoringAudioFrame(audioFrame: AudioFrame): boolean; -} -interface IAudioFrameObserver extends IAudioFrameObserverBase { - onPlaybackAudioFrameBeforeMixing(channelId: string, uid: number, audioFrame: AudioFrame): boolean; -} -declare class AudioSpectrumData { - audioSpectrumData?: number[]; - dataLength?: number; -} -declare class UserAudioSpectrumInfo { - uid?: number; - spectrumData?: AudioSpectrumData; -} -interface IAudioSpectrumObserver { - onLocalAudioSpectrum(data: AudioSpectrumData): boolean; - onRemoteAudioSpectrum(spectrums: UserAudioSpectrumInfo[], spectrumNumber: number): boolean; -} -interface IVideoEncodedFrameObserver { - onEncodedVideoFrameReceived(uid: number, imageBuffer: Uint8Array, length: number, videoEncodedFrameInfo: EncodedVideoFrameInfo): boolean; -} -declare enum VIDEO_FRAME_PROCESS_MODE { - PROCESS_MODE_READ_ONLY = 0, - PROCESS_MODE_READ_WRITE = 1 -} -interface IVideoFrameObserver { - onCaptureVideoFrame(sourceType: VIDEO_SOURCE_TYPE, videoFrame: VideoFrame): boolean; - onPreEncodeVideoFrame(sourceType: VIDEO_SOURCE_TYPE, videoFrame: VideoFrame): boolean; - onMediaPlayerVideoFrame(videoFrame: VideoFrame, mediaPlayerId: number): boolean; - onRenderVideoFrame(channelId: string, remoteUid: number, videoFrame: VideoFrame): boolean; - onTranscodedVideoFrame(videoFrame: VideoFrame): boolean; -} -declare enum EXTERNAL_VIDEO_SOURCE_TYPE { - VIDEO_FRAME = 0, - ENCODED_VIDEO_FRAME = 1 -} -declare enum MediaRecorderContainerFormat { - FORMAT_MP4 = 1 -} -declare enum MediaRecorderStreamType { - STREAM_TYPE_AUDIO = 1, - STREAM_TYPE_VIDEO = 2, - STREAM_TYPE_BOTH = 3 -} -declare enum RecorderState { - RECORDER_STATE_ERROR = -1, - RECORDER_STATE_START = 2, - RECORDER_STATE_STOP = 3 -} -declare enum RecorderErrorCode { - RECORDER_ERROR_NONE = 0, - RECORDER_ERROR_WRITE_FAILED = 1, - RECORDER_ERROR_NO_STREAM = 2, - RECORDER_ERROR_OVER_MAX_DURATION = 3, - RECORDER_ERROR_CONFIG_CHANGED = 4 -} -declare class MediaRecorderConfiguration { - storagePath?: string; - containerFormat?: MediaRecorderContainerFormat; - streamType?: MediaRecorderStreamType; - maxDurationMs?: number; - recorderInfoUpdateInterval?: number; -} -declare class RecorderInfo { - fileName?: string; - durationMs?: number; - fileSize?: number; -} -interface IMediaRecorderObserver { - onRecorderStateChanged(channelId: string, uid: number, state: RecorderState, error: RecorderErrorCode): void; - onRecorderInfoUpdated(channelId: string, uid: number, info: RecorderInfo): void; -} - -declare enum CHANNEL_PROFILE_TYPE { - CHANNEL_PROFILE_COMMUNICATION = 0, - CHANNEL_PROFILE_LIVE_BROADCASTING = 1, - CHANNEL_PROFILE_GAME = 2, - CHANNEL_PROFILE_CLOUD_GAMING = 3, - CHANNEL_PROFILE_COMMUNICATION_1v1 = 4 -} -declare enum WARN_CODE_TYPE { - WARN_INVALID_VIEW = 8, - WARN_INIT_VIDEO = 16, - WARN_PENDING = 20, - WARN_NO_AVAILABLE_CHANNEL = 103, - WARN_LOOKUP_CHANNEL_TIMEOUT = 104, - WARN_LOOKUP_CHANNEL_REJECTED = 105, - WARN_OPEN_CHANNEL_TIMEOUT = 106, - WARN_OPEN_CHANNEL_REJECTED = 107, - WARN_SWITCH_LIVE_VIDEO_TIMEOUT = 111, - WARN_SET_CLIENT_ROLE_TIMEOUT = 118, - WARN_OPEN_CHANNEL_INVALID_TICKET = 121, - WARN_OPEN_CHANNEL_TRY_NEXT_VOS = 122, - WARN_CHANNEL_CONNECTION_UNRECOVERABLE = 131, - WARN_CHANNEL_CONNECTION_IP_CHANGED = 132, - WARN_CHANNEL_CONNECTION_PORT_CHANGED = 133, - WARN_CHANNEL_SOCKET_ERROR = 134, - WARN_AUDIO_MIXING_OPEN_ERROR = 701, - WARN_ADM_RUNTIME_PLAYOUT_WARNING = 1014, - WARN_ADM_RUNTIME_RECORDING_WARNING = 1016, - WARN_ADM_RECORD_AUDIO_SILENCE = 1019, - WARN_ADM_PLAYOUT_MALFUNCTION = 1020, - WARN_ADM_RECORD_MALFUNCTION = 1021, - WARN_ADM_RECORD_AUDIO_LOWLEVEL = 1031, - WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL = 1032, - WARN_ADM_WINDOWS_NO_DATA_READY_EVENT = 1040, - WARN_APM_HOWLING = 1051, - WARN_ADM_GLITCH_STATE = 1052, - WARN_ADM_IMPROPER_SETTINGS = 1053, - WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322, - WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE = 1323, - WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324 -} -declare enum ERROR_CODE_TYPE { - ERR_OK = 0, - ERR_FAILED = 1, - ERR_INVALID_ARGUMENT = 2, - ERR_NOT_READY = 3, - ERR_NOT_SUPPORTED = 4, - ERR_REFUSED = 5, - ERR_BUFFER_TOO_SMALL = 6, - ERR_NOT_INITIALIZED = 7, - ERR_INVALID_STATE = 8, - ERR_NO_PERMISSION = 9, - ERR_TIMEDOUT = 10, - ERR_CANCELED = 11, - ERR_TOO_OFTEN = 12, - ERR_BIND_SOCKET = 13, - ERR_NET_DOWN = 14, - ERR_JOIN_CHANNEL_REJECTED = 17, - ERR_LEAVE_CHANNEL_REJECTED = 18, - ERR_ALREADY_IN_USE = 19, - ERR_ABORTED = 20, - ERR_INIT_NET_ENGINE = 21, - ERR_RESOURCE_LIMITED = 22, - ERR_INVALID_APP_ID = 101, - ERR_INVALID_CHANNEL_NAME = 102, - ERR_NO_SERVER_RESOURCES = 103, - ERR_TOKEN_EXPIRED = 109, - ERR_INVALID_TOKEN = 110, - ERR_CONNECTION_INTERRUPTED = 111, - ERR_CONNECTION_LOST = 112, - ERR_NOT_IN_CHANNEL = 113, - ERR_SIZE_TOO_LARGE = 114, - ERR_BITRATE_LIMIT = 115, - ERR_TOO_MANY_DATA_STREAMS = 116, - ERR_STREAM_MESSAGE_TIMEOUT = 117, - ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119, - ERR_DECRYPTION_FAILED = 120, - ERR_INVALID_USER_ID = 121, - ERR_CLIENT_IS_BANNED_BY_SERVER = 123, - ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130, - ERR_LICENSE_CREDENTIAL_INVALID = 131, - ERR_INVALID_USER_ACCOUNT = 134, - ERR_MODULE_NOT_FOUND = 157, - ERR_CERT_RAW = 157, - ERR_CERT_JSON_PART = 158, - ERR_CERT_JSON_INVAL = 159, - ERR_CERT_JSON_NOMEM = 160, - ERR_CERT_CUSTOM = 161, - ERR_CERT_CREDENTIAL = 162, - ERR_CERT_SIGN = 163, - ERR_CERT_FAIL = 164, - ERR_CERT_BUF = 165, - ERR_CERT_NULL = 166, - ERR_CERT_DUEDATE = 167, - ERR_CERT_REQUEST = 168, - ERR_PCMSEND_FORMAT = 200, - ERR_PCMSEND_BUFFEROVERFLOW = 201, - ERR_LOGIN_ALREADY_LOGIN = 428, - ERR_LOAD_MEDIA_ENGINE = 1001, - ERR_ADM_GENERAL_ERROR = 1005, - ERR_ADM_INIT_PLAYOUT = 1008, - ERR_ADM_START_PLAYOUT = 1009, - ERR_ADM_STOP_PLAYOUT = 1010, - ERR_ADM_INIT_RECORDING = 1011, - ERR_ADM_START_RECORDING = 1012, - ERR_ADM_STOP_RECORDING = 1013, - ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501, - ERR_ADM_APPLICATION_LOOPBACK = 2007 -} -declare enum LICENSE_ERROR_TYPE { - LICENSE_ERR_INVALID = 1, - LICENSE_ERR_EXPIRE = 2, - LICENSE_ERR_MINUTES_EXCEED = 3, - LICENSE_ERR_LIMITED_PERIOD = 4, - LICENSE_ERR_DIFF_DEVICES = 5, - LICENSE_ERR_INTERNAL = 99 -} -declare enum AUDIO_SESSION_OPERATION_RESTRICTION { - AUDIO_SESSION_OPERATION_RESTRICTION_NONE = 0, - AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY = 1, - AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION = 1, - AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION = 1, - AUDIO_SESSION_OPERATION_RESTRICTION_ALL = 1 -} -declare enum USER_OFFLINE_REASON_TYPE { - USER_OFFLINE_QUIT = 0, - USER_OFFLINE_DROPPED = 1, - USER_OFFLINE_BECOME_AUDIENCE = 2 -} -declare enum INTERFACE_ID_TYPE { - AGORA_IID_AUDIO_DEVICE_MANAGER = 1, - AGORA_IID_VIDEO_DEVICE_MANAGER = 2, - AGORA_IID_PARAMETER_ENGINE = 3, - AGORA_IID_MEDIA_ENGINE = 4, - AGORA_IID_AUDIO_ENGINE = 5, - AGORA_IID_VIDEO_ENGINE = 6, - AGORA_IID_RTC_CONNECTION = 7, - AGORA_IID_SIGNALING_ENGINE = 8, - AGORA_IID_MEDIA_ENGINE_REGULATOR = 9, - AGORA_IID_CLOUD_SPATIAL_AUDIO = 10, - AGORA_IID_LOCAL_SPATIAL_AUDIO = 11, - AGORA_IID_STATE_SYNC = 13, - AGORA_IID_METACHAT_SERVICE = 14, - AGORA_IID_MUSIC_CONTENT_CENTER = 15, - AGORA_IID_H265_TRANSCODER = 16 -} -declare enum QUALITY_TYPE { - QUALITY_UNKNOWN = 0, - QUALITY_EXCELLENT = 1, - QUALITY_GOOD = 2, - QUALITY_POOR = 3, - QUALITY_BAD = 4, - QUALITY_VBAD = 5, - QUALITY_DOWN = 6, - QUALITY_UNSUPPORTED = 7, - QUALITY_DETECTING = 8 -} -declare enum FIT_MODE_TYPE { - MODE_COVER = 1, - MODE_CONTAIN = 2 -} -declare enum VIDEO_ORIENTATION { - VIDEO_ORIENTATION_0 = 0, - VIDEO_ORIENTATION_90 = 90, - VIDEO_ORIENTATION_180 = 180, - VIDEO_ORIENTATION_270 = 270 -} -declare enum FRAME_RATE { - FRAME_RATE_FPS_1 = 1, - FRAME_RATE_FPS_7 = 7, - FRAME_RATE_FPS_10 = 10, - FRAME_RATE_FPS_15 = 15, - FRAME_RATE_FPS_24 = 24, - FRAME_RATE_FPS_30 = 30, - FRAME_RATE_FPS_60 = 60 -} -declare enum FRAME_WIDTH { - FRAME_WIDTH_960 = 960 -} -declare enum FRAME_HEIGHT { - FRAME_HEIGHT_540 = 540 -} -declare enum VIDEO_FRAME_TYPE { - VIDEO_FRAME_TYPE_BLANK_FRAME = 0, - VIDEO_FRAME_TYPE_KEY_FRAME = 3, - VIDEO_FRAME_TYPE_DELTA_FRAME = 4, - VIDEO_FRAME_TYPE_B_FRAME = 5, - VIDEO_FRAME_TYPE_DROPPABLE_FRAME = 6, - VIDEO_FRAME_TYPE_UNKNOW = 7 -} -declare enum ORIENTATION_MODE { - ORIENTATION_MODE_ADAPTIVE = 0, - ORIENTATION_MODE_FIXED_LANDSCAPE = 1, - ORIENTATION_MODE_FIXED_PORTRAIT = 2 -} -declare enum DEGRADATION_PREFERENCE { - MAINTAIN_QUALITY = 0, - MAINTAIN_FRAMERATE = 1, - MAINTAIN_BALANCED = 2, - MAINTAIN_RESOLUTION = 3, - DISABLED = 100 -} -declare class VideoDimensions { - width?: number; - height?: number; -} -declare enum SCREEN_CAPTURE_FRAMERATE_CAPABILITY { - SCREEN_CAPTURE_FRAMERATE_CAPABILITY_15_FPS = 0, - SCREEN_CAPTURE_FRAMERATE_CAPABILITY_30_FPS = 1, - SCREEN_CAPTURE_FRAMERATE_CAPABILITY_60_FPS = 2 -} -declare enum VIDEO_CODEC_CAPABILITY_LEVEL { - CODEC_CAPABILITY_LEVEL_UNSPECIFIED = -1, - CODEC_CAPABILITY_LEVEL_BASIC_SUPPORT = 5, - CODEC_CAPABILITY_LEVEL_1080P30FPS = 10, - CODEC_CAPABILITY_LEVEL_1080P60FPS = 20, - CODEC_CAPABILITY_LEVEL_4K60FPS = 30 -} -declare enum VIDEO_CODEC_TYPE { - VIDEO_CODEC_NONE = 0, - VIDEO_CODEC_VP8 = 1, - VIDEO_CODEC_H264 = 2, - VIDEO_CODEC_H265 = 3, - VIDEO_CODEC_GENERIC = 6, - VIDEO_CODEC_GENERIC_H264 = 7, - VIDEO_CODEC_AV1 = 12, - VIDEO_CODEC_VP9 = 13, - VIDEO_CODEC_GENERIC_JPEG = 20 -} -declare enum TCcMode { - CC_ENABLED = 0, - CC_DISABLED = 1 -} -declare class SenderOptions { - ccMode?: TCcMode; - codecType?: VIDEO_CODEC_TYPE; - targetBitrate?: number; -} -declare enum AUDIO_CODEC_TYPE { - AUDIO_CODEC_OPUS = 1, - AUDIO_CODEC_PCMA = 3, - AUDIO_CODEC_PCMU = 4, - AUDIO_CODEC_G722 = 5, - AUDIO_CODEC_AACLC = 8, - AUDIO_CODEC_HEAAC = 9, - AUDIO_CODEC_JC1 = 10, - AUDIO_CODEC_HEAAC2 = 11, - AUDIO_CODEC_LPCNET = 12 -} -declare enum AUDIO_ENCODING_TYPE { - AUDIO_ENCODING_TYPE_AAC_16000_LOW = 65793, - AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM = 65794, - AUDIO_ENCODING_TYPE_AAC_32000_LOW = 66049, - AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM = 66050, - AUDIO_ENCODING_TYPE_AAC_32000_HIGH = 66051, - AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM = 66306, - AUDIO_ENCODING_TYPE_AAC_48000_HIGH = 66307, - AUDIO_ENCODING_TYPE_OPUS_16000_LOW = 131329, - AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM = 131330, - AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM = 131842, - AUDIO_ENCODING_TYPE_OPUS_48000_HIGH = 131843 -} -declare enum WATERMARK_FIT_MODE { - FIT_MODE_COVER_POSITION = 0, - FIT_MODE_USE_IMAGE_RATIO = 1 -} -declare class EncodedAudioFrameAdvancedSettings { - speech?: boolean; - sendEvenIfEmpty?: boolean; -} -declare class EncodedAudioFrameInfo { - codec?: AUDIO_CODEC_TYPE; - sampleRateHz?: number; - samplesPerChannel?: number; - numberOfChannels?: number; - advancedSettings?: EncodedAudioFrameAdvancedSettings; - captureTimeMs?: number; -} -declare class AudioPcmDataInfo { - samplesPerChannel?: number; - channelNum?: number; - samplesOut?: number; - elapsedTimeMs?: number; - ntpTimeMs?: number; -} -declare enum H264PacketizeMode { - NonInterleaved = 0, - SingleNalUnit = 1 -} -declare enum VIDEO_STREAM_TYPE { - VIDEO_STREAM_HIGH = 0, - VIDEO_STREAM_LOW = 1 -} -declare class VideoSubscriptionOptions { - type?: VIDEO_STREAM_TYPE; - encodedFrameOnly?: boolean; -} -declare class EncodedVideoFrameInfo { - codecType?: VIDEO_CODEC_TYPE; - width?: number; - height?: number; - framesPerSecond?: number; - frameType?: VIDEO_FRAME_TYPE; - rotation?: VIDEO_ORIENTATION; - trackId?: number; - captureTimeMs?: number; - decodeTimeMs?: number; - uid?: number; - streamType?: VIDEO_STREAM_TYPE; -} -declare enum COMPRESSION_PREFERENCE { - PREFER_LOW_LATENCY = 0, - PREFER_QUALITY = 1 -} -declare enum ENCODING_PREFERENCE { - PREFER_AUTO = -1, - PREFER_SOFTWARE = 0, - PREFER_HARDWARE = 1 -} -declare class AdvanceOptions { - encodingPreference?: ENCODING_PREFERENCE; - compressionPreference?: COMPRESSION_PREFERENCE; -} -declare enum VIDEO_MIRROR_MODE_TYPE { - VIDEO_MIRROR_MODE_AUTO = 0, - VIDEO_MIRROR_MODE_ENABLED = 1, - VIDEO_MIRROR_MODE_DISABLED = 2 -} -declare enum CODEC_CAP_MASK { - CODEC_CAP_MASK_NONE = 0, - CODEC_CAP_MASK_HW_DEC = 1, - CODEC_CAP_MASK_HW_ENC = 1, - CODEC_CAP_MASK_SW_DEC = 1, - CODEC_CAP_MASK_SW_ENC = 1 -} -declare class CodecCapLevels { - hwDecodingLevel?: VIDEO_CODEC_CAPABILITY_LEVEL; - swDecodingLevel?: VIDEO_CODEC_CAPABILITY_LEVEL; -} -declare class CodecCapInfo { - codecType?: VIDEO_CODEC_TYPE; - codecCapMask?: number; - codecLevels?: CodecCapLevels; -} -declare class VideoEncoderConfiguration { - codecType?: VIDEO_CODEC_TYPE; - dimensions?: VideoDimensions; - frameRate?: number; - bitrate?: number; - minBitrate?: number; - orientationMode?: ORIENTATION_MODE; - degradationPreference?: DEGRADATION_PREFERENCE; - mirrorMode?: VIDEO_MIRROR_MODE_TYPE; - advanceOptions?: AdvanceOptions; -} -declare class DataStreamConfig { - syncWithAudio?: boolean; - ordered?: boolean; -} -declare enum SIMULCAST_STREAM_MODE { - AUTO_SIMULCAST_STREAM = -1, - DISABLE_SIMULCAST_STREAM = 0, - ENABLE_SIMULCAST_STREAM = 1 -} -declare class SimulcastStreamConfig { - dimensions?: VideoDimensions; - kBitrate?: number; - framerate?: number; -} -declare class Rectangle { - x?: number; - y?: number; - width?: number; - height?: number; -} -declare class WatermarkRatio { - xRatio?: number; - yRatio?: number; - widthRatio?: number; -} -declare class WatermarkOptions { - visibleInPreview?: boolean; - positionInLandscapeMode?: Rectangle; - positionInPortraitMode?: Rectangle; - watermarkRatio?: WatermarkRatio; - mode?: WATERMARK_FIT_MODE; -} -declare class RtcStats { - duration?: number; - txBytes?: number; - rxBytes?: number; - txAudioBytes?: number; - txVideoBytes?: number; - rxAudioBytes?: number; - rxVideoBytes?: number; - txKBitRate?: number; - rxKBitRate?: number; - rxAudioKBitRate?: number; - txAudioKBitRate?: number; - rxVideoKBitRate?: number; - txVideoKBitRate?: number; - lastmileDelay?: number; - userCount?: number; - cpuAppUsage?: number; - cpuTotalUsage?: number; - gatewayRtt?: number; - memoryAppUsageRatio?: number; - memoryTotalUsageRatio?: number; - memoryAppUsageInKbytes?: number; - connectTimeMs?: number; - firstAudioPacketDuration?: number; - firstVideoPacketDuration?: number; - firstVideoKeyFramePacketDuration?: number; - packetsBeforeFirstKeyFramePacket?: number; - firstAudioPacketDurationAfterUnmute?: number; - firstVideoPacketDurationAfterUnmute?: number; - firstVideoKeyFramePacketDurationAfterUnmute?: number; - firstVideoKeyFrameDecodedDurationAfterUnmute?: number; - firstVideoKeyFrameRenderedDurationAfterUnmute?: number; - txPacketLossRate?: number; - rxPacketLossRate?: number; -} -declare enum CLIENT_ROLE_TYPE { - CLIENT_ROLE_BROADCASTER = 1, - CLIENT_ROLE_AUDIENCE = 2 -} -declare enum QUALITY_ADAPT_INDICATION { - ADAPT_NONE = 0, - ADAPT_UP_BANDWIDTH = 1, - ADAPT_DOWN_BANDWIDTH = 2 -} -declare enum AUDIENCE_LATENCY_LEVEL_TYPE { - AUDIENCE_LATENCY_LEVEL_LOW_LATENCY = 1, - AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY = 2 -} -declare class ClientRoleOptions { - audienceLatencyLevel?: AUDIENCE_LATENCY_LEVEL_TYPE; -} -declare enum EXPERIENCE_QUALITY_TYPE { - EXPERIENCE_QUALITY_GOOD = 0, - EXPERIENCE_QUALITY_BAD = 1 -} -declare enum EXPERIENCE_POOR_REASON { - EXPERIENCE_REASON_NONE = 0, - REMOTE_NETWORK_QUALITY_POOR = 1, - LOCAL_NETWORK_QUALITY_POOR = 2, - WIRELESS_SIGNAL_POOR = 4, - WIFI_BLUETOOTH_COEXIST = 8 -} -declare enum AUDIO_AINS_MODE { - AINS_MODE_BALANCED = 0, - AINS_MODE_AGGRESSIVE = 1, - AINS_MODE_ULTRALOWLATENCY = 2 -} -declare enum AUDIO_PROFILE_TYPE { - AUDIO_PROFILE_DEFAULT = 0, - AUDIO_PROFILE_SPEECH_STANDARD = 1, - AUDIO_PROFILE_MUSIC_STANDARD = 2, - AUDIO_PROFILE_MUSIC_STANDARD_STEREO = 3, - AUDIO_PROFILE_MUSIC_HIGH_QUALITY = 4, - AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO = 5, - AUDIO_PROFILE_IOT = 6, - AUDIO_PROFILE_NUM = 7 -} -declare enum AUDIO_SCENARIO_TYPE { - AUDIO_SCENARIO_DEFAULT = 0, - AUDIO_SCENARIO_GAME_STREAMING = 3, - AUDIO_SCENARIO_CHATROOM = 5, - AUDIO_SCENARIO_CHORUS = 7, - AUDIO_SCENARIO_MEETING = 8, - AUDIO_SCENARIO_NUM = 9 -} -declare class VideoFormat { - width?: number; - height?: number; - fps?: number; -} -declare enum VIDEO_CONTENT_HINT { - CONTENT_HINT_NONE = 0, - CONTENT_HINT_MOTION = 1, - CONTENT_HINT_DETAILS = 2 -} -declare enum SCREEN_SCENARIO_TYPE { - SCREEN_SCENARIO_DOCUMENT = 1, - SCREEN_SCENARIO_GAMING = 2, - SCREEN_SCENARIO_VIDEO = 3, - SCREEN_SCENARIO_RDC = 4 -} -declare enum VIDEO_APPLICATION_SCENARIO_TYPE { - APPLICATION_SCENARIO_GENERAL = 0, - APPLICATION_SCENARIO_MEETING = 1 -} -declare enum CAPTURE_BRIGHTNESS_LEVEL_TYPE { - CAPTURE_BRIGHTNESS_LEVEL_INVALID = -1, - CAPTURE_BRIGHTNESS_LEVEL_NORMAL = 0, - CAPTURE_BRIGHTNESS_LEVEL_BRIGHT = 1, - CAPTURE_BRIGHTNESS_LEVEL_DARK = 2 -} -declare enum LOCAL_AUDIO_STREAM_STATE { - LOCAL_AUDIO_STREAM_STATE_STOPPED = 0, - LOCAL_AUDIO_STREAM_STATE_RECORDING = 1, - LOCAL_AUDIO_STREAM_STATE_ENCODING = 2, - LOCAL_AUDIO_STREAM_STATE_FAILED = 3 -} -declare enum LOCAL_AUDIO_STREAM_ERROR { - LOCAL_AUDIO_STREAM_ERROR_OK = 0, - LOCAL_AUDIO_STREAM_ERROR_FAILURE = 1, - LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, - LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY = 3, - LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE = 4, - LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE = 5, - LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE = 6, - LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE = 7, - LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED = 8, - LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID = 9, - LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID = 10 -} -declare enum LOCAL_VIDEO_STREAM_STATE { - LOCAL_VIDEO_STREAM_STATE_STOPPED = 0, - LOCAL_VIDEO_STREAM_STATE_CAPTURING = 1, - LOCAL_VIDEO_STREAM_STATE_ENCODING = 2, - LOCAL_VIDEO_STREAM_STATE_FAILED = 3 -} -declare enum LOCAL_VIDEO_STREAM_ERROR { - LOCAL_VIDEO_STREAM_ERROR_OK = 0, - LOCAL_VIDEO_STREAM_ERROR_FAILURE = 1, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION = 2, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY = 3, - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE = 4, - LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE = 5, - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND = 6, - LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS = 7, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND = 8, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED = 9, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID = 10, - LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE = 101, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED = 11, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED = 12, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED = 13, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED = 20, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE = 21, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION = 22, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED = 23, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED = 24, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN = 25, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26, - LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27 -} -declare enum REMOTE_AUDIO_STATE { - REMOTE_AUDIO_STATE_STOPPED = 0, - REMOTE_AUDIO_STATE_STARTING = 1, - REMOTE_AUDIO_STATE_DECODING = 2, - REMOTE_AUDIO_STATE_FROZEN = 3, - REMOTE_AUDIO_STATE_FAILED = 4 -} -declare enum REMOTE_AUDIO_STATE_REASON { - REMOTE_AUDIO_REASON_INTERNAL = 0, - REMOTE_AUDIO_REASON_NETWORK_CONGESTION = 1, - REMOTE_AUDIO_REASON_NETWORK_RECOVERY = 2, - REMOTE_AUDIO_REASON_LOCAL_MUTED = 3, - REMOTE_AUDIO_REASON_LOCAL_UNMUTED = 4, - REMOTE_AUDIO_REASON_REMOTE_MUTED = 5, - REMOTE_AUDIO_REASON_REMOTE_UNMUTED = 6, - REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7 -} -declare enum REMOTE_VIDEO_STATE { - REMOTE_VIDEO_STATE_STOPPED = 0, - REMOTE_VIDEO_STATE_STARTING = 1, - REMOTE_VIDEO_STATE_DECODING = 2, - REMOTE_VIDEO_STATE_FROZEN = 3, - REMOTE_VIDEO_STATE_FAILED = 4 -} -declare enum REMOTE_VIDEO_STATE_REASON { - REMOTE_VIDEO_STATE_REASON_INTERNAL = 0, - REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION = 1, - REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY = 2, - REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED = 3, - REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED = 4, - REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED = 5, - REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED = 6, - REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE = 7, - REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK = 8, - REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY = 9, - REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW = 10, - REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH = 11, - REMOTE_VIDEO_STATE_REASON_SDK_IN_BACKGROUND = 12, - REMOTE_VIDEO_STATE_REASON_CODEC_NOT_SUPPORT = 13 -} -declare enum REMOTE_USER_STATE { - USER_STATE_MUTE_AUDIO = 1, - USER_STATE_MUTE_VIDEO = 2, - USER_STATE_ENABLE_VIDEO = 16, - USER_STATE_ENABLE_LOCAL_VIDEO = 256 -} -declare class VideoTrackInfo { - isLocal?: boolean; - ownerUid?: number; - trackId?: number; - channelId?: string; - streamType?: VIDEO_STREAM_TYPE; - codecType?: VIDEO_CODEC_TYPE; - encodedFrameOnly?: boolean; - sourceType?: VIDEO_SOURCE_TYPE; - observationPosition?: number; -} -declare enum REMOTE_VIDEO_DOWNSCALE_LEVEL { - REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE = 0, - REMOTE_VIDEO_DOWNSCALE_LEVEL_1 = 1, - REMOTE_VIDEO_DOWNSCALE_LEVEL_2 = 2, - REMOTE_VIDEO_DOWNSCALE_LEVEL_3 = 3, - REMOTE_VIDEO_DOWNSCALE_LEVEL_4 = 4 -} -declare class AudioVolumeInfo { - uid?: number; - volume?: number; - vad?: number; - voicePitch?: number; -} -declare class DeviceInfo { - isLowLatencyAudioSupported?: boolean; -} -declare class Packet { - buffer?: Uint8Array; - size?: number; -} -declare enum AUDIO_SAMPLE_RATE_TYPE { - AUDIO_SAMPLE_RATE_32000 = 32000, - AUDIO_SAMPLE_RATE_44100 = 44100, - AUDIO_SAMPLE_RATE_48000 = 48000 -} -declare enum VIDEO_CODEC_TYPE_FOR_STREAM { - VIDEO_CODEC_H264_FOR_STREAM = 1, - VIDEO_CODEC_H265_FOR_STREAM = 2 -} -declare enum VIDEO_CODEC_PROFILE_TYPE { - VIDEO_CODEC_PROFILE_BASELINE = 66, - VIDEO_CODEC_PROFILE_MAIN = 77, - VIDEO_CODEC_PROFILE_HIGH = 100 -} -declare enum AUDIO_CODEC_PROFILE_TYPE { - AUDIO_CODEC_PROFILE_LC_AAC = 0, - AUDIO_CODEC_PROFILE_HE_AAC = 1, - AUDIO_CODEC_PROFILE_HE_AAC_V2 = 2 -} -declare class LocalAudioStats { - numChannels?: number; - sentSampleRate?: number; - sentBitrate?: number; - internalCodec?: number; - txPacketLossRate?: number; - audioDeviceDelay?: number; -} -declare enum RTMP_STREAM_PUBLISH_STATE { - RTMP_STREAM_PUBLISH_STATE_IDLE = 0, - RTMP_STREAM_PUBLISH_STATE_CONNECTING = 1, - RTMP_STREAM_PUBLISH_STATE_RUNNING = 2, - RTMP_STREAM_PUBLISH_STATE_RECOVERING = 3, - RTMP_STREAM_PUBLISH_STATE_FAILURE = 4, - RTMP_STREAM_PUBLISH_STATE_DISCONNECTING = 5 -} -declare enum RTMP_STREAM_PUBLISH_ERROR_TYPE { - RTMP_STREAM_PUBLISH_ERROR_OK = 0, - RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT = 1, - RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED = 2, - RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT = 3, - RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR = 4, - RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR = 5, - RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN = 6, - RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT = 7, - RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED = 8, - RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND = 9, - RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED = 10, - RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER = 11, - RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM = 13, - RTMP_STREAM_PUBLISH_ERROR_NET_DOWN = 14, - RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID = 15, - RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE = 16, - RTMP_STREAM_UNPUBLISH_ERROR_OK = 100 -} -declare enum RTMP_STREAMING_EVENT { - RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE = 1, - RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE = 2, - RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT = 3, - RTMP_STREAMING_EVENT_REQUEST_TOO_OFTEN = 4 -} -declare class RtcImage { - url?: string; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; -} -declare class LiveStreamAdvancedFeature { - featureName?: string; - opened?: boolean; -} -declare enum CONNECTION_STATE_TYPE { - CONNECTION_STATE_DISCONNECTED = 1, - CONNECTION_STATE_CONNECTING = 2, - CONNECTION_STATE_CONNECTED = 3, - CONNECTION_STATE_RECONNECTING = 4, - CONNECTION_STATE_FAILED = 5 -} -declare class TranscodingUser { - uid?: number; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; - audioChannel?: number; -} -declare class LiveTranscoding { - width?: number; - height?: number; - videoBitrate?: number; - videoFramerate?: number; - lowLatency?: boolean; - videoGop?: number; - videoCodecProfile?: VIDEO_CODEC_PROFILE_TYPE; - backgroundColor?: number; - videoCodecType?: VIDEO_CODEC_TYPE_FOR_STREAM; - userCount?: number; - transcodingUsers?: TranscodingUser[]; - transcodingExtraInfo?: string; - metadata?: string; - watermark?: RtcImage[]; - watermarkCount?: number; - backgroundImage?: RtcImage[]; - backgroundImageCount?: number; - audioSampleRate?: AUDIO_SAMPLE_RATE_TYPE; - audioBitrate?: number; - audioChannels?: number; - audioCodecProfile?: AUDIO_CODEC_PROFILE_TYPE; - advancedFeatures?: LiveStreamAdvancedFeature[]; - advancedFeatureCount?: number; -} -declare class TranscodingVideoStream { - sourceType?: VIDEO_SOURCE_TYPE; - remoteUserUid?: number; - imageUrl?: string; - mediaPlayerId?: number; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; - mirror?: boolean; -} -declare class LocalTranscoderConfiguration { - streamCount?: number; - videoInputStreams?: TranscodingVideoStream[]; - videoOutputConfiguration?: VideoEncoderConfiguration; - syncWithPrimaryCamera?: boolean; -} -declare enum VIDEO_TRANSCODER_ERROR { - VT_ERR_OK = 0, - VT_ERR_VIDEO_SOURCE_NOT_READY = 1, - VT_ERR_INVALID_VIDEO_SOURCE_TYPE = 2, - VT_ERR_INVALID_IMAGE_PATH = 3, - VT_ERR_UNSUPPORT_IMAGE_FORMAT = 4, - VT_ERR_INVALID_LAYOUT = 5, - VT_ERR_INTERNAL = 20 -} -declare class LastmileProbeConfig { - probeUplink?: boolean; - probeDownlink?: boolean; - expectedUplinkBitrate?: number; - expectedDownlinkBitrate?: number; -} -declare enum LASTMILE_PROBE_RESULT_STATE { - LASTMILE_PROBE_RESULT_COMPLETE = 1, - LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE = 2, - LASTMILE_PROBE_RESULT_UNAVAILABLE = 3 -} -declare class LastmileProbeOneWayResult { - packetLossRate?: number; - jitter?: number; - availableBandwidth?: number; -} -declare class LastmileProbeResult { - state?: LASTMILE_PROBE_RESULT_STATE; - uplinkReport?: LastmileProbeOneWayResult; - downlinkReport?: LastmileProbeOneWayResult; - rtt?: number; -} -declare enum CONNECTION_CHANGED_REASON_TYPE { - CONNECTION_CHANGED_CONNECTING = 0, - CONNECTION_CHANGED_JOIN_SUCCESS = 1, - CONNECTION_CHANGED_INTERRUPTED = 2, - CONNECTION_CHANGED_BANNED_BY_SERVER = 3, - CONNECTION_CHANGED_JOIN_FAILED = 4, - CONNECTION_CHANGED_LEAVE_CHANNEL = 5, - CONNECTION_CHANGED_INVALID_APP_ID = 6, - CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7, - CONNECTION_CHANGED_INVALID_TOKEN = 8, - CONNECTION_CHANGED_TOKEN_EXPIRED = 9, - CONNECTION_CHANGED_REJECTED_BY_SERVER = 10, - CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11, - CONNECTION_CHANGED_RENEW_TOKEN = 12, - CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13, - CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14, - CONNECTION_CHANGED_REJOIN_SUCCESS = 15, - CONNECTION_CHANGED_LOST = 16, - CONNECTION_CHANGED_ECHO_TEST = 17, - CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER = 18, - CONNECTION_CHANGED_SAME_UID_LOGIN = 19, - CONNECTION_CHANGED_TOO_MANY_BROADCASTERS = 20, - CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE = 21, - CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE = 22 -} -declare enum CLIENT_ROLE_CHANGE_FAILED_REASON { - CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS = 1, - CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED = 2, - CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT = 3, - CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED = 4 -} -declare enum WLACC_MESSAGE_REASON { - WLACC_MESSAGE_REASON_WEAK_SIGNAL = 0, - WLACC_MESSAGE_REASON_CHANNEL_CONGESTION = 1 -} -declare enum WLACC_SUGGEST_ACTION { - WLACC_SUGGEST_ACTION_CLOSE_TO_WIFI = 0, - WLACC_SUGGEST_ACTION_CONNECT_SSID = 1, - WLACC_SUGGEST_ACTION_CHECK_5G = 2, - WLACC_SUGGEST_ACTION_MODIFY_SSID = 3 -} -declare class WlAccStats { - e2eDelayPercent?: number; - frozenRatioPercent?: number; - lossRatePercent?: number; -} -declare enum NETWORK_TYPE { - NETWORK_TYPE_UNKNOWN = -1, - NETWORK_TYPE_DISCONNECTED = 0, - NETWORK_TYPE_LAN = 1, - NETWORK_TYPE_WIFI = 2, - NETWORK_TYPE_MOBILE_2G = 3, - NETWORK_TYPE_MOBILE_3G = 4, - NETWORK_TYPE_MOBILE_4G = 5, - NETWORK_TYPE_MOBILE_5G = 6 -} -declare enum VIDEO_VIEW_SETUP_MODE { - VIDEO_VIEW_SETUP_REPLACE = 0, - VIDEO_VIEW_SETUP_ADD = 1, - VIDEO_VIEW_SETUP_REMOVE = 2 -} -declare class VideoCanvas { - view?: any; - uid?: number; - backgroundColor?: number; - renderMode?: RENDER_MODE_TYPE; - mirrorMode?: VIDEO_MIRROR_MODE_TYPE; - setupMode?: VIDEO_VIEW_SETUP_MODE; - sourceType?: VIDEO_SOURCE_TYPE; - mediaPlayerId?: number; - cropArea?: Rectangle; - enableAlphaMask?: boolean; -} -declare enum LIGHTENING_CONTRAST_LEVEL { - LIGHTENING_CONTRAST_LOW = 0, - LIGHTENING_CONTRAST_NORMAL = 1, - LIGHTENING_CONTRAST_HIGH = 2 -} -declare class BeautyOptions { - lighteningContrastLevel?: LIGHTENING_CONTRAST_LEVEL; - lighteningLevel?: number; - smoothnessLevel?: number; - rednessLevel?: number; - sharpnessLevel?: number; -} -declare enum LOW_LIGHT_ENHANCE_MODE { - LOW_LIGHT_ENHANCE_AUTO = 0, - LOW_LIGHT_ENHANCE_MANUAL = 1 -} -declare enum LOW_LIGHT_ENHANCE_LEVEL { - LOW_LIGHT_ENHANCE_LEVEL_HIGH_QUALITY = 0, - LOW_LIGHT_ENHANCE_LEVEL_FAST = 1 -} -declare class LowlightEnhanceOptions { - mode?: LOW_LIGHT_ENHANCE_MODE; - level?: LOW_LIGHT_ENHANCE_LEVEL; -} -declare enum VIDEO_DENOISER_MODE { - VIDEO_DENOISER_AUTO = 0, - VIDEO_DENOISER_MANUAL = 1 -} -declare enum VIDEO_DENOISER_LEVEL { - VIDEO_DENOISER_LEVEL_HIGH_QUALITY = 0, - VIDEO_DENOISER_LEVEL_FAST = 1, - VIDEO_DENOISER_LEVEL_STRENGTH = 2 -} -declare class VideoDenoiserOptions { - mode?: VIDEO_DENOISER_MODE; - level?: VIDEO_DENOISER_LEVEL; -} -declare class ColorEnhanceOptions { - strengthLevel?: number; - skinProtectLevel?: number; -} -declare enum BACKGROUND_SOURCE_TYPE { - BACKGROUND_NONE = 0, - BACKGROUND_COLOR = 1, - BACKGROUND_IMG = 2, - BACKGROUND_BLUR = 3, - BACKGROUND_VIDEO = 4 -} -declare enum BACKGROUND_BLUR_DEGREE { - BLUR_DEGREE_LOW = 1, - BLUR_DEGREE_MEDIUM = 2, - BLUR_DEGREE_HIGH = 3 -} -declare class VirtualBackgroundSource { - background_source_type?: BACKGROUND_SOURCE_TYPE; - color?: number; - source?: string; - blur_degree?: BACKGROUND_BLUR_DEGREE; -} -declare enum SEG_MODEL_TYPE { - SEG_MODEL_AI = 1, - SEG_MODEL_GREEN = 2 -} -declare class SegmentationProperty { - modelType?: SEG_MODEL_TYPE; - greenCapacity?: number; -} -declare enum AUDIO_TRACK_TYPE { - AUDIO_TRACK_INVALID = -1, - AUDIO_TRACK_MIXABLE = 0, - AUDIO_TRACK_DIRECT = 1 -} -declare class AudioTrackConfig { - enableLocalPlayback?: boolean; -} -declare enum VOICE_BEAUTIFIER_PRESET { - VOICE_BEAUTIFIER_OFF = 0, - CHAT_BEAUTIFIER_MAGNETIC = 16843008, - CHAT_BEAUTIFIER_FRESH = 16843264, - CHAT_BEAUTIFIER_VITALITY = 16843520, - SINGING_BEAUTIFIER = 16908544, - TIMBRE_TRANSFORMATION_VIGOROUS = 16974080, - TIMBRE_TRANSFORMATION_DEEP = 16974336, - TIMBRE_TRANSFORMATION_MELLOW = 16974592, - TIMBRE_TRANSFORMATION_FALSETTO = 16974848, - TIMBRE_TRANSFORMATION_FULL = 16975104, - TIMBRE_TRANSFORMATION_CLEAR = 16975360, - TIMBRE_TRANSFORMATION_RESOUNDING = 16975616, - TIMBRE_TRANSFORMATION_RINGING = 16975872, - ULTRA_HIGH_QUALITY_VOICE = 17039616 -} -declare enum AUDIO_EFFECT_PRESET { - AUDIO_EFFECT_OFF = 0, - ROOM_ACOUSTICS_KTV = 33620224, - ROOM_ACOUSTICS_VOCAL_CONCERT = 33620480, - ROOM_ACOUSTICS_STUDIO = 33620736, - ROOM_ACOUSTICS_PHONOGRAPH = 33620992, - ROOM_ACOUSTICS_VIRTUAL_STEREO = 33621248, - ROOM_ACOUSTICS_SPACIAL = 33621504, - ROOM_ACOUSTICS_ETHEREAL = 33621760, - ROOM_ACOUSTICS_3D_VOICE = 33622016, - ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND = 33622272, - VOICE_CHANGER_EFFECT_UNCLE = 33685760, - VOICE_CHANGER_EFFECT_OLDMAN = 33686016, - VOICE_CHANGER_EFFECT_BOY = 33686272, - VOICE_CHANGER_EFFECT_SISTER = 33686528, - VOICE_CHANGER_EFFECT_GIRL = 33686784, - VOICE_CHANGER_EFFECT_PIGKING = 33687040, - VOICE_CHANGER_EFFECT_HULK = 33687296, - STYLE_TRANSFORMATION_RNB = 33751296, - STYLE_TRANSFORMATION_POPULAR = 33751552, - PITCH_CORRECTION = 33816832 -} -declare enum VOICE_CONVERSION_PRESET { - VOICE_CONVERSION_OFF = 0, - VOICE_CHANGER_NEUTRAL = 50397440, - VOICE_CHANGER_SWEET = 50397696, - VOICE_CHANGER_SOLID = 50397952, - VOICE_CHANGER_BASS = 50398208, - VOICE_CHANGER_CARTOON = 50398464, - VOICE_CHANGER_CHILDLIKE = 50398720, - VOICE_CHANGER_PHONE_OPERATOR = 50398976, - VOICE_CHANGER_MONSTER = 50399232, - VOICE_CHANGER_TRANSFORMERS = 50399488, - VOICE_CHANGER_GROOT = 50399744, - VOICE_CHANGER_DARTH_VADER = 50400000, - VOICE_CHANGER_IRON_LADY = 50400256, - VOICE_CHANGER_SHIN_CHAN = 50400512, - VOICE_CHANGER_GIRLISH_MAN = 50400768, - VOICE_CHANGER_CHIPMUNK = 50401024 -} -declare enum HEADPHONE_EQUALIZER_PRESET { - HEADPHONE_EQUALIZER_OFF = 0, - HEADPHONE_EQUALIZER_OVEREAR = 67108865, - HEADPHONE_EQUALIZER_INEAR = 67108866 -} -declare class ScreenCaptureParameters { - dimensions?: VideoDimensions; - frameRate?: number; - bitrate?: number; - captureMouseCursor?: boolean; - windowFocus?: boolean; - excludeWindowList?: any[]; - excludeWindowCount?: number; - highLightWidth?: number; - highLightColor?: number; - enableHighLight?: boolean; -} -declare enum AUDIO_RECORDING_QUALITY_TYPE { - AUDIO_RECORDING_QUALITY_LOW = 0, - AUDIO_RECORDING_QUALITY_MEDIUM = 1, - AUDIO_RECORDING_QUALITY_HIGH = 2, - AUDIO_RECORDING_QUALITY_ULTRA_HIGH = 3 -} -declare enum AUDIO_FILE_RECORDING_TYPE { - AUDIO_FILE_RECORDING_MIC = 1, - AUDIO_FILE_RECORDING_PLAYBACK = 2, - AUDIO_FILE_RECORDING_MIXED = 3 -} -declare enum AUDIO_ENCODED_FRAME_OBSERVER_POSITION { - AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD = 1, - AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK = 2, - AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED = 3 -} -declare class AudioRecordingConfiguration { - filePath?: string; - encode?: boolean; - sampleRate?: number; - fileRecordingType?: AUDIO_FILE_RECORDING_TYPE; - quality?: AUDIO_RECORDING_QUALITY_TYPE; - recordingChannel?: number; -} -declare class AudioEncodedFrameObserverConfig { - postionType?: AUDIO_ENCODED_FRAME_OBSERVER_POSITION; - encodingType?: AUDIO_ENCODING_TYPE; -} -interface IAudioEncodedFrameObserver { - onRecordAudioEncodedFrame(frameBuffer: Uint8Array, length: number, audioEncodedFrameInfo: EncodedAudioFrameInfo): void; - onPlaybackAudioEncodedFrame(frameBuffer: Uint8Array, length: number, audioEncodedFrameInfo: EncodedAudioFrameInfo): void; - onMixedAudioEncodedFrame(frameBuffer: Uint8Array, length: number, audioEncodedFrameInfo: EncodedAudioFrameInfo): void; -} -declare enum AREA_CODE { - AREA_CODE_CN = 1, - AREA_CODE_NA = 2, - AREA_CODE_EU = 4, - AREA_CODE_AS = 8, - AREA_CODE_JP = 16, - AREA_CODE_IN = 32, - AREA_CODE_GLOB = 4294967295 -} -declare enum AREA_CODE_EX { - AREA_CODE_OC = 64, - AREA_CODE_SA = 128, - AREA_CODE_AF = 256, - AREA_CODE_KR = 512, - AREA_CODE_HKMC = 1024, - AREA_CODE_US = 2048, - AREA_CODE_OVS = 4294967294 -} -declare enum CHANNEL_MEDIA_RELAY_ERROR { - RELAY_OK = 0, - RELAY_ERROR_SERVER_ERROR_RESPONSE = 1, - RELAY_ERROR_SERVER_NO_RESPONSE = 2, - RELAY_ERROR_NO_RESOURCE_AVAILABLE = 3, - RELAY_ERROR_FAILED_JOIN_SRC = 4, - RELAY_ERROR_FAILED_JOIN_DEST = 5, - RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC = 6, - RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST = 7, - RELAY_ERROR_SERVER_CONNECTION_LOST = 8, - RELAY_ERROR_INTERNAL_ERROR = 9, - RELAY_ERROR_SRC_TOKEN_EXPIRED = 10, - RELAY_ERROR_DEST_TOKEN_EXPIRED = 11 -} -declare enum CHANNEL_MEDIA_RELAY_EVENT { - RELAY_EVENT_NETWORK_DISCONNECTED = 0, - RELAY_EVENT_NETWORK_CONNECTED = 1, - RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL = 2, - RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL = 3, - RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL = 4, - RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC = 5, - RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC = 6, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL = 7, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED = 8, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE = 9, - RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL = 10, - RELAY_EVENT_VIDEO_PROFILE_UPDATE = 11, - RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS = 12, - RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED = 13, - RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS = 14, - RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED = 15 -} -declare enum CHANNEL_MEDIA_RELAY_STATE { - RELAY_STATE_IDLE = 0, - RELAY_STATE_CONNECTING = 1, - RELAY_STATE_RUNNING = 2, - RELAY_STATE_FAILURE = 3 -} -declare class ChannelMediaInfo { - channelName?: string; - token?: string; - uid?: number; -} -declare class ChannelMediaRelayConfiguration { - srcInfo?: ChannelMediaInfo[]; - destInfos?: ChannelMediaInfo[]; - destCount?: number; -} -declare class UplinkNetworkInfo { - video_encoder_target_bitrate_bps?: number; -} -declare class PeerDownlinkInfo { - uid?: string; - stream_type?: VIDEO_STREAM_TYPE; - current_downscale_level?: REMOTE_VIDEO_DOWNSCALE_LEVEL; - expected_bitrate_bps?: number; -} -declare class DownlinkNetworkInfo { - lastmile_buffer_delay_time_ms?: number; - bandwidth_estimation_bps?: number; - total_downscale_level_count?: number; - peer_downlink_info?: PeerDownlinkInfo[]; - total_received_video_count?: number; -} -declare enum ENCRYPTION_MODE { - AES_128_XTS = 1, - AES_128_ECB = 2, - AES_256_XTS = 3, - SM4_128_ECB = 4, - AES_128_GCM = 5, - AES_256_GCM = 6, - AES_128_GCM2 = 7, - AES_256_GCM2 = 8, - MODE_END = 9 -} -declare class EncryptionConfig { - encryptionMode?: ENCRYPTION_MODE; - encryptionKey?: string; - encryptionKdfSalt?: number; -} -declare enum ENCRYPTION_ERROR_TYPE { - ENCRYPTION_ERROR_INTERNAL_FAILURE = 0, - ENCRYPTION_ERROR_DECRYPTION_FAILURE = 1, - ENCRYPTION_ERROR_ENCRYPTION_FAILURE = 2 -} -declare enum UPLOAD_ERROR_REASON { - UPLOAD_SUCCESS = 0, - UPLOAD_NET_ERROR = 1, - UPLOAD_SERVER_ERROR = 2 -} -declare enum PERMISSION_TYPE { - RECORD_AUDIO = 0, - CAMERA = 1, - SCREEN_CAPTURE = 2 -} -declare enum MAX_USER_ACCOUNT_LENGTH_TYPE { - MAX_USER_ACCOUNT_LENGTH = 256 -} -declare enum STREAM_SUBSCRIBE_STATE { - SUB_STATE_IDLE = 0, - SUB_STATE_NO_SUBSCRIBED = 1, - SUB_STATE_SUBSCRIBING = 2, - SUB_STATE_SUBSCRIBED = 3 -} -declare enum STREAM_PUBLISH_STATE { - PUB_STATE_IDLE = 0, - PUB_STATE_NO_PUBLISHED = 1, - PUB_STATE_PUBLISHING = 2, - PUB_STATE_PUBLISHED = 3 -} -declare class EchoTestConfiguration { - view?: any; - enableAudio?: boolean; - enableVideo?: boolean; - token?: string; - channelId?: string; - intervalInSeconds?: number; -} -declare class UserInfo { - uid?: number; - userAccount?: string; -} -declare enum EAR_MONITORING_FILTER_TYPE { - EAR_MONITORING_FILTER_NONE = 1, - EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS = 2, - EAR_MONITORING_FILTER_NOISE_SUPPRESSION = 4 -} -declare enum THREAD_PRIORITY_TYPE { - LOWEST = 0, - LOW = 1, - NORMAL = 2, - HIGH = 3, - HIGHEST = 4, - CRITICAL = 5 -} -declare class ScreenVideoParameters { - dimensions?: VideoDimensions; - frameRate?: number; - bitrate?: number; - contentHint?: VIDEO_CONTENT_HINT; -} -declare class ScreenAudioParameters { - sampleRate?: number; - channels?: number; - captureSignalVolume?: number; -} -declare class ScreenCaptureParameters2 { - captureAudio?: boolean; - audioParams?: ScreenAudioParameters; - captureVideo?: boolean; - videoParams?: ScreenVideoParameters; -} -declare enum MEDIA_TRACE_EVENT { - MEDIA_TRACE_EVENT_VIDEO_RENDERED = 0, - MEDIA_TRACE_EVENT_VIDEO_DECODED = 1 -} -declare class VideoRenderingTracingInfo { - elapsedTime?: number; - start2JoinChannel?: number; - join2JoinSuccess?: number; - joinSuccess2RemoteJoined?: number; - remoteJoined2SetView?: number; - remoteJoined2UnmuteVideo?: number; - remoteJoined2PacketReceived?: number; -} -declare enum CONFIG_FETCH_TYPE { - CONFIG_FETCH_TYPE_INITIALIZE = 1, - CONFIG_FETCH_TYPE_JOIN_CHANNEL = 2 -} -declare class RecorderStreamInfo { - channelId?: string; - uid?: number; -} -declare enum LOCAL_PROXY_MODE { - ConnectivityFirst = 0, - LocalOnly = 1 -} -declare class LogUploadServerInfo { - serverDomain?: string; - serverPath?: string; - serverPort?: number; - serverHttps?: boolean; -} -declare class AdvancedConfigInfo { - logUploadServer?: LogUploadServerInfo; -} -declare class LocalAccessPointConfiguration { - ipList?: string[]; - ipListSize?: number; - domainList?: string[]; - domainListSize?: number; - verifyDomainName?: string; - mode?: LOCAL_PROXY_MODE; - advancedConfig?: AdvancedConfigInfo; -} -declare class SpatialAudioParams { - speaker_azimuth?: number; - speaker_elevation?: number; - speaker_distance?: number; - speaker_orientation?: number; - enable_blur?: boolean; - enable_air_absorb?: boolean; - speaker_attenuation?: number; - enable_doppler?: boolean; -} - -declare enum MEDIA_PLAYER_STATE { - PLAYER_STATE_IDLE = 0, - PLAYER_STATE_OPENING = 1, - PLAYER_STATE_OPEN_COMPLETED = 2, - PLAYER_STATE_PLAYING = 3, - PLAYER_STATE_PAUSED = 4, - PLAYER_STATE_PLAYBACK_COMPLETED = 5, - PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED = 6, - PLAYER_STATE_STOPPED = 7, - PLAYER_STATE_PAUSING_INTERNAL = 50, - PLAYER_STATE_STOPPING_INTERNAL = 51, - PLAYER_STATE_SEEKING_INTERNAL = 52, - PLAYER_STATE_GETTING_INTERNAL = 53, - PLAYER_STATE_NONE_INTERNAL = 54, - PLAYER_STATE_DO_NOTHING_INTERNAL = 55, - PLAYER_STATE_SET_TRACK_INTERNAL = 56, - PLAYER_STATE_FAILED = 100 -} -declare enum MEDIA_PLAYER_ERROR { - PLAYER_ERROR_NONE = 0, - PLAYER_ERROR_INVALID_ARGUMENTS = -1, - PLAYER_ERROR_INTERNAL = -2, - PLAYER_ERROR_NO_RESOURCE = -3, - PLAYER_ERROR_INVALID_MEDIA_SOURCE = -4, - PLAYER_ERROR_UNKNOWN_STREAM_TYPE = -5, - PLAYER_ERROR_OBJ_NOT_INITIALIZED = -6, - PLAYER_ERROR_CODEC_NOT_SUPPORTED = -7, - PLAYER_ERROR_VIDEO_RENDER_FAILED = -8, - PLAYER_ERROR_INVALID_STATE = -9, - PLAYER_ERROR_URL_NOT_FOUND = -10, - PLAYER_ERROR_INVALID_CONNECTION_STATE = -11, - PLAYER_ERROR_SRC_BUFFER_UNDERFLOW = -12, - PLAYER_ERROR_INTERRUPTED = -13, - PLAYER_ERROR_NOT_SUPPORTED = -14, - PLAYER_ERROR_TOKEN_EXPIRED = -15, - PLAYER_ERROR_IP_EXPIRED = -16, - PLAYER_ERROR_UNKNOWN = -17 -} -declare enum MEDIA_STREAM_TYPE { - STREAM_TYPE_UNKNOWN = 0, - STREAM_TYPE_VIDEO = 1, - STREAM_TYPE_AUDIO = 2, - STREAM_TYPE_SUBTITLE = 3 -} -declare enum MEDIA_PLAYER_EVENT { - PLAYER_EVENT_SEEK_BEGIN = 0, - PLAYER_EVENT_SEEK_COMPLETE = 1, - PLAYER_EVENT_SEEK_ERROR = 2, - PLAYER_EVENT_AUDIO_TRACK_CHANGED = 5, - PLAYER_EVENT_BUFFER_LOW = 6, - PLAYER_EVENT_BUFFER_RECOVER = 7, - PLAYER_EVENT_FREEZE_START = 8, - PLAYER_EVENT_FREEZE_STOP = 9, - PLAYER_EVENT_SWITCH_BEGIN = 10, - PLAYER_EVENT_SWITCH_COMPLETE = 11, - PLAYER_EVENT_SWITCH_ERROR = 12, - PLAYER_EVENT_FIRST_DISPLAYED = 13, - PLAYER_EVENT_REACH_CACHE_FILE_MAX_COUNT = 14, - PLAYER_EVENT_REACH_CACHE_FILE_MAX_SIZE = 15, - PLAYER_EVENT_TRY_OPEN_START = 16, - PLAYER_EVENT_TRY_OPEN_SUCCEED = 17, - PLAYER_EVENT_TRY_OPEN_FAILED = 18 -} -declare enum PLAYER_PRELOAD_EVENT { - PLAYER_PRELOAD_EVENT_BEGIN = 0, - PLAYER_PRELOAD_EVENT_COMPLETE = 1, - PLAYER_PRELOAD_EVENT_ERROR = 2 -} -declare class PlayerStreamInfo { - streamIndex?: number; - streamType?: MEDIA_STREAM_TYPE; - codecName?: string; - language?: string; - videoFrameRate?: number; - videoBitRate?: number; - videoWidth?: number; - videoHeight?: number; - videoRotation?: number; - audioSampleRate?: number; - audioChannels?: number; - audioBitsPerSample?: number; - duration?: number; -} -declare class SrcInfo { - bitrateInKbps?: number; - name?: string; -} -declare enum MEDIA_PLAYER_METADATA_TYPE { - PLAYER_METADATA_TYPE_UNKNOWN = 0, - PLAYER_METADATA_TYPE_SEI = 1 -} -declare class CacheStatistics { - fileSize?: number; - cacheSize?: number; - downloadSize?: number; -} -declare class PlayerUpdatedInfo { - playerId?: string; - deviceId?: string; - cacheStatistics?: CacheStatistics; -} -declare class MediaSource { - url?: string; - uri?: string; - startPos?: number; - autoPlay?: boolean; - enableCache?: boolean; - isAgoraSource?: boolean; - isLiveSource?: boolean; -} - -declare enum LOG_LEVEL { - LOG_LEVEL_NONE = 0, - LOG_LEVEL_INFO = 1, - LOG_LEVEL_WARN = 2, - LOG_LEVEL_ERROR = 4, - LOG_LEVEL_FATAL = 8, - LOG_LEVEL_API_CALL = 16 -} -declare enum LOG_FILTER_TYPE { - LOG_FILTER_OFF = 0, - LOG_FILTER_DEBUG = 2063, - LOG_FILTER_INFO = 15, - LOG_FILTER_WARN = 14, - LOG_FILTER_ERROR = 12, - LOG_FILTER_CRITICAL = 8, - LOG_FILTER_MASK = 2063 -} -declare class LogConfig { - filePath?: string; - fileSizeInKB?: number; - level?: LOG_LEVEL; -} - -declare enum AUDIO_MIXING_DUAL_MONO_MODE { - AUDIO_MIXING_DUAL_MONO_AUTO = 0, - AUDIO_MIXING_DUAL_MONO_L = 1, - AUDIO_MIXING_DUAL_MONO_R = 2, - AUDIO_MIXING_DUAL_MONO_MIX = 3 -} -interface IMediaEngine { - registerAudioFrameObserver(observer: IAudioFrameObserver): CallApiReturnType; - registerVideoFrameObserver(observer: IVideoFrameObserver): CallApiReturnType; - registerVideoEncodedFrameObserver(observer: IVideoEncodedFrameObserver): CallApiReturnType; - pushAudioFrame(frame: AudioFrame, trackId: number): CallApiReturnType; - pullAudioFrame(frame: AudioFrame): CallApiReturnType; - setExternalVideoSource(enabled: boolean, useTexture: boolean, sourceType: EXTERNAL_VIDEO_SOURCE_TYPE, encodedVideoOption: SenderOptions): CallApiReturnType; - setExternalAudioSource(enabled: boolean, sampleRate: number, channels: number, localPlayback: boolean, publish: boolean): CallApiReturnType; - createCustomAudioTrack(trackType: AUDIO_TRACK_TYPE, config: AudioTrackConfig): CallApiReturnType; - destroyCustomAudioTrack(trackId: number): CallApiReturnType; - setExternalAudioSink(enabled: boolean, sampleRate: number, channels: number): CallApiReturnType; - enableCustomAudioLocalPlayback(trackId: number, enabled: boolean): CallApiReturnType; - pushVideoFrame(frame: ExternalVideoFrame, videoTrackId: number): CallApiReturnType; - pushEncodedVideoImage(imageBuffer: Uint8Array, length: number, videoEncodedFrameInfo: EncodedVideoFrameInfo, videoTrackId: number): CallApiReturnType; - release(): CallApiReturnType; -} - -interface IMediaPlayerSourceObserver { - onPlayerSourceStateChanged(state: MEDIA_PLAYER_STATE, ec: MEDIA_PLAYER_ERROR): void; - onPositionChanged(position_ms: number): void; - onPlayerEvent(eventCode: MEDIA_PLAYER_EVENT, elapsedTime: number, message: string): void; - onMetaData(data: void[], length: number): void; - onPlayBufferUpdated(playCachedBuffer: number): void; - onPreloadEvent(src: string, event: PLAYER_PRELOAD_EVENT): void; - onCompleted(): void; - onAgoraCDNTokenWillExpire(): void; - onPlayerSrcInfoChanged(from: SrcInfo, to: SrcInfo): void; - onPlayerInfoUpdated(info: PlayerUpdatedInfo): void; - onAudioVolumeIndication(volume: number): void; -} - -interface IMediaPlayer { - getMediaPlayerId(): CallApiReturnType; - open(url: string, startPos: number): CallApiReturnType; - openWithMediaSource(source: MediaSource): CallApiReturnType; - play(): CallApiReturnType; - pause(): CallApiReturnType; - stop(): CallApiReturnType; - resume(): CallApiReturnType; - seek(newPos: number): CallApiReturnType; - setAudioPitch(pitch: number): CallApiReturnType; - getDuration(duration: number): CallApiReturnType; - getPlayPosition(pos: number): CallApiReturnType; - getStreamCount(count: number): CallApiReturnType; - getStreamInfo(index: number, info: PlayerStreamInfo[]): CallApiReturnType; - setLoopCount(loopCount: number): CallApiReturnType; - setPlaybackSpeed(speed: number): CallApiReturnType; - selectAudioTrack(index: number): CallApiReturnType; - setPlayerOption(key: string, value: number): CallApiReturnType; - setPlayerOption2(key: string, value: string): CallApiReturnType; - takeScreenshot(filename: string): CallApiReturnType; - selectInternalSubtitle(index: number): CallApiReturnType; - setExternalSubtitle(url: string): CallApiReturnType; - getState(): CallApiReturnType; - mute(muted: boolean): CallApiReturnType; - getMute(muted: boolean): CallApiReturnType; - adjustPlayoutVolume(volume: number): CallApiReturnType; - getPlayoutVolume(volume: number): CallApiReturnType; - adjustPublishSignalVolume(volume: number): CallApiReturnType; - getPublishSignalVolume(volume: number): CallApiReturnType; - setView(view: any): CallApiReturnType; - setRenderMode(renderMode: RENDER_MODE_TYPE): CallApiReturnType; - registerPlayerSourceObserver(observer: IMediaPlayerSourceObserver): CallApiReturnType; - unregisterPlayerSourceObserver(observer: IMediaPlayerSourceObserver): CallApiReturnType; - registerAudioFrameObserver(observer: IAudioPcmFrameSink): CallApiReturnType; - registerAudioFrameObserver2(observer: IAudioPcmFrameSink, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE): CallApiReturnType; - unregisterAudioFrameObserver(observer: IAudioPcmFrameSink): CallApiReturnType; - registerVideoFrameObserver(observer: IVideoFrameObserver): CallApiReturnType; - unregisterVideoFrameObserver(observer: IVideoFrameObserver): CallApiReturnType; - registerMediaPlayerAudioSpectrumObserver(observer: IAudioSpectrumObserver, intervalInMS: number): CallApiReturnType; - unregisterMediaPlayerAudioSpectrumObserver(observer: IAudioSpectrumObserver): CallApiReturnType; - setAudioDualMonoMode(mode: AUDIO_DUAL_MONO_MODE): CallApiReturnType; - getPlayerSdkVersion(): CallApiReturnType; - getPlaySrc(): CallApiReturnType; - openWithAgoraCDNSrc(src: string, startPos: number): CallApiReturnType; - getAgoraCDNLineCount(): CallApiReturnType; - switchAgoraCDNLineByIndex(index: number): CallApiReturnType; - getCurrentAgoraCDNIndex(): CallApiReturnType; - enableAutoSwitchAgoraCDN(enable: boolean): CallApiReturnType; - renewAgoraCDNSrcToken(token: string, ts: number): CallApiReturnType; - switchAgoraCDNSrc(src: string, syncPts: boolean): CallApiReturnType; - switchSrc(src: string, syncPts: boolean): CallApiReturnType; - preloadSrc(src: string, startPos: number): CallApiReturnType; - playPreloadedSrc(src: string): CallApiReturnType; - unloadSrc(src: string): CallApiReturnType; - setSpatialAudioParams(params: SpatialAudioParams): CallApiReturnType; - setSoundPositionParams(pan: number, gain: number): CallApiReturnType; -} -interface IMediaPlayerCacheManager { - removeAllCaches(): CallApiReturnType; - removeOldCache(): CallApiReturnType; - removeCacheByUri(uri: string): CallApiReturnType; - setCacheDir(path: string): CallApiReturnType; - setMaxCacheFileCount(count: number): CallApiReturnType; - setMaxCacheFileSize(cacheSize: number): CallApiReturnType; - enableAutoRemoveCache(enable: boolean): CallApiReturnType; - getCacheDir(path: string, length: number): CallApiReturnType; - getMaxCacheFileCount(): CallApiReturnType; - getMaxCacheFileSize(): CallApiReturnType; - getCacheFileCount(): CallApiReturnType; -} - -interface IMediaRecorder { - setMediaRecorderObserver(callback: IMediaRecorderObserver): CallApiReturnType; - startRecording(config: MediaRecorderConfiguration): CallApiReturnType; - stopRecording(): CallApiReturnType; -} - -declare enum STREAMING_SRC_ERR { - STREAMING_SRC_ERR_NONE = 0, - STREAMING_SRC_ERR_UNKNOWN = 1, - STREAMING_SRC_ERR_INVALID_PARAM = 2, - STREAMING_SRC_ERR_BAD_STATE = 3, - STREAMING_SRC_ERR_NO_MEM = 4, - STREAMING_SRC_ERR_BUFFER_OVERFLOW = 5, - STREAMING_SRC_ERR_BUFFER_UNDERFLOW = 6, - STREAMING_SRC_ERR_NOT_FOUND = 7, - STREAMING_SRC_ERR_TIMEOUT = 8, - STREAMING_SRC_ERR_EXPIRED = 9, - STREAMING_SRC_ERR_UNSUPPORTED = 10, - STREAMING_SRC_ERR_NOT_EXIST = 11, - STREAMING_SRC_ERR_EXIST = 12, - STREAMING_SRC_ERR_OPEN = 13, - STREAMING_SRC_ERR_CLOSE = 14, - STREAMING_SRC_ERR_READ = 15, - STREAMING_SRC_ERR_WRITE = 16, - STREAMING_SRC_ERR_SEEK = 17, - STREAMING_SRC_ERR_EOF = 18, - STREAMING_SRC_ERR_CODECOPEN = 19, - STREAMING_SRC_ERR_CODECCLOSE = 20, - STREAMING_SRC_ERR_CODECPROC = 21 -} -declare enum STREAMING_SRC_STATE { - STREAMING_SRC_STATE_CLOSED = 0, - STREAMING_SRC_STATE_OPENING = 1, - STREAMING_SRC_STATE_IDLE = 2, - STREAMING_SRC_STATE_PLAYING = 3, - STREAMING_SRC_STATE_SEEKING = 4, - STREAMING_SRC_STATE_EOF = 5, - STREAMING_SRC_STATE_ERROR = 6 -} -declare class InputSeiData { - type?: number; - timestamp?: number; - frame_index?: number; - private_data?: Uint8Array; - data_size?: number; -} - -declare enum PreloadStatusCode { - kPreloadStatusCompleted = 0, - kPreloadStatusFailed = 1, - kPreloadStatusPreloading = 2, - kPreloadStatusRemoved = 3 -} -declare enum MusicContentCenterStatusCode { - kMusicContentCenterStatusOk = 0, - kMusicContentCenterStatusErr = 1, - kMusicContentCenterStatusErrGateway = 2, - kMusicContentCenterStatusErrPermissionAndResource = 3, - kMusicContentCenterStatusErrInternalDataParse = 4, - kMusicContentCenterStatusErrMusicLoading = 5, - kMusicContentCenterStatusErrMusicDecryption = 6, - kMusicContentCenterStatusErrHttpInternalError = 7 -} -declare class MusicChartInfo { - chartName?: string; - id?: number; -} -declare enum MUSIC_CACHE_STATUS_TYPE { - MUSIC_CACHE_STATUS_TYPE_CACHED = 0, - MUSIC_CACHE_STATUS_TYPE_CACHING = 1 -} -declare class MusicCacheInfo { - songCode?: number; - status?: MUSIC_CACHE_STATUS_TYPE; -} -interface MusicChartCollection { - getCount(): CallApiReturnType; - get(index: number): CallApiReturnType; -} -declare class MvProperty { - resolution?: string; - bandwidth?: string; -} -declare class ClimaxSegment { - startTimeMs?: number; - endTimeMs?: number; -} -declare class Music { - songCode?: number; - name?: string; - singer?: string; - poster?: string; - releaseTime?: string; - durationS?: number; - type?: number; - pitchType?: number; - lyricCount?: number; - lyricList?: number[]; - climaxSegmentCount?: number; - climaxSegmentList?: ClimaxSegment[]; - mvPropertyCount?: number; - mvPropertyList?: MvProperty[]; -} -interface MusicCollection { - getCount(): CallApiReturnType; - getTotal(): CallApiReturnType; - getPage(): CallApiReturnType; - getPageSize(): CallApiReturnType; - getMusic(index: number): CallApiReturnType; -} -interface IMusicContentCenterEventHandler { - onMusicChartsResult(requestId: string, result: MusicChartCollection, errorCode: MusicContentCenterStatusCode): void; - onMusicCollectionResult(requestId: string, result: MusicCollection, errorCode: MusicContentCenterStatusCode): void; - onLyricResult(requestId: string, songCode: number, lyricUrl: string, errorCode: MusicContentCenterStatusCode): void; - onSongSimpleInfoResult(requestId: string, songCode: number, simpleInfo: string, errorCode: MusicContentCenterStatusCode): void; - onPreLoadEvent(requestId: string, songCode: number, percent: number, lyricUrl: string, status: PreloadStatusCode, errorCode: MusicContentCenterStatusCode): void; -} -declare class MusicContentCenterConfiguration { - appId?: string; - token?: string; - mccUid?: number; - maxCacheSize?: number; - mccDomain?: string; -} -interface IMusicPlayer { -} -interface IMusicContentCenter { - initialize(configuration: MusicContentCenterConfiguration): CallApiReturnType; - renewToken(token: string): CallApiReturnType; - release(): CallApiReturnType; - registerEventHandler(eventHandler: IMusicContentCenterEventHandler): CallApiReturnType; - unregisterEventHandler(): CallApiReturnType; - createMusicPlayer(): CallApiReturnType; - getMusicCharts(requestId: string): CallApiReturnType; - getMusicCollectionByMusicChartId(requestId: string, musicChartId: number, page: number, pageSize: number, jsonOption: string): CallApiReturnType; - searchMusic(requestId: string, keyWord: string, page: number, pageSize: number, jsonOption: string): CallApiReturnType; - preload(songCode: number, jsonOption: string): CallApiReturnType; - preload2(requestId: string, songCode: number): CallApiReturnType; - removeCache(songCode: number): CallApiReturnType; - getCaches(cacheInfo: MusicCacheInfo[], cacheInfoSize: number[]): CallApiReturnType; - isPreloaded(songCode: number): CallApiReturnType; - getLyric(requestId: string, songCode: number, LyricType: number): CallApiReturnType; - getSongSimpleInfo(requestId: string, songCode: number): CallApiReturnType; - getInternalSongCode(songCode: number, jsonOption: string, internalSongCode: number): CallApiReturnType; -} - -declare enum RHYTHM_PLAYER_STATE_TYPE { - RHYTHM_PLAYER_STATE_IDLE = 810, - RHYTHM_PLAYER_STATE_OPENING = 811, - RHYTHM_PLAYER_STATE_DECODING = 812, - RHYTHM_PLAYER_STATE_PLAYING = 813, - RHYTHM_PLAYER_STATE_FAILED = 814 -} -declare enum RHYTHM_PLAYER_ERROR_TYPE { - RHYTHM_PLAYER_ERROR_OK = 0, - RHYTHM_PLAYER_ERROR_FAILED = 1, - RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN = 801, - RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY = 802, - RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT = 803 -} -declare class AgoraRhythmPlayerConfig { - beatsPerMeasure?: number; - beatsPerMinute?: number; -} - -declare enum MEDIA_DEVICE_TYPE { - UNKNOWN_AUDIO_DEVICE = -1, - AUDIO_PLAYOUT_DEVICE = 0, - AUDIO_RECORDING_DEVICE = 1, - VIDEO_RENDER_DEVICE = 2, - VIDEO_CAPTURE_DEVICE = 3, - AUDIO_APPLICATION_PLAYOUT_DEVICE = 4, - AUDIO_VIRTUAL_PLAYOUT_DEVICE = 5, - AUDIO_VIRTUAL_RECORDING_DEVICE = 6 -} -declare enum AUDIO_MIXING_STATE_TYPE { - AUDIO_MIXING_STATE_PLAYING = 710, - AUDIO_MIXING_STATE_PAUSED = 711, - AUDIO_MIXING_STATE_STOPPED = 713, - AUDIO_MIXING_STATE_FAILED = 714 -} -declare enum AUDIO_MIXING_REASON_TYPE { - AUDIO_MIXING_REASON_CAN_NOT_OPEN = 701, - AUDIO_MIXING_REASON_TOO_FREQUENT_CALL = 702, - AUDIO_MIXING_REASON_INTERRUPTED_EOF = 703, - AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED = 721, - AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED = 723, - AUDIO_MIXING_REASON_STOPPED_BY_USER = 724, - AUDIO_MIXING_REASON_OK = 0 -} -declare enum INJECT_STREAM_STATUS { - INJECT_STREAM_STATUS_START_SUCCESS = 0, - INJECT_STREAM_STATUS_START_ALREADY_EXISTS = 1, - INJECT_STREAM_STATUS_START_UNAUTHORIZED = 2, - INJECT_STREAM_STATUS_START_TIMEDOUT = 3, - INJECT_STREAM_STATUS_START_FAILED = 4, - INJECT_STREAM_STATUS_STOP_SUCCESS = 5, - INJECT_STREAM_STATUS_STOP_NOT_FOUND = 6, - INJECT_STREAM_STATUS_STOP_UNAUTHORIZED = 7, - INJECT_STREAM_STATUS_STOP_TIMEDOUT = 8, - INJECT_STREAM_STATUS_STOP_FAILED = 9, - INJECT_STREAM_STATUS_BROKEN = 10 -} -declare enum AUDIO_EQUALIZATION_BAND_FREQUENCY { - AUDIO_EQUALIZATION_BAND_31 = 0, - AUDIO_EQUALIZATION_BAND_62 = 1, - AUDIO_EQUALIZATION_BAND_125 = 2, - AUDIO_EQUALIZATION_BAND_250 = 3, - AUDIO_EQUALIZATION_BAND_500 = 4, - AUDIO_EQUALIZATION_BAND_1K = 5, - AUDIO_EQUALIZATION_BAND_2K = 6, - AUDIO_EQUALIZATION_BAND_4K = 7, - AUDIO_EQUALIZATION_BAND_8K = 8, - AUDIO_EQUALIZATION_BAND_16K = 9 -} -declare enum AUDIO_REVERB_TYPE { - AUDIO_REVERB_DRY_LEVEL = 0, - AUDIO_REVERB_WET_LEVEL = 1, - AUDIO_REVERB_ROOM_SIZE = 2, - AUDIO_REVERB_WET_DELAY = 3, - AUDIO_REVERB_STRENGTH = 4 -} -declare enum STREAM_FALLBACK_OPTIONS { - STREAM_FALLBACK_OPTION_DISABLED = 0, - STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW = 1, - STREAM_FALLBACK_OPTION_AUDIO_ONLY = 2 -} -declare enum PRIORITY_TYPE { - PRIORITY_HIGH = 50, - PRIORITY_NORMAL = 100 -} -declare class LocalVideoStats { - uid?: number; - sentBitrate?: number; - sentFrameRate?: number; - captureFrameRate?: number; - captureFrameWidth?: number; - captureFrameHeight?: number; - regulatedCaptureFrameRate?: number; - regulatedCaptureFrameWidth?: number; - regulatedCaptureFrameHeight?: number; - encoderOutputFrameRate?: number; - encodedFrameWidth?: number; - encodedFrameHeight?: number; - rendererOutputFrameRate?: number; - targetBitrate?: number; - targetFrameRate?: number; - qualityAdaptIndication?: QUALITY_ADAPT_INDICATION; - encodedBitrate?: number; - encodedFrameCount?: number; - codecType?: VIDEO_CODEC_TYPE; - txPacketLossRate?: number; - captureBrightnessLevel?: CAPTURE_BRIGHTNESS_LEVEL_TYPE; - dualStreamEnabled?: boolean; - hwEncoderAccelerating?: number; -} -declare class RemoteAudioStats { - uid?: number; - quality?: number; - networkTransportDelay?: number; - jitterBufferDelay?: number; - audioLossRate?: number; - numChannels?: number; - receivedSampleRate?: number; - receivedBitrate?: number; - totalFrozenTime?: number; - frozenRate?: number; - mosValue?: number; - frozenRateByCustomPlcCount?: number; - plcCount?: number; - totalActiveTime?: number; - publishDuration?: number; - qoeQuality?: number; - qualityChangedReason?: number; - rxAudioBytes?: number; -} -declare class RemoteVideoStats { - uid?: number; - delay?: number; - e2eDelay?: number; - width?: number; - height?: number; - receivedBitrate?: number; - decoderOutputFrameRate?: number; - rendererOutputFrameRate?: number; - frameLossRate?: number; - packetLossRate?: number; - rxStreamType?: VIDEO_STREAM_TYPE; - totalFrozenTime?: number; - frozenRate?: number; - avSyncTimeMs?: number; - totalActiveTime?: number; - publishDuration?: number; - mosValue?: number; - rxVideoBytes?: number; -} -declare class Region { - uid?: number; - x?: number; - y?: number; - width?: number; - height?: number; - zOrder?: number; - alpha?: number; - renderMode?: RENDER_MODE_TYPE; -} -declare class VideoCompositingLayout { - canvasWidth?: number; - canvasHeight?: number; - backgroundColor?: string; - regions?: Region[]; - regionCount?: number; - appData?: string; - appDataLength?: number; -} -declare class InjectStreamConfig { - width?: number; - height?: number; - videoGop?: number; - videoFramerate?: number; - videoBitrate?: number; - audioSampleRate?: AUDIO_SAMPLE_RATE_TYPE; - audioBitrate?: number; - audioChannels?: number; -} -declare enum RTMP_STREAM_LIFE_CYCLE_TYPE { - RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL = 1, - RTMP_STREAM_LIFE_CYCLE_BIND2OWNER = 2 -} -declare class PublisherConfiguration { - width?: number; - height?: number; - framerate?: number; - bitrate?: number; - defaultLayout?: number; - lifecycle?: number; - owner?: boolean; - injectStreamWidth?: number; - injectStreamHeight?: number; - injectStreamUrl?: string; - publishUrl?: string; - rawStreamUrl?: string; - extraInfo?: string; -} -declare enum CAMERA_DIRECTION { - CAMERA_REAR = 0, - CAMERA_FRONT = 1 -} -declare enum CLOUD_PROXY_TYPE { - NONE_PROXY = 0, - UDP_PROXY = 1, - TCP_PROXY = 2 -} -declare class CameraCapturerConfiguration { - cameraDirection?: CAMERA_DIRECTION; - deviceId?: string; - format?: VideoFormat; - followEncodeDimensionRatio?: boolean; -} -declare class ScreenCaptureConfiguration { - isCaptureWindow?: boolean; - displayId?: number; - screenRect?: Rectangle; - windowId?: any; - params?: ScreenCaptureParameters; - regionRect?: Rectangle; -} -declare class SIZE { - width?: number; - height?: number; -} -declare class ThumbImageBuffer { - buffer?: string; - length?: number; - width?: number; - height?: number; -} -declare enum ScreenCaptureSourceType { - ScreenCaptureSourceType_Unknown = -1, - ScreenCaptureSourceType_Window = 0, - ScreenCaptureSourceType_Screen = 1, - ScreenCaptureSourceType_Custom = 2 -} -declare class ScreenCaptureSourceInfo { - type?: ScreenCaptureSourceType; - sourceId?: any; - sourceName?: string; - thumbImage?: ThumbImageBuffer; - iconImage?: ThumbImageBuffer; - processPath?: string; - sourceTitle?: string; - primaryMonitor?: boolean; - isOccluded?: boolean; - position?: Rectangle; - minimizeWindow?: boolean; - sourceDisplayId?: any; -} -declare class AdvancedAudioOptions { - audioProcessingChannels?: number; -} -declare class ImageTrackOptions { - imageUrl?: string; - fps?: number; - mirrorMode?: VIDEO_MIRROR_MODE_TYPE; -} -declare class ChannelMediaOptions { - publishCameraTrack?: boolean; - publishSecondaryCameraTrack?: boolean; - publishThirdCameraTrack?: boolean; - publishFourthCameraTrack?: boolean; - publishMicrophoneTrack?: boolean; - publishScreenCaptureVideo?: boolean; - publishScreenCaptureAudio?: boolean; - publishScreenTrack?: boolean; - publishSecondaryScreenTrack?: boolean; - publishThirdScreenTrack?: boolean; - publishFourthScreenTrack?: boolean; - publishCustomAudioTrack?: boolean; - publishCustomAudioTrackId?: number; - publishCustomVideoTrack?: boolean; - publishEncodedVideoTrack?: boolean; - publishMediaPlayerAudioTrack?: boolean; - publishMediaPlayerVideoTrack?: boolean; - publishTranscodedVideoTrack?: boolean; - autoSubscribeAudio?: boolean; - autoSubscribeVideo?: boolean; - enableAudioRecordingOrPlayout?: boolean; - publishMediaPlayerId?: number; - clientRoleType?: CLIENT_ROLE_TYPE; - audienceLatencyLevel?: AUDIENCE_LATENCY_LEVEL_TYPE; - defaultVideoStreamType?: VIDEO_STREAM_TYPE; - channelProfile?: CHANNEL_PROFILE_TYPE; - audioDelayMs?: number; - mediaPlayerAudioDelayMs?: number; - token?: string; - enableBuiltInMediaEncryption?: boolean; - publishRhythmPlayerTrack?: boolean; - isInteractiveAudience?: boolean; - customVideoTrackId?: number; - isAudioFilterable?: boolean; -} -declare enum PROXY_TYPE { - NONE_PROXY_TYPE = 0, - UDP_PROXY_TYPE = 1, - TCP_PROXY_TYPE = 2, - LOCAL_PROXY_TYPE = 3, - TCP_PROXY_AUTO_FALLBACK_TYPE = 4, - HTTP_PROXY_TYPE = 5, - HTTPS_PROXY_TYPE = 6 -} -declare enum FeatureType { - VIDEO_VIRTUAL_BACKGROUND = 1, - VIDEO_BEAUTY_EFFECT = 2 -} -declare class LeaveChannelOptions { - stopAudioMixing?: boolean; - stopAllEffect?: boolean; - stopMicrophoneRecording?: boolean; -} -interface IRtcEngineEventHandler { - onJoinChannelSuccess(channel: string, uid: number, elapsed: number): void; - onRejoinChannelSuccess(channel: string, uid: number, elapsed: number): void; - onProxyConnected(channel: string, uid: number, proxyType: PROXY_TYPE, localProxyIp: string, elapsed: number): void; - onError(err: ERROR_CODE_TYPE, msg: string): void; - onAudioQuality(uid: number, quality: number, delay: number, lost: number): void; - onLastmileProbeResult(result: LastmileProbeResult): void; - onAudioVolumeIndication(speakers: AudioVolumeInfo[], speakerNumber: number, totalVolume: number): void; - onLeaveChannel(stats: RtcStats): void; - onRtcStats(stats: RtcStats): void; - onAudioDeviceStateChanged(deviceId: string, deviceType: number, deviceState: number): void; - onAudioMixingPositionChanged(position: number): void; - onAudioMixingFinished(): void; - onAudioEffectFinished(soundId: number): void; - onVideoDeviceStateChanged(deviceId: string, deviceType: number, deviceState: number): void; - onNetworkQuality(uid: number, txQuality: number, rxQuality: number): void; - onIntraRequestReceived(): void; - onUplinkNetworkInfoUpdated(info: UplinkNetworkInfo): void; - onDownlinkNetworkInfoUpdated(info: DownlinkNetworkInfo): void; - onLastmileQuality(quality: number): void; - onFirstLocalVideoFrame(source: VIDEO_SOURCE_TYPE, width: number, height: number, elapsed: number): void; - onFirstLocalVideoFramePublished(source: VIDEO_SOURCE_TYPE, elapsed: number): void; - onFirstRemoteVideoDecoded(uid: number, width: number, height: number, elapsed: number): void; - onVideoSizeChanged(sourceType: VIDEO_SOURCE_TYPE, uid: number, width: number, height: number, rotation: number): void; - onLocalVideoStateChanged(source: VIDEO_SOURCE_TYPE, state: LOCAL_VIDEO_STREAM_STATE, error: LOCAL_VIDEO_STREAM_ERROR): void; - onRemoteVideoStateChanged(uid: number, state: REMOTE_VIDEO_STATE, reason: REMOTE_VIDEO_STATE_REASON, elapsed: number): void; - onFirstRemoteVideoFrame(userId: number, width: number, height: number, elapsed: number): void; - onUserJoined(uid: number, elapsed: number): void; - onUserOffline(uid: number, reason: USER_OFFLINE_REASON_TYPE): void; - onUserMuteAudio(uid: number, muted: boolean): void; - onUserMuteVideo(userId: number, muted: boolean): void; - onUserEnableVideo(uid: number, enabled: boolean): void; - onUserStateChanged(uid: number, state: number): void; - onUserEnableLocalVideo(uid: number, enabled: boolean): void; - onLocalAudioStats(stats: LocalAudioStats): void; - onRemoteAudioStats(stats: RemoteAudioStats): void; - onLocalVideoStats(source: VIDEO_SOURCE_TYPE, stats: LocalVideoStats): void; - onRemoteVideoStats(stats: RemoteVideoStats): void; - onCameraReady(): void; - onCameraFocusAreaChanged(x: number, y: number, width: number, height: number): void; - onCameraExposureAreaChanged(x: number, y: number, width: number, height: number): void; - onFacePositionChanged(imageWidth: number, imageHeight: number, vecRectangle: Rectangle[], vecDistance: number[], numFaces: number): void; - onVideoStopped(): void; - onAudioMixingStateChanged(state: AUDIO_MIXING_STATE_TYPE, reason: AUDIO_MIXING_REASON_TYPE): void; - onRhythmPlayerStateChanged(state: RHYTHM_PLAYER_STATE_TYPE, errorCode: RHYTHM_PLAYER_ERROR_TYPE): void; - onConnectionLost(): void; - onConnectionInterrupted(): void; - onConnectionBanned(): void; - onStreamMessage(userId: number, streamId: number, data: string, length: number, sentTs: number): void; - onStreamMessageError(userId: number, streamId: number, code: number, missed: number, cached: number): void; - onRequestToken(): void; - onTokenPrivilegeWillExpire(token: string): void; - onLicenseValidationFailure(error: LICENSE_ERROR_TYPE): void; - onFirstLocalAudioFramePublished(elapsed: number): void; - onFirstRemoteAudioFrame(uid: number, elapsed: number): void; - onFirstRemoteAudioDecoded(uid: number, elapsed: number): void; - onLocalAudioStateChanged(state: LOCAL_AUDIO_STREAM_STATE, error: LOCAL_AUDIO_STREAM_ERROR): void; - onRemoteAudioStateChanged(uid: number, state: REMOTE_AUDIO_STATE, reason: REMOTE_AUDIO_STATE_REASON, elapsed: number): void; - onActiveSpeaker(userId: number): void; - onContentInspectResult(result: CONTENT_INSPECT_RESULT): void; - onSnapshotTaken(uid: number, filePath: string, width: number, height: number, errCode: number): void; - onClientRoleChanged(oldRole: CLIENT_ROLE_TYPE, newRole: CLIENT_ROLE_TYPE, newRoleOptions: ClientRoleOptions): void; - onClientRoleChangeFailed(reason: CLIENT_ROLE_CHANGE_FAILED_REASON, currentRole: CLIENT_ROLE_TYPE): void; - onAudioDeviceVolumeChanged(deviceType: MEDIA_DEVICE_TYPE, volume: number, muted: boolean): void; - onRtmpStreamingStateChanged(url: string, state: RTMP_STREAM_PUBLISH_STATE, errCode: RTMP_STREAM_PUBLISH_ERROR_TYPE): void; - onRtmpStreamingEvent(url: string, eventCode: RTMP_STREAMING_EVENT): void; - onTranscodingUpdated(): void; - onAudioRoutingChanged(routing: number): void; - onChannelMediaRelayStateChanged(state: number, code: number): void; - onChannelMediaRelayEvent(code: number): void; - onLocalPublishFallbackToAudioOnly(isFallbackOrRecover: boolean): void; - onRemoteSubscribeFallbackToAudioOnly(uid: number, isFallbackOrRecover: boolean): void; - onRemoteAudioTransportStats(uid: number, delay: number, lost: number, rxKBitRate: number): void; - onRemoteVideoTransportStats(uid: number, delay: number, lost: number, rxKBitRate: number): void; - onConnectionStateChanged(state: CONNECTION_STATE_TYPE, reason: CONNECTION_CHANGED_REASON_TYPE): void; - onWlAccMessage(reason: WLACC_MESSAGE_REASON, action: WLACC_SUGGEST_ACTION, wlAccMsg: string): void; - onWlAccStats(currentStats: WlAccStats, averageStats: WlAccStats): void; - onNetworkTypeChanged(type: NETWORK_TYPE): void; - onEncryptionError(errorType: ENCRYPTION_ERROR_TYPE): void; - onPermissionError(permissionType: PERMISSION_TYPE): void; - onLocalUserRegistered(uid: number, userAccount: string): void; - onUserInfoUpdated(uid: number, info: UserInfo): void; - onUploadLogResult(requestId: string, success: boolean, reason: UPLOAD_ERROR_REASON): void; - onAudioSubscribeStateChanged(channel: string, uid: number, oldState: STREAM_SUBSCRIBE_STATE, newState: STREAM_SUBSCRIBE_STATE, elapseSinceLastState: number): void; - onVideoSubscribeStateChanged(channel: string, uid: number, oldState: STREAM_SUBSCRIBE_STATE, newState: STREAM_SUBSCRIBE_STATE, elapseSinceLastState: number): void; - onAudioPublishStateChanged(channel: string, oldState: STREAM_PUBLISH_STATE, newState: STREAM_PUBLISH_STATE, elapseSinceLastState: number): void; - onVideoPublishStateChanged(source: VIDEO_SOURCE_TYPE, channel: string, oldState: STREAM_PUBLISH_STATE, newState: STREAM_PUBLISH_STATE, elapseSinceLastState: number): void; - onExtensionEvent(provider: string, extension: string, key: string, value: string): void; - onExtensionStarted(provider: string, extension: string): void; - onExtensionStopped(provider: string, extension: string): void; - onExtensionError(provider: string, extension: string, error: number, message: string): void; - onUserAccountUpdated(uid: number, userAccount: string): void; - onLocalVideoTranscoderError(stream: TranscodingVideoStream, error: VIDEO_TRANSCODER_ERROR): void; - onVideoRenderingTracingResult(uid: number, currentEvent: MEDIA_TRACE_EVENT, tracingInfo: VideoRenderingTracingInfo): void; -} -interface IVideoDeviceManager { - enumerateVideoDevices(): CallApiReturnType; - setDevice(deviceIdUTF8: string): CallApiReturnType; - getDevice(): CallApiReturnType; - numberOfCapabilities(deviceIdUTF8: string): CallApiReturnType; - getCapability(deviceIdUTF8: string, deviceCapabilityNumber: number, capability: VideoFormat): CallApiReturnType; - startDeviceTest(hwnd: any): CallApiReturnType; - stopDeviceTest(): CallApiReturnType; - release(): CallApiReturnType; -} -declare class RtcEngineContext { - appId?: string; - channelProfile?: CHANNEL_PROFILE_TYPE; - license?: string; - audioScenario?: AUDIO_SCENARIO_TYPE; - areaCode?: number; - logConfig?: LogConfig; - threadPriority?: THREAD_PRIORITY_TYPE; - useExternalEglContext?: boolean; - domainLimit?: boolean; - autoRegisterAgoraExtensions?: boolean; -} -declare enum METADATA_TYPE { - UNKNOWN_METADATA = -1, - VIDEO_METADATA = 0 -} -declare enum MAX_METADATA_SIZE_TYPE { - INVALID_METADATA_SIZE_IN_BYTE = -1, - DEFAULT_METADATA_SIZE_IN_BYTE = 512, - MAX_METADATA_SIZE_IN_BYTE = 1024 -} -declare class Metadata { - uid?: number; - size?: number; - buffer?: Uint8Array; - timeStampMs?: number; -} -interface IMetadataObserver { - onMetadataReceived(metadata: Metadata): void; -} -declare enum DIRECT_CDN_STREAMING_ERROR { - DIRECT_CDN_STREAMING_ERROR_OK = 0, - DIRECT_CDN_STREAMING_ERROR_FAILED = 1, - DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION = 2, - DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION = 3, - DIRECT_CDN_STREAMING_ERROR_NET_CONNECT = 4, - DIRECT_CDN_STREAMING_ERROR_BAD_NAME = 5 -} -declare enum DIRECT_CDN_STREAMING_STATE { - DIRECT_CDN_STREAMING_STATE_IDLE = 0, - DIRECT_CDN_STREAMING_STATE_RUNNING = 1, - DIRECT_CDN_STREAMING_STATE_STOPPED = 2, - DIRECT_CDN_STREAMING_STATE_FAILED = 3, - DIRECT_CDN_STREAMING_STATE_RECOVERING = 4 -} -declare class DirectCdnStreamingStats { - videoWidth?: number; - videoHeight?: number; - fps?: number; - videoBitrate?: number; - audioBitrate?: number; -} -interface IDirectCdnStreamingEventHandler { - onDirectCdnStreamingStateChanged(state: DIRECT_CDN_STREAMING_STATE, error: DIRECT_CDN_STREAMING_ERROR, message: string): void; - onDirectCdnStreamingStats(stats: DirectCdnStreamingStats): void; -} -declare class DirectCdnStreamingMediaOptions { - publishCameraTrack?: boolean; - publishMicrophoneTrack?: boolean; - publishCustomAudioTrack?: boolean; - publishCustomVideoTrack?: boolean; - publishMediaPlayerAudioTrack?: boolean; - publishMediaPlayerId?: number; - customVideoTrackId?: number; -} -declare class ExtensionInfo { - mediaSourceType?: MEDIA_SOURCE_TYPE; - remoteUid?: number; - channelId?: string; - localUid?: number; -} -interface IRtcEngine { - release(sync: boolean): CallApiReturnType; - initialize(context: RtcEngineContext): CallApiReturnType; - getVersion(): CallApiReturnType; - getErrorDescription(code: number): CallApiReturnType; - queryCodecCapability(codecInfo: CodecCapInfo[], size: number): CallApiReturnType; - preloadChannel(token: string, channelId: string, uid: number): CallApiReturnType; - preloadChannel2(token: string, channelId: string, userAccount: string): CallApiReturnType; - updatePreloadChannelToken(token: string): CallApiReturnType; - joinChannel(token: string, channelId: string, info: string, uid: number): CallApiReturnType; - joinChannel2(token: string, channelId: string, uid: number, options: ChannelMediaOptions): CallApiReturnType; - updateChannelMediaOptions(options: ChannelMediaOptions): CallApiReturnType; - leaveChannel(): CallApiReturnType; - leaveChannel2(options: LeaveChannelOptions): CallApiReturnType; - renewToken(token: string): CallApiReturnType; - setChannelProfile(profile: CHANNEL_PROFILE_TYPE): CallApiReturnType; - setClientRole(role: CLIENT_ROLE_TYPE): CallApiReturnType; - setClientRole2(role: CLIENT_ROLE_TYPE, options: ClientRoleOptions): CallApiReturnType; - startEchoTest(): CallApiReturnType; - startEchoTest2(intervalInSeconds: number): CallApiReturnType; - startEchoTest3(config: EchoTestConfiguration): CallApiReturnType; - stopEchoTest(): CallApiReturnType; - enableMultiCamera(enabled: boolean, config: CameraCapturerConfiguration): CallApiReturnType; - enableVideo(): CallApiReturnType; - disableVideo(): CallApiReturnType; - startPreview(): CallApiReturnType; - startPreview2(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - stopPreview(): CallApiReturnType; - stopPreview2(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - startLastmileProbeTest(config: LastmileProbeConfig): CallApiReturnType; - stopLastmileProbeTest(): CallApiReturnType; - setVideoEncoderConfiguration(config: VideoEncoderConfiguration): CallApiReturnType; - setBeautyEffectOptions(enabled: boolean, options: BeautyOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setLowlightEnhanceOptions(enabled: boolean, options: LowlightEnhanceOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setVideoDenoiserOptions(enabled: boolean, options: VideoDenoiserOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setColorEnhanceOptions(enabled: boolean, options: ColorEnhanceOptions, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - enableVirtualBackground(enabled: boolean, backgroundSource: VirtualBackgroundSource, segproperty: SegmentationProperty, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setupRemoteVideo(canvas: VideoCanvas): CallApiReturnType; - setupLocalVideo(canvas: VideoCanvas): CallApiReturnType; - setVideoScenario(scenarioType: VIDEO_APPLICATION_SCENARIO_TYPE): CallApiReturnType; - enableAudio(): CallApiReturnType; - disableAudio(): CallApiReturnType; - setAudioProfile(profile: AUDIO_PROFILE_TYPE, scenario: AUDIO_SCENARIO_TYPE): CallApiReturnType; - setAudioProfile2(profile: AUDIO_PROFILE_TYPE): CallApiReturnType; - setAudioScenario(scenario: AUDIO_SCENARIO_TYPE): CallApiReturnType; - enableLocalAudio(enabled: boolean): CallApiReturnType; - muteLocalAudioStream(mute: boolean): CallApiReturnType; - muteAllRemoteAudioStreams(mute: boolean): CallApiReturnType; - setDefaultMuteAllRemoteAudioStreams(mute: boolean): CallApiReturnType; - muteRemoteAudioStream(uid: number, mute: boolean): CallApiReturnType; - muteLocalVideoStream(mute: boolean): CallApiReturnType; - enableLocalVideo(enabled: boolean): CallApiReturnType; - muteAllRemoteVideoStreams(mute: boolean): CallApiReturnType; - setDefaultMuteAllRemoteVideoStreams(mute: boolean): CallApiReturnType; - muteRemoteVideoStream(uid: number, mute: boolean): CallApiReturnType; - setRemoteVideoStreamType(uid: number, streamType: VIDEO_STREAM_TYPE): CallApiReturnType; - setRemoteVideoSubscriptionOptions(uid: number, options: VideoSubscriptionOptions): CallApiReturnType; - setRemoteDefaultVideoStreamType(streamType: VIDEO_STREAM_TYPE): CallApiReturnType; - setSubscribeAudioBlocklist(uidList: number, uidNumber: number): CallApiReturnType; - setSubscribeAudioAllowlist(uidList: number, uidNumber: number): CallApiReturnType; - setSubscribeVideoBlocklist(uidList: number, uidNumber: number): CallApiReturnType; - setSubscribeVideoAllowlist(uidList: number, uidNumber: number): CallApiReturnType; - enableAudioVolumeIndication(interval: number, smooth: number, reportVad: boolean): CallApiReturnType; - startAudioRecording(filePath: string, quality: AUDIO_RECORDING_QUALITY_TYPE): CallApiReturnType; - startAudioRecording2(filePath: string, sampleRate: number, quality: AUDIO_RECORDING_QUALITY_TYPE): CallApiReturnType; - startAudioRecording3(config: AudioRecordingConfiguration): CallApiReturnType; - registerAudioEncodedFrameObserver(config: AudioEncodedFrameObserverConfig, observer: IAudioEncodedFrameObserver): CallApiReturnType; - stopAudioRecording(): CallApiReturnType; - createMediaPlayer(): CallApiReturnType; - destroyMediaPlayer(media_player: IMediaPlayer): CallApiReturnType; - createMediaRecorder(info: RecorderStreamInfo): CallApiReturnType; - destroyMediaRecorder(mediaRecorder: IMediaRecorder): CallApiReturnType; - startAudioMixing(filePath: string, loopback: boolean, cycle: number): CallApiReturnType; - startAudioMixing2(filePath: string, loopback: boolean, cycle: number, startPos: number): CallApiReturnType; - stopAudioMixing(): CallApiReturnType; - pauseAudioMixing(): CallApiReturnType; - resumeAudioMixing(): CallApiReturnType; - selectAudioTrack(index: number): CallApiReturnType; - getAudioTrackCount(): CallApiReturnType; - adjustAudioMixingVolume(volume: number): CallApiReturnType; - adjustAudioMixingPublishVolume(volume: number): CallApiReturnType; - getAudioMixingPublishVolume(): CallApiReturnType; - adjustAudioMixingPlayoutVolume(volume: number): CallApiReturnType; - getAudioMixingPlayoutVolume(): CallApiReturnType; - getAudioMixingDuration(): CallApiReturnType; - getAudioMixingCurrentPosition(): CallApiReturnType; - setAudioMixingPosition(pos: number): CallApiReturnType; - setAudioMixingDualMonoMode(mode: AUDIO_MIXING_DUAL_MONO_MODE): CallApiReturnType; - setAudioMixingPitch(pitch: number): CallApiReturnType; - getEffectsVolume(): CallApiReturnType; - setEffectsVolume(volume: number): CallApiReturnType; - preloadEffect(soundId: number, filePath: string, startPos: number): CallApiReturnType; - playEffect(soundId: number, filePath: string, loopCount: number, pitch: number, pan: number, gain: number, publish: boolean, startPos: number): CallApiReturnType; - playAllEffects(loopCount: number, pitch: number, pan: number, gain: number, publish: boolean): CallApiReturnType; - getVolumeOfEffect(soundId: number): CallApiReturnType; - setVolumeOfEffect(soundId: number, volume: number): CallApiReturnType; - pauseEffect(soundId: number): CallApiReturnType; - pauseAllEffects(): CallApiReturnType; - resumeEffect(soundId: number): CallApiReturnType; - resumeAllEffects(): CallApiReturnType; - stopEffect(soundId: number): CallApiReturnType; - stopAllEffects(): CallApiReturnType; - unloadEffect(soundId: number): CallApiReturnType; - unloadAllEffects(): CallApiReturnType; - getEffectDuration(filePath: string): CallApiReturnType; - setEffectPosition(soundId: number, pos: number): CallApiReturnType; - getEffectCurrentPosition(soundId: number): CallApiReturnType; - enableSoundPositionIndication(enabled: boolean): CallApiReturnType; - setRemoteVoicePosition(uid: number, pan: number, gain: number): CallApiReturnType; - enableSpatialAudio(enabled: boolean): CallApiReturnType; - setRemoteUserSpatialAudioParams(uid: number, params: SpatialAudioParams): CallApiReturnType; - setVoiceBeautifierPreset(preset: VOICE_BEAUTIFIER_PRESET): CallApiReturnType; - setAudioEffectPreset(preset: AUDIO_EFFECT_PRESET): CallApiReturnType; - setVoiceConversionPreset(preset: VOICE_CONVERSION_PRESET): CallApiReturnType; - setAudioEffectParameters(preset: AUDIO_EFFECT_PRESET, param1: number, param2: number): CallApiReturnType; - setVoiceBeautifierParameters(preset: VOICE_BEAUTIFIER_PRESET, param1: number, param2: number): CallApiReturnType; - setVoiceConversionParameters(preset: VOICE_CONVERSION_PRESET, param1: number, param2: number): CallApiReturnType; - setLocalVoicePitch(pitch: number): CallApiReturnType; - setLocalVoiceFormant(formantRatio: number): CallApiReturnType; - setLocalVoiceEqualization(bandFrequency: AUDIO_EQUALIZATION_BAND_FREQUENCY, bandGain: number): CallApiReturnType; - setLocalVoiceReverb(reverbKey: AUDIO_REVERB_TYPE, value: number): CallApiReturnType; - setHeadphoneEQPreset(preset: HEADPHONE_EQUALIZER_PRESET): CallApiReturnType; - setHeadphoneEQParameters(lowGain: number, highGain: number): CallApiReturnType; - setLogFile(filePath: string): CallApiReturnType; - setLogFilter(filter: number): CallApiReturnType; - setLogLevel(level: LOG_LEVEL): CallApiReturnType; - setLogFileSize(fileSizeInKBytes: number): CallApiReturnType; - uploadLogFile(requestId: string): CallApiReturnType; - setLocalRenderMode(renderMode: RENDER_MODE_TYPE, mirrorMode: VIDEO_MIRROR_MODE_TYPE): CallApiReturnType; - setRemoteRenderMode(uid: number, renderMode: RENDER_MODE_TYPE, mirrorMode: VIDEO_MIRROR_MODE_TYPE): CallApiReturnType; - setLocalRenderMode2(renderMode: RENDER_MODE_TYPE): CallApiReturnType; - setLocalVideoMirrorMode(mirrorMode: VIDEO_MIRROR_MODE_TYPE): CallApiReturnType; - enableDualStreamMode(enabled: boolean): CallApiReturnType; - enableDualStreamMode2(enabled: boolean, streamConfig: SimulcastStreamConfig): CallApiReturnType; - setDualStreamMode(mode: SIMULCAST_STREAM_MODE): CallApiReturnType; - setDualStreamMode2(mode: SIMULCAST_STREAM_MODE, streamConfig: SimulcastStreamConfig): CallApiReturnType; - enableCustomAudioLocalPlayback(trackId: number, enabled: boolean): CallApiReturnType; - setRecordingAudioFrameParameters(sampleRate: number, channel: number, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE, samplesPerCall: number): CallApiReturnType; - setPlaybackAudioFrameParameters(sampleRate: number, channel: number, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE, samplesPerCall: number): CallApiReturnType; - setMixedAudioFrameParameters(sampleRate: number, channel: number, samplesPerCall: number): CallApiReturnType; - setEarMonitoringAudioFrameParameters(sampleRate: number, channel: number, mode: RAW_AUDIO_FRAME_OP_MODE_TYPE, samplesPerCall: number): CallApiReturnType; - setPlaybackAudioFrameBeforeMixingParameters(sampleRate: number, channel: number): CallApiReturnType; - enableAudioSpectrumMonitor(intervalInMS: number): CallApiReturnType; - disableAudioSpectrumMonitor(): CallApiReturnType; - registerAudioSpectrumObserver(observer: IAudioSpectrumObserver): CallApiReturnType; - unregisterAudioSpectrumObserver(observer: IAudioSpectrumObserver): CallApiReturnType; - adjustRecordingSignalVolume(volume: number): CallApiReturnType; - muteRecordingSignal(mute: boolean): CallApiReturnType; - adjustPlaybackSignalVolume(volume: number): CallApiReturnType; - adjustUserPlaybackSignalVolume(uid: number, volume: number): CallApiReturnType; - setLocalPublishFallbackOption(option: STREAM_FALLBACK_OPTIONS): CallApiReturnType; - setRemoteSubscribeFallbackOption(option: STREAM_FALLBACK_OPTIONS): CallApiReturnType; - setHighPriorityUserList(uidList: number, uidNum: number, option: STREAM_FALLBACK_OPTIONS): CallApiReturnType; - enableLoopbackRecording(enabled: boolean, deviceName: string): CallApiReturnType; - adjustLoopbackSignalVolume(volume: number): CallApiReturnType; - getLoopbackRecordingVolume(): CallApiReturnType; - enableInEarMonitoring(enabled: boolean, includeAudioFilters: number): CallApiReturnType; - setInEarMonitoringVolume(volume: number): CallApiReturnType; - loadExtensionProvider(path: string, unload_after_use: boolean): CallApiReturnType; - setExtensionProviderProperty(provider: string, key: string, value: string): CallApiReturnType; - registerExtension(provider: string, extension: string, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - enableExtension(provider: string, extension: string, enable: boolean, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - enableExtension2(provider: string, extension: string, extensionInfo: ExtensionInfo, enable: boolean): CallApiReturnType; - setExtensionProperty(provider: string, extension: string, key: string, value: string, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - getExtensionProperty(provider: string, extension: string, key: string, value: string, buf_len: number, type: MEDIA_SOURCE_TYPE): CallApiReturnType; - setExtensionProperty2(provider: string, extension: string, extensionInfo: ExtensionInfo, key: string, value: string): CallApiReturnType; - getExtensionProperty2(provider: string, extension: string, extensionInfo: ExtensionInfo, key: string, value: string, buf_len: number): CallApiReturnType; - setCameraCapturerConfiguration(config: CameraCapturerConfiguration): CallApiReturnType; - createCustomVideoTrack(): CallApiReturnType; - createCustomEncodedVideoTrack(sender_option: SenderOptions): CallApiReturnType; - destroyCustomVideoTrack(video_track_id: number): CallApiReturnType; - destroyCustomEncodedVideoTrack(video_track_id: number): CallApiReturnType; - switchCamera(): CallApiReturnType; - isCameraZoomSupported(): CallApiReturnType; - isCameraFaceDetectSupported(): CallApiReturnType; - isCameraTorchSupported(): CallApiReturnType; - isCameraFocusSupported(): CallApiReturnType; - isCameraAutoFocusFaceModeSupported(): CallApiReturnType; - setCameraZoomFactor(factor: number): CallApiReturnType; - enableFaceDetection(enabled: boolean): CallApiReturnType; - getCameraMaxZoomFactor(): CallApiReturnType; - setCameraFocusPositionInPreview(positionX: number, positionY: number): CallApiReturnType; - setCameraTorchOn(isOn: boolean): CallApiReturnType; - setCameraAutoFocusFaceModeEnabled(enabled: boolean): CallApiReturnType; - isCameraExposurePositionSupported(): CallApiReturnType; - setCameraExposurePosition(positionXinView: number, positionYinView: number): CallApiReturnType; - isCameraExposureSupported(): CallApiReturnType; - setCameraExposureFactor(factor: number): CallApiReturnType; - isCameraAutoExposureFaceModeSupported(): CallApiReturnType; - setCameraAutoExposureFaceModeEnabled(enabled: boolean): CallApiReturnType; - setDefaultAudioRouteToSpeakerphone(defaultToSpeaker: boolean): CallApiReturnType; - setEnableSpeakerphone(speakerOn: boolean): CallApiReturnType; - isSpeakerphoneEnabled(): CallApiReturnType; - setRouteInCommunicationMode(route: number): CallApiReturnType; - getScreenCaptureSources(thumbSize: SIZE, iconSize: SIZE, includeScreen: boolean): CallApiReturnType; - setAudioSessionOperationRestriction(restriction: AUDIO_SESSION_OPERATION_RESTRICTION): CallApiReturnType; - startScreenCaptureByDisplayId(displayId: number, regionRect: Rectangle, captureParams: ScreenCaptureParameters): CallApiReturnType; - startScreenCaptureByScreenRect(screenRect: Rectangle, regionRect: Rectangle, captureParams: ScreenCaptureParameters): CallApiReturnType; - getAudioDeviceInfo(deviceInfo: DeviceInfo): CallApiReturnType; - startScreenCaptureByWindowId(windowId: any, regionRect: Rectangle, captureParams: ScreenCaptureParameters): CallApiReturnType; - setScreenCaptureContentHint(contentHint: VIDEO_CONTENT_HINT): CallApiReturnType; - updateScreenCaptureRegion(regionRect: Rectangle): CallApiReturnType; - updateScreenCaptureParameters(captureParams: ScreenCaptureParameters): CallApiReturnType; - startScreenCapture(captureParams: ScreenCaptureParameters2): CallApiReturnType; - updateScreenCapture(captureParams: ScreenCaptureParameters2): CallApiReturnType; - queryScreenCaptureCapability(): CallApiReturnType; - setScreenCaptureScenario(screenScenario: SCREEN_SCENARIO_TYPE): CallApiReturnType; - stopScreenCapture(): CallApiReturnType; - getCallId(callId: string): CallApiReturnType; - rate(callId: string, rating: number, description: string): CallApiReturnType; - complain(callId: string, description: string): CallApiReturnType; - startRtmpStreamWithoutTranscoding(url: string): CallApiReturnType; - startRtmpStreamWithTranscoding(url: string, transcoding: LiveTranscoding): CallApiReturnType; - updateRtmpTranscoding(transcoding: LiveTranscoding): CallApiReturnType; - stopRtmpStream(url: string): CallApiReturnType; - startLocalVideoTranscoder(config: LocalTranscoderConfiguration): CallApiReturnType; - updateLocalTranscoderConfiguration(config: LocalTranscoderConfiguration): CallApiReturnType; - stopLocalVideoTranscoder(): CallApiReturnType; - startCameraCapture(sourceType: VIDEO_SOURCE_TYPE, config: CameraCapturerConfiguration): CallApiReturnType; - stopCameraCapture(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - setCameraDeviceOrientation(type: VIDEO_SOURCE_TYPE, orientation: VIDEO_ORIENTATION): CallApiReturnType; - setScreenCaptureOrientation(type: VIDEO_SOURCE_TYPE, orientation: VIDEO_ORIENTATION): CallApiReturnType; - startScreenCapture2(sourceType: VIDEO_SOURCE_TYPE, config: ScreenCaptureConfiguration): CallApiReturnType; - stopScreenCapture2(sourceType: VIDEO_SOURCE_TYPE): CallApiReturnType; - getConnectionState(): CallApiReturnType; - registerEventHandler(eventHandler: IRtcEngineEventHandler): CallApiReturnType; - unregisterEventHandler(eventHandler: IRtcEngineEventHandler): CallApiReturnType; - setRemoteUserPriority(uid: number, userPriority: PRIORITY_TYPE): CallApiReturnType; - setEncryptionMode(encryptionMode: string): CallApiReturnType; - setEncryptionSecret(secret: string): CallApiReturnType; - enableEncryption(enabled: boolean, config: EncryptionConfig): CallApiReturnType; - createDataStream(streamId: number[], reliable: boolean, ordered: boolean): CallApiReturnType; - createDataStream2(streamId: number[], config: DataStreamConfig): CallApiReturnType; - sendStreamMessage(streamId: number, data: string, length: number): CallApiReturnType; - addVideoWatermark(watermark: RtcImage): CallApiReturnType; - addVideoWatermark2(watermarkUrl: string, options: WatermarkOptions): CallApiReturnType; - clearVideoWatermarks(): CallApiReturnType; - pauseAudio(): CallApiReturnType; - resumeAudio(): CallApiReturnType; - enableWebSdkInteroperability(enabled: boolean): CallApiReturnType; - sendCustomReportMessage(id: string, category: string, event: string, label: string, value: number): CallApiReturnType; - registerMediaMetadataObserver(observer: IMetadataObserver, type: METADATA_TYPE): CallApiReturnType; - unregisterMediaMetadataObserver(observer: IMetadataObserver, type: METADATA_TYPE): CallApiReturnType; - startAudioFrameDump(channel_id: string, user_id: number, location: string, uuid: string, passwd: string, duration_ms: number, auto_upload: boolean): CallApiReturnType; - stopAudioFrameDump(channel_id: string, user_id: number, location: string): CallApiReturnType; - setAINSMode(enabled: boolean, mode: AUDIO_AINS_MODE): CallApiReturnType; - registerLocalUserAccount(appId: string, userAccount: string): CallApiReturnType; - joinChannelWithUserAccount(token: string, channelId: string, userAccount: string): CallApiReturnType; - joinChannelWithUserAccount2(token: string, channelId: string, userAccount: string, options: ChannelMediaOptions): CallApiReturnType; - joinChannelWithUserAccountEx(token: string, channelId: string, userAccount: string, options: ChannelMediaOptions): CallApiReturnType; - getUserInfoByUserAccount(userAccount: string, userInfo: UserInfo[]): CallApiReturnType; - getUserInfoByUid(uid: number, userInfo: UserInfo[]): CallApiReturnType; - startOrUpdateChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): CallApiReturnType; - startChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): CallApiReturnType; - updateChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): CallApiReturnType; - stopChannelMediaRelay(): CallApiReturnType; - pauseAllChannelMediaRelay(): CallApiReturnType; - resumeAllChannelMediaRelay(): CallApiReturnType; - setDirectCdnStreamingAudioConfiguration(profile: AUDIO_PROFILE_TYPE): CallApiReturnType; - setDirectCdnStreamingVideoConfiguration(config: VideoEncoderConfiguration): CallApiReturnType; - startDirectCdnStreaming(eventHandler: IDirectCdnStreamingEventHandler, publishUrl: string, options: DirectCdnStreamingMediaOptions): CallApiReturnType; - stopDirectCdnStreaming(): CallApiReturnType; - updateDirectCdnStreamingMediaOptions(options: DirectCdnStreamingMediaOptions): CallApiReturnType; - startRhythmPlayer(sound1: string, sound2: string, config: AgoraRhythmPlayerConfig): CallApiReturnType; - stopRhythmPlayer(): CallApiReturnType; - configRhythmPlayer(config: AgoraRhythmPlayerConfig): CallApiReturnType; - takeSnapshot(uid: number, filePath: string): CallApiReturnType; - enableContentInspect(enabled: boolean, config: ContentInspectConfig): CallApiReturnType; - adjustCustomAudioPublishVolume(trackId: number, volume: number): CallApiReturnType; - adjustCustomAudioPlayoutVolume(trackId: number, volume: number): CallApiReturnType; - setCloudProxy(proxyType: CLOUD_PROXY_TYPE): CallApiReturnType; - setLocalAccessPoint(config: LocalAccessPointConfiguration): CallApiReturnType; - setAdvancedAudioOptions(options: AdvancedAudioOptions, sourceType: number): CallApiReturnType; - setAVSyncSource(channelId: string, uid: number): CallApiReturnType; - enableVideoImageSource(enable: boolean, options: ImageTrackOptions): CallApiReturnType; - getCurrentMonotonicTimeInMs(): CallApiReturnType; - enableWirelessAccelerate(enabled: boolean): CallApiReturnType; - getNetworkType(): CallApiReturnType; - setParameters(parameters: string): CallApiReturnType; - startMediaRenderingTracing(): CallApiReturnType; - enableInstantMediaRendering(): CallApiReturnType; - getNtpWallTimeInMs(): CallApiReturnType; - isFeatureAvailableOnDevice(type: FeatureType): CallApiReturnType; -} -declare enum QUALITY_REPORT_FORMAT_TYPE { - QUALITY_REPORT_JSON = 0, - QUALITY_REPORT_HTML = 1 -} -declare enum MEDIA_DEVICE_STATE_TYPE { - MEDIA_DEVICE_STATE_IDLE = 0, - MEDIA_DEVICE_STATE_ACTIVE = 1, - MEDIA_DEVICE_STATE_DISABLED = 2, - MEDIA_DEVICE_STATE_NOT_PRESENT = 4, - MEDIA_DEVICE_STATE_UNPLUGGED = 8 -} -declare enum VIDEO_PROFILE_TYPE { - VIDEO_PROFILE_LANDSCAPE_120P = 0, - VIDEO_PROFILE_LANDSCAPE_120P_3 = 2, - VIDEO_PROFILE_LANDSCAPE_180P = 10, - VIDEO_PROFILE_LANDSCAPE_180P_3 = 12, - VIDEO_PROFILE_LANDSCAPE_180P_4 = 13, - VIDEO_PROFILE_LANDSCAPE_240P = 20, - VIDEO_PROFILE_LANDSCAPE_240P_3 = 22, - VIDEO_PROFILE_LANDSCAPE_240P_4 = 23, - VIDEO_PROFILE_LANDSCAPE_360P = 30, - VIDEO_PROFILE_LANDSCAPE_360P_3 = 32, - VIDEO_PROFILE_LANDSCAPE_360P_4 = 33, - VIDEO_PROFILE_LANDSCAPE_360P_6 = 35, - VIDEO_PROFILE_LANDSCAPE_360P_7 = 36, - VIDEO_PROFILE_LANDSCAPE_360P_8 = 37, - VIDEO_PROFILE_LANDSCAPE_360P_9 = 38, - VIDEO_PROFILE_LANDSCAPE_360P_10 = 39, - VIDEO_PROFILE_LANDSCAPE_360P_11 = 100, - VIDEO_PROFILE_LANDSCAPE_480P = 40, - VIDEO_PROFILE_LANDSCAPE_480P_3 = 42, - VIDEO_PROFILE_LANDSCAPE_480P_4 = 43, - VIDEO_PROFILE_LANDSCAPE_480P_6 = 45, - VIDEO_PROFILE_LANDSCAPE_480P_8 = 47, - VIDEO_PROFILE_LANDSCAPE_480P_9 = 48, - VIDEO_PROFILE_LANDSCAPE_480P_10 = 49, - VIDEO_PROFILE_LANDSCAPE_720P = 50, - VIDEO_PROFILE_LANDSCAPE_720P_3 = 52, - VIDEO_PROFILE_LANDSCAPE_720P_5 = 54, - VIDEO_PROFILE_LANDSCAPE_720P_6 = 55, - VIDEO_PROFILE_LANDSCAPE_1080P = 60, - VIDEO_PROFILE_LANDSCAPE_1080P_3 = 62, - VIDEO_PROFILE_LANDSCAPE_1080P_5 = 64, - VIDEO_PROFILE_LANDSCAPE_1440P = 66, - VIDEO_PROFILE_LANDSCAPE_1440P_2 = 67, - VIDEO_PROFILE_LANDSCAPE_4K = 70, - VIDEO_PROFILE_LANDSCAPE_4K_3 = 72, - VIDEO_PROFILE_PORTRAIT_120P = 1000, - VIDEO_PROFILE_PORTRAIT_120P_3 = 1002, - VIDEO_PROFILE_PORTRAIT_180P = 1010, - VIDEO_PROFILE_PORTRAIT_180P_3 = 1012, - VIDEO_PROFILE_PORTRAIT_180P_4 = 1013, - VIDEO_PROFILE_PORTRAIT_240P = 1020, - VIDEO_PROFILE_PORTRAIT_240P_3 = 1022, - VIDEO_PROFILE_PORTRAIT_240P_4 = 1023, - VIDEO_PROFILE_PORTRAIT_360P = 1030, - VIDEO_PROFILE_PORTRAIT_360P_3 = 1032, - VIDEO_PROFILE_PORTRAIT_360P_4 = 1033, - VIDEO_PROFILE_PORTRAIT_360P_6 = 1035, - VIDEO_PROFILE_PORTRAIT_360P_7 = 1036, - VIDEO_PROFILE_PORTRAIT_360P_8 = 1037, - VIDEO_PROFILE_PORTRAIT_360P_9 = 1038, - VIDEO_PROFILE_PORTRAIT_360P_10 = 1039, - VIDEO_PROFILE_PORTRAIT_360P_11 = 1100, - VIDEO_PROFILE_PORTRAIT_480P = 1040, - VIDEO_PROFILE_PORTRAIT_480P_3 = 1042, - VIDEO_PROFILE_PORTRAIT_480P_4 = 1043, - VIDEO_PROFILE_PORTRAIT_480P_6 = 1045, - VIDEO_PROFILE_PORTRAIT_480P_8 = 1047, - VIDEO_PROFILE_PORTRAIT_480P_9 = 1048, - VIDEO_PROFILE_PORTRAIT_480P_10 = 1049, - VIDEO_PROFILE_PORTRAIT_720P = 1050, - VIDEO_PROFILE_PORTRAIT_720P_3 = 1052, - VIDEO_PROFILE_PORTRAIT_720P_5 = 1054, - VIDEO_PROFILE_PORTRAIT_720P_6 = 1055, - VIDEO_PROFILE_PORTRAIT_1080P = 1060, - VIDEO_PROFILE_PORTRAIT_1080P_3 = 1062, - VIDEO_PROFILE_PORTRAIT_1080P_5 = 1064, - VIDEO_PROFILE_PORTRAIT_1440P = 1066, - VIDEO_PROFILE_PORTRAIT_1440P_2 = 1067, - VIDEO_PROFILE_PORTRAIT_4K = 1070, - VIDEO_PROFILE_PORTRAIT_4K_3 = 1072, - VIDEO_PROFILE_DEFAULT = 30 -} - -declare class RtcConnection { - channelId?: string; - localUid?: number; -} -interface IRtcEngineEventHandlerEx extends IRtcEngineEventHandler { - onJoinChannelSuccessEx(connection: RtcConnection, elapsed: number): void; - onRejoinChannelSuccessEx(connection: RtcConnection, elapsed: number): void; - onAudioQualityEx(connection: RtcConnection, remoteUid: number, quality: number, delay: number, lost: number): void; - onAudioVolumeIndicationEx(connection: RtcConnection, speakers: AudioVolumeInfo[], speakerNumber: number, totalVolume: number): void; - onLeaveChannelEx(connection: RtcConnection, stats: RtcStats): void; - onRtcStatsEx(connection: RtcConnection, stats: RtcStats): void; - onNetworkQualityEx(connection: RtcConnection, remoteUid: number, txQuality: number, rxQuality: number): void; - onIntraRequestReceivedEx(connection: RtcConnection): void; - onFirstRemoteVideoDecodedEx(connection: RtcConnection, remoteUid: number, width: number, height: number, elapsed: number): void; - onVideoSizeChangedEx(connection: RtcConnection, sourceType: VIDEO_SOURCE_TYPE, uid: number, width: number, height: number, rotation: number): void; - onRemoteVideoStateChangedEx(connection: RtcConnection, remoteUid: number, state: REMOTE_VIDEO_STATE, reason: REMOTE_VIDEO_STATE_REASON, elapsed: number): void; - onFirstRemoteVideoFrameEx(connection: RtcConnection, remoteUid: number, width: number, height: number, elapsed: number): void; - onUserJoinedEx(connection: RtcConnection, remoteUid: number, elapsed: number): void; - onUserOfflineEx(connection: RtcConnection, remoteUid: number, reason: USER_OFFLINE_REASON_TYPE): void; - onUserMuteAudioEx(connection: RtcConnection, remoteUid: number, muted: boolean): void; - onUserMuteVideoEx(connection: RtcConnection, remoteUid: number, muted: boolean): void; - onUserEnableVideoEx(connection: RtcConnection, remoteUid: number, enabled: boolean): void; - onUserEnableLocalVideoEx(connection: RtcConnection, remoteUid: number, enabled: boolean): void; - onUserStateChangedEx(connection: RtcConnection, remoteUid: number, state: number): void; - onLocalAudioStatsEx(connection: RtcConnection, stats: LocalAudioStats): void; - onRemoteAudioStatsEx(connection: RtcConnection, stats: RemoteAudioStats): void; - onRemoteVideoStatsEx(connection: RtcConnection, stats: RemoteVideoStats): void; - onConnectionLostEx(connection: RtcConnection): void; - onConnectionInterruptedEx(connection: RtcConnection): void; - onConnectionBannedEx(connection: RtcConnection): void; - onStreamMessageEx(connection: RtcConnection, remoteUid: number, streamId: number, data: string, length: number, sentTs: number): void; - onStreamMessageErrorEx(connection: RtcConnection, remoteUid: number, streamId: number, code: number, missed: number, cached: number): void; - onRequestTokenEx(connection: RtcConnection): void; - onLicenseValidationFailureEx(connection: RtcConnection, reason: LICENSE_ERROR_TYPE): void; - onTokenPrivilegeWillExpireEx(connection: RtcConnection, token: string): void; - onFirstLocalAudioFramePublishedEx(connection: RtcConnection, elapsed: number): void; - onFirstRemoteAudioFrameEx(connection: RtcConnection, userId: number, elapsed: number): void; - onFirstRemoteAudioDecodedEx(connection: RtcConnection, uid: number, elapsed: number): void; - onLocalAudioStateChangedEx(connection: RtcConnection, state: LOCAL_AUDIO_STREAM_STATE, error: LOCAL_AUDIO_STREAM_ERROR): void; - onRemoteAudioStateChangedEx(connection: RtcConnection, remoteUid: number, state: REMOTE_AUDIO_STATE, reason: REMOTE_AUDIO_STATE_REASON, elapsed: number): void; - onActiveSpeakerEx(connection: RtcConnection, uid: number): void; - onClientRoleChangedEx(connection: RtcConnection, oldRole: CLIENT_ROLE_TYPE, newRole: CLIENT_ROLE_TYPE, newRoleOptions: ClientRoleOptions): void; - onClientRoleChangeFailedEx(connection: RtcConnection, reason: CLIENT_ROLE_CHANGE_FAILED_REASON, currentRole: CLIENT_ROLE_TYPE): void; - onRemoteAudioTransportStatsEx(connection: RtcConnection, remoteUid: number, delay: number, lost: number, rxKBitRate: number): void; - onRemoteVideoTransportStatsEx(connection: RtcConnection, remoteUid: number, delay: number, lost: number, rxKBitRate: number): void; - onConnectionStateChangedEx(connection: RtcConnection, state: CONNECTION_STATE_TYPE, reason: CONNECTION_CHANGED_REASON_TYPE): void; - onWlAccMessageEx(connection: RtcConnection, reason: WLACC_MESSAGE_REASON, action: WLACC_SUGGEST_ACTION, wlAccMsg: string): void; - onWlAccStatsEx(connection: RtcConnection, currentStats: WlAccStats, averageStats: WlAccStats): void; - onNetworkTypeChangedEx(connection: RtcConnection, type: NETWORK_TYPE): void; - onEncryptionErrorEx(connection: RtcConnection, errorType: ENCRYPTION_ERROR_TYPE): void; - onUploadLogResultEx(connection: RtcConnection, requestId: string, success: boolean, reason: UPLOAD_ERROR_REASON): void; - onUserAccountUpdatedEx(connection: RtcConnection, remoteUid: number, userAccount: string): void; - onSnapshotTakenEx(connection: RtcConnection, uid: number, filePath: string, width: number, height: number, errCode: number): void; - onVideoRenderingTracingResultEx(connection: RtcConnection, uid: number, currentEvent: MEDIA_TRACE_EVENT, tracingInfo: VideoRenderingTracingInfo): void; -} -interface IRtcEngineEx { - joinChannelEx(token: string, connection: RtcConnection, options: ChannelMediaOptions): CallApiReturnType; - leaveChannelEx(connection: RtcConnection): CallApiReturnType; - leaveChannelEx2(connection: RtcConnection, options: LeaveChannelOptions): CallApiReturnType; - updateChannelMediaOptionsEx(options: ChannelMediaOptions, connection: RtcConnection): CallApiReturnType; - setVideoEncoderConfigurationEx(config: VideoEncoderConfiguration, connection: RtcConnection): CallApiReturnType; - setupRemoteVideoEx(canvas: VideoCanvas, connection: RtcConnection): CallApiReturnType; - muteRemoteAudioStreamEx(uid: number, mute: boolean, connection: RtcConnection): CallApiReturnType; - muteRemoteVideoStreamEx(uid: number, mute: boolean, connection: RtcConnection): CallApiReturnType; - setRemoteVideoStreamTypeEx(uid: number, streamType: VIDEO_STREAM_TYPE, connection: RtcConnection): CallApiReturnType; - muteLocalAudioStreamEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - muteLocalVideoStreamEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - muteAllRemoteAudioStreamsEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - muteAllRemoteVideoStreamsEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - setSubscribeAudioBlocklistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setSubscribeAudioAllowlistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setSubscribeVideoBlocklistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setSubscribeVideoAllowlistEx(uidList: number, uidNumber: number, connection: RtcConnection): CallApiReturnType; - setRemoteVideoSubscriptionOptionsEx(uid: number, options: VideoSubscriptionOptions, connection: RtcConnection): CallApiReturnType; - setRemoteVoicePositionEx(uid: number, pan: number, gain: number, connection: RtcConnection): CallApiReturnType; - setRemoteUserSpatialAudioParamsEx(uid: number, params: SpatialAudioParams, connection: RtcConnection): CallApiReturnType; - setRemoteRenderModeEx(uid: number, renderMode: RENDER_MODE_TYPE, mirrorMode: VIDEO_MIRROR_MODE_TYPE, connection: RtcConnection): CallApiReturnType; - enableLoopbackRecordingEx(connection: RtcConnection, enabled: boolean, deviceName: string): CallApiReturnType; - adjustRecordingSignalVolumeEx(volume: number, connection: RtcConnection): CallApiReturnType; - muteRecordingSignalEx(mute: boolean, connection: RtcConnection): CallApiReturnType; - adjustUserPlaybackSignalVolumeEx(uid: number, volume: number, connection: RtcConnection): CallApiReturnType; - getConnectionStateEx(connection: RtcConnection): CallApiReturnType; - enableEncryptionEx(connection: RtcConnection, enabled: boolean, config: EncryptionConfig): CallApiReturnType; - createDataStreamEx(streamId: number[], reliable: boolean, ordered: boolean, connection: RtcConnection): CallApiReturnType; - createDataStreamEx2(streamId: number[], config: DataStreamConfig, connection: RtcConnection): CallApiReturnType; - sendStreamMessageEx(streamId: number, data: string, length: number, connection: RtcConnection): CallApiReturnType; - addVideoWatermarkEx(watermarkUrl: string, options: WatermarkOptions, connection: RtcConnection): CallApiReturnType; - clearVideoWatermarkEx(connection: RtcConnection): CallApiReturnType; - sendCustomReportMessageEx(id: string, category: string, event: string, label: string, value: number, connection: RtcConnection): CallApiReturnType; - enableAudioVolumeIndicationEx(interval: number, smooth: number, reportVad: boolean, connection: RtcConnection): CallApiReturnType; - startRtmpStreamWithoutTranscodingEx(url: string, connection: RtcConnection): CallApiReturnType; - startRtmpStreamWithTranscodingEx(url: string, transcoding: LiveTranscoding, connection: RtcConnection): CallApiReturnType; - updateRtmpTranscodingEx(transcoding: LiveTranscoding, connection: RtcConnection): CallApiReturnType; - stopRtmpStreamEx(url: string, connection: RtcConnection): CallApiReturnType; - startOrUpdateChannelMediaRelayEx(configuration: ChannelMediaRelayConfiguration, connection: RtcConnection): CallApiReturnType; - startChannelMediaRelayEx(configuration: ChannelMediaRelayConfiguration, connection: RtcConnection): CallApiReturnType; - updateChannelMediaRelayEx(configuration: ChannelMediaRelayConfiguration, connection: RtcConnection): CallApiReturnType; - stopChannelMediaRelayEx(connection: RtcConnection): CallApiReturnType; - pauseAllChannelMediaRelayEx(connection: RtcConnection): CallApiReturnType; - resumeAllChannelMediaRelayEx(connection: RtcConnection): CallApiReturnType; - getUserInfoByUserAccountEx(userAccount: string, userInfo: UserInfo[], connection: RtcConnection): CallApiReturnType; - getUserInfoByUidEx(uid: number, userInfo: UserInfo[], connection: RtcConnection): CallApiReturnType; - enableDualStreamModeEx(enabled: boolean, streamConfig: SimulcastStreamConfig, connection: RtcConnection): CallApiReturnType; - setDualStreamModeEx(mode: SIMULCAST_STREAM_MODE, streamConfig: SimulcastStreamConfig, connection: RtcConnection): CallApiReturnType; - setHighPriorityUserListEx(uidList: number, uidNum: number, option: STREAM_FALLBACK_OPTIONS, connection: RtcConnection): CallApiReturnType; - takeSnapshotEx(connection: RtcConnection, uid: number, filePath: string): CallApiReturnType; - enableContentInspectEx(enabled: boolean, config: ContentInspectConfig, connection: RtcConnection): CallApiReturnType; - startMediaRenderingTracingEx(connection: RtcConnection): CallApiReturnType; -} - -declare class RemoteVoicePositionInfo { - position?: number; - forward?: number; -} -declare class SpatialAudioZone { - zoneSetId?: number; - position?: number; - forward?: number; - right?: number; - up?: number; - forwardLength?: number; - rightLength?: number; - upLength?: number; - audioAttenuation?: number; -} -interface IBaseSpatialAudioEngine { - release(): CallApiReturnType; - setMaxAudioRecvCount(maxCount: number): CallApiReturnType; - setAudioRecvRange(range: number): CallApiReturnType; - setDistanceUnit(unit: number): CallApiReturnType; - updateSelfPosition(position: number, axisForward: number, axisRight: number, axisUp: number): CallApiReturnType; - updateSelfPositionEx(position: number, axisForward: number, axisRight: number, axisUp: number, connection: RtcConnection): CallApiReturnType; - updatePlayerPositionInfo(playerId: number, positionInfo: RemoteVoicePositionInfo): CallApiReturnType; - setParameters(params: string): CallApiReturnType; - muteLocalAudioStream(mute: boolean): CallApiReturnType; - muteAllRemoteAudioStreams(mute: boolean): CallApiReturnType; - setZones(zones: SpatialAudioZone[], zoneCount: number): CallApiReturnType; - setPlayerAttenuation(playerId: number, attenuation: number, forceSet: boolean): CallApiReturnType; - muteRemoteAudioStream(uid: number, mute: boolean): CallApiReturnType; -} -interface ILocalSpatialAudioEngine { - initialize(): CallApiReturnType; - updateRemotePosition(uid: number, posInfo: RemoteVoicePositionInfo): CallApiReturnType; - updateRemotePositionEx(uid: number, posInfo: RemoteVoicePositionInfo, connection: RtcConnection): CallApiReturnType; - removeRemotePosition(uid: number): CallApiReturnType; - removeRemotePositionEx(uid: number, connection: RtcConnection): CallApiReturnType; - clearRemotePositions(): CallApiReturnType; - clearRemotePositionsEx(connection: RtcConnection): CallApiReturnType; - setRemoteAudioAttenuation(uid: number, attenuation: number, forceSet: boolean): CallApiReturnType; -} - -declare enum MAX_DEVICE_ID_LENGTH_TYPE { - MAX_DEVICE_ID_LENGTH = 512 -} -interface IAudioDeviceManager { - enumeratePlaybackDevices(): CallApiReturnType; - enumerateRecordingDevices(): CallApiReturnType; - setPlaybackDevice(deviceId: string[]): CallApiReturnType; - getPlaybackDevice(deviceId: string): CallApiReturnType; - getPlaybackDeviceInfo(): CallApiReturnType; - setPlaybackDeviceVolume(volume: number): CallApiReturnType; - getPlaybackDeviceVolume(volume: number[]): CallApiReturnType; - setRecordingDevice(deviceId: string[]): CallApiReturnType; - getRecordingDevice(deviceId: string): CallApiReturnType; - getRecordingDeviceInfo(): CallApiReturnType; - setRecordingDeviceVolume(volume: number): CallApiReturnType; - getRecordingDeviceVolume(volume: number[]): CallApiReturnType; - setLoopbackDevice(deviceId: string[]): CallApiReturnType; - getLoopbackDevice(deviceId: string): CallApiReturnType; - setPlaybackDeviceMute(mute: boolean): CallApiReturnType; - getPlaybackDeviceMute(mute: boolean): CallApiReturnType; - setRecordingDeviceMute(mute: boolean): CallApiReturnType; - getRecordingDeviceMute(mute: boolean): CallApiReturnType; - startPlaybackDeviceTest(testAudioFilePath: string): CallApiReturnType; - stopPlaybackDeviceTest(): CallApiReturnType; - startRecordingDeviceTest(indicationInterval: number): CallApiReturnType; - stopRecordingDeviceTest(): CallApiReturnType; - startAudioDeviceLoopbackTest(indicationInterval: number): CallApiReturnType; - stopAudioDeviceLoopbackTest(): CallApiReturnType; - followSystemPlaybackDevice(enable: boolean): CallApiReturnType; - followSystemRecordingDevice(enable: boolean): CallApiReturnType; - followSystemLoopbackDevice(enable: boolean): CallApiReturnType; - release(): CallApiReturnType; -} - -export { AREA_CODE, AREA_CODE_EX, AUDIENCE_LATENCY_LEVEL_TYPE, AUDIO_AINS_MODE, AUDIO_CODEC_PROFILE_TYPE, AUDIO_CODEC_TYPE, AUDIO_DUAL_MONO_MODE, AUDIO_EFFECT_PRESET, AUDIO_ENCODED_FRAME_OBSERVER_POSITION, AUDIO_ENCODING_TYPE, AUDIO_EQUALIZATION_BAND_FREQUENCY, AUDIO_FILE_RECORDING_TYPE, AUDIO_FRAME_POSITION, AUDIO_FRAME_TYPE, AUDIO_MIXING_DUAL_MONO_MODE, AUDIO_MIXING_REASON_TYPE, AUDIO_MIXING_STATE_TYPE, AUDIO_PROFILE_TYPE, AUDIO_RECORDING_QUALITY_TYPE, AUDIO_REVERB_TYPE, AUDIO_SAMPLE_RATE_TYPE, AUDIO_SCENARIO_TYPE, AUDIO_SESSION_OPERATION_RESTRICTION, AUDIO_TRACK_TYPE, AdvanceOptions, AdvancedAudioOptions, AdvancedConfigInfo, AgoraRhythmPlayerConfig, AudioEncodedFrameInfo, AudioEncodedFrameObserverConfig, AudioFrame, AudioParameters, AudioParams, AudioPcmDataInfo, AudioPcmFrame, AudioRecordingConfiguration, AudioRoute, AudioSpectrumData, AudioTrackConfig, AudioVolumeInfo, BACKGROUND_BLUR_DEGREE, BACKGROUND_SOURCE_TYPE, BYTES_PER_SAMPLE, BeautyOptions, CAMERA_DIRECTION, CAMERA_VIDEO_SOURCE_TYPE, CAPTURE_BRIGHTNESS_LEVEL_TYPE, CHANNEL_MEDIA_RELAY_ERROR, CHANNEL_MEDIA_RELAY_EVENT, CHANNEL_MEDIA_RELAY_STATE, CHANNEL_PROFILE_TYPE, CLIENT_ROLE_CHANGE_FAILED_REASON, CLIENT_ROLE_TYPE, CLOUD_PROXY_TYPE, CODEC_CAP_MASK, COMPRESSION_PREFERENCE, CONFIG_FETCH_TYPE, CONNECTION_CHANGED_REASON_TYPE, CONNECTION_STATE_TYPE, CONTENT_INSPECT_RESULT, CONTENT_INSPECT_TYPE, CacheStatistics, CameraCapturerConfiguration, ChannelMediaInfo, ChannelMediaOptions, ChannelMediaRelayConfiguration, ClientRoleOptions, ClimaxSegment, CodecCapInfo, CodecCapLevels, ColorEnhanceOptions, ContentInspectConfig, ContentInspectModule, DEGRADATION_PREFERENCE, DIRECT_CDN_STREAMING_ERROR, DIRECT_CDN_STREAMING_STATE, DataStreamConfig, DeviceInfo, DirectCdnStreamingMediaOptions, DirectCdnStreamingStats, DownlinkNetworkInfo, EAR_MONITORING_FILTER_TYPE, EGL_CONTEXT_TYPE, ENCODING_PREFERENCE, ENCRYPTION_ERROR_TYPE, ENCRYPTION_MODE, ERROR_CODE_TYPE, EXPERIENCE_POOR_REASON, EXPERIENCE_QUALITY_TYPE, EXTERNAL_VIDEO_SOURCE_TYPE, EchoTestConfiguration, EncodedAudioFrameAdvancedSettings, EncodedAudioFrameInfo, EncodedVideoFrameInfo, EncryptionConfig, ExtensionInfo, ExternalVideoFrame, FIT_MODE_TYPE, FRAME_HEIGHT, FRAME_RATE, FRAME_WIDTH, FeatureType, H264PacketizeMode, HEADPHONE_EQUALIZER_PRESET, IAudioDeviceManager, IAudioEncodedFrameObserver, IAudioFrameObserver, IAudioFrameObserverBase, IAudioPcmFrameSink, IAudioSpectrumObserver, IBaseSpatialAudioEngine, IDirectCdnStreamingEventHandler, ILocalSpatialAudioEngine, IMediaEngine, IMediaPlayer, IMediaPlayerCacheManager, IMediaPlayerSourceObserver, IMediaRecorder, IMediaRecorderObserver, IMetadataObserver, IMusicContentCenter, IMusicContentCenterEventHandler, IMusicPlayer, INJECT_STREAM_STATUS, INTERFACE_ID_TYPE, IRtcEngine, IRtcEngineEventHandler, IRtcEngineEventHandlerEx, IRtcEngineEx, IVideoDeviceManager, IVideoEncodedFrameObserver, IVideoFrameObserver, ImageTrackOptions, InjectStreamConfig, InputSeiData, LASTMILE_PROBE_RESULT_STATE, LICENSE_ERROR_TYPE, LIGHTENING_CONTRAST_LEVEL, LOCAL_AUDIO_STREAM_ERROR, LOCAL_AUDIO_STREAM_STATE, LOCAL_PROXY_MODE, LOCAL_VIDEO_STREAM_ERROR, LOCAL_VIDEO_STREAM_STATE, LOG_FILTER_TYPE, LOG_LEVEL, LOW_LIGHT_ENHANCE_LEVEL, LOW_LIGHT_ENHANCE_MODE, LastmileProbeConfig, LastmileProbeOneWayResult, LastmileProbeResult, LeaveChannelOptions, LiveStreamAdvancedFeature, LiveTranscoding, LocalAccessPointConfiguration, LocalAudioStats, LocalTranscoderConfiguration, LocalVideoStats, LogConfig, LogUploadServerInfo, LowlightEnhanceOptions, MAX_DEVICE_ID_LENGTH_TYPE, MAX_METADATA_SIZE_TYPE, MAX_USER_ACCOUNT_LENGTH_TYPE, MEDIA_DEVICE_STATE_TYPE, MEDIA_DEVICE_TYPE, MEDIA_PLAYER_ERROR, MEDIA_PLAYER_EVENT, MEDIA_PLAYER_METADATA_TYPE, MEDIA_PLAYER_SOURCE_TYPE, MEDIA_PLAYER_STATE, MEDIA_SOURCE_TYPE, MEDIA_STREAM_TYPE, MEDIA_TRACE_EVENT, METADATA_TYPE, MUSIC_CACHE_STATUS_TYPE, MediaRecorderConfiguration, MediaRecorderContainerFormat, MediaRecorderStreamType, MediaSource, Metadata, Music, MusicCacheInfo, MusicChartCollection, MusicChartInfo, MusicCollection, MusicContentCenterConfiguration, MusicContentCenterStatusCode, MvProperty, NETWORK_TYPE, ORIENTATION_MODE, PERMISSION_TYPE, PLAYER_PRELOAD_EVENT, PRIORITY_TYPE, PROXY_TYPE, Packet, PacketOptions, PeerDownlinkInfo, PlayerStreamInfo, PlayerUpdatedInfo, PreloadStatusCode, PublisherConfiguration, QUALITY_ADAPT_INDICATION, QUALITY_REPORT_FORMAT_TYPE, QUALITY_TYPE, RAW_AUDIO_FRAME_OP_MODE_TYPE, REMOTE_AUDIO_STATE, REMOTE_AUDIO_STATE_REASON, REMOTE_USER_STATE, REMOTE_VIDEO_DOWNSCALE_LEVEL, REMOTE_VIDEO_STATE, REMOTE_VIDEO_STATE_REASON, RENDER_MODE_TYPE, RHYTHM_PLAYER_ERROR_TYPE, RHYTHM_PLAYER_STATE_TYPE, RTMP_STREAMING_EVENT, RTMP_STREAM_LIFE_CYCLE_TYPE, RTMP_STREAM_PUBLISH_ERROR_TYPE, RTMP_STREAM_PUBLISH_STATE, RecorderErrorCode, RecorderInfo, RecorderState, RecorderStreamInfo, Rectangle, Region, RemoteAudioStats, RemoteVideoStats, RemoteVoicePositionInfo, RtcConnection, RtcEngineContext, RtcImage, RtcStats, SCREEN_CAPTURE_FRAMERATE_CAPABILITY, SCREEN_SCENARIO_TYPE, SEG_MODEL_TYPE, SIMULCAST_STREAM_MODE, SIZE, STREAMING_SRC_ERR, STREAMING_SRC_STATE, STREAM_FALLBACK_OPTIONS, STREAM_PUBLISH_STATE, STREAM_SUBSCRIBE_STATE, ScreenAudioParameters, ScreenCaptureConfiguration, ScreenCaptureParameters, ScreenCaptureParameters2, ScreenCaptureSourceInfo, ScreenCaptureSourceType, ScreenVideoParameters, SegmentationProperty, SenderOptions, SimulcastStreamConfig, SpatialAudioParams, SpatialAudioZone, SrcInfo, TCcMode, THREAD_PRIORITY_TYPE, ThumbImageBuffer, TranscodingUser, TranscodingVideoStream, UPLOAD_ERROR_REASON, USER_OFFLINE_REASON_TYPE, UplinkNetworkInfo, UserAudioSpectrumInfo, UserInfo, VIDEO_APPLICATION_SCENARIO_TYPE, VIDEO_BUFFER_TYPE, VIDEO_CODEC_CAPABILITY_LEVEL, VIDEO_CODEC_PROFILE_TYPE, VIDEO_CODEC_TYPE, VIDEO_CODEC_TYPE_FOR_STREAM, VIDEO_CONTENT_HINT, VIDEO_DENOISER_LEVEL, VIDEO_DENOISER_MODE, VIDEO_FRAME_PROCESS_MODE, VIDEO_FRAME_TYPE, VIDEO_MIRROR_MODE_TYPE, VIDEO_MODULE_POSITION, VIDEO_ORIENTATION, VIDEO_PIXEL_FORMAT, VIDEO_PROFILE_TYPE, VIDEO_SOURCE_TYPE, VIDEO_STREAM_TYPE, VIDEO_TRANSCODER_ERROR, VIDEO_VIEW_SETUP_MODE, VOICE_BEAUTIFIER_PRESET, VOICE_CONVERSION_PRESET, VideoCanvas, VideoCompositingLayout, VideoDenoiserOptions, VideoDimensions, VideoEncoderConfiguration, VideoFormat, VideoFrame, VideoRenderingTracingInfo, VideoSubscriptionOptions, VideoTrackInfo, VirtualBackgroundSource, WARN_CODE_TYPE, WATERMARK_FIT_MODE, WLACC_MESSAGE_REASON, WLACC_SUGGEST_ACTION, WatermarkOptions, WatermarkRatio, WlAccStats }; diff --git a/packages/@iris/rtc/.dist/@iris/web-rtc.js b/packages/@iris/rtc/.dist/@iris/web-rtc.js deleted file mode 100644 index 968eba0..0000000 --- a/packages/@iris/rtc/.dist/@iris/web-rtc.js +++ /dev/null @@ -1,2061 +0,0 @@ -'use strict'; - -/** - * @license @iris/web-rtc - * @version 1.0.0 - * - * Copyright (c) Agora, Inc. - * - * This source code is licensed under the MIT license. - */ - - -// generate/AgoraBase.ts -var CHANNEL_PROFILE_TYPE = /* @__PURE__ */ ((CHANNEL_PROFILE_TYPE2) => { - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_COMMUNICATION"] = 0] = "CHANNEL_PROFILE_COMMUNICATION"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_LIVE_BROADCASTING"] = 1] = "CHANNEL_PROFILE_LIVE_BROADCASTING"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_GAME"] = 2] = "CHANNEL_PROFILE_GAME"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_CLOUD_GAMING"] = 3] = "CHANNEL_PROFILE_CLOUD_GAMING"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_COMMUNICATION_1v1"] = 4] = "CHANNEL_PROFILE_COMMUNICATION_1v1"; - return CHANNEL_PROFILE_TYPE2; -})(CHANNEL_PROFILE_TYPE || {}); -var WARN_CODE_TYPE = /* @__PURE__ */ ((WARN_CODE_TYPE2) => { - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_INVALID_VIEW"] = 8] = "WARN_INVALID_VIEW"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_INIT_VIDEO"] = 16] = "WARN_INIT_VIDEO"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_PENDING"] = 20] = "WARN_PENDING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_NO_AVAILABLE_CHANNEL"] = 103] = "WARN_NO_AVAILABLE_CHANNEL"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_LOOKUP_CHANNEL_TIMEOUT"] = 104] = "WARN_LOOKUP_CHANNEL_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_LOOKUP_CHANNEL_REJECTED"] = 105] = "WARN_LOOKUP_CHANNEL_REJECTED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_TIMEOUT"] = 106] = "WARN_OPEN_CHANNEL_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_REJECTED"] = 107] = "WARN_OPEN_CHANNEL_REJECTED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_SWITCH_LIVE_VIDEO_TIMEOUT"] = 111] = "WARN_SWITCH_LIVE_VIDEO_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_SET_CLIENT_ROLE_TIMEOUT"] = 118] = "WARN_SET_CLIENT_ROLE_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_INVALID_TICKET"] = 121] = "WARN_OPEN_CHANNEL_INVALID_TICKET"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_TRY_NEXT_VOS"] = 122] = "WARN_OPEN_CHANNEL_TRY_NEXT_VOS"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_CONNECTION_UNRECOVERABLE"] = 131] = "WARN_CHANNEL_CONNECTION_UNRECOVERABLE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_CONNECTION_IP_CHANGED"] = 132] = "WARN_CHANNEL_CONNECTION_IP_CHANGED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_CONNECTION_PORT_CHANGED"] = 133] = "WARN_CHANNEL_CONNECTION_PORT_CHANGED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_SOCKET_ERROR"] = 134] = "WARN_CHANNEL_SOCKET_ERROR"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_AUDIO_MIXING_OPEN_ERROR"] = 701] = "WARN_AUDIO_MIXING_OPEN_ERROR"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RUNTIME_PLAYOUT_WARNING"] = 1014] = "WARN_ADM_RUNTIME_PLAYOUT_WARNING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RUNTIME_RECORDING_WARNING"] = 1016] = "WARN_ADM_RUNTIME_RECORDING_WARNING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RECORD_AUDIO_SILENCE"] = 1019] = "WARN_ADM_RECORD_AUDIO_SILENCE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_PLAYOUT_MALFUNCTION"] = 1020] = "WARN_ADM_PLAYOUT_MALFUNCTION"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RECORD_MALFUNCTION"] = 1021] = "WARN_ADM_RECORD_MALFUNCTION"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RECORD_AUDIO_LOWLEVEL"] = 1031] = "WARN_ADM_RECORD_AUDIO_LOWLEVEL"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL"] = 1032] = "WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WINDOWS_NO_DATA_READY_EVENT"] = 1040] = "WARN_ADM_WINDOWS_NO_DATA_READY_EVENT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_APM_HOWLING"] = 1051] = "WARN_APM_HOWLING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_GLITCH_STATE"] = 1052] = "WARN_ADM_GLITCH_STATE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_IMPROPER_SETTINGS"] = 1053] = "WARN_ADM_IMPROPER_SETTINGS"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE"] = 1322] = "WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE"] = 1323] = "WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE"] = 1324] = "WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE"; - return WARN_CODE_TYPE2; -})(WARN_CODE_TYPE || {}); -var ERROR_CODE_TYPE = /* @__PURE__ */ ((ERROR_CODE_TYPE2) => { - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_OK"] = 0] = "ERR_OK"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_FAILED"] = 1] = "ERR_FAILED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_ARGUMENT"] = 2] = "ERR_INVALID_ARGUMENT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_READY"] = 3] = "ERR_NOT_READY"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_SUPPORTED"] = 4] = "ERR_NOT_SUPPORTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_REFUSED"] = 5] = "ERR_REFUSED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_BUFFER_TOO_SMALL"] = 6] = "ERR_BUFFER_TOO_SMALL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_INITIALIZED"] = 7] = "ERR_NOT_INITIALIZED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_STATE"] = 8] = "ERR_INVALID_STATE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NO_PERMISSION"] = 9] = "ERR_NO_PERMISSION"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TIMEDOUT"] = 10] = "ERR_TIMEDOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CANCELED"] = 11] = "ERR_CANCELED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TOO_OFTEN"] = 12] = "ERR_TOO_OFTEN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_BIND_SOCKET"] = 13] = "ERR_BIND_SOCKET"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NET_DOWN"] = 14] = "ERR_NET_DOWN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_JOIN_CHANNEL_REJECTED"] = 17] = "ERR_JOIN_CHANNEL_REJECTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LEAVE_CHANNEL_REJECTED"] = 18] = "ERR_LEAVE_CHANNEL_REJECTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ALREADY_IN_USE"] = 19] = "ERR_ALREADY_IN_USE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ABORTED"] = 20] = "ERR_ABORTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INIT_NET_ENGINE"] = 21] = "ERR_INIT_NET_ENGINE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_RESOURCE_LIMITED"] = 22] = "ERR_RESOURCE_LIMITED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_APP_ID"] = 101] = "ERR_INVALID_APP_ID"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_CHANNEL_NAME"] = 102] = "ERR_INVALID_CHANNEL_NAME"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NO_SERVER_RESOURCES"] = 103] = "ERR_NO_SERVER_RESOURCES"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TOKEN_EXPIRED"] = 109] = "ERR_TOKEN_EXPIRED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_TOKEN"] = 110] = "ERR_INVALID_TOKEN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CONNECTION_INTERRUPTED"] = 111] = "ERR_CONNECTION_INTERRUPTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CONNECTION_LOST"] = 112] = "ERR_CONNECTION_LOST"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_IN_CHANNEL"] = 113] = "ERR_NOT_IN_CHANNEL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_SIZE_TOO_LARGE"] = 114] = "ERR_SIZE_TOO_LARGE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_BITRATE_LIMIT"] = 115] = "ERR_BITRATE_LIMIT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TOO_MANY_DATA_STREAMS"] = 116] = "ERR_TOO_MANY_DATA_STREAMS"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_STREAM_MESSAGE_TIMEOUT"] = 117] = "ERR_STREAM_MESSAGE_TIMEOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED"] = 119] = "ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_DECRYPTION_FAILED"] = 120] = "ERR_DECRYPTION_FAILED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_USER_ID"] = 121] = "ERR_INVALID_USER_ID"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CLIENT_IS_BANNED_BY_SERVER"] = 123] = "ERR_CLIENT_IS_BANNED_BY_SERVER"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH"] = 130] = "ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LICENSE_CREDENTIAL_INVALID"] = 131] = "ERR_LICENSE_CREDENTIAL_INVALID"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_USER_ACCOUNT"] = 134] = "ERR_INVALID_USER_ACCOUNT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_MODULE_NOT_FOUND"] = 157] = "ERR_MODULE_NOT_FOUND"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_RAW"] = 157] = "ERR_CERT_RAW"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_JSON_PART"] = 158] = "ERR_CERT_JSON_PART"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_JSON_INVAL"] = 159] = "ERR_CERT_JSON_INVAL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_JSON_NOMEM"] = 160] = "ERR_CERT_JSON_NOMEM"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_CUSTOM"] = 161] = "ERR_CERT_CUSTOM"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_CREDENTIAL"] = 162] = "ERR_CERT_CREDENTIAL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_SIGN"] = 163] = "ERR_CERT_SIGN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_FAIL"] = 164] = "ERR_CERT_FAIL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_BUF"] = 165] = "ERR_CERT_BUF"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_NULL"] = 166] = "ERR_CERT_NULL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_DUEDATE"] = 167] = "ERR_CERT_DUEDATE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_REQUEST"] = 168] = "ERR_CERT_REQUEST"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_PCMSEND_FORMAT"] = 200] = "ERR_PCMSEND_FORMAT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_PCMSEND_BUFFEROVERFLOW"] = 201] = "ERR_PCMSEND_BUFFEROVERFLOW"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LOGIN_ALREADY_LOGIN"] = 428] = "ERR_LOGIN_ALREADY_LOGIN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LOAD_MEDIA_ENGINE"] = 1001] = "ERR_LOAD_MEDIA_ENGINE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_GENERAL_ERROR"] = 1005] = "ERR_ADM_GENERAL_ERROR"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_INIT_PLAYOUT"] = 1008] = "ERR_ADM_INIT_PLAYOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_START_PLAYOUT"] = 1009] = "ERR_ADM_START_PLAYOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_STOP_PLAYOUT"] = 1010] = "ERR_ADM_STOP_PLAYOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_INIT_RECORDING"] = 1011] = "ERR_ADM_INIT_RECORDING"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_START_RECORDING"] = 1012] = "ERR_ADM_START_RECORDING"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_STOP_RECORDING"] = 1013] = "ERR_ADM_STOP_RECORDING"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_VDM_CAMERA_NOT_AUTHORIZED"] = 1501] = "ERR_VDM_CAMERA_NOT_AUTHORIZED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_APPLICATION_LOOPBACK"] = 2007] = "ERR_ADM_APPLICATION_LOOPBACK"; - return ERROR_CODE_TYPE2; -})(ERROR_CODE_TYPE || {}); -var LICENSE_ERROR_TYPE = /* @__PURE__ */ ((LICENSE_ERROR_TYPE2) => { - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_INVALID"] = 1] = "LICENSE_ERR_INVALID"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_EXPIRE"] = 2] = "LICENSE_ERR_EXPIRE"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_MINUTES_EXCEED"] = 3] = "LICENSE_ERR_MINUTES_EXCEED"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_LIMITED_PERIOD"] = 4] = "LICENSE_ERR_LIMITED_PERIOD"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_DIFF_DEVICES"] = 5] = "LICENSE_ERR_DIFF_DEVICES"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_INTERNAL"] = 99] = "LICENSE_ERR_INTERNAL"; - return LICENSE_ERROR_TYPE2; -})(LICENSE_ERROR_TYPE || {}); -var AUDIO_SESSION_OPERATION_RESTRICTION = /* @__PURE__ */ ((AUDIO_SESSION_OPERATION_RESTRICTION2) => { - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_NONE"] = 0] = "AUDIO_SESSION_OPERATION_RESTRICTION_NONE"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_ALL"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_ALL"; - return AUDIO_SESSION_OPERATION_RESTRICTION2; -})(AUDIO_SESSION_OPERATION_RESTRICTION || {}); -var USER_OFFLINE_REASON_TYPE = /* @__PURE__ */ ((USER_OFFLINE_REASON_TYPE2) => { - USER_OFFLINE_REASON_TYPE2[USER_OFFLINE_REASON_TYPE2["USER_OFFLINE_QUIT"] = 0] = "USER_OFFLINE_QUIT"; - USER_OFFLINE_REASON_TYPE2[USER_OFFLINE_REASON_TYPE2["USER_OFFLINE_DROPPED"] = 1] = "USER_OFFLINE_DROPPED"; - USER_OFFLINE_REASON_TYPE2[USER_OFFLINE_REASON_TYPE2["USER_OFFLINE_BECOME_AUDIENCE"] = 2] = "USER_OFFLINE_BECOME_AUDIENCE"; - return USER_OFFLINE_REASON_TYPE2; -})(USER_OFFLINE_REASON_TYPE || {}); -var INTERFACE_ID_TYPE = /* @__PURE__ */ ((INTERFACE_ID_TYPE2) => { - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_AUDIO_DEVICE_MANAGER"] = 1] = "AGORA_IID_AUDIO_DEVICE_MANAGER"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_VIDEO_DEVICE_MANAGER"] = 2] = "AGORA_IID_VIDEO_DEVICE_MANAGER"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_PARAMETER_ENGINE"] = 3] = "AGORA_IID_PARAMETER_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_MEDIA_ENGINE"] = 4] = "AGORA_IID_MEDIA_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_AUDIO_ENGINE"] = 5] = "AGORA_IID_AUDIO_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_VIDEO_ENGINE"] = 6] = "AGORA_IID_VIDEO_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_RTC_CONNECTION"] = 7] = "AGORA_IID_RTC_CONNECTION"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_SIGNALING_ENGINE"] = 8] = "AGORA_IID_SIGNALING_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_MEDIA_ENGINE_REGULATOR"] = 9] = "AGORA_IID_MEDIA_ENGINE_REGULATOR"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_CLOUD_SPATIAL_AUDIO"] = 10] = "AGORA_IID_CLOUD_SPATIAL_AUDIO"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_LOCAL_SPATIAL_AUDIO"] = 11] = "AGORA_IID_LOCAL_SPATIAL_AUDIO"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_STATE_SYNC"] = 13] = "AGORA_IID_STATE_SYNC"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_METACHAT_SERVICE"] = 14] = "AGORA_IID_METACHAT_SERVICE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_MUSIC_CONTENT_CENTER"] = 15] = "AGORA_IID_MUSIC_CONTENT_CENTER"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_H265_TRANSCODER"] = 16] = "AGORA_IID_H265_TRANSCODER"; - return INTERFACE_ID_TYPE2; -})(INTERFACE_ID_TYPE || {}); -var QUALITY_TYPE = /* @__PURE__ */ ((QUALITY_TYPE2) => { - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_UNKNOWN"] = 0] = "QUALITY_UNKNOWN"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_EXCELLENT"] = 1] = "QUALITY_EXCELLENT"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_GOOD"] = 2] = "QUALITY_GOOD"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_POOR"] = 3] = "QUALITY_POOR"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_BAD"] = 4] = "QUALITY_BAD"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_VBAD"] = 5] = "QUALITY_VBAD"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_DOWN"] = 6] = "QUALITY_DOWN"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_UNSUPPORTED"] = 7] = "QUALITY_UNSUPPORTED"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_DETECTING"] = 8] = "QUALITY_DETECTING"; - return QUALITY_TYPE2; -})(QUALITY_TYPE || {}); -var FIT_MODE_TYPE = /* @__PURE__ */ ((FIT_MODE_TYPE2) => { - FIT_MODE_TYPE2[FIT_MODE_TYPE2["MODE_COVER"] = 1] = "MODE_COVER"; - FIT_MODE_TYPE2[FIT_MODE_TYPE2["MODE_CONTAIN"] = 2] = "MODE_CONTAIN"; - return FIT_MODE_TYPE2; -})(FIT_MODE_TYPE || {}); -var VIDEO_ORIENTATION = /* @__PURE__ */ ((VIDEO_ORIENTATION2) => { - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_0"] = 0] = "VIDEO_ORIENTATION_0"; - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_90"] = 90] = "VIDEO_ORIENTATION_90"; - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_180"] = 180] = "VIDEO_ORIENTATION_180"; - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_270"] = 270] = "VIDEO_ORIENTATION_270"; - return VIDEO_ORIENTATION2; -})(VIDEO_ORIENTATION || {}); -var FRAME_RATE = /* @__PURE__ */ ((FRAME_RATE2) => { - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_1"] = 1] = "FRAME_RATE_FPS_1"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_7"] = 7] = "FRAME_RATE_FPS_7"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_10"] = 10] = "FRAME_RATE_FPS_10"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_15"] = 15] = "FRAME_RATE_FPS_15"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_24"] = 24] = "FRAME_RATE_FPS_24"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_30"] = 30] = "FRAME_RATE_FPS_30"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_60"] = 60] = "FRAME_RATE_FPS_60"; - return FRAME_RATE2; -})(FRAME_RATE || {}); -var FRAME_WIDTH = /* @__PURE__ */ ((FRAME_WIDTH2) => { - FRAME_WIDTH2[FRAME_WIDTH2["FRAME_WIDTH_960"] = 960] = "FRAME_WIDTH_960"; - return FRAME_WIDTH2; -})(FRAME_WIDTH || {}); -var FRAME_HEIGHT = /* @__PURE__ */ ((FRAME_HEIGHT2) => { - FRAME_HEIGHT2[FRAME_HEIGHT2["FRAME_HEIGHT_540"] = 540] = "FRAME_HEIGHT_540"; - return FRAME_HEIGHT2; -})(FRAME_HEIGHT || {}); -var VIDEO_FRAME_TYPE = /* @__PURE__ */ ((VIDEO_FRAME_TYPE2) => { - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_BLANK_FRAME"] = 0] = "VIDEO_FRAME_TYPE_BLANK_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_KEY_FRAME"] = 3] = "VIDEO_FRAME_TYPE_KEY_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_DELTA_FRAME"] = 4] = "VIDEO_FRAME_TYPE_DELTA_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_B_FRAME"] = 5] = "VIDEO_FRAME_TYPE_B_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_DROPPABLE_FRAME"] = 6] = "VIDEO_FRAME_TYPE_DROPPABLE_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_UNKNOW"] = 7] = "VIDEO_FRAME_TYPE_UNKNOW"; - return VIDEO_FRAME_TYPE2; -})(VIDEO_FRAME_TYPE || {}); -var ORIENTATION_MODE = /* @__PURE__ */ ((ORIENTATION_MODE2) => { - ORIENTATION_MODE2[ORIENTATION_MODE2["ORIENTATION_MODE_ADAPTIVE"] = 0] = "ORIENTATION_MODE_ADAPTIVE"; - ORIENTATION_MODE2[ORIENTATION_MODE2["ORIENTATION_MODE_FIXED_LANDSCAPE"] = 1] = "ORIENTATION_MODE_FIXED_LANDSCAPE"; - ORIENTATION_MODE2[ORIENTATION_MODE2["ORIENTATION_MODE_FIXED_PORTRAIT"] = 2] = "ORIENTATION_MODE_FIXED_PORTRAIT"; - return ORIENTATION_MODE2; -})(ORIENTATION_MODE || {}); -var DEGRADATION_PREFERENCE = /* @__PURE__ */ ((DEGRADATION_PREFERENCE2) => { - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_QUALITY"] = 0] = "MAINTAIN_QUALITY"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_FRAMERATE"] = 1] = "MAINTAIN_FRAMERATE"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_BALANCED"] = 2] = "MAINTAIN_BALANCED"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_RESOLUTION"] = 3] = "MAINTAIN_RESOLUTION"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["DISABLED"] = 100] = "DISABLED"; - return DEGRADATION_PREFERENCE2; -})(DEGRADATION_PREFERENCE || {}); -var VideoDimensions = class { -}; -var SCREEN_CAPTURE_FRAMERATE_CAPABILITY = /* @__PURE__ */ ((SCREEN_CAPTURE_FRAMERATE_CAPABILITY2) => { - SCREEN_CAPTURE_FRAMERATE_CAPABILITY2[SCREEN_CAPTURE_FRAMERATE_CAPABILITY2["SCREEN_CAPTURE_FRAMERATE_CAPABILITY_15_FPS"] = 0] = "SCREEN_CAPTURE_FRAMERATE_CAPABILITY_15_FPS"; - SCREEN_CAPTURE_FRAMERATE_CAPABILITY2[SCREEN_CAPTURE_FRAMERATE_CAPABILITY2["SCREEN_CAPTURE_FRAMERATE_CAPABILITY_30_FPS"] = 1] = "SCREEN_CAPTURE_FRAMERATE_CAPABILITY_30_FPS"; - SCREEN_CAPTURE_FRAMERATE_CAPABILITY2[SCREEN_CAPTURE_FRAMERATE_CAPABILITY2["SCREEN_CAPTURE_FRAMERATE_CAPABILITY_60_FPS"] = 2] = "SCREEN_CAPTURE_FRAMERATE_CAPABILITY_60_FPS"; - return SCREEN_CAPTURE_FRAMERATE_CAPABILITY2; -})(SCREEN_CAPTURE_FRAMERATE_CAPABILITY || {}); -var VIDEO_CODEC_CAPABILITY_LEVEL = /* @__PURE__ */ ((VIDEO_CODEC_CAPABILITY_LEVEL2) => { - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_UNSPECIFIED"] = -1] = "CODEC_CAPABILITY_LEVEL_UNSPECIFIED"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_BASIC_SUPPORT"] = 5] = "CODEC_CAPABILITY_LEVEL_BASIC_SUPPORT"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_1080P30FPS"] = 10] = "CODEC_CAPABILITY_LEVEL_1080P30FPS"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_1080P60FPS"] = 20] = "CODEC_CAPABILITY_LEVEL_1080P60FPS"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_4K60FPS"] = 30] = "CODEC_CAPABILITY_LEVEL_4K60FPS"; - return VIDEO_CODEC_CAPABILITY_LEVEL2; -})(VIDEO_CODEC_CAPABILITY_LEVEL || {}); -var VIDEO_CODEC_TYPE = /* @__PURE__ */ ((VIDEO_CODEC_TYPE2) => { - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_NONE"] = 0] = "VIDEO_CODEC_NONE"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_VP8"] = 1] = "VIDEO_CODEC_VP8"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_H264"] = 2] = "VIDEO_CODEC_H264"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_H265"] = 3] = "VIDEO_CODEC_H265"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_GENERIC"] = 6] = "VIDEO_CODEC_GENERIC"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_GENERIC_H264"] = 7] = "VIDEO_CODEC_GENERIC_H264"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_AV1"] = 12] = "VIDEO_CODEC_AV1"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_VP9"] = 13] = "VIDEO_CODEC_VP9"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_GENERIC_JPEG"] = 20] = "VIDEO_CODEC_GENERIC_JPEG"; - return VIDEO_CODEC_TYPE2; -})(VIDEO_CODEC_TYPE || {}); -var TCcMode = /* @__PURE__ */ ((TCcMode2) => { - TCcMode2[TCcMode2["CC_ENABLED"] = 0] = "CC_ENABLED"; - TCcMode2[TCcMode2["CC_DISABLED"] = 1] = "CC_DISABLED"; - return TCcMode2; -})(TCcMode || {}); -var SenderOptions = class { -}; -var AUDIO_CODEC_TYPE = /* @__PURE__ */ ((AUDIO_CODEC_TYPE2) => { - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_OPUS"] = 1] = "AUDIO_CODEC_OPUS"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_PCMA"] = 3] = "AUDIO_CODEC_PCMA"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_PCMU"] = 4] = "AUDIO_CODEC_PCMU"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_G722"] = 5] = "AUDIO_CODEC_G722"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_AACLC"] = 8] = "AUDIO_CODEC_AACLC"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_HEAAC"] = 9] = "AUDIO_CODEC_HEAAC"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_JC1"] = 10] = "AUDIO_CODEC_JC1"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_HEAAC2"] = 11] = "AUDIO_CODEC_HEAAC2"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_LPCNET"] = 12] = "AUDIO_CODEC_LPCNET"; - return AUDIO_CODEC_TYPE2; -})(AUDIO_CODEC_TYPE || {}); -var AUDIO_ENCODING_TYPE = /* @__PURE__ */ ((AUDIO_ENCODING_TYPE2) => { - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_16000_LOW"] = 65793] = "AUDIO_ENCODING_TYPE_AAC_16000_LOW"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM"] = 65794] = "AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_32000_LOW"] = 66049] = "AUDIO_ENCODING_TYPE_AAC_32000_LOW"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM"] = 66050] = "AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_32000_HIGH"] = 66051] = "AUDIO_ENCODING_TYPE_AAC_32000_HIGH"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM"] = 66306] = "AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_48000_HIGH"] = 66307] = "AUDIO_ENCODING_TYPE_AAC_48000_HIGH"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_16000_LOW"] = 131329] = "AUDIO_ENCODING_TYPE_OPUS_16000_LOW"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM"] = 131330] = "AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM"] = 131842] = "AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_48000_HIGH"] = 131843] = "AUDIO_ENCODING_TYPE_OPUS_48000_HIGH"; - return AUDIO_ENCODING_TYPE2; -})(AUDIO_ENCODING_TYPE || {}); -var WATERMARK_FIT_MODE = /* @__PURE__ */ ((WATERMARK_FIT_MODE2) => { - WATERMARK_FIT_MODE2[WATERMARK_FIT_MODE2["FIT_MODE_COVER_POSITION"] = 0] = "FIT_MODE_COVER_POSITION"; - WATERMARK_FIT_MODE2[WATERMARK_FIT_MODE2["FIT_MODE_USE_IMAGE_RATIO"] = 1] = "FIT_MODE_USE_IMAGE_RATIO"; - return WATERMARK_FIT_MODE2; -})(WATERMARK_FIT_MODE || {}); -var EncodedAudioFrameAdvancedSettings = class { -}; -var EncodedAudioFrameInfo = class { -}; -var AudioPcmDataInfo = class { -}; -var H264PacketizeMode = /* @__PURE__ */ ((H264PacketizeMode2) => { - H264PacketizeMode2[H264PacketizeMode2["NonInterleaved"] = 0] = "NonInterleaved"; - H264PacketizeMode2[H264PacketizeMode2["SingleNalUnit"] = 1] = "SingleNalUnit"; - return H264PacketizeMode2; -})(H264PacketizeMode || {}); -var VIDEO_STREAM_TYPE = /* @__PURE__ */ ((VIDEO_STREAM_TYPE2) => { - VIDEO_STREAM_TYPE2[VIDEO_STREAM_TYPE2["VIDEO_STREAM_HIGH"] = 0] = "VIDEO_STREAM_HIGH"; - VIDEO_STREAM_TYPE2[VIDEO_STREAM_TYPE2["VIDEO_STREAM_LOW"] = 1] = "VIDEO_STREAM_LOW"; - return VIDEO_STREAM_TYPE2; -})(VIDEO_STREAM_TYPE || {}); -var VideoSubscriptionOptions = class { -}; -var EncodedVideoFrameInfo = class { -}; -var COMPRESSION_PREFERENCE = /* @__PURE__ */ ((COMPRESSION_PREFERENCE2) => { - COMPRESSION_PREFERENCE2[COMPRESSION_PREFERENCE2["PREFER_LOW_LATENCY"] = 0] = "PREFER_LOW_LATENCY"; - COMPRESSION_PREFERENCE2[COMPRESSION_PREFERENCE2["PREFER_QUALITY"] = 1] = "PREFER_QUALITY"; - return COMPRESSION_PREFERENCE2; -})(COMPRESSION_PREFERENCE || {}); -var ENCODING_PREFERENCE = /* @__PURE__ */ ((ENCODING_PREFERENCE2) => { - ENCODING_PREFERENCE2[ENCODING_PREFERENCE2["PREFER_AUTO"] = -1] = "PREFER_AUTO"; - ENCODING_PREFERENCE2[ENCODING_PREFERENCE2["PREFER_SOFTWARE"] = 0] = "PREFER_SOFTWARE"; - ENCODING_PREFERENCE2[ENCODING_PREFERENCE2["PREFER_HARDWARE"] = 1] = "PREFER_HARDWARE"; - return ENCODING_PREFERENCE2; -})(ENCODING_PREFERENCE || {}); -var AdvanceOptions = class { -}; -var VIDEO_MIRROR_MODE_TYPE = /* @__PURE__ */ ((VIDEO_MIRROR_MODE_TYPE2) => { - VIDEO_MIRROR_MODE_TYPE2[VIDEO_MIRROR_MODE_TYPE2["VIDEO_MIRROR_MODE_AUTO"] = 0] = "VIDEO_MIRROR_MODE_AUTO"; - VIDEO_MIRROR_MODE_TYPE2[VIDEO_MIRROR_MODE_TYPE2["VIDEO_MIRROR_MODE_ENABLED"] = 1] = "VIDEO_MIRROR_MODE_ENABLED"; - VIDEO_MIRROR_MODE_TYPE2[VIDEO_MIRROR_MODE_TYPE2["VIDEO_MIRROR_MODE_DISABLED"] = 2] = "VIDEO_MIRROR_MODE_DISABLED"; - return VIDEO_MIRROR_MODE_TYPE2; -})(VIDEO_MIRROR_MODE_TYPE || {}); -var CODEC_CAP_MASK = /* @__PURE__ */ ((CODEC_CAP_MASK2) => { - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_NONE"] = 0] = "CODEC_CAP_MASK_NONE"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_HW_DEC"] = 1] = "CODEC_CAP_MASK_HW_DEC"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_HW_ENC"] = 1] = "CODEC_CAP_MASK_HW_ENC"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_SW_DEC"] = 1] = "CODEC_CAP_MASK_SW_DEC"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_SW_ENC"] = 1] = "CODEC_CAP_MASK_SW_ENC"; - return CODEC_CAP_MASK2; -})(CODEC_CAP_MASK || {}); -var CodecCapLevels = class { -}; -var CodecCapInfo = class { -}; -var VideoEncoderConfiguration = class { -}; -var DataStreamConfig = class { -}; -var SIMULCAST_STREAM_MODE = /* @__PURE__ */ ((SIMULCAST_STREAM_MODE2) => { - SIMULCAST_STREAM_MODE2[SIMULCAST_STREAM_MODE2["AUTO_SIMULCAST_STREAM"] = -1] = "AUTO_SIMULCAST_STREAM"; - SIMULCAST_STREAM_MODE2[SIMULCAST_STREAM_MODE2["DISABLE_SIMULCAST_STREAM"] = 0] = "DISABLE_SIMULCAST_STREAM"; - SIMULCAST_STREAM_MODE2[SIMULCAST_STREAM_MODE2["ENABLE_SIMULCAST_STREAM"] = 1] = "ENABLE_SIMULCAST_STREAM"; - return SIMULCAST_STREAM_MODE2; -})(SIMULCAST_STREAM_MODE || {}); -var SimulcastStreamConfig = class { -}; -var Rectangle = class { -}; -var WatermarkRatio = class { -}; -var WatermarkOptions = class { -}; -var RtcStats = class { -}; -var CLIENT_ROLE_TYPE = /* @__PURE__ */ ((CLIENT_ROLE_TYPE2) => { - CLIENT_ROLE_TYPE2[CLIENT_ROLE_TYPE2["CLIENT_ROLE_BROADCASTER"] = 1] = "CLIENT_ROLE_BROADCASTER"; - CLIENT_ROLE_TYPE2[CLIENT_ROLE_TYPE2["CLIENT_ROLE_AUDIENCE"] = 2] = "CLIENT_ROLE_AUDIENCE"; - return CLIENT_ROLE_TYPE2; -})(CLIENT_ROLE_TYPE || {}); -var QUALITY_ADAPT_INDICATION = /* @__PURE__ */ ((QUALITY_ADAPT_INDICATION2) => { - QUALITY_ADAPT_INDICATION2[QUALITY_ADAPT_INDICATION2["ADAPT_NONE"] = 0] = "ADAPT_NONE"; - QUALITY_ADAPT_INDICATION2[QUALITY_ADAPT_INDICATION2["ADAPT_UP_BANDWIDTH"] = 1] = "ADAPT_UP_BANDWIDTH"; - QUALITY_ADAPT_INDICATION2[QUALITY_ADAPT_INDICATION2["ADAPT_DOWN_BANDWIDTH"] = 2] = "ADAPT_DOWN_BANDWIDTH"; - return QUALITY_ADAPT_INDICATION2; -})(QUALITY_ADAPT_INDICATION || {}); -var AUDIENCE_LATENCY_LEVEL_TYPE = /* @__PURE__ */ ((AUDIENCE_LATENCY_LEVEL_TYPE2) => { - AUDIENCE_LATENCY_LEVEL_TYPE2[AUDIENCE_LATENCY_LEVEL_TYPE2["AUDIENCE_LATENCY_LEVEL_LOW_LATENCY"] = 1] = "AUDIENCE_LATENCY_LEVEL_LOW_LATENCY"; - AUDIENCE_LATENCY_LEVEL_TYPE2[AUDIENCE_LATENCY_LEVEL_TYPE2["AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY"] = 2] = "AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY"; - return AUDIENCE_LATENCY_LEVEL_TYPE2; -})(AUDIENCE_LATENCY_LEVEL_TYPE || {}); -var ClientRoleOptions = class { -}; -var EXPERIENCE_QUALITY_TYPE = /* @__PURE__ */ ((EXPERIENCE_QUALITY_TYPE2) => { - EXPERIENCE_QUALITY_TYPE2[EXPERIENCE_QUALITY_TYPE2["EXPERIENCE_QUALITY_GOOD"] = 0] = "EXPERIENCE_QUALITY_GOOD"; - EXPERIENCE_QUALITY_TYPE2[EXPERIENCE_QUALITY_TYPE2["EXPERIENCE_QUALITY_BAD"] = 1] = "EXPERIENCE_QUALITY_BAD"; - return EXPERIENCE_QUALITY_TYPE2; -})(EXPERIENCE_QUALITY_TYPE || {}); -var EXPERIENCE_POOR_REASON = /* @__PURE__ */ ((EXPERIENCE_POOR_REASON2) => { - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["EXPERIENCE_REASON_NONE"] = 0] = "EXPERIENCE_REASON_NONE"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["REMOTE_NETWORK_QUALITY_POOR"] = 1] = "REMOTE_NETWORK_QUALITY_POOR"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["LOCAL_NETWORK_QUALITY_POOR"] = 2] = "LOCAL_NETWORK_QUALITY_POOR"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["WIRELESS_SIGNAL_POOR"] = 4] = "WIRELESS_SIGNAL_POOR"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["WIFI_BLUETOOTH_COEXIST"] = 8] = "WIFI_BLUETOOTH_COEXIST"; - return EXPERIENCE_POOR_REASON2; -})(EXPERIENCE_POOR_REASON || {}); -var AUDIO_AINS_MODE = /* @__PURE__ */ ((AUDIO_AINS_MODE2) => { - AUDIO_AINS_MODE2[AUDIO_AINS_MODE2["AINS_MODE_BALANCED"] = 0] = "AINS_MODE_BALANCED"; - AUDIO_AINS_MODE2[AUDIO_AINS_MODE2["AINS_MODE_AGGRESSIVE"] = 1] = "AINS_MODE_AGGRESSIVE"; - AUDIO_AINS_MODE2[AUDIO_AINS_MODE2["AINS_MODE_ULTRALOWLATENCY"] = 2] = "AINS_MODE_ULTRALOWLATENCY"; - return AUDIO_AINS_MODE2; -})(AUDIO_AINS_MODE || {}); -var AUDIO_PROFILE_TYPE = /* @__PURE__ */ ((AUDIO_PROFILE_TYPE2) => { - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_DEFAULT"] = 0] = "AUDIO_PROFILE_DEFAULT"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_SPEECH_STANDARD"] = 1] = "AUDIO_PROFILE_SPEECH_STANDARD"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_STANDARD"] = 2] = "AUDIO_PROFILE_MUSIC_STANDARD"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_STANDARD_STEREO"] = 3] = "AUDIO_PROFILE_MUSIC_STANDARD_STEREO"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_HIGH_QUALITY"] = 4] = "AUDIO_PROFILE_MUSIC_HIGH_QUALITY"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO"] = 5] = "AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_IOT"] = 6] = "AUDIO_PROFILE_IOT"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_NUM"] = 7] = "AUDIO_PROFILE_NUM"; - return AUDIO_PROFILE_TYPE2; -})(AUDIO_PROFILE_TYPE || {}); -var AUDIO_SCENARIO_TYPE = /* @__PURE__ */ ((AUDIO_SCENARIO_TYPE2) => { - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_DEFAULT"] = 0] = "AUDIO_SCENARIO_DEFAULT"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_GAME_STREAMING"] = 3] = "AUDIO_SCENARIO_GAME_STREAMING"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_CHATROOM"] = 5] = "AUDIO_SCENARIO_CHATROOM"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_CHORUS"] = 7] = "AUDIO_SCENARIO_CHORUS"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_MEETING"] = 8] = "AUDIO_SCENARIO_MEETING"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_NUM"] = 9] = "AUDIO_SCENARIO_NUM"; - return AUDIO_SCENARIO_TYPE2; -})(AUDIO_SCENARIO_TYPE || {}); -var VideoFormat = class { -}; -var VIDEO_CONTENT_HINT = /* @__PURE__ */ ((VIDEO_CONTENT_HINT2) => { - VIDEO_CONTENT_HINT2[VIDEO_CONTENT_HINT2["CONTENT_HINT_NONE"] = 0] = "CONTENT_HINT_NONE"; - VIDEO_CONTENT_HINT2[VIDEO_CONTENT_HINT2["CONTENT_HINT_MOTION"] = 1] = "CONTENT_HINT_MOTION"; - VIDEO_CONTENT_HINT2[VIDEO_CONTENT_HINT2["CONTENT_HINT_DETAILS"] = 2] = "CONTENT_HINT_DETAILS"; - return VIDEO_CONTENT_HINT2; -})(VIDEO_CONTENT_HINT || {}); -var SCREEN_SCENARIO_TYPE = /* @__PURE__ */ ((SCREEN_SCENARIO_TYPE2) => { - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_DOCUMENT"] = 1] = "SCREEN_SCENARIO_DOCUMENT"; - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_GAMING"] = 2] = "SCREEN_SCENARIO_GAMING"; - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_VIDEO"] = 3] = "SCREEN_SCENARIO_VIDEO"; - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_RDC"] = 4] = "SCREEN_SCENARIO_RDC"; - return SCREEN_SCENARIO_TYPE2; -})(SCREEN_SCENARIO_TYPE || {}); -var VIDEO_APPLICATION_SCENARIO_TYPE = /* @__PURE__ */ ((VIDEO_APPLICATION_SCENARIO_TYPE2) => { - VIDEO_APPLICATION_SCENARIO_TYPE2[VIDEO_APPLICATION_SCENARIO_TYPE2["APPLICATION_SCENARIO_GENERAL"] = 0] = "APPLICATION_SCENARIO_GENERAL"; - VIDEO_APPLICATION_SCENARIO_TYPE2[VIDEO_APPLICATION_SCENARIO_TYPE2["APPLICATION_SCENARIO_MEETING"] = 1] = "APPLICATION_SCENARIO_MEETING"; - return VIDEO_APPLICATION_SCENARIO_TYPE2; -})(VIDEO_APPLICATION_SCENARIO_TYPE || {}); -var CAPTURE_BRIGHTNESS_LEVEL_TYPE = /* @__PURE__ */ ((CAPTURE_BRIGHTNESS_LEVEL_TYPE2) => { - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_INVALID"] = -1] = "CAPTURE_BRIGHTNESS_LEVEL_INVALID"; - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_NORMAL"] = 0] = "CAPTURE_BRIGHTNESS_LEVEL_NORMAL"; - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_BRIGHT"] = 1] = "CAPTURE_BRIGHTNESS_LEVEL_BRIGHT"; - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_DARK"] = 2] = "CAPTURE_BRIGHTNESS_LEVEL_DARK"; - return CAPTURE_BRIGHTNESS_LEVEL_TYPE2; -})(CAPTURE_BRIGHTNESS_LEVEL_TYPE || {}); -var LOCAL_AUDIO_STREAM_STATE = /* @__PURE__ */ ((LOCAL_AUDIO_STREAM_STATE2) => { - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_STOPPED"] = 0] = "LOCAL_AUDIO_STREAM_STATE_STOPPED"; - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_RECORDING"] = 1] = "LOCAL_AUDIO_STREAM_STATE_RECORDING"; - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_ENCODING"] = 2] = "LOCAL_AUDIO_STREAM_STATE_ENCODING"; - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_FAILED"] = 3] = "LOCAL_AUDIO_STREAM_STATE_FAILED"; - return LOCAL_AUDIO_STREAM_STATE2; -})(LOCAL_AUDIO_STREAM_STATE || {}); -var LOCAL_AUDIO_STREAM_ERROR = /* @__PURE__ */ ((LOCAL_AUDIO_STREAM_ERROR2) => { - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_OK"] = 0] = "LOCAL_AUDIO_STREAM_ERROR_OK"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_FAILURE"] = 1] = "LOCAL_AUDIO_STREAM_ERROR_FAILURE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION"] = 2] = "LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY"] = 3] = "LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE"] = 4] = "LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE"] = 5] = "LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE"] = 6] = "LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE"] = 7] = "LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED"] = 8] = "LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID"] = 9] = "LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID"] = 10] = "LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID"; - return LOCAL_AUDIO_STREAM_ERROR2; -})(LOCAL_AUDIO_STREAM_ERROR || {}); -var LOCAL_VIDEO_STREAM_STATE = /* @__PURE__ */ ((LOCAL_VIDEO_STREAM_STATE2) => { - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_STOPPED"] = 0] = "LOCAL_VIDEO_STREAM_STATE_STOPPED"; - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_CAPTURING"] = 1] = "LOCAL_VIDEO_STREAM_STATE_CAPTURING"; - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_ENCODING"] = 2] = "LOCAL_VIDEO_STREAM_STATE_ENCODING"; - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_FAILED"] = 3] = "LOCAL_VIDEO_STREAM_STATE_FAILED"; - return LOCAL_VIDEO_STREAM_STATE2; -})(LOCAL_VIDEO_STREAM_STATE || {}); -var LOCAL_VIDEO_STREAM_ERROR = /* @__PURE__ */ ((LOCAL_VIDEO_STREAM_ERROR2) => { - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_OK"] = 0] = "LOCAL_VIDEO_STREAM_ERROR_OK"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_FAILURE"] = 1] = "LOCAL_VIDEO_STREAM_ERROR_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION"] = 2] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY"] = 3] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE"] = 4] = "LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE"] = 5] = "LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND"] = 6] = "LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS"] = 7] = "LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND"] = 8] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED"] = 9] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID"] = 10] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE"] = 101] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED"] = 11] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED"] = 12] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED"] = 13] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED"] = 20] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE"] = 21] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION"] = 22] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED"] = 23] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED"] = 24] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN"] = 25] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN"] = 26] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED"] = 27] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED"; - return LOCAL_VIDEO_STREAM_ERROR2; -})(LOCAL_VIDEO_STREAM_ERROR || {}); -var REMOTE_AUDIO_STATE = /* @__PURE__ */ ((REMOTE_AUDIO_STATE2) => { - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_STOPPED"] = 0] = "REMOTE_AUDIO_STATE_STOPPED"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_STARTING"] = 1] = "REMOTE_AUDIO_STATE_STARTING"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_DECODING"] = 2] = "REMOTE_AUDIO_STATE_DECODING"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_FROZEN"] = 3] = "REMOTE_AUDIO_STATE_FROZEN"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_FAILED"] = 4] = "REMOTE_AUDIO_STATE_FAILED"; - return REMOTE_AUDIO_STATE2; -})(REMOTE_AUDIO_STATE || {}); -var REMOTE_AUDIO_STATE_REASON = /* @__PURE__ */ ((REMOTE_AUDIO_STATE_REASON2) => { - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_INTERNAL"] = 0] = "REMOTE_AUDIO_REASON_INTERNAL"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_NETWORK_CONGESTION"] = 1] = "REMOTE_AUDIO_REASON_NETWORK_CONGESTION"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_NETWORK_RECOVERY"] = 2] = "REMOTE_AUDIO_REASON_NETWORK_RECOVERY"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_LOCAL_MUTED"] = 3] = "REMOTE_AUDIO_REASON_LOCAL_MUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_LOCAL_UNMUTED"] = 4] = "REMOTE_AUDIO_REASON_LOCAL_UNMUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_REMOTE_MUTED"] = 5] = "REMOTE_AUDIO_REASON_REMOTE_MUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_REMOTE_UNMUTED"] = 6] = "REMOTE_AUDIO_REASON_REMOTE_UNMUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_REMOTE_OFFLINE"] = 7] = "REMOTE_AUDIO_REASON_REMOTE_OFFLINE"; - return REMOTE_AUDIO_STATE_REASON2; -})(REMOTE_AUDIO_STATE_REASON || {}); -var REMOTE_VIDEO_STATE = /* @__PURE__ */ ((REMOTE_VIDEO_STATE2) => { - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_STOPPED"] = 0] = "REMOTE_VIDEO_STATE_STOPPED"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_STARTING"] = 1] = "REMOTE_VIDEO_STATE_STARTING"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_DECODING"] = 2] = "REMOTE_VIDEO_STATE_DECODING"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_FROZEN"] = 3] = "REMOTE_VIDEO_STATE_FROZEN"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_FAILED"] = 4] = "REMOTE_VIDEO_STATE_FAILED"; - return REMOTE_VIDEO_STATE2; -})(REMOTE_VIDEO_STATE || {}); -var REMOTE_VIDEO_STATE_REASON = /* @__PURE__ */ ((REMOTE_VIDEO_STATE_REASON2) => { - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_INTERNAL"] = 0] = "REMOTE_VIDEO_STATE_REASON_INTERNAL"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION"] = 1] = "REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY"] = 2] = "REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED"] = 3] = "REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED"] = 4] = "REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED"] = 5] = "REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED"] = 6] = "REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE"] = 7] = "REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK"] = 8] = "REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY"] = 9] = "REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW"] = 10] = "REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH"] = 11] = "REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_SDK_IN_BACKGROUND"] = 12] = "REMOTE_VIDEO_STATE_REASON_SDK_IN_BACKGROUND"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_CODEC_NOT_SUPPORT"] = 13] = "REMOTE_VIDEO_STATE_REASON_CODEC_NOT_SUPPORT"; - return REMOTE_VIDEO_STATE_REASON2; -})(REMOTE_VIDEO_STATE_REASON || {}); -var REMOTE_USER_STATE = /* @__PURE__ */ ((REMOTE_USER_STATE2) => { - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_MUTE_AUDIO"] = 1] = "USER_STATE_MUTE_AUDIO"; - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_MUTE_VIDEO"] = 2] = "USER_STATE_MUTE_VIDEO"; - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_ENABLE_VIDEO"] = 16] = "USER_STATE_ENABLE_VIDEO"; - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_ENABLE_LOCAL_VIDEO"] = 256] = "USER_STATE_ENABLE_LOCAL_VIDEO"; - return REMOTE_USER_STATE2; -})(REMOTE_USER_STATE || {}); -var VideoTrackInfo = class { -}; -var REMOTE_VIDEO_DOWNSCALE_LEVEL = /* @__PURE__ */ ((REMOTE_VIDEO_DOWNSCALE_LEVEL2) => { - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE"] = 0] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_1"] = 1] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_1"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_2"] = 2] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_2"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_3"] = 3] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_3"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_4"] = 4] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_4"; - return REMOTE_VIDEO_DOWNSCALE_LEVEL2; -})(REMOTE_VIDEO_DOWNSCALE_LEVEL || {}); -var AudioVolumeInfo = class { -}; -var DeviceInfo = class { -}; -var Packet = class { -}; -var AUDIO_SAMPLE_RATE_TYPE = /* @__PURE__ */ ((AUDIO_SAMPLE_RATE_TYPE2) => { - AUDIO_SAMPLE_RATE_TYPE2[AUDIO_SAMPLE_RATE_TYPE2["AUDIO_SAMPLE_RATE_32000"] = 32e3] = "AUDIO_SAMPLE_RATE_32000"; - AUDIO_SAMPLE_RATE_TYPE2[AUDIO_SAMPLE_RATE_TYPE2["AUDIO_SAMPLE_RATE_44100"] = 44100] = "AUDIO_SAMPLE_RATE_44100"; - AUDIO_SAMPLE_RATE_TYPE2[AUDIO_SAMPLE_RATE_TYPE2["AUDIO_SAMPLE_RATE_48000"] = 48e3] = "AUDIO_SAMPLE_RATE_48000"; - return AUDIO_SAMPLE_RATE_TYPE2; -})(AUDIO_SAMPLE_RATE_TYPE || {}); -var VIDEO_CODEC_TYPE_FOR_STREAM = /* @__PURE__ */ ((VIDEO_CODEC_TYPE_FOR_STREAM2) => { - VIDEO_CODEC_TYPE_FOR_STREAM2[VIDEO_CODEC_TYPE_FOR_STREAM2["VIDEO_CODEC_H264_FOR_STREAM"] = 1] = "VIDEO_CODEC_H264_FOR_STREAM"; - VIDEO_CODEC_TYPE_FOR_STREAM2[VIDEO_CODEC_TYPE_FOR_STREAM2["VIDEO_CODEC_H265_FOR_STREAM"] = 2] = "VIDEO_CODEC_H265_FOR_STREAM"; - return VIDEO_CODEC_TYPE_FOR_STREAM2; -})(VIDEO_CODEC_TYPE_FOR_STREAM || {}); -var VIDEO_CODEC_PROFILE_TYPE = /* @__PURE__ */ ((VIDEO_CODEC_PROFILE_TYPE2) => { - VIDEO_CODEC_PROFILE_TYPE2[VIDEO_CODEC_PROFILE_TYPE2["VIDEO_CODEC_PROFILE_BASELINE"] = 66] = "VIDEO_CODEC_PROFILE_BASELINE"; - VIDEO_CODEC_PROFILE_TYPE2[VIDEO_CODEC_PROFILE_TYPE2["VIDEO_CODEC_PROFILE_MAIN"] = 77] = "VIDEO_CODEC_PROFILE_MAIN"; - VIDEO_CODEC_PROFILE_TYPE2[VIDEO_CODEC_PROFILE_TYPE2["VIDEO_CODEC_PROFILE_HIGH"] = 100] = "VIDEO_CODEC_PROFILE_HIGH"; - return VIDEO_CODEC_PROFILE_TYPE2; -})(VIDEO_CODEC_PROFILE_TYPE || {}); -var AUDIO_CODEC_PROFILE_TYPE = /* @__PURE__ */ ((AUDIO_CODEC_PROFILE_TYPE2) => { - AUDIO_CODEC_PROFILE_TYPE2[AUDIO_CODEC_PROFILE_TYPE2["AUDIO_CODEC_PROFILE_LC_AAC"] = 0] = "AUDIO_CODEC_PROFILE_LC_AAC"; - AUDIO_CODEC_PROFILE_TYPE2[AUDIO_CODEC_PROFILE_TYPE2["AUDIO_CODEC_PROFILE_HE_AAC"] = 1] = "AUDIO_CODEC_PROFILE_HE_AAC"; - AUDIO_CODEC_PROFILE_TYPE2[AUDIO_CODEC_PROFILE_TYPE2["AUDIO_CODEC_PROFILE_HE_AAC_V2"] = 2] = "AUDIO_CODEC_PROFILE_HE_AAC_V2"; - return AUDIO_CODEC_PROFILE_TYPE2; -})(AUDIO_CODEC_PROFILE_TYPE || {}); -var LocalAudioStats = class { -}; -var RTMP_STREAM_PUBLISH_STATE = /* @__PURE__ */ ((RTMP_STREAM_PUBLISH_STATE2) => { - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_IDLE"] = 0] = "RTMP_STREAM_PUBLISH_STATE_IDLE"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_CONNECTING"] = 1] = "RTMP_STREAM_PUBLISH_STATE_CONNECTING"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_RUNNING"] = 2] = "RTMP_STREAM_PUBLISH_STATE_RUNNING"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_RECOVERING"] = 3] = "RTMP_STREAM_PUBLISH_STATE_RECOVERING"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_FAILURE"] = 4] = "RTMP_STREAM_PUBLISH_STATE_FAILURE"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_DISCONNECTING"] = 5] = "RTMP_STREAM_PUBLISH_STATE_DISCONNECTING"; - return RTMP_STREAM_PUBLISH_STATE2; -})(RTMP_STREAM_PUBLISH_STATE || {}); -var RTMP_STREAM_PUBLISH_ERROR_TYPE = /* @__PURE__ */ ((RTMP_STREAM_PUBLISH_ERROR_TYPE2) => { - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_OK"] = 0] = "RTMP_STREAM_PUBLISH_ERROR_OK"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT"] = 1] = "RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED"] = 2] = "RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT"] = 3] = "RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR"] = 4] = "RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR"] = 5] = "RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN"] = 6] = "RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT"] = 7] = "RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED"] = 8] = "RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND"] = 9] = "RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED"] = 10] = "RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER"] = 11] = "RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM"] = 13] = "RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_NET_DOWN"] = 14] = "RTMP_STREAM_PUBLISH_ERROR_NET_DOWN"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID"] = 15] = "RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE"] = 16] = "RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_UNPUBLISH_ERROR_OK"] = 100] = "RTMP_STREAM_UNPUBLISH_ERROR_OK"; - return RTMP_STREAM_PUBLISH_ERROR_TYPE2; -})(RTMP_STREAM_PUBLISH_ERROR_TYPE || {}); -var RTMP_STREAMING_EVENT = /* @__PURE__ */ ((RTMP_STREAMING_EVENT2) => { - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE"] = 1] = "RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE"; - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE"] = 2] = "RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE"; - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT"] = 3] = "RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT"; - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_REQUEST_TOO_OFTEN"] = 4] = "RTMP_STREAMING_EVENT_REQUEST_TOO_OFTEN"; - return RTMP_STREAMING_EVENT2; -})(RTMP_STREAMING_EVENT || {}); -var RtcImage = class { -}; -var LiveStreamAdvancedFeature = class { -}; -var CONNECTION_STATE_TYPE = /* @__PURE__ */ ((CONNECTION_STATE_TYPE2) => { - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_DISCONNECTED"] = 1] = "CONNECTION_STATE_DISCONNECTED"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_CONNECTING"] = 2] = "CONNECTION_STATE_CONNECTING"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_CONNECTED"] = 3] = "CONNECTION_STATE_CONNECTED"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_RECONNECTING"] = 4] = "CONNECTION_STATE_RECONNECTING"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_FAILED"] = 5] = "CONNECTION_STATE_FAILED"; - return CONNECTION_STATE_TYPE2; -})(CONNECTION_STATE_TYPE || {}); -var TranscodingUser = class { -}; -var LiveTranscoding = class { -}; -var TranscodingVideoStream = class { -}; -var LocalTranscoderConfiguration = class { -}; -var VIDEO_TRANSCODER_ERROR = /* @__PURE__ */ ((VIDEO_TRANSCODER_ERROR2) => { - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_OK"] = 0] = "VT_ERR_OK"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_VIDEO_SOURCE_NOT_READY"] = 1] = "VT_ERR_VIDEO_SOURCE_NOT_READY"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INVALID_VIDEO_SOURCE_TYPE"] = 2] = "VT_ERR_INVALID_VIDEO_SOURCE_TYPE"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INVALID_IMAGE_PATH"] = 3] = "VT_ERR_INVALID_IMAGE_PATH"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_UNSUPPORT_IMAGE_FORMAT"] = 4] = "VT_ERR_UNSUPPORT_IMAGE_FORMAT"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INVALID_LAYOUT"] = 5] = "VT_ERR_INVALID_LAYOUT"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INTERNAL"] = 20] = "VT_ERR_INTERNAL"; - return VIDEO_TRANSCODER_ERROR2; -})(VIDEO_TRANSCODER_ERROR || {}); -var LastmileProbeConfig = class { -}; -var LASTMILE_PROBE_RESULT_STATE = /* @__PURE__ */ ((LASTMILE_PROBE_RESULT_STATE2) => { - LASTMILE_PROBE_RESULT_STATE2[LASTMILE_PROBE_RESULT_STATE2["LASTMILE_PROBE_RESULT_COMPLETE"] = 1] = "LASTMILE_PROBE_RESULT_COMPLETE"; - LASTMILE_PROBE_RESULT_STATE2[LASTMILE_PROBE_RESULT_STATE2["LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE"] = 2] = "LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE"; - LASTMILE_PROBE_RESULT_STATE2[LASTMILE_PROBE_RESULT_STATE2["LASTMILE_PROBE_RESULT_UNAVAILABLE"] = 3] = "LASTMILE_PROBE_RESULT_UNAVAILABLE"; - return LASTMILE_PROBE_RESULT_STATE2; -})(LASTMILE_PROBE_RESULT_STATE || {}); -var LastmileProbeOneWayResult = class { -}; -var LastmileProbeResult = class { -}; -var CONNECTION_CHANGED_REASON_TYPE = /* @__PURE__ */ ((CONNECTION_CHANGED_REASON_TYPE2) => { - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CONNECTING"] = 0] = "CONNECTION_CHANGED_CONNECTING"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_JOIN_SUCCESS"] = 1] = "CONNECTION_CHANGED_JOIN_SUCCESS"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INTERRUPTED"] = 2] = "CONNECTION_CHANGED_INTERRUPTED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_BANNED_BY_SERVER"] = 3] = "CONNECTION_CHANGED_BANNED_BY_SERVER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_JOIN_FAILED"] = 4] = "CONNECTION_CHANGED_JOIN_FAILED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_LEAVE_CHANNEL"] = 5] = "CONNECTION_CHANGED_LEAVE_CHANNEL"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INVALID_APP_ID"] = 6] = "CONNECTION_CHANGED_INVALID_APP_ID"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INVALID_CHANNEL_NAME"] = 7] = "CONNECTION_CHANGED_INVALID_CHANNEL_NAME"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INVALID_TOKEN"] = 8] = "CONNECTION_CHANGED_INVALID_TOKEN"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_TOKEN_EXPIRED"] = 9] = "CONNECTION_CHANGED_TOKEN_EXPIRED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_REJECTED_BY_SERVER"] = 10] = "CONNECTION_CHANGED_REJECTED_BY_SERVER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_SETTING_PROXY_SERVER"] = 11] = "CONNECTION_CHANGED_SETTING_PROXY_SERVER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_RENEW_TOKEN"] = 12] = "CONNECTION_CHANGED_RENEW_TOKEN"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED"] = 13] = "CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT"] = 14] = "CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_REJOIN_SUCCESS"] = 15] = "CONNECTION_CHANGED_REJOIN_SUCCESS"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_LOST"] = 16] = "CONNECTION_CHANGED_LOST"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_ECHO_TEST"] = 17] = "CONNECTION_CHANGED_ECHO_TEST"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER"] = 18] = "CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_SAME_UID_LOGIN"] = 19] = "CONNECTION_CHANGED_SAME_UID_LOGIN"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_TOO_MANY_BROADCASTERS"] = 20] = "CONNECTION_CHANGED_TOO_MANY_BROADCASTERS"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE"] = 21] = "CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE"] = 22] = "CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE"; - return CONNECTION_CHANGED_REASON_TYPE2; -})(CONNECTION_CHANGED_REASON_TYPE || {}); -var CLIENT_ROLE_CHANGE_FAILED_REASON = /* @__PURE__ */ ((CLIENT_ROLE_CHANGE_FAILED_REASON2) => { - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS"] = 1] = "CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS"; - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED"] = 2] = "CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED"; - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"] = 3] = "CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"; - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"] = 4] = "CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"; - return CLIENT_ROLE_CHANGE_FAILED_REASON2; -})(CLIENT_ROLE_CHANGE_FAILED_REASON || {}); -var WLACC_MESSAGE_REASON = /* @__PURE__ */ ((WLACC_MESSAGE_REASON2) => { - WLACC_MESSAGE_REASON2[WLACC_MESSAGE_REASON2["WLACC_MESSAGE_REASON_WEAK_SIGNAL"] = 0] = "WLACC_MESSAGE_REASON_WEAK_SIGNAL"; - WLACC_MESSAGE_REASON2[WLACC_MESSAGE_REASON2["WLACC_MESSAGE_REASON_CHANNEL_CONGESTION"] = 1] = "WLACC_MESSAGE_REASON_CHANNEL_CONGESTION"; - return WLACC_MESSAGE_REASON2; -})(WLACC_MESSAGE_REASON || {}); -var WLACC_SUGGEST_ACTION = /* @__PURE__ */ ((WLACC_SUGGEST_ACTION2) => { - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_CLOSE_TO_WIFI"] = 0] = "WLACC_SUGGEST_ACTION_CLOSE_TO_WIFI"; - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_CONNECT_SSID"] = 1] = "WLACC_SUGGEST_ACTION_CONNECT_SSID"; - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_CHECK_5G"] = 2] = "WLACC_SUGGEST_ACTION_CHECK_5G"; - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_MODIFY_SSID"] = 3] = "WLACC_SUGGEST_ACTION_MODIFY_SSID"; - return WLACC_SUGGEST_ACTION2; -})(WLACC_SUGGEST_ACTION || {}); -var WlAccStats = class { -}; -var NETWORK_TYPE = /* @__PURE__ */ ((NETWORK_TYPE2) => { - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_UNKNOWN"] = -1] = "NETWORK_TYPE_UNKNOWN"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_DISCONNECTED"] = 0] = "NETWORK_TYPE_DISCONNECTED"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_LAN"] = 1] = "NETWORK_TYPE_LAN"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_WIFI"] = 2] = "NETWORK_TYPE_WIFI"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_2G"] = 3] = "NETWORK_TYPE_MOBILE_2G"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_3G"] = 4] = "NETWORK_TYPE_MOBILE_3G"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_4G"] = 5] = "NETWORK_TYPE_MOBILE_4G"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_5G"] = 6] = "NETWORK_TYPE_MOBILE_5G"; - return NETWORK_TYPE2; -})(NETWORK_TYPE || {}); -var VIDEO_VIEW_SETUP_MODE = /* @__PURE__ */ ((VIDEO_VIEW_SETUP_MODE2) => { - VIDEO_VIEW_SETUP_MODE2[VIDEO_VIEW_SETUP_MODE2["VIDEO_VIEW_SETUP_REPLACE"] = 0] = "VIDEO_VIEW_SETUP_REPLACE"; - VIDEO_VIEW_SETUP_MODE2[VIDEO_VIEW_SETUP_MODE2["VIDEO_VIEW_SETUP_ADD"] = 1] = "VIDEO_VIEW_SETUP_ADD"; - VIDEO_VIEW_SETUP_MODE2[VIDEO_VIEW_SETUP_MODE2["VIDEO_VIEW_SETUP_REMOVE"] = 2] = "VIDEO_VIEW_SETUP_REMOVE"; - return VIDEO_VIEW_SETUP_MODE2; -})(VIDEO_VIEW_SETUP_MODE || {}); -var VideoCanvas = class { -}; -var LIGHTENING_CONTRAST_LEVEL = /* @__PURE__ */ ((LIGHTENING_CONTRAST_LEVEL2) => { - LIGHTENING_CONTRAST_LEVEL2[LIGHTENING_CONTRAST_LEVEL2["LIGHTENING_CONTRAST_LOW"] = 0] = "LIGHTENING_CONTRAST_LOW"; - LIGHTENING_CONTRAST_LEVEL2[LIGHTENING_CONTRAST_LEVEL2["LIGHTENING_CONTRAST_NORMAL"] = 1] = "LIGHTENING_CONTRAST_NORMAL"; - LIGHTENING_CONTRAST_LEVEL2[LIGHTENING_CONTRAST_LEVEL2["LIGHTENING_CONTRAST_HIGH"] = 2] = "LIGHTENING_CONTRAST_HIGH"; - return LIGHTENING_CONTRAST_LEVEL2; -})(LIGHTENING_CONTRAST_LEVEL || {}); -var BeautyOptions = class { -}; -var LOW_LIGHT_ENHANCE_MODE = /* @__PURE__ */ ((LOW_LIGHT_ENHANCE_MODE2) => { - LOW_LIGHT_ENHANCE_MODE2[LOW_LIGHT_ENHANCE_MODE2["LOW_LIGHT_ENHANCE_AUTO"] = 0] = "LOW_LIGHT_ENHANCE_AUTO"; - LOW_LIGHT_ENHANCE_MODE2[LOW_LIGHT_ENHANCE_MODE2["LOW_LIGHT_ENHANCE_MANUAL"] = 1] = "LOW_LIGHT_ENHANCE_MANUAL"; - return LOW_LIGHT_ENHANCE_MODE2; -})(LOW_LIGHT_ENHANCE_MODE || {}); -var LOW_LIGHT_ENHANCE_LEVEL = /* @__PURE__ */ ((LOW_LIGHT_ENHANCE_LEVEL2) => { - LOW_LIGHT_ENHANCE_LEVEL2[LOW_LIGHT_ENHANCE_LEVEL2["LOW_LIGHT_ENHANCE_LEVEL_HIGH_QUALITY"] = 0] = "LOW_LIGHT_ENHANCE_LEVEL_HIGH_QUALITY"; - LOW_LIGHT_ENHANCE_LEVEL2[LOW_LIGHT_ENHANCE_LEVEL2["LOW_LIGHT_ENHANCE_LEVEL_FAST"] = 1] = "LOW_LIGHT_ENHANCE_LEVEL_FAST"; - return LOW_LIGHT_ENHANCE_LEVEL2; -})(LOW_LIGHT_ENHANCE_LEVEL || {}); -var LowlightEnhanceOptions = class { -}; -var VIDEO_DENOISER_MODE = /* @__PURE__ */ ((VIDEO_DENOISER_MODE2) => { - VIDEO_DENOISER_MODE2[VIDEO_DENOISER_MODE2["VIDEO_DENOISER_AUTO"] = 0] = "VIDEO_DENOISER_AUTO"; - VIDEO_DENOISER_MODE2[VIDEO_DENOISER_MODE2["VIDEO_DENOISER_MANUAL"] = 1] = "VIDEO_DENOISER_MANUAL"; - return VIDEO_DENOISER_MODE2; -})(VIDEO_DENOISER_MODE || {}); -var VIDEO_DENOISER_LEVEL = /* @__PURE__ */ ((VIDEO_DENOISER_LEVEL2) => { - VIDEO_DENOISER_LEVEL2[VIDEO_DENOISER_LEVEL2["VIDEO_DENOISER_LEVEL_HIGH_QUALITY"] = 0] = "VIDEO_DENOISER_LEVEL_HIGH_QUALITY"; - VIDEO_DENOISER_LEVEL2[VIDEO_DENOISER_LEVEL2["VIDEO_DENOISER_LEVEL_FAST"] = 1] = "VIDEO_DENOISER_LEVEL_FAST"; - VIDEO_DENOISER_LEVEL2[VIDEO_DENOISER_LEVEL2["VIDEO_DENOISER_LEVEL_STRENGTH"] = 2] = "VIDEO_DENOISER_LEVEL_STRENGTH"; - return VIDEO_DENOISER_LEVEL2; -})(VIDEO_DENOISER_LEVEL || {}); -var VideoDenoiserOptions = class { -}; -var ColorEnhanceOptions = class { -}; -var BACKGROUND_SOURCE_TYPE = /* @__PURE__ */ ((BACKGROUND_SOURCE_TYPE2) => { - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_NONE"] = 0] = "BACKGROUND_NONE"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_COLOR"] = 1] = "BACKGROUND_COLOR"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_IMG"] = 2] = "BACKGROUND_IMG"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_BLUR"] = 3] = "BACKGROUND_BLUR"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_VIDEO"] = 4] = "BACKGROUND_VIDEO"; - return BACKGROUND_SOURCE_TYPE2; -})(BACKGROUND_SOURCE_TYPE || {}); -var BACKGROUND_BLUR_DEGREE = /* @__PURE__ */ ((BACKGROUND_BLUR_DEGREE2) => { - BACKGROUND_BLUR_DEGREE2[BACKGROUND_BLUR_DEGREE2["BLUR_DEGREE_LOW"] = 1] = "BLUR_DEGREE_LOW"; - BACKGROUND_BLUR_DEGREE2[BACKGROUND_BLUR_DEGREE2["BLUR_DEGREE_MEDIUM"] = 2] = "BLUR_DEGREE_MEDIUM"; - BACKGROUND_BLUR_DEGREE2[BACKGROUND_BLUR_DEGREE2["BLUR_DEGREE_HIGH"] = 3] = "BLUR_DEGREE_HIGH"; - return BACKGROUND_BLUR_DEGREE2; -})(BACKGROUND_BLUR_DEGREE || {}); -var VirtualBackgroundSource = class { -}; -var SEG_MODEL_TYPE = /* @__PURE__ */ ((SEG_MODEL_TYPE2) => { - SEG_MODEL_TYPE2[SEG_MODEL_TYPE2["SEG_MODEL_AI"] = 1] = "SEG_MODEL_AI"; - SEG_MODEL_TYPE2[SEG_MODEL_TYPE2["SEG_MODEL_GREEN"] = 2] = "SEG_MODEL_GREEN"; - return SEG_MODEL_TYPE2; -})(SEG_MODEL_TYPE || {}); -var SegmentationProperty = class { -}; -var AUDIO_TRACK_TYPE = /* @__PURE__ */ ((AUDIO_TRACK_TYPE2) => { - AUDIO_TRACK_TYPE2[AUDIO_TRACK_TYPE2["AUDIO_TRACK_INVALID"] = -1] = "AUDIO_TRACK_INVALID"; - AUDIO_TRACK_TYPE2[AUDIO_TRACK_TYPE2["AUDIO_TRACK_MIXABLE"] = 0] = "AUDIO_TRACK_MIXABLE"; - AUDIO_TRACK_TYPE2[AUDIO_TRACK_TYPE2["AUDIO_TRACK_DIRECT"] = 1] = "AUDIO_TRACK_DIRECT"; - return AUDIO_TRACK_TYPE2; -})(AUDIO_TRACK_TYPE || {}); -var AudioTrackConfig = class { -}; -var VOICE_BEAUTIFIER_PRESET = /* @__PURE__ */ ((VOICE_BEAUTIFIER_PRESET2) => { - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["VOICE_BEAUTIFIER_OFF"] = 0] = "VOICE_BEAUTIFIER_OFF"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["CHAT_BEAUTIFIER_MAGNETIC"] = 16843008] = "CHAT_BEAUTIFIER_MAGNETIC"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["CHAT_BEAUTIFIER_FRESH"] = 16843264] = "CHAT_BEAUTIFIER_FRESH"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["CHAT_BEAUTIFIER_VITALITY"] = 16843520] = "CHAT_BEAUTIFIER_VITALITY"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["SINGING_BEAUTIFIER"] = 16908544] = "SINGING_BEAUTIFIER"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_VIGOROUS"] = 16974080] = "TIMBRE_TRANSFORMATION_VIGOROUS"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_DEEP"] = 16974336] = "TIMBRE_TRANSFORMATION_DEEP"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_MELLOW"] = 16974592] = "TIMBRE_TRANSFORMATION_MELLOW"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_FALSETTO"] = 16974848] = "TIMBRE_TRANSFORMATION_FALSETTO"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_FULL"] = 16975104] = "TIMBRE_TRANSFORMATION_FULL"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_CLEAR"] = 16975360] = "TIMBRE_TRANSFORMATION_CLEAR"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_RESOUNDING"] = 16975616] = "TIMBRE_TRANSFORMATION_RESOUNDING"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_RINGING"] = 16975872] = "TIMBRE_TRANSFORMATION_RINGING"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["ULTRA_HIGH_QUALITY_VOICE"] = 17039616] = "ULTRA_HIGH_QUALITY_VOICE"; - return VOICE_BEAUTIFIER_PRESET2; -})(VOICE_BEAUTIFIER_PRESET || {}); -var AUDIO_EFFECT_PRESET = /* @__PURE__ */ ((AUDIO_EFFECT_PRESET2) => { - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["AUDIO_EFFECT_OFF"] = 0] = "AUDIO_EFFECT_OFF"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_KTV"] = 33620224] = "ROOM_ACOUSTICS_KTV"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_VOCAL_CONCERT"] = 33620480] = "ROOM_ACOUSTICS_VOCAL_CONCERT"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_STUDIO"] = 33620736] = "ROOM_ACOUSTICS_STUDIO"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_PHONOGRAPH"] = 33620992] = "ROOM_ACOUSTICS_PHONOGRAPH"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_VIRTUAL_STEREO"] = 33621248] = "ROOM_ACOUSTICS_VIRTUAL_STEREO"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_SPACIAL"] = 33621504] = "ROOM_ACOUSTICS_SPACIAL"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_ETHEREAL"] = 33621760] = "ROOM_ACOUSTICS_ETHEREAL"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_3D_VOICE"] = 33622016] = "ROOM_ACOUSTICS_3D_VOICE"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND"] = 33622272] = "ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_UNCLE"] = 33685760] = "VOICE_CHANGER_EFFECT_UNCLE"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_OLDMAN"] = 33686016] = "VOICE_CHANGER_EFFECT_OLDMAN"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_BOY"] = 33686272] = "VOICE_CHANGER_EFFECT_BOY"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_SISTER"] = 33686528] = "VOICE_CHANGER_EFFECT_SISTER"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_GIRL"] = 33686784] = "VOICE_CHANGER_EFFECT_GIRL"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_PIGKING"] = 33687040] = "VOICE_CHANGER_EFFECT_PIGKING"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_HULK"] = 33687296] = "VOICE_CHANGER_EFFECT_HULK"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["STYLE_TRANSFORMATION_RNB"] = 33751296] = "STYLE_TRANSFORMATION_RNB"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["STYLE_TRANSFORMATION_POPULAR"] = 33751552] = "STYLE_TRANSFORMATION_POPULAR"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["PITCH_CORRECTION"] = 33816832] = "PITCH_CORRECTION"; - return AUDIO_EFFECT_PRESET2; -})(AUDIO_EFFECT_PRESET || {}); -var VOICE_CONVERSION_PRESET = /* @__PURE__ */ ((VOICE_CONVERSION_PRESET2) => { - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CONVERSION_OFF"] = 0] = "VOICE_CONVERSION_OFF"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_NEUTRAL"] = 50397440] = "VOICE_CHANGER_NEUTRAL"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_SWEET"] = 50397696] = "VOICE_CHANGER_SWEET"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_SOLID"] = 50397952] = "VOICE_CHANGER_SOLID"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_BASS"] = 50398208] = "VOICE_CHANGER_BASS"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_CARTOON"] = 50398464] = "VOICE_CHANGER_CARTOON"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_CHILDLIKE"] = 50398720] = "VOICE_CHANGER_CHILDLIKE"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_PHONE_OPERATOR"] = 50398976] = "VOICE_CHANGER_PHONE_OPERATOR"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_MONSTER"] = 50399232] = "VOICE_CHANGER_MONSTER"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_TRANSFORMERS"] = 50399488] = "VOICE_CHANGER_TRANSFORMERS"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_GROOT"] = 50399744] = "VOICE_CHANGER_GROOT"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_DARTH_VADER"] = 504e5] = "VOICE_CHANGER_DARTH_VADER"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_IRON_LADY"] = 50400256] = "VOICE_CHANGER_IRON_LADY"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_SHIN_CHAN"] = 50400512] = "VOICE_CHANGER_SHIN_CHAN"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_GIRLISH_MAN"] = 50400768] = "VOICE_CHANGER_GIRLISH_MAN"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_CHIPMUNK"] = 50401024] = "VOICE_CHANGER_CHIPMUNK"; - return VOICE_CONVERSION_PRESET2; -})(VOICE_CONVERSION_PRESET || {}); -var HEADPHONE_EQUALIZER_PRESET = /* @__PURE__ */ ((HEADPHONE_EQUALIZER_PRESET2) => { - HEADPHONE_EQUALIZER_PRESET2[HEADPHONE_EQUALIZER_PRESET2["HEADPHONE_EQUALIZER_OFF"] = 0] = "HEADPHONE_EQUALIZER_OFF"; - HEADPHONE_EQUALIZER_PRESET2[HEADPHONE_EQUALIZER_PRESET2["HEADPHONE_EQUALIZER_OVEREAR"] = 67108865] = "HEADPHONE_EQUALIZER_OVEREAR"; - HEADPHONE_EQUALIZER_PRESET2[HEADPHONE_EQUALIZER_PRESET2["HEADPHONE_EQUALIZER_INEAR"] = 67108866] = "HEADPHONE_EQUALIZER_INEAR"; - return HEADPHONE_EQUALIZER_PRESET2; -})(HEADPHONE_EQUALIZER_PRESET || {}); -var ScreenCaptureParameters = class { -}; -var AUDIO_RECORDING_QUALITY_TYPE = /* @__PURE__ */ ((AUDIO_RECORDING_QUALITY_TYPE2) => { - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_LOW"] = 0] = "AUDIO_RECORDING_QUALITY_LOW"; - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_MEDIUM"] = 1] = "AUDIO_RECORDING_QUALITY_MEDIUM"; - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_HIGH"] = 2] = "AUDIO_RECORDING_QUALITY_HIGH"; - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_ULTRA_HIGH"] = 3] = "AUDIO_RECORDING_QUALITY_ULTRA_HIGH"; - return AUDIO_RECORDING_QUALITY_TYPE2; -})(AUDIO_RECORDING_QUALITY_TYPE || {}); -var AUDIO_FILE_RECORDING_TYPE = /* @__PURE__ */ ((AUDIO_FILE_RECORDING_TYPE2) => { - AUDIO_FILE_RECORDING_TYPE2[AUDIO_FILE_RECORDING_TYPE2["AUDIO_FILE_RECORDING_MIC"] = 1] = "AUDIO_FILE_RECORDING_MIC"; - AUDIO_FILE_RECORDING_TYPE2[AUDIO_FILE_RECORDING_TYPE2["AUDIO_FILE_RECORDING_PLAYBACK"] = 2] = "AUDIO_FILE_RECORDING_PLAYBACK"; - AUDIO_FILE_RECORDING_TYPE2[AUDIO_FILE_RECORDING_TYPE2["AUDIO_FILE_RECORDING_MIXED"] = 3] = "AUDIO_FILE_RECORDING_MIXED"; - return AUDIO_FILE_RECORDING_TYPE2; -})(AUDIO_FILE_RECORDING_TYPE || {}); -var AUDIO_ENCODED_FRAME_OBSERVER_POSITION = /* @__PURE__ */ ((AUDIO_ENCODED_FRAME_OBSERVER_POSITION2) => { - AUDIO_ENCODED_FRAME_OBSERVER_POSITION2[AUDIO_ENCODED_FRAME_OBSERVER_POSITION2["AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD"] = 1] = "AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD"; - AUDIO_ENCODED_FRAME_OBSERVER_POSITION2[AUDIO_ENCODED_FRAME_OBSERVER_POSITION2["AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK"] = 2] = "AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK"; - AUDIO_ENCODED_FRAME_OBSERVER_POSITION2[AUDIO_ENCODED_FRAME_OBSERVER_POSITION2["AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED"] = 3] = "AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED"; - return AUDIO_ENCODED_FRAME_OBSERVER_POSITION2; -})(AUDIO_ENCODED_FRAME_OBSERVER_POSITION || {}); -var AudioRecordingConfiguration = class { -}; -var AudioEncodedFrameObserverConfig = class { -}; -var AREA_CODE = /* @__PURE__ */ ((AREA_CODE2) => { - AREA_CODE2[AREA_CODE2["AREA_CODE_CN"] = 1] = "AREA_CODE_CN"; - AREA_CODE2[AREA_CODE2["AREA_CODE_NA"] = 2] = "AREA_CODE_NA"; - AREA_CODE2[AREA_CODE2["AREA_CODE_EU"] = 4] = "AREA_CODE_EU"; - AREA_CODE2[AREA_CODE2["AREA_CODE_AS"] = 8] = "AREA_CODE_AS"; - AREA_CODE2[AREA_CODE2["AREA_CODE_JP"] = 16] = "AREA_CODE_JP"; - AREA_CODE2[AREA_CODE2["AREA_CODE_IN"] = 32] = "AREA_CODE_IN"; - AREA_CODE2[AREA_CODE2["AREA_CODE_GLOB"] = 4294967295] = "AREA_CODE_GLOB"; - return AREA_CODE2; -})(AREA_CODE || {}); -var AREA_CODE_EX = /* @__PURE__ */ ((AREA_CODE_EX2) => { - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_OC"] = 64] = "AREA_CODE_OC"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_SA"] = 128] = "AREA_CODE_SA"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_AF"] = 256] = "AREA_CODE_AF"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_KR"] = 512] = "AREA_CODE_KR"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_HKMC"] = 1024] = "AREA_CODE_HKMC"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_US"] = 2048] = "AREA_CODE_US"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_OVS"] = 4294967294] = "AREA_CODE_OVS"; - return AREA_CODE_EX2; -})(AREA_CODE_EX || {}); -var CHANNEL_MEDIA_RELAY_ERROR = /* @__PURE__ */ ((CHANNEL_MEDIA_RELAY_ERROR2) => { - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_OK"] = 0] = "RELAY_OK"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SERVER_ERROR_RESPONSE"] = 1] = "RELAY_ERROR_SERVER_ERROR_RESPONSE"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SERVER_NO_RESPONSE"] = 2] = "RELAY_ERROR_SERVER_NO_RESPONSE"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_NO_RESOURCE_AVAILABLE"] = 3] = "RELAY_ERROR_NO_RESOURCE_AVAILABLE"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_JOIN_SRC"] = 4] = "RELAY_ERROR_FAILED_JOIN_SRC"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_JOIN_DEST"] = 5] = "RELAY_ERROR_FAILED_JOIN_DEST"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC"] = 6] = "RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST"] = 7] = "RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SERVER_CONNECTION_LOST"] = 8] = "RELAY_ERROR_SERVER_CONNECTION_LOST"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_INTERNAL_ERROR"] = 9] = "RELAY_ERROR_INTERNAL_ERROR"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SRC_TOKEN_EXPIRED"] = 10] = "RELAY_ERROR_SRC_TOKEN_EXPIRED"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_DEST_TOKEN_EXPIRED"] = 11] = "RELAY_ERROR_DEST_TOKEN_EXPIRED"; - return CHANNEL_MEDIA_RELAY_ERROR2; -})(CHANNEL_MEDIA_RELAY_ERROR || {}); -var CHANNEL_MEDIA_RELAY_EVENT = /* @__PURE__ */ ((CHANNEL_MEDIA_RELAY_EVENT2) => { - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_NETWORK_DISCONNECTED"] = 0] = "RELAY_EVENT_NETWORK_DISCONNECTED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_NETWORK_CONNECTED"] = 1] = "RELAY_EVENT_NETWORK_CONNECTED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL"] = 2] = "RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL"] = 3] = "RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL"] = 4] = "RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC"] = 5] = "RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC"] = 6] = "RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL"] = 7] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED"] = 8] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE"] = 9] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL"] = 10] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_VIDEO_PROFILE_UPDATE"] = 11] = "RELAY_EVENT_VIDEO_PROFILE_UPDATE"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"] = 12] = "RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED"] = 13] = "RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"] = 14] = "RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED"] = 15] = "RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED"; - return CHANNEL_MEDIA_RELAY_EVENT2; -})(CHANNEL_MEDIA_RELAY_EVENT || {}); -var CHANNEL_MEDIA_RELAY_STATE = /* @__PURE__ */ ((CHANNEL_MEDIA_RELAY_STATE2) => { - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_IDLE"] = 0] = "RELAY_STATE_IDLE"; - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_CONNECTING"] = 1] = "RELAY_STATE_CONNECTING"; - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_RUNNING"] = 2] = "RELAY_STATE_RUNNING"; - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_FAILURE"] = 3] = "RELAY_STATE_FAILURE"; - return CHANNEL_MEDIA_RELAY_STATE2; -})(CHANNEL_MEDIA_RELAY_STATE || {}); -var ChannelMediaInfo = class { -}; -var ChannelMediaRelayConfiguration = class { -}; -var UplinkNetworkInfo = class { -}; -var PeerDownlinkInfo = class { -}; -var DownlinkNetworkInfo = class { -}; -var ENCRYPTION_MODE = /* @__PURE__ */ ((ENCRYPTION_MODE2) => { - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_XTS"] = 1] = "AES_128_XTS"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_ECB"] = 2] = "AES_128_ECB"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_256_XTS"] = 3] = "AES_256_XTS"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["SM4_128_ECB"] = 4] = "SM4_128_ECB"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_GCM"] = 5] = "AES_128_GCM"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_256_GCM"] = 6] = "AES_256_GCM"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_GCM2"] = 7] = "AES_128_GCM2"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_256_GCM2"] = 8] = "AES_256_GCM2"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["MODE_END"] = 9] = "MODE_END"; - return ENCRYPTION_MODE2; -})(ENCRYPTION_MODE || {}); -var EncryptionConfig = class { -}; -var ENCRYPTION_ERROR_TYPE = /* @__PURE__ */ ((ENCRYPTION_ERROR_TYPE2) => { - ENCRYPTION_ERROR_TYPE2[ENCRYPTION_ERROR_TYPE2["ENCRYPTION_ERROR_INTERNAL_FAILURE"] = 0] = "ENCRYPTION_ERROR_INTERNAL_FAILURE"; - ENCRYPTION_ERROR_TYPE2[ENCRYPTION_ERROR_TYPE2["ENCRYPTION_ERROR_DECRYPTION_FAILURE"] = 1] = "ENCRYPTION_ERROR_DECRYPTION_FAILURE"; - ENCRYPTION_ERROR_TYPE2[ENCRYPTION_ERROR_TYPE2["ENCRYPTION_ERROR_ENCRYPTION_FAILURE"] = 2] = "ENCRYPTION_ERROR_ENCRYPTION_FAILURE"; - return ENCRYPTION_ERROR_TYPE2; -})(ENCRYPTION_ERROR_TYPE || {}); -var UPLOAD_ERROR_REASON = /* @__PURE__ */ ((UPLOAD_ERROR_REASON2) => { - UPLOAD_ERROR_REASON2[UPLOAD_ERROR_REASON2["UPLOAD_SUCCESS"] = 0] = "UPLOAD_SUCCESS"; - UPLOAD_ERROR_REASON2[UPLOAD_ERROR_REASON2["UPLOAD_NET_ERROR"] = 1] = "UPLOAD_NET_ERROR"; - UPLOAD_ERROR_REASON2[UPLOAD_ERROR_REASON2["UPLOAD_SERVER_ERROR"] = 2] = "UPLOAD_SERVER_ERROR"; - return UPLOAD_ERROR_REASON2; -})(UPLOAD_ERROR_REASON || {}); -var PERMISSION_TYPE = /* @__PURE__ */ ((PERMISSION_TYPE2) => { - PERMISSION_TYPE2[PERMISSION_TYPE2["RECORD_AUDIO"] = 0] = "RECORD_AUDIO"; - PERMISSION_TYPE2[PERMISSION_TYPE2["CAMERA"] = 1] = "CAMERA"; - PERMISSION_TYPE2[PERMISSION_TYPE2["SCREEN_CAPTURE"] = 2] = "SCREEN_CAPTURE"; - return PERMISSION_TYPE2; -})(PERMISSION_TYPE || {}); -var MAX_USER_ACCOUNT_LENGTH_TYPE = /* @__PURE__ */ ((MAX_USER_ACCOUNT_LENGTH_TYPE2) => { - MAX_USER_ACCOUNT_LENGTH_TYPE2[MAX_USER_ACCOUNT_LENGTH_TYPE2["MAX_USER_ACCOUNT_LENGTH"] = 256] = "MAX_USER_ACCOUNT_LENGTH"; - return MAX_USER_ACCOUNT_LENGTH_TYPE2; -})(MAX_USER_ACCOUNT_LENGTH_TYPE || {}); -var STREAM_SUBSCRIBE_STATE = /* @__PURE__ */ ((STREAM_SUBSCRIBE_STATE2) => { - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_IDLE"] = 0] = "SUB_STATE_IDLE"; - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_NO_SUBSCRIBED"] = 1] = "SUB_STATE_NO_SUBSCRIBED"; - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_SUBSCRIBING"] = 2] = "SUB_STATE_SUBSCRIBING"; - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_SUBSCRIBED"] = 3] = "SUB_STATE_SUBSCRIBED"; - return STREAM_SUBSCRIBE_STATE2; -})(STREAM_SUBSCRIBE_STATE || {}); -var STREAM_PUBLISH_STATE = /* @__PURE__ */ ((STREAM_PUBLISH_STATE2) => { - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_IDLE"] = 0] = "PUB_STATE_IDLE"; - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_NO_PUBLISHED"] = 1] = "PUB_STATE_NO_PUBLISHED"; - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_PUBLISHING"] = 2] = "PUB_STATE_PUBLISHING"; - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_PUBLISHED"] = 3] = "PUB_STATE_PUBLISHED"; - return STREAM_PUBLISH_STATE2; -})(STREAM_PUBLISH_STATE || {}); -var EchoTestConfiguration = class { -}; -var UserInfo = class { -}; -var EAR_MONITORING_FILTER_TYPE = /* @__PURE__ */ ((EAR_MONITORING_FILTER_TYPE2) => { - EAR_MONITORING_FILTER_TYPE2[EAR_MONITORING_FILTER_TYPE2["EAR_MONITORING_FILTER_NONE"] = 1] = "EAR_MONITORING_FILTER_NONE"; - EAR_MONITORING_FILTER_TYPE2[EAR_MONITORING_FILTER_TYPE2["EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS"] = 2] = "EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS"; - EAR_MONITORING_FILTER_TYPE2[EAR_MONITORING_FILTER_TYPE2["EAR_MONITORING_FILTER_NOISE_SUPPRESSION"] = 4] = "EAR_MONITORING_FILTER_NOISE_SUPPRESSION"; - return EAR_MONITORING_FILTER_TYPE2; -})(EAR_MONITORING_FILTER_TYPE || {}); -var THREAD_PRIORITY_TYPE = /* @__PURE__ */ ((THREAD_PRIORITY_TYPE2) => { - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["LOWEST"] = 0] = "LOWEST"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["LOW"] = 1] = "LOW"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["NORMAL"] = 2] = "NORMAL"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["HIGH"] = 3] = "HIGH"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["HIGHEST"] = 4] = "HIGHEST"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["CRITICAL"] = 5] = "CRITICAL"; - return THREAD_PRIORITY_TYPE2; -})(THREAD_PRIORITY_TYPE || {}); -var ScreenVideoParameters = class { -}; -var ScreenAudioParameters = class { -}; -var ScreenCaptureParameters2 = class { -}; -var MEDIA_TRACE_EVENT = /* @__PURE__ */ ((MEDIA_TRACE_EVENT2) => { - MEDIA_TRACE_EVENT2[MEDIA_TRACE_EVENT2["MEDIA_TRACE_EVENT_VIDEO_RENDERED"] = 0] = "MEDIA_TRACE_EVENT_VIDEO_RENDERED"; - MEDIA_TRACE_EVENT2[MEDIA_TRACE_EVENT2["MEDIA_TRACE_EVENT_VIDEO_DECODED"] = 1] = "MEDIA_TRACE_EVENT_VIDEO_DECODED"; - return MEDIA_TRACE_EVENT2; -})(MEDIA_TRACE_EVENT || {}); -var VideoRenderingTracingInfo = class { -}; -var CONFIG_FETCH_TYPE = /* @__PURE__ */ ((CONFIG_FETCH_TYPE2) => { - CONFIG_FETCH_TYPE2[CONFIG_FETCH_TYPE2["CONFIG_FETCH_TYPE_INITIALIZE"] = 1] = "CONFIG_FETCH_TYPE_INITIALIZE"; - CONFIG_FETCH_TYPE2[CONFIG_FETCH_TYPE2["CONFIG_FETCH_TYPE_JOIN_CHANNEL"] = 2] = "CONFIG_FETCH_TYPE_JOIN_CHANNEL"; - return CONFIG_FETCH_TYPE2; -})(CONFIG_FETCH_TYPE || {}); -var RecorderStreamInfo = class { -}; -var LOCAL_PROXY_MODE = /* @__PURE__ */ ((LOCAL_PROXY_MODE2) => { - LOCAL_PROXY_MODE2[LOCAL_PROXY_MODE2["ConnectivityFirst"] = 0] = "ConnectivityFirst"; - LOCAL_PROXY_MODE2[LOCAL_PROXY_MODE2["LocalOnly"] = 1] = "LocalOnly"; - return LOCAL_PROXY_MODE2; -})(LOCAL_PROXY_MODE || {}); -var LogUploadServerInfo = class { -}; -var AdvancedConfigInfo = class { -}; -var LocalAccessPointConfiguration = class { -}; -var SpatialAudioParams = class { -}; - -// generate/AgoraMediaBase.ts -var VIDEO_SOURCE_TYPE = /* @__PURE__ */ ((VIDEO_SOURCE_TYPE2) => { - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_PRIMARY"] = 0] = "VIDEO_SOURCE_CAMERA_PRIMARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA"] = 0] = "VIDEO_SOURCE_CAMERA"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_SECONDARY"] = 1] = "VIDEO_SOURCE_CAMERA_SECONDARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_PRIMARY"] = 2] = "VIDEO_SOURCE_SCREEN_PRIMARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN"] = 2] = "VIDEO_SOURCE_SCREEN"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_SECONDARY"] = 3] = "VIDEO_SOURCE_SCREEN_SECONDARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CUSTOM"] = 4] = "VIDEO_SOURCE_CUSTOM"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_MEDIA_PLAYER"] = 5] = "VIDEO_SOURCE_MEDIA_PLAYER"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_RTC_IMAGE_PNG"] = 6] = "VIDEO_SOURCE_RTC_IMAGE_PNG"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_RTC_IMAGE_JPEG"] = 7] = "VIDEO_SOURCE_RTC_IMAGE_JPEG"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_RTC_IMAGE_GIF"] = 8] = "VIDEO_SOURCE_RTC_IMAGE_GIF"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_REMOTE"] = 9] = "VIDEO_SOURCE_REMOTE"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_TRANSCODED"] = 10] = "VIDEO_SOURCE_TRANSCODED"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_THIRD"] = 11] = "VIDEO_SOURCE_CAMERA_THIRD"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_FOURTH"] = 12] = "VIDEO_SOURCE_CAMERA_FOURTH"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_THIRD"] = 13] = "VIDEO_SOURCE_SCREEN_THIRD"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_FOURTH"] = 14] = "VIDEO_SOURCE_SCREEN_FOURTH"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_UNKNOWN"] = 100] = "VIDEO_SOURCE_UNKNOWN"; - return VIDEO_SOURCE_TYPE2; -})(VIDEO_SOURCE_TYPE || {}); -var AudioRoute = /* @__PURE__ */ ((AudioRoute2) => { - AudioRoute2[AudioRoute2["ROUTE_DEFAULT"] = -1] = "ROUTE_DEFAULT"; - AudioRoute2[AudioRoute2["ROUTE_HEADSET"] = 0] = "ROUTE_HEADSET"; - AudioRoute2[AudioRoute2["ROUTE_EARPIECE"] = 1] = "ROUTE_EARPIECE"; - AudioRoute2[AudioRoute2["ROUTE_HEADSETNOMIC"] = 2] = "ROUTE_HEADSETNOMIC"; - AudioRoute2[AudioRoute2["ROUTE_SPEAKERPHONE"] = 3] = "ROUTE_SPEAKERPHONE"; - AudioRoute2[AudioRoute2["ROUTE_LOUDSPEAKER"] = 4] = "ROUTE_LOUDSPEAKER"; - AudioRoute2[AudioRoute2["ROUTE_HEADSETBLUETOOTH"] = 5] = "ROUTE_HEADSETBLUETOOTH"; - AudioRoute2[AudioRoute2["ROUTE_USB"] = 6] = "ROUTE_USB"; - AudioRoute2[AudioRoute2["ROUTE_HDMI"] = 7] = "ROUTE_HDMI"; - AudioRoute2[AudioRoute2["ROUTE_DISPLAYPORT"] = 8] = "ROUTE_DISPLAYPORT"; - AudioRoute2[AudioRoute2["ROUTE_AIRPLAY"] = 9] = "ROUTE_AIRPLAY"; - return AudioRoute2; -})(AudioRoute || {}); -var BYTES_PER_SAMPLE = /* @__PURE__ */ ((BYTES_PER_SAMPLE2) => { - BYTES_PER_SAMPLE2[BYTES_PER_SAMPLE2["TWO_BYTES_PER_SAMPLE"] = 2] = "TWO_BYTES_PER_SAMPLE"; - return BYTES_PER_SAMPLE2; -})(BYTES_PER_SAMPLE || {}); -var AudioParameters = class { -}; -var RAW_AUDIO_FRAME_OP_MODE_TYPE = /* @__PURE__ */ ((RAW_AUDIO_FRAME_OP_MODE_TYPE2) => { - RAW_AUDIO_FRAME_OP_MODE_TYPE2[RAW_AUDIO_FRAME_OP_MODE_TYPE2["RAW_AUDIO_FRAME_OP_MODE_READ_ONLY"] = 0] = "RAW_AUDIO_FRAME_OP_MODE_READ_ONLY"; - RAW_AUDIO_FRAME_OP_MODE_TYPE2[RAW_AUDIO_FRAME_OP_MODE_TYPE2["RAW_AUDIO_FRAME_OP_MODE_READ_WRITE"] = 2] = "RAW_AUDIO_FRAME_OP_MODE_READ_WRITE"; - return RAW_AUDIO_FRAME_OP_MODE_TYPE2; -})(RAW_AUDIO_FRAME_OP_MODE_TYPE || {}); -var MEDIA_SOURCE_TYPE = /* @__PURE__ */ ((MEDIA_SOURCE_TYPE2) => { - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["AUDIO_PLAYOUT_SOURCE"] = 0] = "AUDIO_PLAYOUT_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["AUDIO_RECORDING_SOURCE"] = 1] = "AUDIO_RECORDING_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["PRIMARY_CAMERA_SOURCE"] = 2] = "PRIMARY_CAMERA_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["SECONDARY_CAMERA_SOURCE"] = 3] = "SECONDARY_CAMERA_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["PRIMARY_SCREEN_SOURCE"] = 4] = "PRIMARY_SCREEN_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["SECONDARY_SCREEN_SOURCE"] = 5] = "SECONDARY_SCREEN_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["CUSTOM_VIDEO_SOURCE"] = 6] = "CUSTOM_VIDEO_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE"] = 7] = "MEDIA_PLAYER_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["RTC_IMAGE_PNG_SOURCE"] = 8] = "RTC_IMAGE_PNG_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["RTC_IMAGE_JPEG_SOURCE"] = 9] = "RTC_IMAGE_JPEG_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["RTC_IMAGE_GIF_SOURCE"] = 10] = "RTC_IMAGE_GIF_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["REMOTE_VIDEO_SOURCE"] = 11] = "REMOTE_VIDEO_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["TRANSCODED_VIDEO_SOURCE"] = 12] = "TRANSCODED_VIDEO_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["UNKNOWN_MEDIA_SOURCE"] = 100] = "UNKNOWN_MEDIA_SOURCE"; - return MEDIA_SOURCE_TYPE2; -})(MEDIA_SOURCE_TYPE || {}); -var CONTENT_INSPECT_RESULT = /* @__PURE__ */ ((CONTENT_INSPECT_RESULT2) => { - CONTENT_INSPECT_RESULT2[CONTENT_INSPECT_RESULT2["CONTENT_INSPECT_NEUTRAL"] = 1] = "CONTENT_INSPECT_NEUTRAL"; - CONTENT_INSPECT_RESULT2[CONTENT_INSPECT_RESULT2["CONTENT_INSPECT_SEXY"] = 2] = "CONTENT_INSPECT_SEXY"; - CONTENT_INSPECT_RESULT2[CONTENT_INSPECT_RESULT2["CONTENT_INSPECT_PORN"] = 3] = "CONTENT_INSPECT_PORN"; - return CONTENT_INSPECT_RESULT2; -})(CONTENT_INSPECT_RESULT || {}); -var CONTENT_INSPECT_TYPE = /* @__PURE__ */ ((CONTENT_INSPECT_TYPE2) => { - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_INVALID"] = 0] = "CONTENT_INSPECT_INVALID"; - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_MODERATION"] = 1] = "CONTENT_INSPECT_MODERATION"; - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_SUPERVISION"] = 2] = "CONTENT_INSPECT_SUPERVISION"; - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_IMAGE_MODERATION"] = 3] = "CONTENT_INSPECT_IMAGE_MODERATION"; - return CONTENT_INSPECT_TYPE2; -})(CONTENT_INSPECT_TYPE || {}); -var ContentInspectModule = class { -}; -var ContentInspectConfig = class { -}; -var PacketOptions = class { -}; -var AudioEncodedFrameInfo = class { -}; -var AudioPcmFrame = class { -}; -var AUDIO_DUAL_MONO_MODE = /* @__PURE__ */ ((AUDIO_DUAL_MONO_MODE2) => { - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_STEREO"] = 0] = "AUDIO_DUAL_MONO_STEREO"; - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_L"] = 1] = "AUDIO_DUAL_MONO_L"; - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_R"] = 2] = "AUDIO_DUAL_MONO_R"; - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_MIX"] = 3] = "AUDIO_DUAL_MONO_MIX"; - return AUDIO_DUAL_MONO_MODE2; -})(AUDIO_DUAL_MONO_MODE || {}); -var VIDEO_PIXEL_FORMAT = /* @__PURE__ */ ((VIDEO_PIXEL_FORMAT2) => { - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_DEFAULT"] = 0] = "VIDEO_PIXEL_DEFAULT"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_I420"] = 1] = "VIDEO_PIXEL_I420"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_BGRA"] = 2] = "VIDEO_PIXEL_BGRA"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_NV21"] = 3] = "VIDEO_PIXEL_NV21"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_RGBA"] = 4] = "VIDEO_PIXEL_RGBA"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_NV12"] = 8] = "VIDEO_PIXEL_NV12"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_TEXTURE_2D"] = 10] = "VIDEO_TEXTURE_2D"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_TEXTURE_OES"] = 11] = "VIDEO_TEXTURE_OES"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_CVPIXEL_NV12"] = 12] = "VIDEO_CVPIXEL_NV12"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_CVPIXEL_I420"] = 13] = "VIDEO_CVPIXEL_I420"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_CVPIXEL_BGRA"] = 14] = "VIDEO_CVPIXEL_BGRA"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_I422"] = 16] = "VIDEO_PIXEL_I422"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_TEXTURE_ID3D11TEXTURE2D"] = 17] = "VIDEO_TEXTURE_ID3D11TEXTURE2D"; - return VIDEO_PIXEL_FORMAT2; -})(VIDEO_PIXEL_FORMAT || {}); -var RENDER_MODE_TYPE = /* @__PURE__ */ ((RENDER_MODE_TYPE2) => { - RENDER_MODE_TYPE2[RENDER_MODE_TYPE2["RENDER_MODE_HIDDEN"] = 1] = "RENDER_MODE_HIDDEN"; - RENDER_MODE_TYPE2[RENDER_MODE_TYPE2["RENDER_MODE_FIT"] = 2] = "RENDER_MODE_FIT"; - RENDER_MODE_TYPE2[RENDER_MODE_TYPE2["RENDER_MODE_ADAPTIVE"] = 3] = "RENDER_MODE_ADAPTIVE"; - return RENDER_MODE_TYPE2; -})(RENDER_MODE_TYPE || {}); -var CAMERA_VIDEO_SOURCE_TYPE = /* @__PURE__ */ ((CAMERA_VIDEO_SOURCE_TYPE2) => { - CAMERA_VIDEO_SOURCE_TYPE2[CAMERA_VIDEO_SOURCE_TYPE2["CAMERA_SOURCE_FRONT"] = 0] = "CAMERA_SOURCE_FRONT"; - CAMERA_VIDEO_SOURCE_TYPE2[CAMERA_VIDEO_SOURCE_TYPE2["CAMERA_SOURCE_BACK"] = 1] = "CAMERA_SOURCE_BACK"; - CAMERA_VIDEO_SOURCE_TYPE2[CAMERA_VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_UNSPECIFIED"] = 2] = "VIDEO_SOURCE_UNSPECIFIED"; - return CAMERA_VIDEO_SOURCE_TYPE2; -})(CAMERA_VIDEO_SOURCE_TYPE || {}); -var EGL_CONTEXT_TYPE = /* @__PURE__ */ ((EGL_CONTEXT_TYPE2) => { - EGL_CONTEXT_TYPE2[EGL_CONTEXT_TYPE2["EGL_CONTEXT10"] = 0] = "EGL_CONTEXT10"; - EGL_CONTEXT_TYPE2[EGL_CONTEXT_TYPE2["EGL_CONTEXT14"] = 1] = "EGL_CONTEXT14"; - return EGL_CONTEXT_TYPE2; -})(EGL_CONTEXT_TYPE || {}); -var VIDEO_BUFFER_TYPE = /* @__PURE__ */ ((VIDEO_BUFFER_TYPE2) => { - VIDEO_BUFFER_TYPE2[VIDEO_BUFFER_TYPE2["VIDEO_BUFFER_RAW_DATA"] = 1] = "VIDEO_BUFFER_RAW_DATA"; - VIDEO_BUFFER_TYPE2[VIDEO_BUFFER_TYPE2["VIDEO_BUFFER_ARRAY"] = 2] = "VIDEO_BUFFER_ARRAY"; - VIDEO_BUFFER_TYPE2[VIDEO_BUFFER_TYPE2["VIDEO_BUFFER_TEXTURE"] = 3] = "VIDEO_BUFFER_TEXTURE"; - return VIDEO_BUFFER_TYPE2; -})(VIDEO_BUFFER_TYPE || {}); -var ExternalVideoFrame = class { -}; -var VideoFrame = class { -}; -var MEDIA_PLAYER_SOURCE_TYPE = /* @__PURE__ */ ((MEDIA_PLAYER_SOURCE_TYPE2) => { - MEDIA_PLAYER_SOURCE_TYPE2[MEDIA_PLAYER_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE_DEFAULT"] = 0] = "MEDIA_PLAYER_SOURCE_DEFAULT"; - MEDIA_PLAYER_SOURCE_TYPE2[MEDIA_PLAYER_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE_FULL_FEATURED"] = 1] = "MEDIA_PLAYER_SOURCE_FULL_FEATURED"; - MEDIA_PLAYER_SOURCE_TYPE2[MEDIA_PLAYER_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE_SIMPLE"] = 2] = "MEDIA_PLAYER_SOURCE_SIMPLE"; - return MEDIA_PLAYER_SOURCE_TYPE2; -})(MEDIA_PLAYER_SOURCE_TYPE || {}); -var VIDEO_MODULE_POSITION = /* @__PURE__ */ ((VIDEO_MODULE_POSITION2) => { - VIDEO_MODULE_POSITION2[VIDEO_MODULE_POSITION2["POSITION_POST_CAPTURER"] = 1] = "POSITION_POST_CAPTURER"; - VIDEO_MODULE_POSITION2[VIDEO_MODULE_POSITION2["POSITION_PRE_RENDERER"] = 1] = "POSITION_PRE_RENDERER"; - VIDEO_MODULE_POSITION2[VIDEO_MODULE_POSITION2["POSITION_PRE_ENCODER"] = 1] = "POSITION_PRE_ENCODER"; - return VIDEO_MODULE_POSITION2; -})(VIDEO_MODULE_POSITION || {}); -var AUDIO_FRAME_TYPE = /* @__PURE__ */ ((AUDIO_FRAME_TYPE2) => { - AUDIO_FRAME_TYPE2[AUDIO_FRAME_TYPE2["FRAME_TYPE_PCM16"] = 0] = "FRAME_TYPE_PCM16"; - return AUDIO_FRAME_TYPE2; -})(AUDIO_FRAME_TYPE || {}); -var AudioFrame = class { -}; -var AUDIO_FRAME_POSITION = /* @__PURE__ */ ((AUDIO_FRAME_POSITION2) => { - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_NONE"] = 0] = "AUDIO_FRAME_POSITION_NONE"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_PLAYBACK"] = 1] = "AUDIO_FRAME_POSITION_PLAYBACK"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_RECORD"] = 2] = "AUDIO_FRAME_POSITION_RECORD"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_MIXED"] = 4] = "AUDIO_FRAME_POSITION_MIXED"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_BEFORE_MIXING"] = 8] = "AUDIO_FRAME_POSITION_BEFORE_MIXING"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_EAR_MONITORING"] = 16] = "AUDIO_FRAME_POSITION_EAR_MONITORING"; - return AUDIO_FRAME_POSITION2; -})(AUDIO_FRAME_POSITION || {}); -var AudioParams = class { -}; -var AudioSpectrumData = class { -}; -var UserAudioSpectrumInfo = class { -}; -var VIDEO_FRAME_PROCESS_MODE = /* @__PURE__ */ ((VIDEO_FRAME_PROCESS_MODE2) => { - VIDEO_FRAME_PROCESS_MODE2[VIDEO_FRAME_PROCESS_MODE2["PROCESS_MODE_READ_ONLY"] = 0] = "PROCESS_MODE_READ_ONLY"; - VIDEO_FRAME_PROCESS_MODE2[VIDEO_FRAME_PROCESS_MODE2["PROCESS_MODE_READ_WRITE"] = 1] = "PROCESS_MODE_READ_WRITE"; - return VIDEO_FRAME_PROCESS_MODE2; -})(VIDEO_FRAME_PROCESS_MODE || {}); -var EXTERNAL_VIDEO_SOURCE_TYPE = /* @__PURE__ */ ((EXTERNAL_VIDEO_SOURCE_TYPE2) => { - EXTERNAL_VIDEO_SOURCE_TYPE2[EXTERNAL_VIDEO_SOURCE_TYPE2["VIDEO_FRAME"] = 0] = "VIDEO_FRAME"; - EXTERNAL_VIDEO_SOURCE_TYPE2[EXTERNAL_VIDEO_SOURCE_TYPE2["ENCODED_VIDEO_FRAME"] = 1] = "ENCODED_VIDEO_FRAME"; - return EXTERNAL_VIDEO_SOURCE_TYPE2; -})(EXTERNAL_VIDEO_SOURCE_TYPE || {}); -var MediaRecorderContainerFormat = /* @__PURE__ */ ((MediaRecorderContainerFormat2) => { - MediaRecorderContainerFormat2[MediaRecorderContainerFormat2["FORMAT_MP4"] = 1] = "FORMAT_MP4"; - return MediaRecorderContainerFormat2; -})(MediaRecorderContainerFormat || {}); -var MediaRecorderStreamType = /* @__PURE__ */ ((MediaRecorderStreamType2) => { - MediaRecorderStreamType2[MediaRecorderStreamType2["STREAM_TYPE_AUDIO"] = 1] = "STREAM_TYPE_AUDIO"; - MediaRecorderStreamType2[MediaRecorderStreamType2["STREAM_TYPE_VIDEO"] = 2] = "STREAM_TYPE_VIDEO"; - MediaRecorderStreamType2[MediaRecorderStreamType2["STREAM_TYPE_BOTH"] = 3] = "STREAM_TYPE_BOTH"; - return MediaRecorderStreamType2; -})(MediaRecorderStreamType || {}); -var RecorderState = /* @__PURE__ */ ((RecorderState2) => { - RecorderState2[RecorderState2["RECORDER_STATE_ERROR"] = -1] = "RECORDER_STATE_ERROR"; - RecorderState2[RecorderState2["RECORDER_STATE_START"] = 2] = "RECORDER_STATE_START"; - RecorderState2[RecorderState2["RECORDER_STATE_STOP"] = 3] = "RECORDER_STATE_STOP"; - return RecorderState2; -})(RecorderState || {}); -var RecorderErrorCode = /* @__PURE__ */ ((RecorderErrorCode2) => { - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_NONE"] = 0] = "RECORDER_ERROR_NONE"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_WRITE_FAILED"] = 1] = "RECORDER_ERROR_WRITE_FAILED"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_NO_STREAM"] = 2] = "RECORDER_ERROR_NO_STREAM"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_OVER_MAX_DURATION"] = 3] = "RECORDER_ERROR_OVER_MAX_DURATION"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_CONFIG_CHANGED"] = 4] = "RECORDER_ERROR_CONFIG_CHANGED"; - return RecorderErrorCode2; -})(RecorderErrorCode || {}); -var MediaRecorderConfiguration = class { -}; -var RecorderInfo = class { -}; - -// generate/AgoraMediaPlayerTypes.ts -var MEDIA_PLAYER_STATE = /* @__PURE__ */ ((MEDIA_PLAYER_STATE2) => { - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_IDLE"] = 0] = "PLAYER_STATE_IDLE"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_OPENING"] = 1] = "PLAYER_STATE_OPENING"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_OPEN_COMPLETED"] = 2] = "PLAYER_STATE_OPEN_COMPLETED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PLAYING"] = 3] = "PLAYER_STATE_PLAYING"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PAUSED"] = 4] = "PLAYER_STATE_PAUSED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PLAYBACK_COMPLETED"] = 5] = "PLAYER_STATE_PLAYBACK_COMPLETED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED"] = 6] = "PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_STOPPED"] = 7] = "PLAYER_STATE_STOPPED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PAUSING_INTERNAL"] = 50] = "PLAYER_STATE_PAUSING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_STOPPING_INTERNAL"] = 51] = "PLAYER_STATE_STOPPING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_SEEKING_INTERNAL"] = 52] = "PLAYER_STATE_SEEKING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_GETTING_INTERNAL"] = 53] = "PLAYER_STATE_GETTING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_NONE_INTERNAL"] = 54] = "PLAYER_STATE_NONE_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_DO_NOTHING_INTERNAL"] = 55] = "PLAYER_STATE_DO_NOTHING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_SET_TRACK_INTERNAL"] = 56] = "PLAYER_STATE_SET_TRACK_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_FAILED"] = 100] = "PLAYER_STATE_FAILED"; - return MEDIA_PLAYER_STATE2; -})(MEDIA_PLAYER_STATE || {}); -var MEDIA_PLAYER_ERROR = /* @__PURE__ */ ((MEDIA_PLAYER_ERROR2) => { - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_NONE"] = 0] = "PLAYER_ERROR_NONE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_ARGUMENTS"] = -1] = "PLAYER_ERROR_INVALID_ARGUMENTS"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INTERNAL"] = -2] = "PLAYER_ERROR_INTERNAL"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_NO_RESOURCE"] = -3] = "PLAYER_ERROR_NO_RESOURCE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_MEDIA_SOURCE"] = -4] = "PLAYER_ERROR_INVALID_MEDIA_SOURCE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_UNKNOWN_STREAM_TYPE"] = -5] = "PLAYER_ERROR_UNKNOWN_STREAM_TYPE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_OBJ_NOT_INITIALIZED"] = -6] = "PLAYER_ERROR_OBJ_NOT_INITIALIZED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_CODEC_NOT_SUPPORTED"] = -7] = "PLAYER_ERROR_CODEC_NOT_SUPPORTED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_VIDEO_RENDER_FAILED"] = -8] = "PLAYER_ERROR_VIDEO_RENDER_FAILED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_STATE"] = -9] = "PLAYER_ERROR_INVALID_STATE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_URL_NOT_FOUND"] = -10] = "PLAYER_ERROR_URL_NOT_FOUND"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_CONNECTION_STATE"] = -11] = "PLAYER_ERROR_INVALID_CONNECTION_STATE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_SRC_BUFFER_UNDERFLOW"] = -12] = "PLAYER_ERROR_SRC_BUFFER_UNDERFLOW"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INTERRUPTED"] = -13] = "PLAYER_ERROR_INTERRUPTED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_NOT_SUPPORTED"] = -14] = "PLAYER_ERROR_NOT_SUPPORTED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_TOKEN_EXPIRED"] = -15] = "PLAYER_ERROR_TOKEN_EXPIRED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_IP_EXPIRED"] = -16] = "PLAYER_ERROR_IP_EXPIRED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_UNKNOWN"] = -17] = "PLAYER_ERROR_UNKNOWN"; - return MEDIA_PLAYER_ERROR2; -})(MEDIA_PLAYER_ERROR || {}); -var MEDIA_STREAM_TYPE = /* @__PURE__ */ ((MEDIA_STREAM_TYPE2) => { - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_UNKNOWN"] = 0] = "STREAM_TYPE_UNKNOWN"; - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_VIDEO"] = 1] = "STREAM_TYPE_VIDEO"; - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_AUDIO"] = 2] = "STREAM_TYPE_AUDIO"; - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_SUBTITLE"] = 3] = "STREAM_TYPE_SUBTITLE"; - return MEDIA_STREAM_TYPE2; -})(MEDIA_STREAM_TYPE || {}); -var MEDIA_PLAYER_EVENT = /* @__PURE__ */ ((MEDIA_PLAYER_EVENT2) => { - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SEEK_BEGIN"] = 0] = "PLAYER_EVENT_SEEK_BEGIN"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SEEK_COMPLETE"] = 1] = "PLAYER_EVENT_SEEK_COMPLETE"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SEEK_ERROR"] = 2] = "PLAYER_EVENT_SEEK_ERROR"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_AUDIO_TRACK_CHANGED"] = 5] = "PLAYER_EVENT_AUDIO_TRACK_CHANGED"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_BUFFER_LOW"] = 6] = "PLAYER_EVENT_BUFFER_LOW"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_BUFFER_RECOVER"] = 7] = "PLAYER_EVENT_BUFFER_RECOVER"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_FREEZE_START"] = 8] = "PLAYER_EVENT_FREEZE_START"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_FREEZE_STOP"] = 9] = "PLAYER_EVENT_FREEZE_STOP"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SWITCH_BEGIN"] = 10] = "PLAYER_EVENT_SWITCH_BEGIN"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SWITCH_COMPLETE"] = 11] = "PLAYER_EVENT_SWITCH_COMPLETE"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SWITCH_ERROR"] = 12] = "PLAYER_EVENT_SWITCH_ERROR"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_FIRST_DISPLAYED"] = 13] = "PLAYER_EVENT_FIRST_DISPLAYED"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_REACH_CACHE_FILE_MAX_COUNT"] = 14] = "PLAYER_EVENT_REACH_CACHE_FILE_MAX_COUNT"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_REACH_CACHE_FILE_MAX_SIZE"] = 15] = "PLAYER_EVENT_REACH_CACHE_FILE_MAX_SIZE"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_TRY_OPEN_START"] = 16] = "PLAYER_EVENT_TRY_OPEN_START"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_TRY_OPEN_SUCCEED"] = 17] = "PLAYER_EVENT_TRY_OPEN_SUCCEED"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_TRY_OPEN_FAILED"] = 18] = "PLAYER_EVENT_TRY_OPEN_FAILED"; - return MEDIA_PLAYER_EVENT2; -})(MEDIA_PLAYER_EVENT || {}); -var PLAYER_PRELOAD_EVENT = /* @__PURE__ */ ((PLAYER_PRELOAD_EVENT2) => { - PLAYER_PRELOAD_EVENT2[PLAYER_PRELOAD_EVENT2["PLAYER_PRELOAD_EVENT_BEGIN"] = 0] = "PLAYER_PRELOAD_EVENT_BEGIN"; - PLAYER_PRELOAD_EVENT2[PLAYER_PRELOAD_EVENT2["PLAYER_PRELOAD_EVENT_COMPLETE"] = 1] = "PLAYER_PRELOAD_EVENT_COMPLETE"; - PLAYER_PRELOAD_EVENT2[PLAYER_PRELOAD_EVENT2["PLAYER_PRELOAD_EVENT_ERROR"] = 2] = "PLAYER_PRELOAD_EVENT_ERROR"; - return PLAYER_PRELOAD_EVENT2; -})(PLAYER_PRELOAD_EVENT || {}); -var PlayerStreamInfo = class { -}; -var SrcInfo = class { -}; -var MEDIA_PLAYER_METADATA_TYPE = /* @__PURE__ */ ((MEDIA_PLAYER_METADATA_TYPE2) => { - MEDIA_PLAYER_METADATA_TYPE2[MEDIA_PLAYER_METADATA_TYPE2["PLAYER_METADATA_TYPE_UNKNOWN"] = 0] = "PLAYER_METADATA_TYPE_UNKNOWN"; - MEDIA_PLAYER_METADATA_TYPE2[MEDIA_PLAYER_METADATA_TYPE2["PLAYER_METADATA_TYPE_SEI"] = 1] = "PLAYER_METADATA_TYPE_SEI"; - return MEDIA_PLAYER_METADATA_TYPE2; -})(MEDIA_PLAYER_METADATA_TYPE || {}); -var CacheStatistics = class { -}; -var PlayerUpdatedInfo = class { -}; -var MediaSource = class { -}; - -// generate/IAgoraLog.ts -var LOG_LEVEL = /* @__PURE__ */ ((LOG_LEVEL2) => { - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_NONE"] = 0] = "LOG_LEVEL_NONE"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_INFO"] = 1] = "LOG_LEVEL_INFO"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_WARN"] = 2] = "LOG_LEVEL_WARN"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_ERROR"] = 4] = "LOG_LEVEL_ERROR"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_FATAL"] = 8] = "LOG_LEVEL_FATAL"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_API_CALL"] = 16] = "LOG_LEVEL_API_CALL"; - return LOG_LEVEL2; -})(LOG_LEVEL || {}); -var LOG_FILTER_TYPE = /* @__PURE__ */ ((LOG_FILTER_TYPE2) => { - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_OFF"] = 0] = "LOG_FILTER_OFF"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_DEBUG"] = 2063] = "LOG_FILTER_DEBUG"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_INFO"] = 15] = "LOG_FILTER_INFO"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_WARN"] = 14] = "LOG_FILTER_WARN"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_ERROR"] = 12] = "LOG_FILTER_ERROR"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_CRITICAL"] = 8] = "LOG_FILTER_CRITICAL"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_MASK"] = 2063] = "LOG_FILTER_MASK"; - return LOG_FILTER_TYPE2; -})(LOG_FILTER_TYPE || {}); -var LogConfig = class { -}; - -// generate/IAgoraMediaEngine.ts -var AUDIO_MIXING_DUAL_MONO_MODE = /* @__PURE__ */ ((AUDIO_MIXING_DUAL_MONO_MODE2) => { - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_AUTO"] = 0] = "AUDIO_MIXING_DUAL_MONO_AUTO"; - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_L"] = 1] = "AUDIO_MIXING_DUAL_MONO_L"; - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_R"] = 2] = "AUDIO_MIXING_DUAL_MONO_R"; - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_MIX"] = 3] = "AUDIO_MIXING_DUAL_MONO_MIX"; - return AUDIO_MIXING_DUAL_MONO_MODE2; -})(AUDIO_MIXING_DUAL_MONO_MODE || {}); - -// generate/IAgoraMediaStreamingSource.ts -var STREAMING_SRC_ERR = /* @__PURE__ */ ((STREAMING_SRC_ERR2) => { - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NONE"] = 0] = "STREAMING_SRC_ERR_NONE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_UNKNOWN"] = 1] = "STREAMING_SRC_ERR_UNKNOWN"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_INVALID_PARAM"] = 2] = "STREAMING_SRC_ERR_INVALID_PARAM"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_BAD_STATE"] = 3] = "STREAMING_SRC_ERR_BAD_STATE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NO_MEM"] = 4] = "STREAMING_SRC_ERR_NO_MEM"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_BUFFER_OVERFLOW"] = 5] = "STREAMING_SRC_ERR_BUFFER_OVERFLOW"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_BUFFER_UNDERFLOW"] = 6] = "STREAMING_SRC_ERR_BUFFER_UNDERFLOW"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NOT_FOUND"] = 7] = "STREAMING_SRC_ERR_NOT_FOUND"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_TIMEOUT"] = 8] = "STREAMING_SRC_ERR_TIMEOUT"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_EXPIRED"] = 9] = "STREAMING_SRC_ERR_EXPIRED"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_UNSUPPORTED"] = 10] = "STREAMING_SRC_ERR_UNSUPPORTED"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NOT_EXIST"] = 11] = "STREAMING_SRC_ERR_NOT_EXIST"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_EXIST"] = 12] = "STREAMING_SRC_ERR_EXIST"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_OPEN"] = 13] = "STREAMING_SRC_ERR_OPEN"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CLOSE"] = 14] = "STREAMING_SRC_ERR_CLOSE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_READ"] = 15] = "STREAMING_SRC_ERR_READ"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_WRITE"] = 16] = "STREAMING_SRC_ERR_WRITE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_SEEK"] = 17] = "STREAMING_SRC_ERR_SEEK"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_EOF"] = 18] = "STREAMING_SRC_ERR_EOF"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CODECOPEN"] = 19] = "STREAMING_SRC_ERR_CODECOPEN"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CODECCLOSE"] = 20] = "STREAMING_SRC_ERR_CODECCLOSE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CODECPROC"] = 21] = "STREAMING_SRC_ERR_CODECPROC"; - return STREAMING_SRC_ERR2; -})(STREAMING_SRC_ERR || {}); -var STREAMING_SRC_STATE = /* @__PURE__ */ ((STREAMING_SRC_STATE2) => { - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_CLOSED"] = 0] = "STREAMING_SRC_STATE_CLOSED"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_OPENING"] = 1] = "STREAMING_SRC_STATE_OPENING"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_IDLE"] = 2] = "STREAMING_SRC_STATE_IDLE"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_PLAYING"] = 3] = "STREAMING_SRC_STATE_PLAYING"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_SEEKING"] = 4] = "STREAMING_SRC_STATE_SEEKING"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_EOF"] = 5] = "STREAMING_SRC_STATE_EOF"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_ERROR"] = 6] = "STREAMING_SRC_STATE_ERROR"; - return STREAMING_SRC_STATE2; -})(STREAMING_SRC_STATE || {}); -var InputSeiData = class { -}; - -// generate/IAgoraMusicContentCenter.ts -var PreloadStatusCode = /* @__PURE__ */ ((PreloadStatusCode2) => { - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusCompleted"] = 0] = "kPreloadStatusCompleted"; - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusFailed"] = 1] = "kPreloadStatusFailed"; - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusPreloading"] = 2] = "kPreloadStatusPreloading"; - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusRemoved"] = 3] = "kPreloadStatusRemoved"; - return PreloadStatusCode2; -})(PreloadStatusCode || {}); -var MusicContentCenterStatusCode = /* @__PURE__ */ ((MusicContentCenterStatusCode2) => { - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusOk"] = 0] = "kMusicContentCenterStatusOk"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErr"] = 1] = "kMusicContentCenterStatusErr"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrGateway"] = 2] = "kMusicContentCenterStatusErrGateway"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrPermissionAndResource"] = 3] = "kMusicContentCenterStatusErrPermissionAndResource"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrInternalDataParse"] = 4] = "kMusicContentCenterStatusErrInternalDataParse"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrMusicLoading"] = 5] = "kMusicContentCenterStatusErrMusicLoading"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrMusicDecryption"] = 6] = "kMusicContentCenterStatusErrMusicDecryption"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrHttpInternalError"] = 7] = "kMusicContentCenterStatusErrHttpInternalError"; - return MusicContentCenterStatusCode2; -})(MusicContentCenterStatusCode || {}); -var MusicChartInfo = class { -}; -var MUSIC_CACHE_STATUS_TYPE = /* @__PURE__ */ ((MUSIC_CACHE_STATUS_TYPE2) => { - MUSIC_CACHE_STATUS_TYPE2[MUSIC_CACHE_STATUS_TYPE2["MUSIC_CACHE_STATUS_TYPE_CACHED"] = 0] = "MUSIC_CACHE_STATUS_TYPE_CACHED"; - MUSIC_CACHE_STATUS_TYPE2[MUSIC_CACHE_STATUS_TYPE2["MUSIC_CACHE_STATUS_TYPE_CACHING"] = 1] = "MUSIC_CACHE_STATUS_TYPE_CACHING"; - return MUSIC_CACHE_STATUS_TYPE2; -})(MUSIC_CACHE_STATUS_TYPE || {}); -var MusicCacheInfo = class { -}; -var MvProperty = class { -}; -var ClimaxSegment = class { -}; -var Music = class { -}; -var MusicContentCenterConfiguration = class { -}; - -// generate/IAgoraRhythmPlayer.ts -var RHYTHM_PLAYER_STATE_TYPE = /* @__PURE__ */ ((RHYTHM_PLAYER_STATE_TYPE2) => { - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_IDLE"] = 810] = "RHYTHM_PLAYER_STATE_IDLE"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_OPENING"] = 811] = "RHYTHM_PLAYER_STATE_OPENING"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_DECODING"] = 812] = "RHYTHM_PLAYER_STATE_DECODING"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_PLAYING"] = 813] = "RHYTHM_PLAYER_STATE_PLAYING"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_FAILED"] = 814] = "RHYTHM_PLAYER_STATE_FAILED"; - return RHYTHM_PLAYER_STATE_TYPE2; -})(RHYTHM_PLAYER_STATE_TYPE || {}); -var RHYTHM_PLAYER_ERROR_TYPE = /* @__PURE__ */ ((RHYTHM_PLAYER_ERROR_TYPE2) => { - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_OK"] = 0] = "RHYTHM_PLAYER_ERROR_OK"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_FAILED"] = 1] = "RHYTHM_PLAYER_ERROR_FAILED"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN"] = 801] = "RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY"] = 802] = "RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT"] = 803] = "RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT"; - return RHYTHM_PLAYER_ERROR_TYPE2; -})(RHYTHM_PLAYER_ERROR_TYPE || {}); -var AgoraRhythmPlayerConfig = class { -}; - -// generate/IAgoraRtcEngine.ts -var MEDIA_DEVICE_TYPE = /* @__PURE__ */ ((MEDIA_DEVICE_TYPE2) => { - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["UNKNOWN_AUDIO_DEVICE"] = -1] = "UNKNOWN_AUDIO_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_PLAYOUT_DEVICE"] = 0] = "AUDIO_PLAYOUT_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_RECORDING_DEVICE"] = 1] = "AUDIO_RECORDING_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["VIDEO_RENDER_DEVICE"] = 2] = "VIDEO_RENDER_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["VIDEO_CAPTURE_DEVICE"] = 3] = "VIDEO_CAPTURE_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_APPLICATION_PLAYOUT_DEVICE"] = 4] = "AUDIO_APPLICATION_PLAYOUT_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_VIRTUAL_PLAYOUT_DEVICE"] = 5] = "AUDIO_VIRTUAL_PLAYOUT_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_VIRTUAL_RECORDING_DEVICE"] = 6] = "AUDIO_VIRTUAL_RECORDING_DEVICE"; - return MEDIA_DEVICE_TYPE2; -})(MEDIA_DEVICE_TYPE || {}); -var AUDIO_MIXING_STATE_TYPE = /* @__PURE__ */ ((AUDIO_MIXING_STATE_TYPE2) => { - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_PLAYING"] = 710] = "AUDIO_MIXING_STATE_PLAYING"; - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_PAUSED"] = 711] = "AUDIO_MIXING_STATE_PAUSED"; - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_STOPPED"] = 713] = "AUDIO_MIXING_STATE_STOPPED"; - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_FAILED"] = 714] = "AUDIO_MIXING_STATE_FAILED"; - return AUDIO_MIXING_STATE_TYPE2; -})(AUDIO_MIXING_STATE_TYPE || {}); -var AUDIO_MIXING_REASON_TYPE = /* @__PURE__ */ ((AUDIO_MIXING_REASON_TYPE2) => { - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_CAN_NOT_OPEN"] = 701] = "AUDIO_MIXING_REASON_CAN_NOT_OPEN"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_TOO_FREQUENT_CALL"] = 702] = "AUDIO_MIXING_REASON_TOO_FREQUENT_CALL"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_INTERRUPTED_EOF"] = 703] = "AUDIO_MIXING_REASON_INTERRUPTED_EOF"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED"] = 721] = "AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED"] = 723] = "AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_STOPPED_BY_USER"] = 724] = "AUDIO_MIXING_REASON_STOPPED_BY_USER"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_OK"] = 0] = "AUDIO_MIXING_REASON_OK"; - return AUDIO_MIXING_REASON_TYPE2; -})(AUDIO_MIXING_REASON_TYPE || {}); -var INJECT_STREAM_STATUS = /* @__PURE__ */ ((INJECT_STREAM_STATUS2) => { - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_SUCCESS"] = 0] = "INJECT_STREAM_STATUS_START_SUCCESS"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_ALREADY_EXISTS"] = 1] = "INJECT_STREAM_STATUS_START_ALREADY_EXISTS"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_UNAUTHORIZED"] = 2] = "INJECT_STREAM_STATUS_START_UNAUTHORIZED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_TIMEDOUT"] = 3] = "INJECT_STREAM_STATUS_START_TIMEDOUT"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_FAILED"] = 4] = "INJECT_STREAM_STATUS_START_FAILED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_SUCCESS"] = 5] = "INJECT_STREAM_STATUS_STOP_SUCCESS"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_NOT_FOUND"] = 6] = "INJECT_STREAM_STATUS_STOP_NOT_FOUND"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_UNAUTHORIZED"] = 7] = "INJECT_STREAM_STATUS_STOP_UNAUTHORIZED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_TIMEDOUT"] = 8] = "INJECT_STREAM_STATUS_STOP_TIMEDOUT"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_FAILED"] = 9] = "INJECT_STREAM_STATUS_STOP_FAILED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_BROKEN"] = 10] = "INJECT_STREAM_STATUS_BROKEN"; - return INJECT_STREAM_STATUS2; -})(INJECT_STREAM_STATUS || {}); -var AUDIO_EQUALIZATION_BAND_FREQUENCY = /* @__PURE__ */ ((AUDIO_EQUALIZATION_BAND_FREQUENCY2) => { - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_31"] = 0] = "AUDIO_EQUALIZATION_BAND_31"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_62"] = 1] = "AUDIO_EQUALIZATION_BAND_62"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_125"] = 2] = "AUDIO_EQUALIZATION_BAND_125"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_250"] = 3] = "AUDIO_EQUALIZATION_BAND_250"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_500"] = 4] = "AUDIO_EQUALIZATION_BAND_500"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_1K"] = 5] = "AUDIO_EQUALIZATION_BAND_1K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_2K"] = 6] = "AUDIO_EQUALIZATION_BAND_2K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_4K"] = 7] = "AUDIO_EQUALIZATION_BAND_4K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_8K"] = 8] = "AUDIO_EQUALIZATION_BAND_8K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_16K"] = 9] = "AUDIO_EQUALIZATION_BAND_16K"; - return AUDIO_EQUALIZATION_BAND_FREQUENCY2; -})(AUDIO_EQUALIZATION_BAND_FREQUENCY || {}); -var AUDIO_REVERB_TYPE = /* @__PURE__ */ ((AUDIO_REVERB_TYPE2) => { - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_DRY_LEVEL"] = 0] = "AUDIO_REVERB_DRY_LEVEL"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_WET_LEVEL"] = 1] = "AUDIO_REVERB_WET_LEVEL"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_ROOM_SIZE"] = 2] = "AUDIO_REVERB_ROOM_SIZE"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_WET_DELAY"] = 3] = "AUDIO_REVERB_WET_DELAY"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_STRENGTH"] = 4] = "AUDIO_REVERB_STRENGTH"; - return AUDIO_REVERB_TYPE2; -})(AUDIO_REVERB_TYPE || {}); -var STREAM_FALLBACK_OPTIONS = /* @__PURE__ */ ((STREAM_FALLBACK_OPTIONS2) => { - STREAM_FALLBACK_OPTIONS2[STREAM_FALLBACK_OPTIONS2["STREAM_FALLBACK_OPTION_DISABLED"] = 0] = "STREAM_FALLBACK_OPTION_DISABLED"; - STREAM_FALLBACK_OPTIONS2[STREAM_FALLBACK_OPTIONS2["STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW"] = 1] = "STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW"; - STREAM_FALLBACK_OPTIONS2[STREAM_FALLBACK_OPTIONS2["STREAM_FALLBACK_OPTION_AUDIO_ONLY"] = 2] = "STREAM_FALLBACK_OPTION_AUDIO_ONLY"; - return STREAM_FALLBACK_OPTIONS2; -})(STREAM_FALLBACK_OPTIONS || {}); -var PRIORITY_TYPE = /* @__PURE__ */ ((PRIORITY_TYPE2) => { - PRIORITY_TYPE2[PRIORITY_TYPE2["PRIORITY_HIGH"] = 50] = "PRIORITY_HIGH"; - PRIORITY_TYPE2[PRIORITY_TYPE2["PRIORITY_NORMAL"] = 100] = "PRIORITY_NORMAL"; - return PRIORITY_TYPE2; -})(PRIORITY_TYPE || {}); -var LocalVideoStats = class { -}; -var RemoteAudioStats = class { -}; -var RemoteVideoStats = class { -}; -var Region = class { -}; -var VideoCompositingLayout = class { -}; -var InjectStreamConfig = class { -}; -var RTMP_STREAM_LIFE_CYCLE_TYPE = /* @__PURE__ */ ((RTMP_STREAM_LIFE_CYCLE_TYPE2) => { - RTMP_STREAM_LIFE_CYCLE_TYPE2[RTMP_STREAM_LIFE_CYCLE_TYPE2["RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL"] = 1] = "RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL"; - RTMP_STREAM_LIFE_CYCLE_TYPE2[RTMP_STREAM_LIFE_CYCLE_TYPE2["RTMP_STREAM_LIFE_CYCLE_BIND2OWNER"] = 2] = "RTMP_STREAM_LIFE_CYCLE_BIND2OWNER"; - return RTMP_STREAM_LIFE_CYCLE_TYPE2; -})(RTMP_STREAM_LIFE_CYCLE_TYPE || {}); -var PublisherConfiguration = class { -}; -var CAMERA_DIRECTION = /* @__PURE__ */ ((CAMERA_DIRECTION2) => { - CAMERA_DIRECTION2[CAMERA_DIRECTION2["CAMERA_REAR"] = 0] = "CAMERA_REAR"; - CAMERA_DIRECTION2[CAMERA_DIRECTION2["CAMERA_FRONT"] = 1] = "CAMERA_FRONT"; - return CAMERA_DIRECTION2; -})(CAMERA_DIRECTION || {}); -var CLOUD_PROXY_TYPE = /* @__PURE__ */ ((CLOUD_PROXY_TYPE2) => { - CLOUD_PROXY_TYPE2[CLOUD_PROXY_TYPE2["NONE_PROXY"] = 0] = "NONE_PROXY"; - CLOUD_PROXY_TYPE2[CLOUD_PROXY_TYPE2["UDP_PROXY"] = 1] = "UDP_PROXY"; - CLOUD_PROXY_TYPE2[CLOUD_PROXY_TYPE2["TCP_PROXY"] = 2] = "TCP_PROXY"; - return CLOUD_PROXY_TYPE2; -})(CLOUD_PROXY_TYPE || {}); -var CameraCapturerConfiguration = class { -}; -var ScreenCaptureConfiguration = class { -}; -var SIZE = class { -}; -var ThumbImageBuffer = class { -}; -var ScreenCaptureSourceType = /* @__PURE__ */ ((ScreenCaptureSourceType2) => { - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Unknown"] = -1] = "ScreenCaptureSourceType_Unknown"; - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Window"] = 0] = "ScreenCaptureSourceType_Window"; - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Screen"] = 1] = "ScreenCaptureSourceType_Screen"; - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Custom"] = 2] = "ScreenCaptureSourceType_Custom"; - return ScreenCaptureSourceType2; -})(ScreenCaptureSourceType || {}); -var ScreenCaptureSourceInfo = class { -}; -var AdvancedAudioOptions = class { -}; -var ImageTrackOptions = class { -}; -var ChannelMediaOptions = class { -}; -var PROXY_TYPE = /* @__PURE__ */ ((PROXY_TYPE2) => { - PROXY_TYPE2[PROXY_TYPE2["NONE_PROXY_TYPE"] = 0] = "NONE_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["UDP_PROXY_TYPE"] = 1] = "UDP_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["TCP_PROXY_TYPE"] = 2] = "TCP_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["LOCAL_PROXY_TYPE"] = 3] = "LOCAL_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["TCP_PROXY_AUTO_FALLBACK_TYPE"] = 4] = "TCP_PROXY_AUTO_FALLBACK_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["HTTP_PROXY_TYPE"] = 5] = "HTTP_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["HTTPS_PROXY_TYPE"] = 6] = "HTTPS_PROXY_TYPE"; - return PROXY_TYPE2; -})(PROXY_TYPE || {}); -var FeatureType = /* @__PURE__ */ ((FeatureType2) => { - FeatureType2[FeatureType2["VIDEO_VIRTUAL_BACKGROUND"] = 1] = "VIDEO_VIRTUAL_BACKGROUND"; - FeatureType2[FeatureType2["VIDEO_BEAUTY_EFFECT"] = 2] = "VIDEO_BEAUTY_EFFECT"; - return FeatureType2; -})(FeatureType || {}); -var LeaveChannelOptions = class { -}; -var RtcEngineContext = class { -}; -var METADATA_TYPE = /* @__PURE__ */ ((METADATA_TYPE2) => { - METADATA_TYPE2[METADATA_TYPE2["UNKNOWN_METADATA"] = -1] = "UNKNOWN_METADATA"; - METADATA_TYPE2[METADATA_TYPE2["VIDEO_METADATA"] = 0] = "VIDEO_METADATA"; - return METADATA_TYPE2; -})(METADATA_TYPE || {}); -var MAX_METADATA_SIZE_TYPE = /* @__PURE__ */ ((MAX_METADATA_SIZE_TYPE2) => { - MAX_METADATA_SIZE_TYPE2[MAX_METADATA_SIZE_TYPE2["INVALID_METADATA_SIZE_IN_BYTE"] = -1] = "INVALID_METADATA_SIZE_IN_BYTE"; - MAX_METADATA_SIZE_TYPE2[MAX_METADATA_SIZE_TYPE2["DEFAULT_METADATA_SIZE_IN_BYTE"] = 512] = "DEFAULT_METADATA_SIZE_IN_BYTE"; - MAX_METADATA_SIZE_TYPE2[MAX_METADATA_SIZE_TYPE2["MAX_METADATA_SIZE_IN_BYTE"] = 1024] = "MAX_METADATA_SIZE_IN_BYTE"; - return MAX_METADATA_SIZE_TYPE2; -})(MAX_METADATA_SIZE_TYPE || {}); -var Metadata = class { -}; -var DIRECT_CDN_STREAMING_ERROR = /* @__PURE__ */ ((DIRECT_CDN_STREAMING_ERROR2) => { - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_OK"] = 0] = "DIRECT_CDN_STREAMING_ERROR_OK"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_FAILED"] = 1] = "DIRECT_CDN_STREAMING_ERROR_FAILED"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION"] = 2] = "DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION"] = 3] = "DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_NET_CONNECT"] = 4] = "DIRECT_CDN_STREAMING_ERROR_NET_CONNECT"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_BAD_NAME"] = 5] = "DIRECT_CDN_STREAMING_ERROR_BAD_NAME"; - return DIRECT_CDN_STREAMING_ERROR2; -})(DIRECT_CDN_STREAMING_ERROR || {}); -var DIRECT_CDN_STREAMING_STATE = /* @__PURE__ */ ((DIRECT_CDN_STREAMING_STATE2) => { - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_IDLE"] = 0] = "DIRECT_CDN_STREAMING_STATE_IDLE"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_RUNNING"] = 1] = "DIRECT_CDN_STREAMING_STATE_RUNNING"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_STOPPED"] = 2] = "DIRECT_CDN_STREAMING_STATE_STOPPED"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_FAILED"] = 3] = "DIRECT_CDN_STREAMING_STATE_FAILED"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_RECOVERING"] = 4] = "DIRECT_CDN_STREAMING_STATE_RECOVERING"; - return DIRECT_CDN_STREAMING_STATE2; -})(DIRECT_CDN_STREAMING_STATE || {}); -var DirectCdnStreamingStats = class { -}; -var DirectCdnStreamingMediaOptions = class { -}; -var ExtensionInfo = class { -}; -var QUALITY_REPORT_FORMAT_TYPE = /* @__PURE__ */ ((QUALITY_REPORT_FORMAT_TYPE2) => { - QUALITY_REPORT_FORMAT_TYPE2[QUALITY_REPORT_FORMAT_TYPE2["QUALITY_REPORT_JSON"] = 0] = "QUALITY_REPORT_JSON"; - QUALITY_REPORT_FORMAT_TYPE2[QUALITY_REPORT_FORMAT_TYPE2["QUALITY_REPORT_HTML"] = 1] = "QUALITY_REPORT_HTML"; - return QUALITY_REPORT_FORMAT_TYPE2; -})(QUALITY_REPORT_FORMAT_TYPE || {}); -var MEDIA_DEVICE_STATE_TYPE = /* @__PURE__ */ ((MEDIA_DEVICE_STATE_TYPE2) => { - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_IDLE"] = 0] = "MEDIA_DEVICE_STATE_IDLE"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_ACTIVE"] = 1] = "MEDIA_DEVICE_STATE_ACTIVE"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_DISABLED"] = 2] = "MEDIA_DEVICE_STATE_DISABLED"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_NOT_PRESENT"] = 4] = "MEDIA_DEVICE_STATE_NOT_PRESENT"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_UNPLUGGED"] = 8] = "MEDIA_DEVICE_STATE_UNPLUGGED"; - return MEDIA_DEVICE_STATE_TYPE2; -})(MEDIA_DEVICE_STATE_TYPE || {}); -var VIDEO_PROFILE_TYPE = /* @__PURE__ */ ((VIDEO_PROFILE_TYPE2) => { - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_120P"] = 0] = "VIDEO_PROFILE_LANDSCAPE_120P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_120P_3"] = 2] = "VIDEO_PROFILE_LANDSCAPE_120P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_180P"] = 10] = "VIDEO_PROFILE_LANDSCAPE_180P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_180P_3"] = 12] = "VIDEO_PROFILE_LANDSCAPE_180P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_180P_4"] = 13] = "VIDEO_PROFILE_LANDSCAPE_180P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_240P"] = 20] = "VIDEO_PROFILE_LANDSCAPE_240P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_240P_3"] = 22] = "VIDEO_PROFILE_LANDSCAPE_240P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_240P_4"] = 23] = "VIDEO_PROFILE_LANDSCAPE_240P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P"] = 30] = "VIDEO_PROFILE_LANDSCAPE_360P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_3"] = 32] = "VIDEO_PROFILE_LANDSCAPE_360P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_4"] = 33] = "VIDEO_PROFILE_LANDSCAPE_360P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_6"] = 35] = "VIDEO_PROFILE_LANDSCAPE_360P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_7"] = 36] = "VIDEO_PROFILE_LANDSCAPE_360P_7"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_8"] = 37] = "VIDEO_PROFILE_LANDSCAPE_360P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_9"] = 38] = "VIDEO_PROFILE_LANDSCAPE_360P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_10"] = 39] = "VIDEO_PROFILE_LANDSCAPE_360P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_11"] = 100] = "VIDEO_PROFILE_LANDSCAPE_360P_11"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P"] = 40] = "VIDEO_PROFILE_LANDSCAPE_480P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_3"] = 42] = "VIDEO_PROFILE_LANDSCAPE_480P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_4"] = 43] = "VIDEO_PROFILE_LANDSCAPE_480P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_6"] = 45] = "VIDEO_PROFILE_LANDSCAPE_480P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_8"] = 47] = "VIDEO_PROFILE_LANDSCAPE_480P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_9"] = 48] = "VIDEO_PROFILE_LANDSCAPE_480P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_10"] = 49] = "VIDEO_PROFILE_LANDSCAPE_480P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P"] = 50] = "VIDEO_PROFILE_LANDSCAPE_720P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P_3"] = 52] = "VIDEO_PROFILE_LANDSCAPE_720P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P_5"] = 54] = "VIDEO_PROFILE_LANDSCAPE_720P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P_6"] = 55] = "VIDEO_PROFILE_LANDSCAPE_720P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1080P"] = 60] = "VIDEO_PROFILE_LANDSCAPE_1080P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1080P_3"] = 62] = "VIDEO_PROFILE_LANDSCAPE_1080P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1080P_5"] = 64] = "VIDEO_PROFILE_LANDSCAPE_1080P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1440P"] = 66] = "VIDEO_PROFILE_LANDSCAPE_1440P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1440P_2"] = 67] = "VIDEO_PROFILE_LANDSCAPE_1440P_2"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_4K"] = 70] = "VIDEO_PROFILE_LANDSCAPE_4K"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_4K_3"] = 72] = "VIDEO_PROFILE_LANDSCAPE_4K_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_120P"] = 1e3] = "VIDEO_PROFILE_PORTRAIT_120P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_120P_3"] = 1002] = "VIDEO_PROFILE_PORTRAIT_120P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_180P"] = 1010] = "VIDEO_PROFILE_PORTRAIT_180P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_180P_3"] = 1012] = "VIDEO_PROFILE_PORTRAIT_180P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_180P_4"] = 1013] = "VIDEO_PROFILE_PORTRAIT_180P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_240P"] = 1020] = "VIDEO_PROFILE_PORTRAIT_240P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_240P_3"] = 1022] = "VIDEO_PROFILE_PORTRAIT_240P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_240P_4"] = 1023] = "VIDEO_PROFILE_PORTRAIT_240P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P"] = 1030] = "VIDEO_PROFILE_PORTRAIT_360P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_3"] = 1032] = "VIDEO_PROFILE_PORTRAIT_360P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_4"] = 1033] = "VIDEO_PROFILE_PORTRAIT_360P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_6"] = 1035] = "VIDEO_PROFILE_PORTRAIT_360P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_7"] = 1036] = "VIDEO_PROFILE_PORTRAIT_360P_7"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_8"] = 1037] = "VIDEO_PROFILE_PORTRAIT_360P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_9"] = 1038] = "VIDEO_PROFILE_PORTRAIT_360P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_10"] = 1039] = "VIDEO_PROFILE_PORTRAIT_360P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_11"] = 1100] = "VIDEO_PROFILE_PORTRAIT_360P_11"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P"] = 1040] = "VIDEO_PROFILE_PORTRAIT_480P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_3"] = 1042] = "VIDEO_PROFILE_PORTRAIT_480P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_4"] = 1043] = "VIDEO_PROFILE_PORTRAIT_480P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_6"] = 1045] = "VIDEO_PROFILE_PORTRAIT_480P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_8"] = 1047] = "VIDEO_PROFILE_PORTRAIT_480P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_9"] = 1048] = "VIDEO_PROFILE_PORTRAIT_480P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_10"] = 1049] = "VIDEO_PROFILE_PORTRAIT_480P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P"] = 1050] = "VIDEO_PROFILE_PORTRAIT_720P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P_3"] = 1052] = "VIDEO_PROFILE_PORTRAIT_720P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P_5"] = 1054] = "VIDEO_PROFILE_PORTRAIT_720P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P_6"] = 1055] = "VIDEO_PROFILE_PORTRAIT_720P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1080P"] = 1060] = "VIDEO_PROFILE_PORTRAIT_1080P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1080P_3"] = 1062] = "VIDEO_PROFILE_PORTRAIT_1080P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1080P_5"] = 1064] = "VIDEO_PROFILE_PORTRAIT_1080P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1440P"] = 1066] = "VIDEO_PROFILE_PORTRAIT_1440P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1440P_2"] = 1067] = "VIDEO_PROFILE_PORTRAIT_1440P_2"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_4K"] = 1070] = "VIDEO_PROFILE_PORTRAIT_4K"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_4K_3"] = 1072] = "VIDEO_PROFILE_PORTRAIT_4K_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_DEFAULT"] = 30] = "VIDEO_PROFILE_DEFAULT"; - return VIDEO_PROFILE_TYPE2; -})(VIDEO_PROFILE_TYPE || {}); - -// generate/IAgoraRtcEngineEx.ts -var RtcConnection = class { -}; - -// generate/IAgoraSpatialAudio.ts -var RemoteVoicePositionInfo = class { -}; -var SpatialAudioZone = class { -}; - -// generate/IAudioDeviceManager.ts -var MAX_DEVICE_ID_LENGTH_TYPE = /* @__PURE__ */ ((MAX_DEVICE_ID_LENGTH_TYPE2) => { - MAX_DEVICE_ID_LENGTH_TYPE2[MAX_DEVICE_ID_LENGTH_TYPE2["MAX_DEVICE_ID_LENGTH"] = 512] = "MAX_DEVICE_ID_LENGTH"; - return MAX_DEVICE_ID_LENGTH_TYPE2; -})(MAX_DEVICE_ID_LENGTH_TYPE || {}); - -exports.AREA_CODE = AREA_CODE; -exports.AREA_CODE_EX = AREA_CODE_EX; -exports.AUDIENCE_LATENCY_LEVEL_TYPE = AUDIENCE_LATENCY_LEVEL_TYPE; -exports.AUDIO_AINS_MODE = AUDIO_AINS_MODE; -exports.AUDIO_CODEC_PROFILE_TYPE = AUDIO_CODEC_PROFILE_TYPE; -exports.AUDIO_CODEC_TYPE = AUDIO_CODEC_TYPE; -exports.AUDIO_DUAL_MONO_MODE = AUDIO_DUAL_MONO_MODE; -exports.AUDIO_EFFECT_PRESET = AUDIO_EFFECT_PRESET; -exports.AUDIO_ENCODED_FRAME_OBSERVER_POSITION = AUDIO_ENCODED_FRAME_OBSERVER_POSITION; -exports.AUDIO_ENCODING_TYPE = AUDIO_ENCODING_TYPE; -exports.AUDIO_EQUALIZATION_BAND_FREQUENCY = AUDIO_EQUALIZATION_BAND_FREQUENCY; -exports.AUDIO_FILE_RECORDING_TYPE = AUDIO_FILE_RECORDING_TYPE; -exports.AUDIO_FRAME_POSITION = AUDIO_FRAME_POSITION; -exports.AUDIO_FRAME_TYPE = AUDIO_FRAME_TYPE; -exports.AUDIO_MIXING_DUAL_MONO_MODE = AUDIO_MIXING_DUAL_MONO_MODE; -exports.AUDIO_MIXING_REASON_TYPE = AUDIO_MIXING_REASON_TYPE; -exports.AUDIO_MIXING_STATE_TYPE = AUDIO_MIXING_STATE_TYPE; -exports.AUDIO_PROFILE_TYPE = AUDIO_PROFILE_TYPE; -exports.AUDIO_RECORDING_QUALITY_TYPE = AUDIO_RECORDING_QUALITY_TYPE; -exports.AUDIO_REVERB_TYPE = AUDIO_REVERB_TYPE; -exports.AUDIO_SAMPLE_RATE_TYPE = AUDIO_SAMPLE_RATE_TYPE; -exports.AUDIO_SCENARIO_TYPE = AUDIO_SCENARIO_TYPE; -exports.AUDIO_SESSION_OPERATION_RESTRICTION = AUDIO_SESSION_OPERATION_RESTRICTION; -exports.AUDIO_TRACK_TYPE = AUDIO_TRACK_TYPE; -exports.AdvanceOptions = AdvanceOptions; -exports.AdvancedAudioOptions = AdvancedAudioOptions; -exports.AdvancedConfigInfo = AdvancedConfigInfo; -exports.AgoraRhythmPlayerConfig = AgoraRhythmPlayerConfig; -exports.AudioEncodedFrameInfo = AudioEncodedFrameInfo; -exports.AudioEncodedFrameObserverConfig = AudioEncodedFrameObserverConfig; -exports.AudioFrame = AudioFrame; -exports.AudioParameters = AudioParameters; -exports.AudioParams = AudioParams; -exports.AudioPcmDataInfo = AudioPcmDataInfo; -exports.AudioPcmFrame = AudioPcmFrame; -exports.AudioRecordingConfiguration = AudioRecordingConfiguration; -exports.AudioRoute = AudioRoute; -exports.AudioSpectrumData = AudioSpectrumData; -exports.AudioTrackConfig = AudioTrackConfig; -exports.AudioVolumeInfo = AudioVolumeInfo; -exports.BACKGROUND_BLUR_DEGREE = BACKGROUND_BLUR_DEGREE; -exports.BACKGROUND_SOURCE_TYPE = BACKGROUND_SOURCE_TYPE; -exports.BYTES_PER_SAMPLE = BYTES_PER_SAMPLE; -exports.BeautyOptions = BeautyOptions; -exports.CAMERA_DIRECTION = CAMERA_DIRECTION; -exports.CAMERA_VIDEO_SOURCE_TYPE = CAMERA_VIDEO_SOURCE_TYPE; -exports.CAPTURE_BRIGHTNESS_LEVEL_TYPE = CAPTURE_BRIGHTNESS_LEVEL_TYPE; -exports.CHANNEL_MEDIA_RELAY_ERROR = CHANNEL_MEDIA_RELAY_ERROR; -exports.CHANNEL_MEDIA_RELAY_EVENT = CHANNEL_MEDIA_RELAY_EVENT; -exports.CHANNEL_MEDIA_RELAY_STATE = CHANNEL_MEDIA_RELAY_STATE; -exports.CHANNEL_PROFILE_TYPE = CHANNEL_PROFILE_TYPE; -exports.CLIENT_ROLE_CHANGE_FAILED_REASON = CLIENT_ROLE_CHANGE_FAILED_REASON; -exports.CLIENT_ROLE_TYPE = CLIENT_ROLE_TYPE; -exports.CLOUD_PROXY_TYPE = CLOUD_PROXY_TYPE; -exports.CODEC_CAP_MASK = CODEC_CAP_MASK; -exports.COMPRESSION_PREFERENCE = COMPRESSION_PREFERENCE; -exports.CONFIG_FETCH_TYPE = CONFIG_FETCH_TYPE; -exports.CONNECTION_CHANGED_REASON_TYPE = CONNECTION_CHANGED_REASON_TYPE; -exports.CONNECTION_STATE_TYPE = CONNECTION_STATE_TYPE; -exports.CONTENT_INSPECT_RESULT = CONTENT_INSPECT_RESULT; -exports.CONTENT_INSPECT_TYPE = CONTENT_INSPECT_TYPE; -exports.CacheStatistics = CacheStatistics; -exports.CameraCapturerConfiguration = CameraCapturerConfiguration; -exports.ChannelMediaInfo = ChannelMediaInfo; -exports.ChannelMediaOptions = ChannelMediaOptions; -exports.ChannelMediaRelayConfiguration = ChannelMediaRelayConfiguration; -exports.ClientRoleOptions = ClientRoleOptions; -exports.ClimaxSegment = ClimaxSegment; -exports.CodecCapInfo = CodecCapInfo; -exports.CodecCapLevels = CodecCapLevels; -exports.ColorEnhanceOptions = ColorEnhanceOptions; -exports.ContentInspectConfig = ContentInspectConfig; -exports.ContentInspectModule = ContentInspectModule; -exports.DEGRADATION_PREFERENCE = DEGRADATION_PREFERENCE; -exports.DIRECT_CDN_STREAMING_ERROR = DIRECT_CDN_STREAMING_ERROR; -exports.DIRECT_CDN_STREAMING_STATE = DIRECT_CDN_STREAMING_STATE; -exports.DataStreamConfig = DataStreamConfig; -exports.DeviceInfo = DeviceInfo; -exports.DirectCdnStreamingMediaOptions = DirectCdnStreamingMediaOptions; -exports.DirectCdnStreamingStats = DirectCdnStreamingStats; -exports.DownlinkNetworkInfo = DownlinkNetworkInfo; -exports.EAR_MONITORING_FILTER_TYPE = EAR_MONITORING_FILTER_TYPE; -exports.EGL_CONTEXT_TYPE = EGL_CONTEXT_TYPE; -exports.ENCODING_PREFERENCE = ENCODING_PREFERENCE; -exports.ENCRYPTION_ERROR_TYPE = ENCRYPTION_ERROR_TYPE; -exports.ENCRYPTION_MODE = ENCRYPTION_MODE; -exports.ERROR_CODE_TYPE = ERROR_CODE_TYPE; -exports.EXPERIENCE_POOR_REASON = EXPERIENCE_POOR_REASON; -exports.EXPERIENCE_QUALITY_TYPE = EXPERIENCE_QUALITY_TYPE; -exports.EXTERNAL_VIDEO_SOURCE_TYPE = EXTERNAL_VIDEO_SOURCE_TYPE; -exports.EchoTestConfiguration = EchoTestConfiguration; -exports.EncodedAudioFrameAdvancedSettings = EncodedAudioFrameAdvancedSettings; -exports.EncodedAudioFrameInfo = EncodedAudioFrameInfo; -exports.EncodedVideoFrameInfo = EncodedVideoFrameInfo; -exports.EncryptionConfig = EncryptionConfig; -exports.ExtensionInfo = ExtensionInfo; -exports.ExternalVideoFrame = ExternalVideoFrame; -exports.FIT_MODE_TYPE = FIT_MODE_TYPE; -exports.FRAME_HEIGHT = FRAME_HEIGHT; -exports.FRAME_RATE = FRAME_RATE; -exports.FRAME_WIDTH = FRAME_WIDTH; -exports.FeatureType = FeatureType; -exports.H264PacketizeMode = H264PacketizeMode; -exports.HEADPHONE_EQUALIZER_PRESET = HEADPHONE_EQUALIZER_PRESET; -exports.INJECT_STREAM_STATUS = INJECT_STREAM_STATUS; -exports.INTERFACE_ID_TYPE = INTERFACE_ID_TYPE; -exports.ImageTrackOptions = ImageTrackOptions; -exports.InjectStreamConfig = InjectStreamConfig; -exports.InputSeiData = InputSeiData; -exports.LASTMILE_PROBE_RESULT_STATE = LASTMILE_PROBE_RESULT_STATE; -exports.LICENSE_ERROR_TYPE = LICENSE_ERROR_TYPE; -exports.LIGHTENING_CONTRAST_LEVEL = LIGHTENING_CONTRAST_LEVEL; -exports.LOCAL_AUDIO_STREAM_ERROR = LOCAL_AUDIO_STREAM_ERROR; -exports.LOCAL_AUDIO_STREAM_STATE = LOCAL_AUDIO_STREAM_STATE; -exports.LOCAL_PROXY_MODE = LOCAL_PROXY_MODE; -exports.LOCAL_VIDEO_STREAM_ERROR = LOCAL_VIDEO_STREAM_ERROR; -exports.LOCAL_VIDEO_STREAM_STATE = LOCAL_VIDEO_STREAM_STATE; -exports.LOG_FILTER_TYPE = LOG_FILTER_TYPE; -exports.LOG_LEVEL = LOG_LEVEL; -exports.LOW_LIGHT_ENHANCE_LEVEL = LOW_LIGHT_ENHANCE_LEVEL; -exports.LOW_LIGHT_ENHANCE_MODE = LOW_LIGHT_ENHANCE_MODE; -exports.LastmileProbeConfig = LastmileProbeConfig; -exports.LastmileProbeOneWayResult = LastmileProbeOneWayResult; -exports.LastmileProbeResult = LastmileProbeResult; -exports.LeaveChannelOptions = LeaveChannelOptions; -exports.LiveStreamAdvancedFeature = LiveStreamAdvancedFeature; -exports.LiveTranscoding = LiveTranscoding; -exports.LocalAccessPointConfiguration = LocalAccessPointConfiguration; -exports.LocalAudioStats = LocalAudioStats; -exports.LocalTranscoderConfiguration = LocalTranscoderConfiguration; -exports.LocalVideoStats = LocalVideoStats; -exports.LogConfig = LogConfig; -exports.LogUploadServerInfo = LogUploadServerInfo; -exports.LowlightEnhanceOptions = LowlightEnhanceOptions; -exports.MAX_DEVICE_ID_LENGTH_TYPE = MAX_DEVICE_ID_LENGTH_TYPE; -exports.MAX_METADATA_SIZE_TYPE = MAX_METADATA_SIZE_TYPE; -exports.MAX_USER_ACCOUNT_LENGTH_TYPE = MAX_USER_ACCOUNT_LENGTH_TYPE; -exports.MEDIA_DEVICE_STATE_TYPE = MEDIA_DEVICE_STATE_TYPE; -exports.MEDIA_DEVICE_TYPE = MEDIA_DEVICE_TYPE; -exports.MEDIA_PLAYER_ERROR = MEDIA_PLAYER_ERROR; -exports.MEDIA_PLAYER_EVENT = MEDIA_PLAYER_EVENT; -exports.MEDIA_PLAYER_METADATA_TYPE = MEDIA_PLAYER_METADATA_TYPE; -exports.MEDIA_PLAYER_SOURCE_TYPE = MEDIA_PLAYER_SOURCE_TYPE; -exports.MEDIA_PLAYER_STATE = MEDIA_PLAYER_STATE; -exports.MEDIA_SOURCE_TYPE = MEDIA_SOURCE_TYPE; -exports.MEDIA_STREAM_TYPE = MEDIA_STREAM_TYPE; -exports.MEDIA_TRACE_EVENT = MEDIA_TRACE_EVENT; -exports.METADATA_TYPE = METADATA_TYPE; -exports.MUSIC_CACHE_STATUS_TYPE = MUSIC_CACHE_STATUS_TYPE; -exports.MediaRecorderConfiguration = MediaRecorderConfiguration; -exports.MediaRecorderContainerFormat = MediaRecorderContainerFormat; -exports.MediaRecorderStreamType = MediaRecorderStreamType; -exports.MediaSource = MediaSource; -exports.Metadata = Metadata; -exports.Music = Music; -exports.MusicCacheInfo = MusicCacheInfo; -exports.MusicChartInfo = MusicChartInfo; -exports.MusicContentCenterConfiguration = MusicContentCenterConfiguration; -exports.MusicContentCenterStatusCode = MusicContentCenterStatusCode; -exports.MvProperty = MvProperty; -exports.NETWORK_TYPE = NETWORK_TYPE; -exports.ORIENTATION_MODE = ORIENTATION_MODE; -exports.PERMISSION_TYPE = PERMISSION_TYPE; -exports.PLAYER_PRELOAD_EVENT = PLAYER_PRELOAD_EVENT; -exports.PRIORITY_TYPE = PRIORITY_TYPE; -exports.PROXY_TYPE = PROXY_TYPE; -exports.Packet = Packet; -exports.PacketOptions = PacketOptions; -exports.PeerDownlinkInfo = PeerDownlinkInfo; -exports.PlayerStreamInfo = PlayerStreamInfo; -exports.PlayerUpdatedInfo = PlayerUpdatedInfo; -exports.PreloadStatusCode = PreloadStatusCode; -exports.PublisherConfiguration = PublisherConfiguration; -exports.QUALITY_ADAPT_INDICATION = QUALITY_ADAPT_INDICATION; -exports.QUALITY_REPORT_FORMAT_TYPE = QUALITY_REPORT_FORMAT_TYPE; -exports.QUALITY_TYPE = QUALITY_TYPE; -exports.RAW_AUDIO_FRAME_OP_MODE_TYPE = RAW_AUDIO_FRAME_OP_MODE_TYPE; -exports.REMOTE_AUDIO_STATE = REMOTE_AUDIO_STATE; -exports.REMOTE_AUDIO_STATE_REASON = REMOTE_AUDIO_STATE_REASON; -exports.REMOTE_USER_STATE = REMOTE_USER_STATE; -exports.REMOTE_VIDEO_DOWNSCALE_LEVEL = REMOTE_VIDEO_DOWNSCALE_LEVEL; -exports.REMOTE_VIDEO_STATE = REMOTE_VIDEO_STATE; -exports.REMOTE_VIDEO_STATE_REASON = REMOTE_VIDEO_STATE_REASON; -exports.RENDER_MODE_TYPE = RENDER_MODE_TYPE; -exports.RHYTHM_PLAYER_ERROR_TYPE = RHYTHM_PLAYER_ERROR_TYPE; -exports.RHYTHM_PLAYER_STATE_TYPE = RHYTHM_PLAYER_STATE_TYPE; -exports.RTMP_STREAMING_EVENT = RTMP_STREAMING_EVENT; -exports.RTMP_STREAM_LIFE_CYCLE_TYPE = RTMP_STREAM_LIFE_CYCLE_TYPE; -exports.RTMP_STREAM_PUBLISH_ERROR_TYPE = RTMP_STREAM_PUBLISH_ERROR_TYPE; -exports.RTMP_STREAM_PUBLISH_STATE = RTMP_STREAM_PUBLISH_STATE; -exports.RecorderErrorCode = RecorderErrorCode; -exports.RecorderInfo = RecorderInfo; -exports.RecorderState = RecorderState; -exports.RecorderStreamInfo = RecorderStreamInfo; -exports.Rectangle = Rectangle; -exports.Region = Region; -exports.RemoteAudioStats = RemoteAudioStats; -exports.RemoteVideoStats = RemoteVideoStats; -exports.RemoteVoicePositionInfo = RemoteVoicePositionInfo; -exports.RtcConnection = RtcConnection; -exports.RtcEngineContext = RtcEngineContext; -exports.RtcImage = RtcImage; -exports.RtcStats = RtcStats; -exports.SCREEN_CAPTURE_FRAMERATE_CAPABILITY = SCREEN_CAPTURE_FRAMERATE_CAPABILITY; -exports.SCREEN_SCENARIO_TYPE = SCREEN_SCENARIO_TYPE; -exports.SEG_MODEL_TYPE = SEG_MODEL_TYPE; -exports.SIMULCAST_STREAM_MODE = SIMULCAST_STREAM_MODE; -exports.SIZE = SIZE; -exports.STREAMING_SRC_ERR = STREAMING_SRC_ERR; -exports.STREAMING_SRC_STATE = STREAMING_SRC_STATE; -exports.STREAM_FALLBACK_OPTIONS = STREAM_FALLBACK_OPTIONS; -exports.STREAM_PUBLISH_STATE = STREAM_PUBLISH_STATE; -exports.STREAM_SUBSCRIBE_STATE = STREAM_SUBSCRIBE_STATE; -exports.ScreenAudioParameters = ScreenAudioParameters; -exports.ScreenCaptureConfiguration = ScreenCaptureConfiguration; -exports.ScreenCaptureParameters = ScreenCaptureParameters; -exports.ScreenCaptureParameters2 = ScreenCaptureParameters2; -exports.ScreenCaptureSourceInfo = ScreenCaptureSourceInfo; -exports.ScreenCaptureSourceType = ScreenCaptureSourceType; -exports.ScreenVideoParameters = ScreenVideoParameters; -exports.SegmentationProperty = SegmentationProperty; -exports.SenderOptions = SenderOptions; -exports.SimulcastStreamConfig = SimulcastStreamConfig; -exports.SpatialAudioParams = SpatialAudioParams; -exports.SpatialAudioZone = SpatialAudioZone; -exports.SrcInfo = SrcInfo; -exports.TCcMode = TCcMode; -exports.THREAD_PRIORITY_TYPE = THREAD_PRIORITY_TYPE; -exports.ThumbImageBuffer = ThumbImageBuffer; -exports.TranscodingUser = TranscodingUser; -exports.TranscodingVideoStream = TranscodingVideoStream; -exports.UPLOAD_ERROR_REASON = UPLOAD_ERROR_REASON; -exports.USER_OFFLINE_REASON_TYPE = USER_OFFLINE_REASON_TYPE; -exports.UplinkNetworkInfo = UplinkNetworkInfo; -exports.UserAudioSpectrumInfo = UserAudioSpectrumInfo; -exports.UserInfo = UserInfo; -exports.VIDEO_APPLICATION_SCENARIO_TYPE = VIDEO_APPLICATION_SCENARIO_TYPE; -exports.VIDEO_BUFFER_TYPE = VIDEO_BUFFER_TYPE; -exports.VIDEO_CODEC_CAPABILITY_LEVEL = VIDEO_CODEC_CAPABILITY_LEVEL; -exports.VIDEO_CODEC_PROFILE_TYPE = VIDEO_CODEC_PROFILE_TYPE; -exports.VIDEO_CODEC_TYPE = VIDEO_CODEC_TYPE; -exports.VIDEO_CODEC_TYPE_FOR_STREAM = VIDEO_CODEC_TYPE_FOR_STREAM; -exports.VIDEO_CONTENT_HINT = VIDEO_CONTENT_HINT; -exports.VIDEO_DENOISER_LEVEL = VIDEO_DENOISER_LEVEL; -exports.VIDEO_DENOISER_MODE = VIDEO_DENOISER_MODE; -exports.VIDEO_FRAME_PROCESS_MODE = VIDEO_FRAME_PROCESS_MODE; -exports.VIDEO_FRAME_TYPE = VIDEO_FRAME_TYPE; -exports.VIDEO_MIRROR_MODE_TYPE = VIDEO_MIRROR_MODE_TYPE; -exports.VIDEO_MODULE_POSITION = VIDEO_MODULE_POSITION; -exports.VIDEO_ORIENTATION = VIDEO_ORIENTATION; -exports.VIDEO_PIXEL_FORMAT = VIDEO_PIXEL_FORMAT; -exports.VIDEO_PROFILE_TYPE = VIDEO_PROFILE_TYPE; -exports.VIDEO_SOURCE_TYPE = VIDEO_SOURCE_TYPE; -exports.VIDEO_STREAM_TYPE = VIDEO_STREAM_TYPE; -exports.VIDEO_TRANSCODER_ERROR = VIDEO_TRANSCODER_ERROR; -exports.VIDEO_VIEW_SETUP_MODE = VIDEO_VIEW_SETUP_MODE; -exports.VOICE_BEAUTIFIER_PRESET = VOICE_BEAUTIFIER_PRESET; -exports.VOICE_CONVERSION_PRESET = VOICE_CONVERSION_PRESET; -exports.VideoCanvas = VideoCanvas; -exports.VideoCompositingLayout = VideoCompositingLayout; -exports.VideoDenoiserOptions = VideoDenoiserOptions; -exports.VideoDimensions = VideoDimensions; -exports.VideoEncoderConfiguration = VideoEncoderConfiguration; -exports.VideoFormat = VideoFormat; -exports.VideoFrame = VideoFrame; -exports.VideoRenderingTracingInfo = VideoRenderingTracingInfo; -exports.VideoSubscriptionOptions = VideoSubscriptionOptions; -exports.VideoTrackInfo = VideoTrackInfo; -exports.VirtualBackgroundSource = VirtualBackgroundSource; -exports.WARN_CODE_TYPE = WARN_CODE_TYPE; -exports.WATERMARK_FIT_MODE = WATERMARK_FIT_MODE; -exports.WLACC_MESSAGE_REASON = WLACC_MESSAGE_REASON; -exports.WLACC_SUGGEST_ACTION = WLACC_SUGGEST_ACTION; -exports.WatermarkOptions = WatermarkOptions; -exports.WatermarkRatio = WatermarkRatio; -exports.WlAccStats = WlAccStats; diff --git a/packages/@iris/rtc/.dist/@iris/web-rtc.mjs b/packages/@iris/rtc/.dist/@iris/web-rtc.mjs deleted file mode 100644 index 136babb..0000000 --- a/packages/@iris/rtc/.dist/@iris/web-rtc.mjs +++ /dev/null @@ -1,1784 +0,0 @@ -/** - * @license @iris/web-rtc - * @version 1.0.0 - * - * Copyright (c) Agora, Inc. - * - * This source code is licensed under the MIT license. - */ - - -// generate/AgoraBase.ts -var CHANNEL_PROFILE_TYPE = /* @__PURE__ */ ((CHANNEL_PROFILE_TYPE2) => { - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_COMMUNICATION"] = 0] = "CHANNEL_PROFILE_COMMUNICATION"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_LIVE_BROADCASTING"] = 1] = "CHANNEL_PROFILE_LIVE_BROADCASTING"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_GAME"] = 2] = "CHANNEL_PROFILE_GAME"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_CLOUD_GAMING"] = 3] = "CHANNEL_PROFILE_CLOUD_GAMING"; - CHANNEL_PROFILE_TYPE2[CHANNEL_PROFILE_TYPE2["CHANNEL_PROFILE_COMMUNICATION_1v1"] = 4] = "CHANNEL_PROFILE_COMMUNICATION_1v1"; - return CHANNEL_PROFILE_TYPE2; -})(CHANNEL_PROFILE_TYPE || {}); -var WARN_CODE_TYPE = /* @__PURE__ */ ((WARN_CODE_TYPE2) => { - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_INVALID_VIEW"] = 8] = "WARN_INVALID_VIEW"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_INIT_VIDEO"] = 16] = "WARN_INIT_VIDEO"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_PENDING"] = 20] = "WARN_PENDING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_NO_AVAILABLE_CHANNEL"] = 103] = "WARN_NO_AVAILABLE_CHANNEL"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_LOOKUP_CHANNEL_TIMEOUT"] = 104] = "WARN_LOOKUP_CHANNEL_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_LOOKUP_CHANNEL_REJECTED"] = 105] = "WARN_LOOKUP_CHANNEL_REJECTED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_TIMEOUT"] = 106] = "WARN_OPEN_CHANNEL_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_REJECTED"] = 107] = "WARN_OPEN_CHANNEL_REJECTED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_SWITCH_LIVE_VIDEO_TIMEOUT"] = 111] = "WARN_SWITCH_LIVE_VIDEO_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_SET_CLIENT_ROLE_TIMEOUT"] = 118] = "WARN_SET_CLIENT_ROLE_TIMEOUT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_INVALID_TICKET"] = 121] = "WARN_OPEN_CHANNEL_INVALID_TICKET"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_OPEN_CHANNEL_TRY_NEXT_VOS"] = 122] = "WARN_OPEN_CHANNEL_TRY_NEXT_VOS"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_CONNECTION_UNRECOVERABLE"] = 131] = "WARN_CHANNEL_CONNECTION_UNRECOVERABLE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_CONNECTION_IP_CHANGED"] = 132] = "WARN_CHANNEL_CONNECTION_IP_CHANGED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_CONNECTION_PORT_CHANGED"] = 133] = "WARN_CHANNEL_CONNECTION_PORT_CHANGED"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_CHANNEL_SOCKET_ERROR"] = 134] = "WARN_CHANNEL_SOCKET_ERROR"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_AUDIO_MIXING_OPEN_ERROR"] = 701] = "WARN_AUDIO_MIXING_OPEN_ERROR"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RUNTIME_PLAYOUT_WARNING"] = 1014] = "WARN_ADM_RUNTIME_PLAYOUT_WARNING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RUNTIME_RECORDING_WARNING"] = 1016] = "WARN_ADM_RUNTIME_RECORDING_WARNING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RECORD_AUDIO_SILENCE"] = 1019] = "WARN_ADM_RECORD_AUDIO_SILENCE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_PLAYOUT_MALFUNCTION"] = 1020] = "WARN_ADM_PLAYOUT_MALFUNCTION"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RECORD_MALFUNCTION"] = 1021] = "WARN_ADM_RECORD_MALFUNCTION"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_RECORD_AUDIO_LOWLEVEL"] = 1031] = "WARN_ADM_RECORD_AUDIO_LOWLEVEL"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL"] = 1032] = "WARN_ADM_PLAYOUT_AUDIO_LOWLEVEL"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WINDOWS_NO_DATA_READY_EVENT"] = 1040] = "WARN_ADM_WINDOWS_NO_DATA_READY_EVENT"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_APM_HOWLING"] = 1051] = "WARN_APM_HOWLING"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_GLITCH_STATE"] = 1052] = "WARN_ADM_GLITCH_STATE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_IMPROPER_SETTINGS"] = 1053] = "WARN_ADM_IMPROPER_SETTINGS"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE"] = 1322] = "WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE"] = 1323] = "WARN_ADM_WIN_CORE_NO_PLAYOUT_DEVICE"; - WARN_CODE_TYPE2[WARN_CODE_TYPE2["WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE"] = 1324] = "WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE"; - return WARN_CODE_TYPE2; -})(WARN_CODE_TYPE || {}); -var ERROR_CODE_TYPE = /* @__PURE__ */ ((ERROR_CODE_TYPE2) => { - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_OK"] = 0] = "ERR_OK"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_FAILED"] = 1] = "ERR_FAILED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_ARGUMENT"] = 2] = "ERR_INVALID_ARGUMENT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_READY"] = 3] = "ERR_NOT_READY"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_SUPPORTED"] = 4] = "ERR_NOT_SUPPORTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_REFUSED"] = 5] = "ERR_REFUSED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_BUFFER_TOO_SMALL"] = 6] = "ERR_BUFFER_TOO_SMALL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_INITIALIZED"] = 7] = "ERR_NOT_INITIALIZED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_STATE"] = 8] = "ERR_INVALID_STATE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NO_PERMISSION"] = 9] = "ERR_NO_PERMISSION"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TIMEDOUT"] = 10] = "ERR_TIMEDOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CANCELED"] = 11] = "ERR_CANCELED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TOO_OFTEN"] = 12] = "ERR_TOO_OFTEN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_BIND_SOCKET"] = 13] = "ERR_BIND_SOCKET"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NET_DOWN"] = 14] = "ERR_NET_DOWN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_JOIN_CHANNEL_REJECTED"] = 17] = "ERR_JOIN_CHANNEL_REJECTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LEAVE_CHANNEL_REJECTED"] = 18] = "ERR_LEAVE_CHANNEL_REJECTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ALREADY_IN_USE"] = 19] = "ERR_ALREADY_IN_USE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ABORTED"] = 20] = "ERR_ABORTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INIT_NET_ENGINE"] = 21] = "ERR_INIT_NET_ENGINE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_RESOURCE_LIMITED"] = 22] = "ERR_RESOURCE_LIMITED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_APP_ID"] = 101] = "ERR_INVALID_APP_ID"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_CHANNEL_NAME"] = 102] = "ERR_INVALID_CHANNEL_NAME"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NO_SERVER_RESOURCES"] = 103] = "ERR_NO_SERVER_RESOURCES"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TOKEN_EXPIRED"] = 109] = "ERR_TOKEN_EXPIRED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_TOKEN"] = 110] = "ERR_INVALID_TOKEN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CONNECTION_INTERRUPTED"] = 111] = "ERR_CONNECTION_INTERRUPTED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CONNECTION_LOST"] = 112] = "ERR_CONNECTION_LOST"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_NOT_IN_CHANNEL"] = 113] = "ERR_NOT_IN_CHANNEL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_SIZE_TOO_LARGE"] = 114] = "ERR_SIZE_TOO_LARGE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_BITRATE_LIMIT"] = 115] = "ERR_BITRATE_LIMIT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_TOO_MANY_DATA_STREAMS"] = 116] = "ERR_TOO_MANY_DATA_STREAMS"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_STREAM_MESSAGE_TIMEOUT"] = 117] = "ERR_STREAM_MESSAGE_TIMEOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED"] = 119] = "ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_DECRYPTION_FAILED"] = 120] = "ERR_DECRYPTION_FAILED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_USER_ID"] = 121] = "ERR_INVALID_USER_ID"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CLIENT_IS_BANNED_BY_SERVER"] = 123] = "ERR_CLIENT_IS_BANNED_BY_SERVER"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH"] = 130] = "ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LICENSE_CREDENTIAL_INVALID"] = 131] = "ERR_LICENSE_CREDENTIAL_INVALID"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_INVALID_USER_ACCOUNT"] = 134] = "ERR_INVALID_USER_ACCOUNT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_MODULE_NOT_FOUND"] = 157] = "ERR_MODULE_NOT_FOUND"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_RAW"] = 157] = "ERR_CERT_RAW"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_JSON_PART"] = 158] = "ERR_CERT_JSON_PART"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_JSON_INVAL"] = 159] = "ERR_CERT_JSON_INVAL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_JSON_NOMEM"] = 160] = "ERR_CERT_JSON_NOMEM"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_CUSTOM"] = 161] = "ERR_CERT_CUSTOM"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_CREDENTIAL"] = 162] = "ERR_CERT_CREDENTIAL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_SIGN"] = 163] = "ERR_CERT_SIGN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_FAIL"] = 164] = "ERR_CERT_FAIL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_BUF"] = 165] = "ERR_CERT_BUF"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_NULL"] = 166] = "ERR_CERT_NULL"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_DUEDATE"] = 167] = "ERR_CERT_DUEDATE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_CERT_REQUEST"] = 168] = "ERR_CERT_REQUEST"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_PCMSEND_FORMAT"] = 200] = "ERR_PCMSEND_FORMAT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_PCMSEND_BUFFEROVERFLOW"] = 201] = "ERR_PCMSEND_BUFFEROVERFLOW"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LOGIN_ALREADY_LOGIN"] = 428] = "ERR_LOGIN_ALREADY_LOGIN"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_LOAD_MEDIA_ENGINE"] = 1001] = "ERR_LOAD_MEDIA_ENGINE"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_GENERAL_ERROR"] = 1005] = "ERR_ADM_GENERAL_ERROR"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_INIT_PLAYOUT"] = 1008] = "ERR_ADM_INIT_PLAYOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_START_PLAYOUT"] = 1009] = "ERR_ADM_START_PLAYOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_STOP_PLAYOUT"] = 1010] = "ERR_ADM_STOP_PLAYOUT"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_INIT_RECORDING"] = 1011] = "ERR_ADM_INIT_RECORDING"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_START_RECORDING"] = 1012] = "ERR_ADM_START_RECORDING"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_STOP_RECORDING"] = 1013] = "ERR_ADM_STOP_RECORDING"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_VDM_CAMERA_NOT_AUTHORIZED"] = 1501] = "ERR_VDM_CAMERA_NOT_AUTHORIZED"; - ERROR_CODE_TYPE2[ERROR_CODE_TYPE2["ERR_ADM_APPLICATION_LOOPBACK"] = 2007] = "ERR_ADM_APPLICATION_LOOPBACK"; - return ERROR_CODE_TYPE2; -})(ERROR_CODE_TYPE || {}); -var LICENSE_ERROR_TYPE = /* @__PURE__ */ ((LICENSE_ERROR_TYPE2) => { - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_INVALID"] = 1] = "LICENSE_ERR_INVALID"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_EXPIRE"] = 2] = "LICENSE_ERR_EXPIRE"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_MINUTES_EXCEED"] = 3] = "LICENSE_ERR_MINUTES_EXCEED"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_LIMITED_PERIOD"] = 4] = "LICENSE_ERR_LIMITED_PERIOD"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_DIFF_DEVICES"] = 5] = "LICENSE_ERR_DIFF_DEVICES"; - LICENSE_ERROR_TYPE2[LICENSE_ERROR_TYPE2["LICENSE_ERR_INTERNAL"] = 99] = "LICENSE_ERR_INTERNAL"; - return LICENSE_ERROR_TYPE2; -})(LICENSE_ERROR_TYPE || {}); -var AUDIO_SESSION_OPERATION_RESTRICTION = /* @__PURE__ */ ((AUDIO_SESSION_OPERATION_RESTRICTION2) => { - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_NONE"] = 0] = "AUDIO_SESSION_OPERATION_RESTRICTION_NONE"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_SET_CATEGORY"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_CONFIGURE_SESSION"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_DEACTIVATE_SESSION"; - AUDIO_SESSION_OPERATION_RESTRICTION2[AUDIO_SESSION_OPERATION_RESTRICTION2["AUDIO_SESSION_OPERATION_RESTRICTION_ALL"] = 1] = "AUDIO_SESSION_OPERATION_RESTRICTION_ALL"; - return AUDIO_SESSION_OPERATION_RESTRICTION2; -})(AUDIO_SESSION_OPERATION_RESTRICTION || {}); -var USER_OFFLINE_REASON_TYPE = /* @__PURE__ */ ((USER_OFFLINE_REASON_TYPE2) => { - USER_OFFLINE_REASON_TYPE2[USER_OFFLINE_REASON_TYPE2["USER_OFFLINE_QUIT"] = 0] = "USER_OFFLINE_QUIT"; - USER_OFFLINE_REASON_TYPE2[USER_OFFLINE_REASON_TYPE2["USER_OFFLINE_DROPPED"] = 1] = "USER_OFFLINE_DROPPED"; - USER_OFFLINE_REASON_TYPE2[USER_OFFLINE_REASON_TYPE2["USER_OFFLINE_BECOME_AUDIENCE"] = 2] = "USER_OFFLINE_BECOME_AUDIENCE"; - return USER_OFFLINE_REASON_TYPE2; -})(USER_OFFLINE_REASON_TYPE || {}); -var INTERFACE_ID_TYPE = /* @__PURE__ */ ((INTERFACE_ID_TYPE2) => { - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_AUDIO_DEVICE_MANAGER"] = 1] = "AGORA_IID_AUDIO_DEVICE_MANAGER"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_VIDEO_DEVICE_MANAGER"] = 2] = "AGORA_IID_VIDEO_DEVICE_MANAGER"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_PARAMETER_ENGINE"] = 3] = "AGORA_IID_PARAMETER_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_MEDIA_ENGINE"] = 4] = "AGORA_IID_MEDIA_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_AUDIO_ENGINE"] = 5] = "AGORA_IID_AUDIO_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_VIDEO_ENGINE"] = 6] = "AGORA_IID_VIDEO_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_RTC_CONNECTION"] = 7] = "AGORA_IID_RTC_CONNECTION"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_SIGNALING_ENGINE"] = 8] = "AGORA_IID_SIGNALING_ENGINE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_MEDIA_ENGINE_REGULATOR"] = 9] = "AGORA_IID_MEDIA_ENGINE_REGULATOR"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_CLOUD_SPATIAL_AUDIO"] = 10] = "AGORA_IID_CLOUD_SPATIAL_AUDIO"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_LOCAL_SPATIAL_AUDIO"] = 11] = "AGORA_IID_LOCAL_SPATIAL_AUDIO"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_STATE_SYNC"] = 13] = "AGORA_IID_STATE_SYNC"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_METACHAT_SERVICE"] = 14] = "AGORA_IID_METACHAT_SERVICE"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_MUSIC_CONTENT_CENTER"] = 15] = "AGORA_IID_MUSIC_CONTENT_CENTER"; - INTERFACE_ID_TYPE2[INTERFACE_ID_TYPE2["AGORA_IID_H265_TRANSCODER"] = 16] = "AGORA_IID_H265_TRANSCODER"; - return INTERFACE_ID_TYPE2; -})(INTERFACE_ID_TYPE || {}); -var QUALITY_TYPE = /* @__PURE__ */ ((QUALITY_TYPE2) => { - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_UNKNOWN"] = 0] = "QUALITY_UNKNOWN"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_EXCELLENT"] = 1] = "QUALITY_EXCELLENT"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_GOOD"] = 2] = "QUALITY_GOOD"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_POOR"] = 3] = "QUALITY_POOR"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_BAD"] = 4] = "QUALITY_BAD"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_VBAD"] = 5] = "QUALITY_VBAD"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_DOWN"] = 6] = "QUALITY_DOWN"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_UNSUPPORTED"] = 7] = "QUALITY_UNSUPPORTED"; - QUALITY_TYPE2[QUALITY_TYPE2["QUALITY_DETECTING"] = 8] = "QUALITY_DETECTING"; - return QUALITY_TYPE2; -})(QUALITY_TYPE || {}); -var FIT_MODE_TYPE = /* @__PURE__ */ ((FIT_MODE_TYPE2) => { - FIT_MODE_TYPE2[FIT_MODE_TYPE2["MODE_COVER"] = 1] = "MODE_COVER"; - FIT_MODE_TYPE2[FIT_MODE_TYPE2["MODE_CONTAIN"] = 2] = "MODE_CONTAIN"; - return FIT_MODE_TYPE2; -})(FIT_MODE_TYPE || {}); -var VIDEO_ORIENTATION = /* @__PURE__ */ ((VIDEO_ORIENTATION2) => { - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_0"] = 0] = "VIDEO_ORIENTATION_0"; - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_90"] = 90] = "VIDEO_ORIENTATION_90"; - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_180"] = 180] = "VIDEO_ORIENTATION_180"; - VIDEO_ORIENTATION2[VIDEO_ORIENTATION2["VIDEO_ORIENTATION_270"] = 270] = "VIDEO_ORIENTATION_270"; - return VIDEO_ORIENTATION2; -})(VIDEO_ORIENTATION || {}); -var FRAME_RATE = /* @__PURE__ */ ((FRAME_RATE2) => { - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_1"] = 1] = "FRAME_RATE_FPS_1"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_7"] = 7] = "FRAME_RATE_FPS_7"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_10"] = 10] = "FRAME_RATE_FPS_10"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_15"] = 15] = "FRAME_RATE_FPS_15"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_24"] = 24] = "FRAME_RATE_FPS_24"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_30"] = 30] = "FRAME_RATE_FPS_30"; - FRAME_RATE2[FRAME_RATE2["FRAME_RATE_FPS_60"] = 60] = "FRAME_RATE_FPS_60"; - return FRAME_RATE2; -})(FRAME_RATE || {}); -var FRAME_WIDTH = /* @__PURE__ */ ((FRAME_WIDTH2) => { - FRAME_WIDTH2[FRAME_WIDTH2["FRAME_WIDTH_960"] = 960] = "FRAME_WIDTH_960"; - return FRAME_WIDTH2; -})(FRAME_WIDTH || {}); -var FRAME_HEIGHT = /* @__PURE__ */ ((FRAME_HEIGHT2) => { - FRAME_HEIGHT2[FRAME_HEIGHT2["FRAME_HEIGHT_540"] = 540] = "FRAME_HEIGHT_540"; - return FRAME_HEIGHT2; -})(FRAME_HEIGHT || {}); -var VIDEO_FRAME_TYPE = /* @__PURE__ */ ((VIDEO_FRAME_TYPE2) => { - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_BLANK_FRAME"] = 0] = "VIDEO_FRAME_TYPE_BLANK_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_KEY_FRAME"] = 3] = "VIDEO_FRAME_TYPE_KEY_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_DELTA_FRAME"] = 4] = "VIDEO_FRAME_TYPE_DELTA_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_B_FRAME"] = 5] = "VIDEO_FRAME_TYPE_B_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_DROPPABLE_FRAME"] = 6] = "VIDEO_FRAME_TYPE_DROPPABLE_FRAME"; - VIDEO_FRAME_TYPE2[VIDEO_FRAME_TYPE2["VIDEO_FRAME_TYPE_UNKNOW"] = 7] = "VIDEO_FRAME_TYPE_UNKNOW"; - return VIDEO_FRAME_TYPE2; -})(VIDEO_FRAME_TYPE || {}); -var ORIENTATION_MODE = /* @__PURE__ */ ((ORIENTATION_MODE2) => { - ORIENTATION_MODE2[ORIENTATION_MODE2["ORIENTATION_MODE_ADAPTIVE"] = 0] = "ORIENTATION_MODE_ADAPTIVE"; - ORIENTATION_MODE2[ORIENTATION_MODE2["ORIENTATION_MODE_FIXED_LANDSCAPE"] = 1] = "ORIENTATION_MODE_FIXED_LANDSCAPE"; - ORIENTATION_MODE2[ORIENTATION_MODE2["ORIENTATION_MODE_FIXED_PORTRAIT"] = 2] = "ORIENTATION_MODE_FIXED_PORTRAIT"; - return ORIENTATION_MODE2; -})(ORIENTATION_MODE || {}); -var DEGRADATION_PREFERENCE = /* @__PURE__ */ ((DEGRADATION_PREFERENCE2) => { - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_QUALITY"] = 0] = "MAINTAIN_QUALITY"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_FRAMERATE"] = 1] = "MAINTAIN_FRAMERATE"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_BALANCED"] = 2] = "MAINTAIN_BALANCED"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["MAINTAIN_RESOLUTION"] = 3] = "MAINTAIN_RESOLUTION"; - DEGRADATION_PREFERENCE2[DEGRADATION_PREFERENCE2["DISABLED"] = 100] = "DISABLED"; - return DEGRADATION_PREFERENCE2; -})(DEGRADATION_PREFERENCE || {}); -var VideoDimensions = class { -}; -var SCREEN_CAPTURE_FRAMERATE_CAPABILITY = /* @__PURE__ */ ((SCREEN_CAPTURE_FRAMERATE_CAPABILITY2) => { - SCREEN_CAPTURE_FRAMERATE_CAPABILITY2[SCREEN_CAPTURE_FRAMERATE_CAPABILITY2["SCREEN_CAPTURE_FRAMERATE_CAPABILITY_15_FPS"] = 0] = "SCREEN_CAPTURE_FRAMERATE_CAPABILITY_15_FPS"; - SCREEN_CAPTURE_FRAMERATE_CAPABILITY2[SCREEN_CAPTURE_FRAMERATE_CAPABILITY2["SCREEN_CAPTURE_FRAMERATE_CAPABILITY_30_FPS"] = 1] = "SCREEN_CAPTURE_FRAMERATE_CAPABILITY_30_FPS"; - SCREEN_CAPTURE_FRAMERATE_CAPABILITY2[SCREEN_CAPTURE_FRAMERATE_CAPABILITY2["SCREEN_CAPTURE_FRAMERATE_CAPABILITY_60_FPS"] = 2] = "SCREEN_CAPTURE_FRAMERATE_CAPABILITY_60_FPS"; - return SCREEN_CAPTURE_FRAMERATE_CAPABILITY2; -})(SCREEN_CAPTURE_FRAMERATE_CAPABILITY || {}); -var VIDEO_CODEC_CAPABILITY_LEVEL = /* @__PURE__ */ ((VIDEO_CODEC_CAPABILITY_LEVEL2) => { - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_UNSPECIFIED"] = -1] = "CODEC_CAPABILITY_LEVEL_UNSPECIFIED"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_BASIC_SUPPORT"] = 5] = "CODEC_CAPABILITY_LEVEL_BASIC_SUPPORT"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_1080P30FPS"] = 10] = "CODEC_CAPABILITY_LEVEL_1080P30FPS"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_1080P60FPS"] = 20] = "CODEC_CAPABILITY_LEVEL_1080P60FPS"; - VIDEO_CODEC_CAPABILITY_LEVEL2[VIDEO_CODEC_CAPABILITY_LEVEL2["CODEC_CAPABILITY_LEVEL_4K60FPS"] = 30] = "CODEC_CAPABILITY_LEVEL_4K60FPS"; - return VIDEO_CODEC_CAPABILITY_LEVEL2; -})(VIDEO_CODEC_CAPABILITY_LEVEL || {}); -var VIDEO_CODEC_TYPE = /* @__PURE__ */ ((VIDEO_CODEC_TYPE2) => { - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_NONE"] = 0] = "VIDEO_CODEC_NONE"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_VP8"] = 1] = "VIDEO_CODEC_VP8"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_H264"] = 2] = "VIDEO_CODEC_H264"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_H265"] = 3] = "VIDEO_CODEC_H265"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_GENERIC"] = 6] = "VIDEO_CODEC_GENERIC"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_GENERIC_H264"] = 7] = "VIDEO_CODEC_GENERIC_H264"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_AV1"] = 12] = "VIDEO_CODEC_AV1"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_VP9"] = 13] = "VIDEO_CODEC_VP9"; - VIDEO_CODEC_TYPE2[VIDEO_CODEC_TYPE2["VIDEO_CODEC_GENERIC_JPEG"] = 20] = "VIDEO_CODEC_GENERIC_JPEG"; - return VIDEO_CODEC_TYPE2; -})(VIDEO_CODEC_TYPE || {}); -var TCcMode = /* @__PURE__ */ ((TCcMode2) => { - TCcMode2[TCcMode2["CC_ENABLED"] = 0] = "CC_ENABLED"; - TCcMode2[TCcMode2["CC_DISABLED"] = 1] = "CC_DISABLED"; - return TCcMode2; -})(TCcMode || {}); -var SenderOptions = class { -}; -var AUDIO_CODEC_TYPE = /* @__PURE__ */ ((AUDIO_CODEC_TYPE2) => { - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_OPUS"] = 1] = "AUDIO_CODEC_OPUS"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_PCMA"] = 3] = "AUDIO_CODEC_PCMA"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_PCMU"] = 4] = "AUDIO_CODEC_PCMU"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_G722"] = 5] = "AUDIO_CODEC_G722"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_AACLC"] = 8] = "AUDIO_CODEC_AACLC"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_HEAAC"] = 9] = "AUDIO_CODEC_HEAAC"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_JC1"] = 10] = "AUDIO_CODEC_JC1"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_HEAAC2"] = 11] = "AUDIO_CODEC_HEAAC2"; - AUDIO_CODEC_TYPE2[AUDIO_CODEC_TYPE2["AUDIO_CODEC_LPCNET"] = 12] = "AUDIO_CODEC_LPCNET"; - return AUDIO_CODEC_TYPE2; -})(AUDIO_CODEC_TYPE || {}); -var AUDIO_ENCODING_TYPE = /* @__PURE__ */ ((AUDIO_ENCODING_TYPE2) => { - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_16000_LOW"] = 65793] = "AUDIO_ENCODING_TYPE_AAC_16000_LOW"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM"] = 65794] = "AUDIO_ENCODING_TYPE_AAC_16000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_32000_LOW"] = 66049] = "AUDIO_ENCODING_TYPE_AAC_32000_LOW"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM"] = 66050] = "AUDIO_ENCODING_TYPE_AAC_32000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_32000_HIGH"] = 66051] = "AUDIO_ENCODING_TYPE_AAC_32000_HIGH"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM"] = 66306] = "AUDIO_ENCODING_TYPE_AAC_48000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_AAC_48000_HIGH"] = 66307] = "AUDIO_ENCODING_TYPE_AAC_48000_HIGH"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_16000_LOW"] = 131329] = "AUDIO_ENCODING_TYPE_OPUS_16000_LOW"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM"] = 131330] = "AUDIO_ENCODING_TYPE_OPUS_16000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM"] = 131842] = "AUDIO_ENCODING_TYPE_OPUS_48000_MEDIUM"; - AUDIO_ENCODING_TYPE2[AUDIO_ENCODING_TYPE2["AUDIO_ENCODING_TYPE_OPUS_48000_HIGH"] = 131843] = "AUDIO_ENCODING_TYPE_OPUS_48000_HIGH"; - return AUDIO_ENCODING_TYPE2; -})(AUDIO_ENCODING_TYPE || {}); -var WATERMARK_FIT_MODE = /* @__PURE__ */ ((WATERMARK_FIT_MODE2) => { - WATERMARK_FIT_MODE2[WATERMARK_FIT_MODE2["FIT_MODE_COVER_POSITION"] = 0] = "FIT_MODE_COVER_POSITION"; - WATERMARK_FIT_MODE2[WATERMARK_FIT_MODE2["FIT_MODE_USE_IMAGE_RATIO"] = 1] = "FIT_MODE_USE_IMAGE_RATIO"; - return WATERMARK_FIT_MODE2; -})(WATERMARK_FIT_MODE || {}); -var EncodedAudioFrameAdvancedSettings = class { -}; -var EncodedAudioFrameInfo = class { -}; -var AudioPcmDataInfo = class { -}; -var H264PacketizeMode = /* @__PURE__ */ ((H264PacketizeMode2) => { - H264PacketizeMode2[H264PacketizeMode2["NonInterleaved"] = 0] = "NonInterleaved"; - H264PacketizeMode2[H264PacketizeMode2["SingleNalUnit"] = 1] = "SingleNalUnit"; - return H264PacketizeMode2; -})(H264PacketizeMode || {}); -var VIDEO_STREAM_TYPE = /* @__PURE__ */ ((VIDEO_STREAM_TYPE2) => { - VIDEO_STREAM_TYPE2[VIDEO_STREAM_TYPE2["VIDEO_STREAM_HIGH"] = 0] = "VIDEO_STREAM_HIGH"; - VIDEO_STREAM_TYPE2[VIDEO_STREAM_TYPE2["VIDEO_STREAM_LOW"] = 1] = "VIDEO_STREAM_LOW"; - return VIDEO_STREAM_TYPE2; -})(VIDEO_STREAM_TYPE || {}); -var VideoSubscriptionOptions = class { -}; -var EncodedVideoFrameInfo = class { -}; -var COMPRESSION_PREFERENCE = /* @__PURE__ */ ((COMPRESSION_PREFERENCE2) => { - COMPRESSION_PREFERENCE2[COMPRESSION_PREFERENCE2["PREFER_LOW_LATENCY"] = 0] = "PREFER_LOW_LATENCY"; - COMPRESSION_PREFERENCE2[COMPRESSION_PREFERENCE2["PREFER_QUALITY"] = 1] = "PREFER_QUALITY"; - return COMPRESSION_PREFERENCE2; -})(COMPRESSION_PREFERENCE || {}); -var ENCODING_PREFERENCE = /* @__PURE__ */ ((ENCODING_PREFERENCE2) => { - ENCODING_PREFERENCE2[ENCODING_PREFERENCE2["PREFER_AUTO"] = -1] = "PREFER_AUTO"; - ENCODING_PREFERENCE2[ENCODING_PREFERENCE2["PREFER_SOFTWARE"] = 0] = "PREFER_SOFTWARE"; - ENCODING_PREFERENCE2[ENCODING_PREFERENCE2["PREFER_HARDWARE"] = 1] = "PREFER_HARDWARE"; - return ENCODING_PREFERENCE2; -})(ENCODING_PREFERENCE || {}); -var AdvanceOptions = class { -}; -var VIDEO_MIRROR_MODE_TYPE = /* @__PURE__ */ ((VIDEO_MIRROR_MODE_TYPE2) => { - VIDEO_MIRROR_MODE_TYPE2[VIDEO_MIRROR_MODE_TYPE2["VIDEO_MIRROR_MODE_AUTO"] = 0] = "VIDEO_MIRROR_MODE_AUTO"; - VIDEO_MIRROR_MODE_TYPE2[VIDEO_MIRROR_MODE_TYPE2["VIDEO_MIRROR_MODE_ENABLED"] = 1] = "VIDEO_MIRROR_MODE_ENABLED"; - VIDEO_MIRROR_MODE_TYPE2[VIDEO_MIRROR_MODE_TYPE2["VIDEO_MIRROR_MODE_DISABLED"] = 2] = "VIDEO_MIRROR_MODE_DISABLED"; - return VIDEO_MIRROR_MODE_TYPE2; -})(VIDEO_MIRROR_MODE_TYPE || {}); -var CODEC_CAP_MASK = /* @__PURE__ */ ((CODEC_CAP_MASK2) => { - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_NONE"] = 0] = "CODEC_CAP_MASK_NONE"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_HW_DEC"] = 1] = "CODEC_CAP_MASK_HW_DEC"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_HW_ENC"] = 1] = "CODEC_CAP_MASK_HW_ENC"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_SW_DEC"] = 1] = "CODEC_CAP_MASK_SW_DEC"; - CODEC_CAP_MASK2[CODEC_CAP_MASK2["CODEC_CAP_MASK_SW_ENC"] = 1] = "CODEC_CAP_MASK_SW_ENC"; - return CODEC_CAP_MASK2; -})(CODEC_CAP_MASK || {}); -var CodecCapLevels = class { -}; -var CodecCapInfo = class { -}; -var VideoEncoderConfiguration = class { -}; -var DataStreamConfig = class { -}; -var SIMULCAST_STREAM_MODE = /* @__PURE__ */ ((SIMULCAST_STREAM_MODE2) => { - SIMULCAST_STREAM_MODE2[SIMULCAST_STREAM_MODE2["AUTO_SIMULCAST_STREAM"] = -1] = "AUTO_SIMULCAST_STREAM"; - SIMULCAST_STREAM_MODE2[SIMULCAST_STREAM_MODE2["DISABLE_SIMULCAST_STREAM"] = 0] = "DISABLE_SIMULCAST_STREAM"; - SIMULCAST_STREAM_MODE2[SIMULCAST_STREAM_MODE2["ENABLE_SIMULCAST_STREAM"] = 1] = "ENABLE_SIMULCAST_STREAM"; - return SIMULCAST_STREAM_MODE2; -})(SIMULCAST_STREAM_MODE || {}); -var SimulcastStreamConfig = class { -}; -var Rectangle = class { -}; -var WatermarkRatio = class { -}; -var WatermarkOptions = class { -}; -var RtcStats = class { -}; -var CLIENT_ROLE_TYPE = /* @__PURE__ */ ((CLIENT_ROLE_TYPE2) => { - CLIENT_ROLE_TYPE2[CLIENT_ROLE_TYPE2["CLIENT_ROLE_BROADCASTER"] = 1] = "CLIENT_ROLE_BROADCASTER"; - CLIENT_ROLE_TYPE2[CLIENT_ROLE_TYPE2["CLIENT_ROLE_AUDIENCE"] = 2] = "CLIENT_ROLE_AUDIENCE"; - return CLIENT_ROLE_TYPE2; -})(CLIENT_ROLE_TYPE || {}); -var QUALITY_ADAPT_INDICATION = /* @__PURE__ */ ((QUALITY_ADAPT_INDICATION2) => { - QUALITY_ADAPT_INDICATION2[QUALITY_ADAPT_INDICATION2["ADAPT_NONE"] = 0] = "ADAPT_NONE"; - QUALITY_ADAPT_INDICATION2[QUALITY_ADAPT_INDICATION2["ADAPT_UP_BANDWIDTH"] = 1] = "ADAPT_UP_BANDWIDTH"; - QUALITY_ADAPT_INDICATION2[QUALITY_ADAPT_INDICATION2["ADAPT_DOWN_BANDWIDTH"] = 2] = "ADAPT_DOWN_BANDWIDTH"; - return QUALITY_ADAPT_INDICATION2; -})(QUALITY_ADAPT_INDICATION || {}); -var AUDIENCE_LATENCY_LEVEL_TYPE = /* @__PURE__ */ ((AUDIENCE_LATENCY_LEVEL_TYPE2) => { - AUDIENCE_LATENCY_LEVEL_TYPE2[AUDIENCE_LATENCY_LEVEL_TYPE2["AUDIENCE_LATENCY_LEVEL_LOW_LATENCY"] = 1] = "AUDIENCE_LATENCY_LEVEL_LOW_LATENCY"; - AUDIENCE_LATENCY_LEVEL_TYPE2[AUDIENCE_LATENCY_LEVEL_TYPE2["AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY"] = 2] = "AUDIENCE_LATENCY_LEVEL_ULTRA_LOW_LATENCY"; - return AUDIENCE_LATENCY_LEVEL_TYPE2; -})(AUDIENCE_LATENCY_LEVEL_TYPE || {}); -var ClientRoleOptions = class { -}; -var EXPERIENCE_QUALITY_TYPE = /* @__PURE__ */ ((EXPERIENCE_QUALITY_TYPE2) => { - EXPERIENCE_QUALITY_TYPE2[EXPERIENCE_QUALITY_TYPE2["EXPERIENCE_QUALITY_GOOD"] = 0] = "EXPERIENCE_QUALITY_GOOD"; - EXPERIENCE_QUALITY_TYPE2[EXPERIENCE_QUALITY_TYPE2["EXPERIENCE_QUALITY_BAD"] = 1] = "EXPERIENCE_QUALITY_BAD"; - return EXPERIENCE_QUALITY_TYPE2; -})(EXPERIENCE_QUALITY_TYPE || {}); -var EXPERIENCE_POOR_REASON = /* @__PURE__ */ ((EXPERIENCE_POOR_REASON2) => { - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["EXPERIENCE_REASON_NONE"] = 0] = "EXPERIENCE_REASON_NONE"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["REMOTE_NETWORK_QUALITY_POOR"] = 1] = "REMOTE_NETWORK_QUALITY_POOR"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["LOCAL_NETWORK_QUALITY_POOR"] = 2] = "LOCAL_NETWORK_QUALITY_POOR"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["WIRELESS_SIGNAL_POOR"] = 4] = "WIRELESS_SIGNAL_POOR"; - EXPERIENCE_POOR_REASON2[EXPERIENCE_POOR_REASON2["WIFI_BLUETOOTH_COEXIST"] = 8] = "WIFI_BLUETOOTH_COEXIST"; - return EXPERIENCE_POOR_REASON2; -})(EXPERIENCE_POOR_REASON || {}); -var AUDIO_AINS_MODE = /* @__PURE__ */ ((AUDIO_AINS_MODE2) => { - AUDIO_AINS_MODE2[AUDIO_AINS_MODE2["AINS_MODE_BALANCED"] = 0] = "AINS_MODE_BALANCED"; - AUDIO_AINS_MODE2[AUDIO_AINS_MODE2["AINS_MODE_AGGRESSIVE"] = 1] = "AINS_MODE_AGGRESSIVE"; - AUDIO_AINS_MODE2[AUDIO_AINS_MODE2["AINS_MODE_ULTRALOWLATENCY"] = 2] = "AINS_MODE_ULTRALOWLATENCY"; - return AUDIO_AINS_MODE2; -})(AUDIO_AINS_MODE || {}); -var AUDIO_PROFILE_TYPE = /* @__PURE__ */ ((AUDIO_PROFILE_TYPE2) => { - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_DEFAULT"] = 0] = "AUDIO_PROFILE_DEFAULT"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_SPEECH_STANDARD"] = 1] = "AUDIO_PROFILE_SPEECH_STANDARD"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_STANDARD"] = 2] = "AUDIO_PROFILE_MUSIC_STANDARD"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_STANDARD_STEREO"] = 3] = "AUDIO_PROFILE_MUSIC_STANDARD_STEREO"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_HIGH_QUALITY"] = 4] = "AUDIO_PROFILE_MUSIC_HIGH_QUALITY"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO"] = 5] = "AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_IOT"] = 6] = "AUDIO_PROFILE_IOT"; - AUDIO_PROFILE_TYPE2[AUDIO_PROFILE_TYPE2["AUDIO_PROFILE_NUM"] = 7] = "AUDIO_PROFILE_NUM"; - return AUDIO_PROFILE_TYPE2; -})(AUDIO_PROFILE_TYPE || {}); -var AUDIO_SCENARIO_TYPE = /* @__PURE__ */ ((AUDIO_SCENARIO_TYPE2) => { - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_DEFAULT"] = 0] = "AUDIO_SCENARIO_DEFAULT"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_GAME_STREAMING"] = 3] = "AUDIO_SCENARIO_GAME_STREAMING"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_CHATROOM"] = 5] = "AUDIO_SCENARIO_CHATROOM"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_CHORUS"] = 7] = "AUDIO_SCENARIO_CHORUS"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_MEETING"] = 8] = "AUDIO_SCENARIO_MEETING"; - AUDIO_SCENARIO_TYPE2[AUDIO_SCENARIO_TYPE2["AUDIO_SCENARIO_NUM"] = 9] = "AUDIO_SCENARIO_NUM"; - return AUDIO_SCENARIO_TYPE2; -})(AUDIO_SCENARIO_TYPE || {}); -var VideoFormat = class { -}; -var VIDEO_CONTENT_HINT = /* @__PURE__ */ ((VIDEO_CONTENT_HINT2) => { - VIDEO_CONTENT_HINT2[VIDEO_CONTENT_HINT2["CONTENT_HINT_NONE"] = 0] = "CONTENT_HINT_NONE"; - VIDEO_CONTENT_HINT2[VIDEO_CONTENT_HINT2["CONTENT_HINT_MOTION"] = 1] = "CONTENT_HINT_MOTION"; - VIDEO_CONTENT_HINT2[VIDEO_CONTENT_HINT2["CONTENT_HINT_DETAILS"] = 2] = "CONTENT_HINT_DETAILS"; - return VIDEO_CONTENT_HINT2; -})(VIDEO_CONTENT_HINT || {}); -var SCREEN_SCENARIO_TYPE = /* @__PURE__ */ ((SCREEN_SCENARIO_TYPE2) => { - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_DOCUMENT"] = 1] = "SCREEN_SCENARIO_DOCUMENT"; - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_GAMING"] = 2] = "SCREEN_SCENARIO_GAMING"; - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_VIDEO"] = 3] = "SCREEN_SCENARIO_VIDEO"; - SCREEN_SCENARIO_TYPE2[SCREEN_SCENARIO_TYPE2["SCREEN_SCENARIO_RDC"] = 4] = "SCREEN_SCENARIO_RDC"; - return SCREEN_SCENARIO_TYPE2; -})(SCREEN_SCENARIO_TYPE || {}); -var VIDEO_APPLICATION_SCENARIO_TYPE = /* @__PURE__ */ ((VIDEO_APPLICATION_SCENARIO_TYPE2) => { - VIDEO_APPLICATION_SCENARIO_TYPE2[VIDEO_APPLICATION_SCENARIO_TYPE2["APPLICATION_SCENARIO_GENERAL"] = 0] = "APPLICATION_SCENARIO_GENERAL"; - VIDEO_APPLICATION_SCENARIO_TYPE2[VIDEO_APPLICATION_SCENARIO_TYPE2["APPLICATION_SCENARIO_MEETING"] = 1] = "APPLICATION_SCENARIO_MEETING"; - return VIDEO_APPLICATION_SCENARIO_TYPE2; -})(VIDEO_APPLICATION_SCENARIO_TYPE || {}); -var CAPTURE_BRIGHTNESS_LEVEL_TYPE = /* @__PURE__ */ ((CAPTURE_BRIGHTNESS_LEVEL_TYPE2) => { - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_INVALID"] = -1] = "CAPTURE_BRIGHTNESS_LEVEL_INVALID"; - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_NORMAL"] = 0] = "CAPTURE_BRIGHTNESS_LEVEL_NORMAL"; - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_BRIGHT"] = 1] = "CAPTURE_BRIGHTNESS_LEVEL_BRIGHT"; - CAPTURE_BRIGHTNESS_LEVEL_TYPE2[CAPTURE_BRIGHTNESS_LEVEL_TYPE2["CAPTURE_BRIGHTNESS_LEVEL_DARK"] = 2] = "CAPTURE_BRIGHTNESS_LEVEL_DARK"; - return CAPTURE_BRIGHTNESS_LEVEL_TYPE2; -})(CAPTURE_BRIGHTNESS_LEVEL_TYPE || {}); -var LOCAL_AUDIO_STREAM_STATE = /* @__PURE__ */ ((LOCAL_AUDIO_STREAM_STATE2) => { - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_STOPPED"] = 0] = "LOCAL_AUDIO_STREAM_STATE_STOPPED"; - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_RECORDING"] = 1] = "LOCAL_AUDIO_STREAM_STATE_RECORDING"; - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_ENCODING"] = 2] = "LOCAL_AUDIO_STREAM_STATE_ENCODING"; - LOCAL_AUDIO_STREAM_STATE2[LOCAL_AUDIO_STREAM_STATE2["LOCAL_AUDIO_STREAM_STATE_FAILED"] = 3] = "LOCAL_AUDIO_STREAM_STATE_FAILED"; - return LOCAL_AUDIO_STREAM_STATE2; -})(LOCAL_AUDIO_STREAM_STATE || {}); -var LOCAL_AUDIO_STREAM_ERROR = /* @__PURE__ */ ((LOCAL_AUDIO_STREAM_ERROR2) => { - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_OK"] = 0] = "LOCAL_AUDIO_STREAM_ERROR_OK"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_FAILURE"] = 1] = "LOCAL_AUDIO_STREAM_ERROR_FAILURE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION"] = 2] = "LOCAL_AUDIO_STREAM_ERROR_DEVICE_NO_PERMISSION"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY"] = 3] = "LOCAL_AUDIO_STREAM_ERROR_DEVICE_BUSY"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE"] = 4] = "LOCAL_AUDIO_STREAM_ERROR_RECORD_FAILURE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE"] = 5] = "LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE"] = 6] = "LOCAL_AUDIO_STREAM_ERROR_NO_RECORDING_DEVICE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE"] = 7] = "LOCAL_AUDIO_STREAM_ERROR_NO_PLAYOUT_DEVICE"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED"] = 8] = "LOCAL_AUDIO_STREAM_ERROR_INTERRUPTED"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID"] = 9] = "LOCAL_AUDIO_STREAM_ERROR_RECORD_INVALID_ID"; - LOCAL_AUDIO_STREAM_ERROR2[LOCAL_AUDIO_STREAM_ERROR2["LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID"] = 10] = "LOCAL_AUDIO_STREAM_ERROR_PLAYOUT_INVALID_ID"; - return LOCAL_AUDIO_STREAM_ERROR2; -})(LOCAL_AUDIO_STREAM_ERROR || {}); -var LOCAL_VIDEO_STREAM_STATE = /* @__PURE__ */ ((LOCAL_VIDEO_STREAM_STATE2) => { - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_STOPPED"] = 0] = "LOCAL_VIDEO_STREAM_STATE_STOPPED"; - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_CAPTURING"] = 1] = "LOCAL_VIDEO_STREAM_STATE_CAPTURING"; - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_ENCODING"] = 2] = "LOCAL_VIDEO_STREAM_STATE_ENCODING"; - LOCAL_VIDEO_STREAM_STATE2[LOCAL_VIDEO_STREAM_STATE2["LOCAL_VIDEO_STREAM_STATE_FAILED"] = 3] = "LOCAL_VIDEO_STREAM_STATE_FAILED"; - return LOCAL_VIDEO_STREAM_STATE2; -})(LOCAL_VIDEO_STREAM_STATE || {}); -var LOCAL_VIDEO_STREAM_ERROR = /* @__PURE__ */ ((LOCAL_VIDEO_STREAM_ERROR2) => { - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_OK"] = 0] = "LOCAL_VIDEO_STREAM_ERROR_OK"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_FAILURE"] = 1] = "LOCAL_VIDEO_STREAM_ERROR_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION"] = 2] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY"] = 3] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_BUSY"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE"] = 4] = "LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE"] = 5] = "LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND"] = 6] = "LOCAL_VIDEO_STREAM_ERROR_CAPTURE_INBACKGROUND"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS"] = 7] = "LOCAL_VIDEO_STREAM_ERROR_CAPTURE_MULTIPLE_FOREGROUND_APPS"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND"] = 8] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_NOT_FOUND"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED"] = 9] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_DISCONNECTED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID"] = 10] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_INVALID_ID"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE"] = 101] = "LOCAL_VIDEO_STREAM_ERROR_DEVICE_SYSTEM_PRESSURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED"] = 11] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_MINIMIZED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED"] = 12] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_CLOSED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED"] = 13] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_OCCLUDED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED"] = 20] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_NOT_SUPPORTED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE"] = 21] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION"] = 22] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED"] = 23] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED"] = 24] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN"] = 25] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN"] = 26] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN"; - LOCAL_VIDEO_STREAM_ERROR2[LOCAL_VIDEO_STREAM_ERROR2["LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED"] = 27] = "LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED"; - return LOCAL_VIDEO_STREAM_ERROR2; -})(LOCAL_VIDEO_STREAM_ERROR || {}); -var REMOTE_AUDIO_STATE = /* @__PURE__ */ ((REMOTE_AUDIO_STATE2) => { - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_STOPPED"] = 0] = "REMOTE_AUDIO_STATE_STOPPED"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_STARTING"] = 1] = "REMOTE_AUDIO_STATE_STARTING"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_DECODING"] = 2] = "REMOTE_AUDIO_STATE_DECODING"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_FROZEN"] = 3] = "REMOTE_AUDIO_STATE_FROZEN"; - REMOTE_AUDIO_STATE2[REMOTE_AUDIO_STATE2["REMOTE_AUDIO_STATE_FAILED"] = 4] = "REMOTE_AUDIO_STATE_FAILED"; - return REMOTE_AUDIO_STATE2; -})(REMOTE_AUDIO_STATE || {}); -var REMOTE_AUDIO_STATE_REASON = /* @__PURE__ */ ((REMOTE_AUDIO_STATE_REASON2) => { - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_INTERNAL"] = 0] = "REMOTE_AUDIO_REASON_INTERNAL"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_NETWORK_CONGESTION"] = 1] = "REMOTE_AUDIO_REASON_NETWORK_CONGESTION"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_NETWORK_RECOVERY"] = 2] = "REMOTE_AUDIO_REASON_NETWORK_RECOVERY"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_LOCAL_MUTED"] = 3] = "REMOTE_AUDIO_REASON_LOCAL_MUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_LOCAL_UNMUTED"] = 4] = "REMOTE_AUDIO_REASON_LOCAL_UNMUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_REMOTE_MUTED"] = 5] = "REMOTE_AUDIO_REASON_REMOTE_MUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_REMOTE_UNMUTED"] = 6] = "REMOTE_AUDIO_REASON_REMOTE_UNMUTED"; - REMOTE_AUDIO_STATE_REASON2[REMOTE_AUDIO_STATE_REASON2["REMOTE_AUDIO_REASON_REMOTE_OFFLINE"] = 7] = "REMOTE_AUDIO_REASON_REMOTE_OFFLINE"; - return REMOTE_AUDIO_STATE_REASON2; -})(REMOTE_AUDIO_STATE_REASON || {}); -var REMOTE_VIDEO_STATE = /* @__PURE__ */ ((REMOTE_VIDEO_STATE2) => { - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_STOPPED"] = 0] = "REMOTE_VIDEO_STATE_STOPPED"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_STARTING"] = 1] = "REMOTE_VIDEO_STATE_STARTING"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_DECODING"] = 2] = "REMOTE_VIDEO_STATE_DECODING"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_FROZEN"] = 3] = "REMOTE_VIDEO_STATE_FROZEN"; - REMOTE_VIDEO_STATE2[REMOTE_VIDEO_STATE2["REMOTE_VIDEO_STATE_FAILED"] = 4] = "REMOTE_VIDEO_STATE_FAILED"; - return REMOTE_VIDEO_STATE2; -})(REMOTE_VIDEO_STATE || {}); -var REMOTE_VIDEO_STATE_REASON = /* @__PURE__ */ ((REMOTE_VIDEO_STATE_REASON2) => { - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_INTERNAL"] = 0] = "REMOTE_VIDEO_STATE_REASON_INTERNAL"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION"] = 1] = "REMOTE_VIDEO_STATE_REASON_NETWORK_CONGESTION"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY"] = 2] = "REMOTE_VIDEO_STATE_REASON_NETWORK_RECOVERY"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED"] = 3] = "REMOTE_VIDEO_STATE_REASON_LOCAL_MUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED"] = 4] = "REMOTE_VIDEO_STATE_REASON_LOCAL_UNMUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED"] = 5] = "REMOTE_VIDEO_STATE_REASON_REMOTE_MUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED"] = 6] = "REMOTE_VIDEO_STATE_REASON_REMOTE_UNMUTED"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE"] = 7] = "REMOTE_VIDEO_STATE_REASON_REMOTE_OFFLINE"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK"] = 8] = "REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY"] = 9] = "REMOTE_VIDEO_STATE_REASON_AUDIO_FALLBACK_RECOVERY"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW"] = 10] = "REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_LOW"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH"] = 11] = "REMOTE_VIDEO_STATE_REASON_VIDEO_STREAM_TYPE_CHANGE_TO_HIGH"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_SDK_IN_BACKGROUND"] = 12] = "REMOTE_VIDEO_STATE_REASON_SDK_IN_BACKGROUND"; - REMOTE_VIDEO_STATE_REASON2[REMOTE_VIDEO_STATE_REASON2["REMOTE_VIDEO_STATE_REASON_CODEC_NOT_SUPPORT"] = 13] = "REMOTE_VIDEO_STATE_REASON_CODEC_NOT_SUPPORT"; - return REMOTE_VIDEO_STATE_REASON2; -})(REMOTE_VIDEO_STATE_REASON || {}); -var REMOTE_USER_STATE = /* @__PURE__ */ ((REMOTE_USER_STATE2) => { - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_MUTE_AUDIO"] = 1] = "USER_STATE_MUTE_AUDIO"; - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_MUTE_VIDEO"] = 2] = "USER_STATE_MUTE_VIDEO"; - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_ENABLE_VIDEO"] = 16] = "USER_STATE_ENABLE_VIDEO"; - REMOTE_USER_STATE2[REMOTE_USER_STATE2["USER_STATE_ENABLE_LOCAL_VIDEO"] = 256] = "USER_STATE_ENABLE_LOCAL_VIDEO"; - return REMOTE_USER_STATE2; -})(REMOTE_USER_STATE || {}); -var VideoTrackInfo = class { -}; -var REMOTE_VIDEO_DOWNSCALE_LEVEL = /* @__PURE__ */ ((REMOTE_VIDEO_DOWNSCALE_LEVEL2) => { - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE"] = 0] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_NONE"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_1"] = 1] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_1"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_2"] = 2] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_2"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_3"] = 3] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_3"; - REMOTE_VIDEO_DOWNSCALE_LEVEL2[REMOTE_VIDEO_DOWNSCALE_LEVEL2["REMOTE_VIDEO_DOWNSCALE_LEVEL_4"] = 4] = "REMOTE_VIDEO_DOWNSCALE_LEVEL_4"; - return REMOTE_VIDEO_DOWNSCALE_LEVEL2; -})(REMOTE_VIDEO_DOWNSCALE_LEVEL || {}); -var AudioVolumeInfo = class { -}; -var DeviceInfo = class { -}; -var Packet = class { -}; -var AUDIO_SAMPLE_RATE_TYPE = /* @__PURE__ */ ((AUDIO_SAMPLE_RATE_TYPE2) => { - AUDIO_SAMPLE_RATE_TYPE2[AUDIO_SAMPLE_RATE_TYPE2["AUDIO_SAMPLE_RATE_32000"] = 32e3] = "AUDIO_SAMPLE_RATE_32000"; - AUDIO_SAMPLE_RATE_TYPE2[AUDIO_SAMPLE_RATE_TYPE2["AUDIO_SAMPLE_RATE_44100"] = 44100] = "AUDIO_SAMPLE_RATE_44100"; - AUDIO_SAMPLE_RATE_TYPE2[AUDIO_SAMPLE_RATE_TYPE2["AUDIO_SAMPLE_RATE_48000"] = 48e3] = "AUDIO_SAMPLE_RATE_48000"; - return AUDIO_SAMPLE_RATE_TYPE2; -})(AUDIO_SAMPLE_RATE_TYPE || {}); -var VIDEO_CODEC_TYPE_FOR_STREAM = /* @__PURE__ */ ((VIDEO_CODEC_TYPE_FOR_STREAM2) => { - VIDEO_CODEC_TYPE_FOR_STREAM2[VIDEO_CODEC_TYPE_FOR_STREAM2["VIDEO_CODEC_H264_FOR_STREAM"] = 1] = "VIDEO_CODEC_H264_FOR_STREAM"; - VIDEO_CODEC_TYPE_FOR_STREAM2[VIDEO_CODEC_TYPE_FOR_STREAM2["VIDEO_CODEC_H265_FOR_STREAM"] = 2] = "VIDEO_CODEC_H265_FOR_STREAM"; - return VIDEO_CODEC_TYPE_FOR_STREAM2; -})(VIDEO_CODEC_TYPE_FOR_STREAM || {}); -var VIDEO_CODEC_PROFILE_TYPE = /* @__PURE__ */ ((VIDEO_CODEC_PROFILE_TYPE2) => { - VIDEO_CODEC_PROFILE_TYPE2[VIDEO_CODEC_PROFILE_TYPE2["VIDEO_CODEC_PROFILE_BASELINE"] = 66] = "VIDEO_CODEC_PROFILE_BASELINE"; - VIDEO_CODEC_PROFILE_TYPE2[VIDEO_CODEC_PROFILE_TYPE2["VIDEO_CODEC_PROFILE_MAIN"] = 77] = "VIDEO_CODEC_PROFILE_MAIN"; - VIDEO_CODEC_PROFILE_TYPE2[VIDEO_CODEC_PROFILE_TYPE2["VIDEO_CODEC_PROFILE_HIGH"] = 100] = "VIDEO_CODEC_PROFILE_HIGH"; - return VIDEO_CODEC_PROFILE_TYPE2; -})(VIDEO_CODEC_PROFILE_TYPE || {}); -var AUDIO_CODEC_PROFILE_TYPE = /* @__PURE__ */ ((AUDIO_CODEC_PROFILE_TYPE2) => { - AUDIO_CODEC_PROFILE_TYPE2[AUDIO_CODEC_PROFILE_TYPE2["AUDIO_CODEC_PROFILE_LC_AAC"] = 0] = "AUDIO_CODEC_PROFILE_LC_AAC"; - AUDIO_CODEC_PROFILE_TYPE2[AUDIO_CODEC_PROFILE_TYPE2["AUDIO_CODEC_PROFILE_HE_AAC"] = 1] = "AUDIO_CODEC_PROFILE_HE_AAC"; - AUDIO_CODEC_PROFILE_TYPE2[AUDIO_CODEC_PROFILE_TYPE2["AUDIO_CODEC_PROFILE_HE_AAC_V2"] = 2] = "AUDIO_CODEC_PROFILE_HE_AAC_V2"; - return AUDIO_CODEC_PROFILE_TYPE2; -})(AUDIO_CODEC_PROFILE_TYPE || {}); -var LocalAudioStats = class { -}; -var RTMP_STREAM_PUBLISH_STATE = /* @__PURE__ */ ((RTMP_STREAM_PUBLISH_STATE2) => { - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_IDLE"] = 0] = "RTMP_STREAM_PUBLISH_STATE_IDLE"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_CONNECTING"] = 1] = "RTMP_STREAM_PUBLISH_STATE_CONNECTING"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_RUNNING"] = 2] = "RTMP_STREAM_PUBLISH_STATE_RUNNING"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_RECOVERING"] = 3] = "RTMP_STREAM_PUBLISH_STATE_RECOVERING"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_FAILURE"] = 4] = "RTMP_STREAM_PUBLISH_STATE_FAILURE"; - RTMP_STREAM_PUBLISH_STATE2[RTMP_STREAM_PUBLISH_STATE2["RTMP_STREAM_PUBLISH_STATE_DISCONNECTING"] = 5] = "RTMP_STREAM_PUBLISH_STATE_DISCONNECTING"; - return RTMP_STREAM_PUBLISH_STATE2; -})(RTMP_STREAM_PUBLISH_STATE || {}); -var RTMP_STREAM_PUBLISH_ERROR_TYPE = /* @__PURE__ */ ((RTMP_STREAM_PUBLISH_ERROR_TYPE2) => { - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_OK"] = 0] = "RTMP_STREAM_PUBLISH_ERROR_OK"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT"] = 1] = "RTMP_STREAM_PUBLISH_ERROR_INVALID_ARGUMENT"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED"] = 2] = "RTMP_STREAM_PUBLISH_ERROR_ENCRYPTED_STREAM_NOT_ALLOWED"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT"] = 3] = "RTMP_STREAM_PUBLISH_ERROR_CONNECTION_TIMEOUT"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR"] = 4] = "RTMP_STREAM_PUBLISH_ERROR_INTERNAL_SERVER_ERROR"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR"] = 5] = "RTMP_STREAM_PUBLISH_ERROR_RTMP_SERVER_ERROR"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN"] = 6] = "RTMP_STREAM_PUBLISH_ERROR_TOO_OFTEN"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT"] = 7] = "RTMP_STREAM_PUBLISH_ERROR_REACH_LIMIT"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED"] = 8] = "RTMP_STREAM_PUBLISH_ERROR_NOT_AUTHORIZED"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND"] = 9] = "RTMP_STREAM_PUBLISH_ERROR_STREAM_NOT_FOUND"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED"] = 10] = "RTMP_STREAM_PUBLISH_ERROR_FORMAT_NOT_SUPPORTED"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER"] = 11] = "RTMP_STREAM_PUBLISH_ERROR_NOT_BROADCASTER"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM"] = 13] = "RTMP_STREAM_PUBLISH_ERROR_TRANSCODING_NO_MIX_STREAM"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_NET_DOWN"] = 14] = "RTMP_STREAM_PUBLISH_ERROR_NET_DOWN"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID"] = 15] = "RTMP_STREAM_PUBLISH_ERROR_INVALID_APPID"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE"] = 16] = "RTMP_STREAM_PUBLISH_ERROR_INVALID_PRIVILEGE"; - RTMP_STREAM_PUBLISH_ERROR_TYPE2[RTMP_STREAM_PUBLISH_ERROR_TYPE2["RTMP_STREAM_UNPUBLISH_ERROR_OK"] = 100] = "RTMP_STREAM_UNPUBLISH_ERROR_OK"; - return RTMP_STREAM_PUBLISH_ERROR_TYPE2; -})(RTMP_STREAM_PUBLISH_ERROR_TYPE || {}); -var RTMP_STREAMING_EVENT = /* @__PURE__ */ ((RTMP_STREAMING_EVENT2) => { - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE"] = 1] = "RTMP_STREAMING_EVENT_FAILED_LOAD_IMAGE"; - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE"] = 2] = "RTMP_STREAMING_EVENT_URL_ALREADY_IN_USE"; - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT"] = 3] = "RTMP_STREAMING_EVENT_ADVANCED_FEATURE_NOT_SUPPORT"; - RTMP_STREAMING_EVENT2[RTMP_STREAMING_EVENT2["RTMP_STREAMING_EVENT_REQUEST_TOO_OFTEN"] = 4] = "RTMP_STREAMING_EVENT_REQUEST_TOO_OFTEN"; - return RTMP_STREAMING_EVENT2; -})(RTMP_STREAMING_EVENT || {}); -var RtcImage = class { -}; -var LiveStreamAdvancedFeature = class { -}; -var CONNECTION_STATE_TYPE = /* @__PURE__ */ ((CONNECTION_STATE_TYPE2) => { - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_DISCONNECTED"] = 1] = "CONNECTION_STATE_DISCONNECTED"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_CONNECTING"] = 2] = "CONNECTION_STATE_CONNECTING"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_CONNECTED"] = 3] = "CONNECTION_STATE_CONNECTED"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_RECONNECTING"] = 4] = "CONNECTION_STATE_RECONNECTING"; - CONNECTION_STATE_TYPE2[CONNECTION_STATE_TYPE2["CONNECTION_STATE_FAILED"] = 5] = "CONNECTION_STATE_FAILED"; - return CONNECTION_STATE_TYPE2; -})(CONNECTION_STATE_TYPE || {}); -var TranscodingUser = class { -}; -var LiveTranscoding = class { -}; -var TranscodingVideoStream = class { -}; -var LocalTranscoderConfiguration = class { -}; -var VIDEO_TRANSCODER_ERROR = /* @__PURE__ */ ((VIDEO_TRANSCODER_ERROR2) => { - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_OK"] = 0] = "VT_ERR_OK"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_VIDEO_SOURCE_NOT_READY"] = 1] = "VT_ERR_VIDEO_SOURCE_NOT_READY"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INVALID_VIDEO_SOURCE_TYPE"] = 2] = "VT_ERR_INVALID_VIDEO_SOURCE_TYPE"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INVALID_IMAGE_PATH"] = 3] = "VT_ERR_INVALID_IMAGE_PATH"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_UNSUPPORT_IMAGE_FORMAT"] = 4] = "VT_ERR_UNSUPPORT_IMAGE_FORMAT"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INVALID_LAYOUT"] = 5] = "VT_ERR_INVALID_LAYOUT"; - VIDEO_TRANSCODER_ERROR2[VIDEO_TRANSCODER_ERROR2["VT_ERR_INTERNAL"] = 20] = "VT_ERR_INTERNAL"; - return VIDEO_TRANSCODER_ERROR2; -})(VIDEO_TRANSCODER_ERROR || {}); -var LastmileProbeConfig = class { -}; -var LASTMILE_PROBE_RESULT_STATE = /* @__PURE__ */ ((LASTMILE_PROBE_RESULT_STATE2) => { - LASTMILE_PROBE_RESULT_STATE2[LASTMILE_PROBE_RESULT_STATE2["LASTMILE_PROBE_RESULT_COMPLETE"] = 1] = "LASTMILE_PROBE_RESULT_COMPLETE"; - LASTMILE_PROBE_RESULT_STATE2[LASTMILE_PROBE_RESULT_STATE2["LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE"] = 2] = "LASTMILE_PROBE_RESULT_INCOMPLETE_NO_BWE"; - LASTMILE_PROBE_RESULT_STATE2[LASTMILE_PROBE_RESULT_STATE2["LASTMILE_PROBE_RESULT_UNAVAILABLE"] = 3] = "LASTMILE_PROBE_RESULT_UNAVAILABLE"; - return LASTMILE_PROBE_RESULT_STATE2; -})(LASTMILE_PROBE_RESULT_STATE || {}); -var LastmileProbeOneWayResult = class { -}; -var LastmileProbeResult = class { -}; -var CONNECTION_CHANGED_REASON_TYPE = /* @__PURE__ */ ((CONNECTION_CHANGED_REASON_TYPE2) => { - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CONNECTING"] = 0] = "CONNECTION_CHANGED_CONNECTING"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_JOIN_SUCCESS"] = 1] = "CONNECTION_CHANGED_JOIN_SUCCESS"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INTERRUPTED"] = 2] = "CONNECTION_CHANGED_INTERRUPTED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_BANNED_BY_SERVER"] = 3] = "CONNECTION_CHANGED_BANNED_BY_SERVER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_JOIN_FAILED"] = 4] = "CONNECTION_CHANGED_JOIN_FAILED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_LEAVE_CHANNEL"] = 5] = "CONNECTION_CHANGED_LEAVE_CHANNEL"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INVALID_APP_ID"] = 6] = "CONNECTION_CHANGED_INVALID_APP_ID"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INVALID_CHANNEL_NAME"] = 7] = "CONNECTION_CHANGED_INVALID_CHANNEL_NAME"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_INVALID_TOKEN"] = 8] = "CONNECTION_CHANGED_INVALID_TOKEN"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_TOKEN_EXPIRED"] = 9] = "CONNECTION_CHANGED_TOKEN_EXPIRED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_REJECTED_BY_SERVER"] = 10] = "CONNECTION_CHANGED_REJECTED_BY_SERVER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_SETTING_PROXY_SERVER"] = 11] = "CONNECTION_CHANGED_SETTING_PROXY_SERVER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_RENEW_TOKEN"] = 12] = "CONNECTION_CHANGED_RENEW_TOKEN"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED"] = 13] = "CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT"] = 14] = "CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_REJOIN_SUCCESS"] = 15] = "CONNECTION_CHANGED_REJOIN_SUCCESS"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_LOST"] = 16] = "CONNECTION_CHANGED_LOST"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_ECHO_TEST"] = 17] = "CONNECTION_CHANGED_ECHO_TEST"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER"] = 18] = "CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_SAME_UID_LOGIN"] = 19] = "CONNECTION_CHANGED_SAME_UID_LOGIN"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_TOO_MANY_BROADCASTERS"] = 20] = "CONNECTION_CHANGED_TOO_MANY_BROADCASTERS"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE"] = 21] = "CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE"; - CONNECTION_CHANGED_REASON_TYPE2[CONNECTION_CHANGED_REASON_TYPE2["CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE"] = 22] = "CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE"; - return CONNECTION_CHANGED_REASON_TYPE2; -})(CONNECTION_CHANGED_REASON_TYPE || {}); -var CLIENT_ROLE_CHANGE_FAILED_REASON = /* @__PURE__ */ ((CLIENT_ROLE_CHANGE_FAILED_REASON2) => { - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS"] = 1] = "CLIENT_ROLE_CHANGE_FAILED_TOO_MANY_BROADCASTERS"; - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED"] = 2] = "CLIENT_ROLE_CHANGE_FAILED_NOT_AUTHORIZED"; - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"] = 3] = "CLIENT_ROLE_CHANGE_FAILED_REQUEST_TIME_OUT"; - CLIENT_ROLE_CHANGE_FAILED_REASON2[CLIENT_ROLE_CHANGE_FAILED_REASON2["CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"] = 4] = "CLIENT_ROLE_CHANGE_FAILED_CONNECTION_FAILED"; - return CLIENT_ROLE_CHANGE_FAILED_REASON2; -})(CLIENT_ROLE_CHANGE_FAILED_REASON || {}); -var WLACC_MESSAGE_REASON = /* @__PURE__ */ ((WLACC_MESSAGE_REASON2) => { - WLACC_MESSAGE_REASON2[WLACC_MESSAGE_REASON2["WLACC_MESSAGE_REASON_WEAK_SIGNAL"] = 0] = "WLACC_MESSAGE_REASON_WEAK_SIGNAL"; - WLACC_MESSAGE_REASON2[WLACC_MESSAGE_REASON2["WLACC_MESSAGE_REASON_CHANNEL_CONGESTION"] = 1] = "WLACC_MESSAGE_REASON_CHANNEL_CONGESTION"; - return WLACC_MESSAGE_REASON2; -})(WLACC_MESSAGE_REASON || {}); -var WLACC_SUGGEST_ACTION = /* @__PURE__ */ ((WLACC_SUGGEST_ACTION2) => { - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_CLOSE_TO_WIFI"] = 0] = "WLACC_SUGGEST_ACTION_CLOSE_TO_WIFI"; - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_CONNECT_SSID"] = 1] = "WLACC_SUGGEST_ACTION_CONNECT_SSID"; - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_CHECK_5G"] = 2] = "WLACC_SUGGEST_ACTION_CHECK_5G"; - WLACC_SUGGEST_ACTION2[WLACC_SUGGEST_ACTION2["WLACC_SUGGEST_ACTION_MODIFY_SSID"] = 3] = "WLACC_SUGGEST_ACTION_MODIFY_SSID"; - return WLACC_SUGGEST_ACTION2; -})(WLACC_SUGGEST_ACTION || {}); -var WlAccStats = class { -}; -var NETWORK_TYPE = /* @__PURE__ */ ((NETWORK_TYPE2) => { - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_UNKNOWN"] = -1] = "NETWORK_TYPE_UNKNOWN"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_DISCONNECTED"] = 0] = "NETWORK_TYPE_DISCONNECTED"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_LAN"] = 1] = "NETWORK_TYPE_LAN"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_WIFI"] = 2] = "NETWORK_TYPE_WIFI"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_2G"] = 3] = "NETWORK_TYPE_MOBILE_2G"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_3G"] = 4] = "NETWORK_TYPE_MOBILE_3G"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_4G"] = 5] = "NETWORK_TYPE_MOBILE_4G"; - NETWORK_TYPE2[NETWORK_TYPE2["NETWORK_TYPE_MOBILE_5G"] = 6] = "NETWORK_TYPE_MOBILE_5G"; - return NETWORK_TYPE2; -})(NETWORK_TYPE || {}); -var VIDEO_VIEW_SETUP_MODE = /* @__PURE__ */ ((VIDEO_VIEW_SETUP_MODE2) => { - VIDEO_VIEW_SETUP_MODE2[VIDEO_VIEW_SETUP_MODE2["VIDEO_VIEW_SETUP_REPLACE"] = 0] = "VIDEO_VIEW_SETUP_REPLACE"; - VIDEO_VIEW_SETUP_MODE2[VIDEO_VIEW_SETUP_MODE2["VIDEO_VIEW_SETUP_ADD"] = 1] = "VIDEO_VIEW_SETUP_ADD"; - VIDEO_VIEW_SETUP_MODE2[VIDEO_VIEW_SETUP_MODE2["VIDEO_VIEW_SETUP_REMOVE"] = 2] = "VIDEO_VIEW_SETUP_REMOVE"; - return VIDEO_VIEW_SETUP_MODE2; -})(VIDEO_VIEW_SETUP_MODE || {}); -var VideoCanvas = class { -}; -var LIGHTENING_CONTRAST_LEVEL = /* @__PURE__ */ ((LIGHTENING_CONTRAST_LEVEL2) => { - LIGHTENING_CONTRAST_LEVEL2[LIGHTENING_CONTRAST_LEVEL2["LIGHTENING_CONTRAST_LOW"] = 0] = "LIGHTENING_CONTRAST_LOW"; - LIGHTENING_CONTRAST_LEVEL2[LIGHTENING_CONTRAST_LEVEL2["LIGHTENING_CONTRAST_NORMAL"] = 1] = "LIGHTENING_CONTRAST_NORMAL"; - LIGHTENING_CONTRAST_LEVEL2[LIGHTENING_CONTRAST_LEVEL2["LIGHTENING_CONTRAST_HIGH"] = 2] = "LIGHTENING_CONTRAST_HIGH"; - return LIGHTENING_CONTRAST_LEVEL2; -})(LIGHTENING_CONTRAST_LEVEL || {}); -var BeautyOptions = class { -}; -var LOW_LIGHT_ENHANCE_MODE = /* @__PURE__ */ ((LOW_LIGHT_ENHANCE_MODE2) => { - LOW_LIGHT_ENHANCE_MODE2[LOW_LIGHT_ENHANCE_MODE2["LOW_LIGHT_ENHANCE_AUTO"] = 0] = "LOW_LIGHT_ENHANCE_AUTO"; - LOW_LIGHT_ENHANCE_MODE2[LOW_LIGHT_ENHANCE_MODE2["LOW_LIGHT_ENHANCE_MANUAL"] = 1] = "LOW_LIGHT_ENHANCE_MANUAL"; - return LOW_LIGHT_ENHANCE_MODE2; -})(LOW_LIGHT_ENHANCE_MODE || {}); -var LOW_LIGHT_ENHANCE_LEVEL = /* @__PURE__ */ ((LOW_LIGHT_ENHANCE_LEVEL2) => { - LOW_LIGHT_ENHANCE_LEVEL2[LOW_LIGHT_ENHANCE_LEVEL2["LOW_LIGHT_ENHANCE_LEVEL_HIGH_QUALITY"] = 0] = "LOW_LIGHT_ENHANCE_LEVEL_HIGH_QUALITY"; - LOW_LIGHT_ENHANCE_LEVEL2[LOW_LIGHT_ENHANCE_LEVEL2["LOW_LIGHT_ENHANCE_LEVEL_FAST"] = 1] = "LOW_LIGHT_ENHANCE_LEVEL_FAST"; - return LOW_LIGHT_ENHANCE_LEVEL2; -})(LOW_LIGHT_ENHANCE_LEVEL || {}); -var LowlightEnhanceOptions = class { -}; -var VIDEO_DENOISER_MODE = /* @__PURE__ */ ((VIDEO_DENOISER_MODE2) => { - VIDEO_DENOISER_MODE2[VIDEO_DENOISER_MODE2["VIDEO_DENOISER_AUTO"] = 0] = "VIDEO_DENOISER_AUTO"; - VIDEO_DENOISER_MODE2[VIDEO_DENOISER_MODE2["VIDEO_DENOISER_MANUAL"] = 1] = "VIDEO_DENOISER_MANUAL"; - return VIDEO_DENOISER_MODE2; -})(VIDEO_DENOISER_MODE || {}); -var VIDEO_DENOISER_LEVEL = /* @__PURE__ */ ((VIDEO_DENOISER_LEVEL2) => { - VIDEO_DENOISER_LEVEL2[VIDEO_DENOISER_LEVEL2["VIDEO_DENOISER_LEVEL_HIGH_QUALITY"] = 0] = "VIDEO_DENOISER_LEVEL_HIGH_QUALITY"; - VIDEO_DENOISER_LEVEL2[VIDEO_DENOISER_LEVEL2["VIDEO_DENOISER_LEVEL_FAST"] = 1] = "VIDEO_DENOISER_LEVEL_FAST"; - VIDEO_DENOISER_LEVEL2[VIDEO_DENOISER_LEVEL2["VIDEO_DENOISER_LEVEL_STRENGTH"] = 2] = "VIDEO_DENOISER_LEVEL_STRENGTH"; - return VIDEO_DENOISER_LEVEL2; -})(VIDEO_DENOISER_LEVEL || {}); -var VideoDenoiserOptions = class { -}; -var ColorEnhanceOptions = class { -}; -var BACKGROUND_SOURCE_TYPE = /* @__PURE__ */ ((BACKGROUND_SOURCE_TYPE2) => { - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_NONE"] = 0] = "BACKGROUND_NONE"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_COLOR"] = 1] = "BACKGROUND_COLOR"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_IMG"] = 2] = "BACKGROUND_IMG"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_BLUR"] = 3] = "BACKGROUND_BLUR"; - BACKGROUND_SOURCE_TYPE2[BACKGROUND_SOURCE_TYPE2["BACKGROUND_VIDEO"] = 4] = "BACKGROUND_VIDEO"; - return BACKGROUND_SOURCE_TYPE2; -})(BACKGROUND_SOURCE_TYPE || {}); -var BACKGROUND_BLUR_DEGREE = /* @__PURE__ */ ((BACKGROUND_BLUR_DEGREE2) => { - BACKGROUND_BLUR_DEGREE2[BACKGROUND_BLUR_DEGREE2["BLUR_DEGREE_LOW"] = 1] = "BLUR_DEGREE_LOW"; - BACKGROUND_BLUR_DEGREE2[BACKGROUND_BLUR_DEGREE2["BLUR_DEGREE_MEDIUM"] = 2] = "BLUR_DEGREE_MEDIUM"; - BACKGROUND_BLUR_DEGREE2[BACKGROUND_BLUR_DEGREE2["BLUR_DEGREE_HIGH"] = 3] = "BLUR_DEGREE_HIGH"; - return BACKGROUND_BLUR_DEGREE2; -})(BACKGROUND_BLUR_DEGREE || {}); -var VirtualBackgroundSource = class { -}; -var SEG_MODEL_TYPE = /* @__PURE__ */ ((SEG_MODEL_TYPE2) => { - SEG_MODEL_TYPE2[SEG_MODEL_TYPE2["SEG_MODEL_AI"] = 1] = "SEG_MODEL_AI"; - SEG_MODEL_TYPE2[SEG_MODEL_TYPE2["SEG_MODEL_GREEN"] = 2] = "SEG_MODEL_GREEN"; - return SEG_MODEL_TYPE2; -})(SEG_MODEL_TYPE || {}); -var SegmentationProperty = class { -}; -var AUDIO_TRACK_TYPE = /* @__PURE__ */ ((AUDIO_TRACK_TYPE2) => { - AUDIO_TRACK_TYPE2[AUDIO_TRACK_TYPE2["AUDIO_TRACK_INVALID"] = -1] = "AUDIO_TRACK_INVALID"; - AUDIO_TRACK_TYPE2[AUDIO_TRACK_TYPE2["AUDIO_TRACK_MIXABLE"] = 0] = "AUDIO_TRACK_MIXABLE"; - AUDIO_TRACK_TYPE2[AUDIO_TRACK_TYPE2["AUDIO_TRACK_DIRECT"] = 1] = "AUDIO_TRACK_DIRECT"; - return AUDIO_TRACK_TYPE2; -})(AUDIO_TRACK_TYPE || {}); -var AudioTrackConfig = class { -}; -var VOICE_BEAUTIFIER_PRESET = /* @__PURE__ */ ((VOICE_BEAUTIFIER_PRESET2) => { - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["VOICE_BEAUTIFIER_OFF"] = 0] = "VOICE_BEAUTIFIER_OFF"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["CHAT_BEAUTIFIER_MAGNETIC"] = 16843008] = "CHAT_BEAUTIFIER_MAGNETIC"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["CHAT_BEAUTIFIER_FRESH"] = 16843264] = "CHAT_BEAUTIFIER_FRESH"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["CHAT_BEAUTIFIER_VITALITY"] = 16843520] = "CHAT_BEAUTIFIER_VITALITY"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["SINGING_BEAUTIFIER"] = 16908544] = "SINGING_BEAUTIFIER"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_VIGOROUS"] = 16974080] = "TIMBRE_TRANSFORMATION_VIGOROUS"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_DEEP"] = 16974336] = "TIMBRE_TRANSFORMATION_DEEP"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_MELLOW"] = 16974592] = "TIMBRE_TRANSFORMATION_MELLOW"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_FALSETTO"] = 16974848] = "TIMBRE_TRANSFORMATION_FALSETTO"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_FULL"] = 16975104] = "TIMBRE_TRANSFORMATION_FULL"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_CLEAR"] = 16975360] = "TIMBRE_TRANSFORMATION_CLEAR"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_RESOUNDING"] = 16975616] = "TIMBRE_TRANSFORMATION_RESOUNDING"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["TIMBRE_TRANSFORMATION_RINGING"] = 16975872] = "TIMBRE_TRANSFORMATION_RINGING"; - VOICE_BEAUTIFIER_PRESET2[VOICE_BEAUTIFIER_PRESET2["ULTRA_HIGH_QUALITY_VOICE"] = 17039616] = "ULTRA_HIGH_QUALITY_VOICE"; - return VOICE_BEAUTIFIER_PRESET2; -})(VOICE_BEAUTIFIER_PRESET || {}); -var AUDIO_EFFECT_PRESET = /* @__PURE__ */ ((AUDIO_EFFECT_PRESET2) => { - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["AUDIO_EFFECT_OFF"] = 0] = "AUDIO_EFFECT_OFF"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_KTV"] = 33620224] = "ROOM_ACOUSTICS_KTV"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_VOCAL_CONCERT"] = 33620480] = "ROOM_ACOUSTICS_VOCAL_CONCERT"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_STUDIO"] = 33620736] = "ROOM_ACOUSTICS_STUDIO"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_PHONOGRAPH"] = 33620992] = "ROOM_ACOUSTICS_PHONOGRAPH"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_VIRTUAL_STEREO"] = 33621248] = "ROOM_ACOUSTICS_VIRTUAL_STEREO"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_SPACIAL"] = 33621504] = "ROOM_ACOUSTICS_SPACIAL"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_ETHEREAL"] = 33621760] = "ROOM_ACOUSTICS_ETHEREAL"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_3D_VOICE"] = 33622016] = "ROOM_ACOUSTICS_3D_VOICE"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND"] = 33622272] = "ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_UNCLE"] = 33685760] = "VOICE_CHANGER_EFFECT_UNCLE"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_OLDMAN"] = 33686016] = "VOICE_CHANGER_EFFECT_OLDMAN"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_BOY"] = 33686272] = "VOICE_CHANGER_EFFECT_BOY"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_SISTER"] = 33686528] = "VOICE_CHANGER_EFFECT_SISTER"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_GIRL"] = 33686784] = "VOICE_CHANGER_EFFECT_GIRL"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_PIGKING"] = 33687040] = "VOICE_CHANGER_EFFECT_PIGKING"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["VOICE_CHANGER_EFFECT_HULK"] = 33687296] = "VOICE_CHANGER_EFFECT_HULK"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["STYLE_TRANSFORMATION_RNB"] = 33751296] = "STYLE_TRANSFORMATION_RNB"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["STYLE_TRANSFORMATION_POPULAR"] = 33751552] = "STYLE_TRANSFORMATION_POPULAR"; - AUDIO_EFFECT_PRESET2[AUDIO_EFFECT_PRESET2["PITCH_CORRECTION"] = 33816832] = "PITCH_CORRECTION"; - return AUDIO_EFFECT_PRESET2; -})(AUDIO_EFFECT_PRESET || {}); -var VOICE_CONVERSION_PRESET = /* @__PURE__ */ ((VOICE_CONVERSION_PRESET2) => { - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CONVERSION_OFF"] = 0] = "VOICE_CONVERSION_OFF"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_NEUTRAL"] = 50397440] = "VOICE_CHANGER_NEUTRAL"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_SWEET"] = 50397696] = "VOICE_CHANGER_SWEET"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_SOLID"] = 50397952] = "VOICE_CHANGER_SOLID"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_BASS"] = 50398208] = "VOICE_CHANGER_BASS"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_CARTOON"] = 50398464] = "VOICE_CHANGER_CARTOON"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_CHILDLIKE"] = 50398720] = "VOICE_CHANGER_CHILDLIKE"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_PHONE_OPERATOR"] = 50398976] = "VOICE_CHANGER_PHONE_OPERATOR"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_MONSTER"] = 50399232] = "VOICE_CHANGER_MONSTER"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_TRANSFORMERS"] = 50399488] = "VOICE_CHANGER_TRANSFORMERS"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_GROOT"] = 50399744] = "VOICE_CHANGER_GROOT"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_DARTH_VADER"] = 504e5] = "VOICE_CHANGER_DARTH_VADER"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_IRON_LADY"] = 50400256] = "VOICE_CHANGER_IRON_LADY"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_SHIN_CHAN"] = 50400512] = "VOICE_CHANGER_SHIN_CHAN"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_GIRLISH_MAN"] = 50400768] = "VOICE_CHANGER_GIRLISH_MAN"; - VOICE_CONVERSION_PRESET2[VOICE_CONVERSION_PRESET2["VOICE_CHANGER_CHIPMUNK"] = 50401024] = "VOICE_CHANGER_CHIPMUNK"; - return VOICE_CONVERSION_PRESET2; -})(VOICE_CONVERSION_PRESET || {}); -var HEADPHONE_EQUALIZER_PRESET = /* @__PURE__ */ ((HEADPHONE_EQUALIZER_PRESET2) => { - HEADPHONE_EQUALIZER_PRESET2[HEADPHONE_EQUALIZER_PRESET2["HEADPHONE_EQUALIZER_OFF"] = 0] = "HEADPHONE_EQUALIZER_OFF"; - HEADPHONE_EQUALIZER_PRESET2[HEADPHONE_EQUALIZER_PRESET2["HEADPHONE_EQUALIZER_OVEREAR"] = 67108865] = "HEADPHONE_EQUALIZER_OVEREAR"; - HEADPHONE_EQUALIZER_PRESET2[HEADPHONE_EQUALIZER_PRESET2["HEADPHONE_EQUALIZER_INEAR"] = 67108866] = "HEADPHONE_EQUALIZER_INEAR"; - return HEADPHONE_EQUALIZER_PRESET2; -})(HEADPHONE_EQUALIZER_PRESET || {}); -var ScreenCaptureParameters = class { -}; -var AUDIO_RECORDING_QUALITY_TYPE = /* @__PURE__ */ ((AUDIO_RECORDING_QUALITY_TYPE2) => { - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_LOW"] = 0] = "AUDIO_RECORDING_QUALITY_LOW"; - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_MEDIUM"] = 1] = "AUDIO_RECORDING_QUALITY_MEDIUM"; - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_HIGH"] = 2] = "AUDIO_RECORDING_QUALITY_HIGH"; - AUDIO_RECORDING_QUALITY_TYPE2[AUDIO_RECORDING_QUALITY_TYPE2["AUDIO_RECORDING_QUALITY_ULTRA_HIGH"] = 3] = "AUDIO_RECORDING_QUALITY_ULTRA_HIGH"; - return AUDIO_RECORDING_QUALITY_TYPE2; -})(AUDIO_RECORDING_QUALITY_TYPE || {}); -var AUDIO_FILE_RECORDING_TYPE = /* @__PURE__ */ ((AUDIO_FILE_RECORDING_TYPE2) => { - AUDIO_FILE_RECORDING_TYPE2[AUDIO_FILE_RECORDING_TYPE2["AUDIO_FILE_RECORDING_MIC"] = 1] = "AUDIO_FILE_RECORDING_MIC"; - AUDIO_FILE_RECORDING_TYPE2[AUDIO_FILE_RECORDING_TYPE2["AUDIO_FILE_RECORDING_PLAYBACK"] = 2] = "AUDIO_FILE_RECORDING_PLAYBACK"; - AUDIO_FILE_RECORDING_TYPE2[AUDIO_FILE_RECORDING_TYPE2["AUDIO_FILE_RECORDING_MIXED"] = 3] = "AUDIO_FILE_RECORDING_MIXED"; - return AUDIO_FILE_RECORDING_TYPE2; -})(AUDIO_FILE_RECORDING_TYPE || {}); -var AUDIO_ENCODED_FRAME_OBSERVER_POSITION = /* @__PURE__ */ ((AUDIO_ENCODED_FRAME_OBSERVER_POSITION2) => { - AUDIO_ENCODED_FRAME_OBSERVER_POSITION2[AUDIO_ENCODED_FRAME_OBSERVER_POSITION2["AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD"] = 1] = "AUDIO_ENCODED_FRAME_OBSERVER_POSITION_RECORD"; - AUDIO_ENCODED_FRAME_OBSERVER_POSITION2[AUDIO_ENCODED_FRAME_OBSERVER_POSITION2["AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK"] = 2] = "AUDIO_ENCODED_FRAME_OBSERVER_POSITION_PLAYBACK"; - AUDIO_ENCODED_FRAME_OBSERVER_POSITION2[AUDIO_ENCODED_FRAME_OBSERVER_POSITION2["AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED"] = 3] = "AUDIO_ENCODED_FRAME_OBSERVER_POSITION_MIXED"; - return AUDIO_ENCODED_FRAME_OBSERVER_POSITION2; -})(AUDIO_ENCODED_FRAME_OBSERVER_POSITION || {}); -var AudioRecordingConfiguration = class { -}; -var AudioEncodedFrameObserverConfig = class { -}; -var AREA_CODE = /* @__PURE__ */ ((AREA_CODE2) => { - AREA_CODE2[AREA_CODE2["AREA_CODE_CN"] = 1] = "AREA_CODE_CN"; - AREA_CODE2[AREA_CODE2["AREA_CODE_NA"] = 2] = "AREA_CODE_NA"; - AREA_CODE2[AREA_CODE2["AREA_CODE_EU"] = 4] = "AREA_CODE_EU"; - AREA_CODE2[AREA_CODE2["AREA_CODE_AS"] = 8] = "AREA_CODE_AS"; - AREA_CODE2[AREA_CODE2["AREA_CODE_JP"] = 16] = "AREA_CODE_JP"; - AREA_CODE2[AREA_CODE2["AREA_CODE_IN"] = 32] = "AREA_CODE_IN"; - AREA_CODE2[AREA_CODE2["AREA_CODE_GLOB"] = 4294967295] = "AREA_CODE_GLOB"; - return AREA_CODE2; -})(AREA_CODE || {}); -var AREA_CODE_EX = /* @__PURE__ */ ((AREA_CODE_EX2) => { - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_OC"] = 64] = "AREA_CODE_OC"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_SA"] = 128] = "AREA_CODE_SA"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_AF"] = 256] = "AREA_CODE_AF"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_KR"] = 512] = "AREA_CODE_KR"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_HKMC"] = 1024] = "AREA_CODE_HKMC"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_US"] = 2048] = "AREA_CODE_US"; - AREA_CODE_EX2[AREA_CODE_EX2["AREA_CODE_OVS"] = 4294967294] = "AREA_CODE_OVS"; - return AREA_CODE_EX2; -})(AREA_CODE_EX || {}); -var CHANNEL_MEDIA_RELAY_ERROR = /* @__PURE__ */ ((CHANNEL_MEDIA_RELAY_ERROR2) => { - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_OK"] = 0] = "RELAY_OK"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SERVER_ERROR_RESPONSE"] = 1] = "RELAY_ERROR_SERVER_ERROR_RESPONSE"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SERVER_NO_RESPONSE"] = 2] = "RELAY_ERROR_SERVER_NO_RESPONSE"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_NO_RESOURCE_AVAILABLE"] = 3] = "RELAY_ERROR_NO_RESOURCE_AVAILABLE"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_JOIN_SRC"] = 4] = "RELAY_ERROR_FAILED_JOIN_SRC"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_JOIN_DEST"] = 5] = "RELAY_ERROR_FAILED_JOIN_DEST"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC"] = 6] = "RELAY_ERROR_FAILED_PACKET_RECEIVED_FROM_SRC"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST"] = 7] = "RELAY_ERROR_FAILED_PACKET_SENT_TO_DEST"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SERVER_CONNECTION_LOST"] = 8] = "RELAY_ERROR_SERVER_CONNECTION_LOST"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_INTERNAL_ERROR"] = 9] = "RELAY_ERROR_INTERNAL_ERROR"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_SRC_TOKEN_EXPIRED"] = 10] = "RELAY_ERROR_SRC_TOKEN_EXPIRED"; - CHANNEL_MEDIA_RELAY_ERROR2[CHANNEL_MEDIA_RELAY_ERROR2["RELAY_ERROR_DEST_TOKEN_EXPIRED"] = 11] = "RELAY_ERROR_DEST_TOKEN_EXPIRED"; - return CHANNEL_MEDIA_RELAY_ERROR2; -})(CHANNEL_MEDIA_RELAY_ERROR || {}); -var CHANNEL_MEDIA_RELAY_EVENT = /* @__PURE__ */ ((CHANNEL_MEDIA_RELAY_EVENT2) => { - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_NETWORK_DISCONNECTED"] = 0] = "RELAY_EVENT_NETWORK_DISCONNECTED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_NETWORK_CONNECTED"] = 1] = "RELAY_EVENT_NETWORK_CONNECTED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL"] = 2] = "RELAY_EVENT_PACKET_JOINED_SRC_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL"] = 3] = "RELAY_EVENT_PACKET_JOINED_DEST_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL"] = 4] = "RELAY_EVENT_PACKET_SENT_TO_DEST_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC"] = 5] = "RELAY_EVENT_PACKET_RECEIVED_VIDEO_FROM_SRC"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC"] = 6] = "RELAY_EVENT_PACKET_RECEIVED_AUDIO_FROM_SRC"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL"] = 7] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED"] = 8] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_REFUSED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE"] = 9] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL"] = 10] = "RELAY_EVENT_PACKET_UPDATE_DEST_CHANNEL_IS_NULL"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_VIDEO_PROFILE_UPDATE"] = 11] = "RELAY_EVENT_VIDEO_PROFILE_UPDATE"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"] = 12] = "RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED"] = 13] = "RELAY_EVENT_PAUSE_SEND_PACKET_TO_DEST_CHANNEL_FAILED"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"] = 14] = "RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_SUCCESS"; - CHANNEL_MEDIA_RELAY_EVENT2[CHANNEL_MEDIA_RELAY_EVENT2["RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED"] = 15] = "RELAY_EVENT_RESUME_SEND_PACKET_TO_DEST_CHANNEL_FAILED"; - return CHANNEL_MEDIA_RELAY_EVENT2; -})(CHANNEL_MEDIA_RELAY_EVENT || {}); -var CHANNEL_MEDIA_RELAY_STATE = /* @__PURE__ */ ((CHANNEL_MEDIA_RELAY_STATE2) => { - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_IDLE"] = 0] = "RELAY_STATE_IDLE"; - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_CONNECTING"] = 1] = "RELAY_STATE_CONNECTING"; - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_RUNNING"] = 2] = "RELAY_STATE_RUNNING"; - CHANNEL_MEDIA_RELAY_STATE2[CHANNEL_MEDIA_RELAY_STATE2["RELAY_STATE_FAILURE"] = 3] = "RELAY_STATE_FAILURE"; - return CHANNEL_MEDIA_RELAY_STATE2; -})(CHANNEL_MEDIA_RELAY_STATE || {}); -var ChannelMediaInfo = class { -}; -var ChannelMediaRelayConfiguration = class { -}; -var UplinkNetworkInfo = class { -}; -var PeerDownlinkInfo = class { -}; -var DownlinkNetworkInfo = class { -}; -var ENCRYPTION_MODE = /* @__PURE__ */ ((ENCRYPTION_MODE2) => { - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_XTS"] = 1] = "AES_128_XTS"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_ECB"] = 2] = "AES_128_ECB"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_256_XTS"] = 3] = "AES_256_XTS"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["SM4_128_ECB"] = 4] = "SM4_128_ECB"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_GCM"] = 5] = "AES_128_GCM"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_256_GCM"] = 6] = "AES_256_GCM"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_128_GCM2"] = 7] = "AES_128_GCM2"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["AES_256_GCM2"] = 8] = "AES_256_GCM2"; - ENCRYPTION_MODE2[ENCRYPTION_MODE2["MODE_END"] = 9] = "MODE_END"; - return ENCRYPTION_MODE2; -})(ENCRYPTION_MODE || {}); -var EncryptionConfig = class { -}; -var ENCRYPTION_ERROR_TYPE = /* @__PURE__ */ ((ENCRYPTION_ERROR_TYPE2) => { - ENCRYPTION_ERROR_TYPE2[ENCRYPTION_ERROR_TYPE2["ENCRYPTION_ERROR_INTERNAL_FAILURE"] = 0] = "ENCRYPTION_ERROR_INTERNAL_FAILURE"; - ENCRYPTION_ERROR_TYPE2[ENCRYPTION_ERROR_TYPE2["ENCRYPTION_ERROR_DECRYPTION_FAILURE"] = 1] = "ENCRYPTION_ERROR_DECRYPTION_FAILURE"; - ENCRYPTION_ERROR_TYPE2[ENCRYPTION_ERROR_TYPE2["ENCRYPTION_ERROR_ENCRYPTION_FAILURE"] = 2] = "ENCRYPTION_ERROR_ENCRYPTION_FAILURE"; - return ENCRYPTION_ERROR_TYPE2; -})(ENCRYPTION_ERROR_TYPE || {}); -var UPLOAD_ERROR_REASON = /* @__PURE__ */ ((UPLOAD_ERROR_REASON2) => { - UPLOAD_ERROR_REASON2[UPLOAD_ERROR_REASON2["UPLOAD_SUCCESS"] = 0] = "UPLOAD_SUCCESS"; - UPLOAD_ERROR_REASON2[UPLOAD_ERROR_REASON2["UPLOAD_NET_ERROR"] = 1] = "UPLOAD_NET_ERROR"; - UPLOAD_ERROR_REASON2[UPLOAD_ERROR_REASON2["UPLOAD_SERVER_ERROR"] = 2] = "UPLOAD_SERVER_ERROR"; - return UPLOAD_ERROR_REASON2; -})(UPLOAD_ERROR_REASON || {}); -var PERMISSION_TYPE = /* @__PURE__ */ ((PERMISSION_TYPE2) => { - PERMISSION_TYPE2[PERMISSION_TYPE2["RECORD_AUDIO"] = 0] = "RECORD_AUDIO"; - PERMISSION_TYPE2[PERMISSION_TYPE2["CAMERA"] = 1] = "CAMERA"; - PERMISSION_TYPE2[PERMISSION_TYPE2["SCREEN_CAPTURE"] = 2] = "SCREEN_CAPTURE"; - return PERMISSION_TYPE2; -})(PERMISSION_TYPE || {}); -var MAX_USER_ACCOUNT_LENGTH_TYPE = /* @__PURE__ */ ((MAX_USER_ACCOUNT_LENGTH_TYPE2) => { - MAX_USER_ACCOUNT_LENGTH_TYPE2[MAX_USER_ACCOUNT_LENGTH_TYPE2["MAX_USER_ACCOUNT_LENGTH"] = 256] = "MAX_USER_ACCOUNT_LENGTH"; - return MAX_USER_ACCOUNT_LENGTH_TYPE2; -})(MAX_USER_ACCOUNT_LENGTH_TYPE || {}); -var STREAM_SUBSCRIBE_STATE = /* @__PURE__ */ ((STREAM_SUBSCRIBE_STATE2) => { - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_IDLE"] = 0] = "SUB_STATE_IDLE"; - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_NO_SUBSCRIBED"] = 1] = "SUB_STATE_NO_SUBSCRIBED"; - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_SUBSCRIBING"] = 2] = "SUB_STATE_SUBSCRIBING"; - STREAM_SUBSCRIBE_STATE2[STREAM_SUBSCRIBE_STATE2["SUB_STATE_SUBSCRIBED"] = 3] = "SUB_STATE_SUBSCRIBED"; - return STREAM_SUBSCRIBE_STATE2; -})(STREAM_SUBSCRIBE_STATE || {}); -var STREAM_PUBLISH_STATE = /* @__PURE__ */ ((STREAM_PUBLISH_STATE2) => { - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_IDLE"] = 0] = "PUB_STATE_IDLE"; - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_NO_PUBLISHED"] = 1] = "PUB_STATE_NO_PUBLISHED"; - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_PUBLISHING"] = 2] = "PUB_STATE_PUBLISHING"; - STREAM_PUBLISH_STATE2[STREAM_PUBLISH_STATE2["PUB_STATE_PUBLISHED"] = 3] = "PUB_STATE_PUBLISHED"; - return STREAM_PUBLISH_STATE2; -})(STREAM_PUBLISH_STATE || {}); -var EchoTestConfiguration = class { -}; -var UserInfo = class { -}; -var EAR_MONITORING_FILTER_TYPE = /* @__PURE__ */ ((EAR_MONITORING_FILTER_TYPE2) => { - EAR_MONITORING_FILTER_TYPE2[EAR_MONITORING_FILTER_TYPE2["EAR_MONITORING_FILTER_NONE"] = 1] = "EAR_MONITORING_FILTER_NONE"; - EAR_MONITORING_FILTER_TYPE2[EAR_MONITORING_FILTER_TYPE2["EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS"] = 2] = "EAR_MONITORING_FILTER_BUILT_IN_AUDIO_FILTERS"; - EAR_MONITORING_FILTER_TYPE2[EAR_MONITORING_FILTER_TYPE2["EAR_MONITORING_FILTER_NOISE_SUPPRESSION"] = 4] = "EAR_MONITORING_FILTER_NOISE_SUPPRESSION"; - return EAR_MONITORING_FILTER_TYPE2; -})(EAR_MONITORING_FILTER_TYPE || {}); -var THREAD_PRIORITY_TYPE = /* @__PURE__ */ ((THREAD_PRIORITY_TYPE2) => { - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["LOWEST"] = 0] = "LOWEST"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["LOW"] = 1] = "LOW"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["NORMAL"] = 2] = "NORMAL"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["HIGH"] = 3] = "HIGH"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["HIGHEST"] = 4] = "HIGHEST"; - THREAD_PRIORITY_TYPE2[THREAD_PRIORITY_TYPE2["CRITICAL"] = 5] = "CRITICAL"; - return THREAD_PRIORITY_TYPE2; -})(THREAD_PRIORITY_TYPE || {}); -var ScreenVideoParameters = class { -}; -var ScreenAudioParameters = class { -}; -var ScreenCaptureParameters2 = class { -}; -var MEDIA_TRACE_EVENT = /* @__PURE__ */ ((MEDIA_TRACE_EVENT2) => { - MEDIA_TRACE_EVENT2[MEDIA_TRACE_EVENT2["MEDIA_TRACE_EVENT_VIDEO_RENDERED"] = 0] = "MEDIA_TRACE_EVENT_VIDEO_RENDERED"; - MEDIA_TRACE_EVENT2[MEDIA_TRACE_EVENT2["MEDIA_TRACE_EVENT_VIDEO_DECODED"] = 1] = "MEDIA_TRACE_EVENT_VIDEO_DECODED"; - return MEDIA_TRACE_EVENT2; -})(MEDIA_TRACE_EVENT || {}); -var VideoRenderingTracingInfo = class { -}; -var CONFIG_FETCH_TYPE = /* @__PURE__ */ ((CONFIG_FETCH_TYPE2) => { - CONFIG_FETCH_TYPE2[CONFIG_FETCH_TYPE2["CONFIG_FETCH_TYPE_INITIALIZE"] = 1] = "CONFIG_FETCH_TYPE_INITIALIZE"; - CONFIG_FETCH_TYPE2[CONFIG_FETCH_TYPE2["CONFIG_FETCH_TYPE_JOIN_CHANNEL"] = 2] = "CONFIG_FETCH_TYPE_JOIN_CHANNEL"; - return CONFIG_FETCH_TYPE2; -})(CONFIG_FETCH_TYPE || {}); -var RecorderStreamInfo = class { -}; -var LOCAL_PROXY_MODE = /* @__PURE__ */ ((LOCAL_PROXY_MODE2) => { - LOCAL_PROXY_MODE2[LOCAL_PROXY_MODE2["ConnectivityFirst"] = 0] = "ConnectivityFirst"; - LOCAL_PROXY_MODE2[LOCAL_PROXY_MODE2["LocalOnly"] = 1] = "LocalOnly"; - return LOCAL_PROXY_MODE2; -})(LOCAL_PROXY_MODE || {}); -var LogUploadServerInfo = class { -}; -var AdvancedConfigInfo = class { -}; -var LocalAccessPointConfiguration = class { -}; -var SpatialAudioParams = class { -}; - -// generate/AgoraMediaBase.ts -var VIDEO_SOURCE_TYPE = /* @__PURE__ */ ((VIDEO_SOURCE_TYPE2) => { - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_PRIMARY"] = 0] = "VIDEO_SOURCE_CAMERA_PRIMARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA"] = 0] = "VIDEO_SOURCE_CAMERA"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_SECONDARY"] = 1] = "VIDEO_SOURCE_CAMERA_SECONDARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_PRIMARY"] = 2] = "VIDEO_SOURCE_SCREEN_PRIMARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN"] = 2] = "VIDEO_SOURCE_SCREEN"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_SECONDARY"] = 3] = "VIDEO_SOURCE_SCREEN_SECONDARY"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CUSTOM"] = 4] = "VIDEO_SOURCE_CUSTOM"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_MEDIA_PLAYER"] = 5] = "VIDEO_SOURCE_MEDIA_PLAYER"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_RTC_IMAGE_PNG"] = 6] = "VIDEO_SOURCE_RTC_IMAGE_PNG"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_RTC_IMAGE_JPEG"] = 7] = "VIDEO_SOURCE_RTC_IMAGE_JPEG"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_RTC_IMAGE_GIF"] = 8] = "VIDEO_SOURCE_RTC_IMAGE_GIF"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_REMOTE"] = 9] = "VIDEO_SOURCE_REMOTE"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_TRANSCODED"] = 10] = "VIDEO_SOURCE_TRANSCODED"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_THIRD"] = 11] = "VIDEO_SOURCE_CAMERA_THIRD"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_CAMERA_FOURTH"] = 12] = "VIDEO_SOURCE_CAMERA_FOURTH"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_THIRD"] = 13] = "VIDEO_SOURCE_SCREEN_THIRD"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_SCREEN_FOURTH"] = 14] = "VIDEO_SOURCE_SCREEN_FOURTH"; - VIDEO_SOURCE_TYPE2[VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_UNKNOWN"] = 100] = "VIDEO_SOURCE_UNKNOWN"; - return VIDEO_SOURCE_TYPE2; -})(VIDEO_SOURCE_TYPE || {}); -var AudioRoute = /* @__PURE__ */ ((AudioRoute2) => { - AudioRoute2[AudioRoute2["ROUTE_DEFAULT"] = -1] = "ROUTE_DEFAULT"; - AudioRoute2[AudioRoute2["ROUTE_HEADSET"] = 0] = "ROUTE_HEADSET"; - AudioRoute2[AudioRoute2["ROUTE_EARPIECE"] = 1] = "ROUTE_EARPIECE"; - AudioRoute2[AudioRoute2["ROUTE_HEADSETNOMIC"] = 2] = "ROUTE_HEADSETNOMIC"; - AudioRoute2[AudioRoute2["ROUTE_SPEAKERPHONE"] = 3] = "ROUTE_SPEAKERPHONE"; - AudioRoute2[AudioRoute2["ROUTE_LOUDSPEAKER"] = 4] = "ROUTE_LOUDSPEAKER"; - AudioRoute2[AudioRoute2["ROUTE_HEADSETBLUETOOTH"] = 5] = "ROUTE_HEADSETBLUETOOTH"; - AudioRoute2[AudioRoute2["ROUTE_USB"] = 6] = "ROUTE_USB"; - AudioRoute2[AudioRoute2["ROUTE_HDMI"] = 7] = "ROUTE_HDMI"; - AudioRoute2[AudioRoute2["ROUTE_DISPLAYPORT"] = 8] = "ROUTE_DISPLAYPORT"; - AudioRoute2[AudioRoute2["ROUTE_AIRPLAY"] = 9] = "ROUTE_AIRPLAY"; - return AudioRoute2; -})(AudioRoute || {}); -var BYTES_PER_SAMPLE = /* @__PURE__ */ ((BYTES_PER_SAMPLE2) => { - BYTES_PER_SAMPLE2[BYTES_PER_SAMPLE2["TWO_BYTES_PER_SAMPLE"] = 2] = "TWO_BYTES_PER_SAMPLE"; - return BYTES_PER_SAMPLE2; -})(BYTES_PER_SAMPLE || {}); -var AudioParameters = class { -}; -var RAW_AUDIO_FRAME_OP_MODE_TYPE = /* @__PURE__ */ ((RAW_AUDIO_FRAME_OP_MODE_TYPE2) => { - RAW_AUDIO_FRAME_OP_MODE_TYPE2[RAW_AUDIO_FRAME_OP_MODE_TYPE2["RAW_AUDIO_FRAME_OP_MODE_READ_ONLY"] = 0] = "RAW_AUDIO_FRAME_OP_MODE_READ_ONLY"; - RAW_AUDIO_FRAME_OP_MODE_TYPE2[RAW_AUDIO_FRAME_OP_MODE_TYPE2["RAW_AUDIO_FRAME_OP_MODE_READ_WRITE"] = 2] = "RAW_AUDIO_FRAME_OP_MODE_READ_WRITE"; - return RAW_AUDIO_FRAME_OP_MODE_TYPE2; -})(RAW_AUDIO_FRAME_OP_MODE_TYPE || {}); -var MEDIA_SOURCE_TYPE = /* @__PURE__ */ ((MEDIA_SOURCE_TYPE2) => { - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["AUDIO_PLAYOUT_SOURCE"] = 0] = "AUDIO_PLAYOUT_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["AUDIO_RECORDING_SOURCE"] = 1] = "AUDIO_RECORDING_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["PRIMARY_CAMERA_SOURCE"] = 2] = "PRIMARY_CAMERA_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["SECONDARY_CAMERA_SOURCE"] = 3] = "SECONDARY_CAMERA_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["PRIMARY_SCREEN_SOURCE"] = 4] = "PRIMARY_SCREEN_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["SECONDARY_SCREEN_SOURCE"] = 5] = "SECONDARY_SCREEN_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["CUSTOM_VIDEO_SOURCE"] = 6] = "CUSTOM_VIDEO_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE"] = 7] = "MEDIA_PLAYER_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["RTC_IMAGE_PNG_SOURCE"] = 8] = "RTC_IMAGE_PNG_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["RTC_IMAGE_JPEG_SOURCE"] = 9] = "RTC_IMAGE_JPEG_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["RTC_IMAGE_GIF_SOURCE"] = 10] = "RTC_IMAGE_GIF_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["REMOTE_VIDEO_SOURCE"] = 11] = "REMOTE_VIDEO_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["TRANSCODED_VIDEO_SOURCE"] = 12] = "TRANSCODED_VIDEO_SOURCE"; - MEDIA_SOURCE_TYPE2[MEDIA_SOURCE_TYPE2["UNKNOWN_MEDIA_SOURCE"] = 100] = "UNKNOWN_MEDIA_SOURCE"; - return MEDIA_SOURCE_TYPE2; -})(MEDIA_SOURCE_TYPE || {}); -var CONTENT_INSPECT_RESULT = /* @__PURE__ */ ((CONTENT_INSPECT_RESULT2) => { - CONTENT_INSPECT_RESULT2[CONTENT_INSPECT_RESULT2["CONTENT_INSPECT_NEUTRAL"] = 1] = "CONTENT_INSPECT_NEUTRAL"; - CONTENT_INSPECT_RESULT2[CONTENT_INSPECT_RESULT2["CONTENT_INSPECT_SEXY"] = 2] = "CONTENT_INSPECT_SEXY"; - CONTENT_INSPECT_RESULT2[CONTENT_INSPECT_RESULT2["CONTENT_INSPECT_PORN"] = 3] = "CONTENT_INSPECT_PORN"; - return CONTENT_INSPECT_RESULT2; -})(CONTENT_INSPECT_RESULT || {}); -var CONTENT_INSPECT_TYPE = /* @__PURE__ */ ((CONTENT_INSPECT_TYPE2) => { - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_INVALID"] = 0] = "CONTENT_INSPECT_INVALID"; - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_MODERATION"] = 1] = "CONTENT_INSPECT_MODERATION"; - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_SUPERVISION"] = 2] = "CONTENT_INSPECT_SUPERVISION"; - CONTENT_INSPECT_TYPE2[CONTENT_INSPECT_TYPE2["CONTENT_INSPECT_IMAGE_MODERATION"] = 3] = "CONTENT_INSPECT_IMAGE_MODERATION"; - return CONTENT_INSPECT_TYPE2; -})(CONTENT_INSPECT_TYPE || {}); -var ContentInspectModule = class { -}; -var ContentInspectConfig = class { -}; -var PacketOptions = class { -}; -var AudioEncodedFrameInfo = class { -}; -var AudioPcmFrame = class { -}; -var AUDIO_DUAL_MONO_MODE = /* @__PURE__ */ ((AUDIO_DUAL_MONO_MODE2) => { - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_STEREO"] = 0] = "AUDIO_DUAL_MONO_STEREO"; - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_L"] = 1] = "AUDIO_DUAL_MONO_L"; - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_R"] = 2] = "AUDIO_DUAL_MONO_R"; - AUDIO_DUAL_MONO_MODE2[AUDIO_DUAL_MONO_MODE2["AUDIO_DUAL_MONO_MIX"] = 3] = "AUDIO_DUAL_MONO_MIX"; - return AUDIO_DUAL_MONO_MODE2; -})(AUDIO_DUAL_MONO_MODE || {}); -var VIDEO_PIXEL_FORMAT = /* @__PURE__ */ ((VIDEO_PIXEL_FORMAT2) => { - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_DEFAULT"] = 0] = "VIDEO_PIXEL_DEFAULT"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_I420"] = 1] = "VIDEO_PIXEL_I420"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_BGRA"] = 2] = "VIDEO_PIXEL_BGRA"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_NV21"] = 3] = "VIDEO_PIXEL_NV21"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_RGBA"] = 4] = "VIDEO_PIXEL_RGBA"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_NV12"] = 8] = "VIDEO_PIXEL_NV12"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_TEXTURE_2D"] = 10] = "VIDEO_TEXTURE_2D"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_TEXTURE_OES"] = 11] = "VIDEO_TEXTURE_OES"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_CVPIXEL_NV12"] = 12] = "VIDEO_CVPIXEL_NV12"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_CVPIXEL_I420"] = 13] = "VIDEO_CVPIXEL_I420"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_CVPIXEL_BGRA"] = 14] = "VIDEO_CVPIXEL_BGRA"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_PIXEL_I422"] = 16] = "VIDEO_PIXEL_I422"; - VIDEO_PIXEL_FORMAT2[VIDEO_PIXEL_FORMAT2["VIDEO_TEXTURE_ID3D11TEXTURE2D"] = 17] = "VIDEO_TEXTURE_ID3D11TEXTURE2D"; - return VIDEO_PIXEL_FORMAT2; -})(VIDEO_PIXEL_FORMAT || {}); -var RENDER_MODE_TYPE = /* @__PURE__ */ ((RENDER_MODE_TYPE2) => { - RENDER_MODE_TYPE2[RENDER_MODE_TYPE2["RENDER_MODE_HIDDEN"] = 1] = "RENDER_MODE_HIDDEN"; - RENDER_MODE_TYPE2[RENDER_MODE_TYPE2["RENDER_MODE_FIT"] = 2] = "RENDER_MODE_FIT"; - RENDER_MODE_TYPE2[RENDER_MODE_TYPE2["RENDER_MODE_ADAPTIVE"] = 3] = "RENDER_MODE_ADAPTIVE"; - return RENDER_MODE_TYPE2; -})(RENDER_MODE_TYPE || {}); -var CAMERA_VIDEO_SOURCE_TYPE = /* @__PURE__ */ ((CAMERA_VIDEO_SOURCE_TYPE2) => { - CAMERA_VIDEO_SOURCE_TYPE2[CAMERA_VIDEO_SOURCE_TYPE2["CAMERA_SOURCE_FRONT"] = 0] = "CAMERA_SOURCE_FRONT"; - CAMERA_VIDEO_SOURCE_TYPE2[CAMERA_VIDEO_SOURCE_TYPE2["CAMERA_SOURCE_BACK"] = 1] = "CAMERA_SOURCE_BACK"; - CAMERA_VIDEO_SOURCE_TYPE2[CAMERA_VIDEO_SOURCE_TYPE2["VIDEO_SOURCE_UNSPECIFIED"] = 2] = "VIDEO_SOURCE_UNSPECIFIED"; - return CAMERA_VIDEO_SOURCE_TYPE2; -})(CAMERA_VIDEO_SOURCE_TYPE || {}); -var EGL_CONTEXT_TYPE = /* @__PURE__ */ ((EGL_CONTEXT_TYPE2) => { - EGL_CONTEXT_TYPE2[EGL_CONTEXT_TYPE2["EGL_CONTEXT10"] = 0] = "EGL_CONTEXT10"; - EGL_CONTEXT_TYPE2[EGL_CONTEXT_TYPE2["EGL_CONTEXT14"] = 1] = "EGL_CONTEXT14"; - return EGL_CONTEXT_TYPE2; -})(EGL_CONTEXT_TYPE || {}); -var VIDEO_BUFFER_TYPE = /* @__PURE__ */ ((VIDEO_BUFFER_TYPE2) => { - VIDEO_BUFFER_TYPE2[VIDEO_BUFFER_TYPE2["VIDEO_BUFFER_RAW_DATA"] = 1] = "VIDEO_BUFFER_RAW_DATA"; - VIDEO_BUFFER_TYPE2[VIDEO_BUFFER_TYPE2["VIDEO_BUFFER_ARRAY"] = 2] = "VIDEO_BUFFER_ARRAY"; - VIDEO_BUFFER_TYPE2[VIDEO_BUFFER_TYPE2["VIDEO_BUFFER_TEXTURE"] = 3] = "VIDEO_BUFFER_TEXTURE"; - return VIDEO_BUFFER_TYPE2; -})(VIDEO_BUFFER_TYPE || {}); -var ExternalVideoFrame = class { -}; -var VideoFrame = class { -}; -var MEDIA_PLAYER_SOURCE_TYPE = /* @__PURE__ */ ((MEDIA_PLAYER_SOURCE_TYPE2) => { - MEDIA_PLAYER_SOURCE_TYPE2[MEDIA_PLAYER_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE_DEFAULT"] = 0] = "MEDIA_PLAYER_SOURCE_DEFAULT"; - MEDIA_PLAYER_SOURCE_TYPE2[MEDIA_PLAYER_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE_FULL_FEATURED"] = 1] = "MEDIA_PLAYER_SOURCE_FULL_FEATURED"; - MEDIA_PLAYER_SOURCE_TYPE2[MEDIA_PLAYER_SOURCE_TYPE2["MEDIA_PLAYER_SOURCE_SIMPLE"] = 2] = "MEDIA_PLAYER_SOURCE_SIMPLE"; - return MEDIA_PLAYER_SOURCE_TYPE2; -})(MEDIA_PLAYER_SOURCE_TYPE || {}); -var VIDEO_MODULE_POSITION = /* @__PURE__ */ ((VIDEO_MODULE_POSITION2) => { - VIDEO_MODULE_POSITION2[VIDEO_MODULE_POSITION2["POSITION_POST_CAPTURER"] = 1] = "POSITION_POST_CAPTURER"; - VIDEO_MODULE_POSITION2[VIDEO_MODULE_POSITION2["POSITION_PRE_RENDERER"] = 1] = "POSITION_PRE_RENDERER"; - VIDEO_MODULE_POSITION2[VIDEO_MODULE_POSITION2["POSITION_PRE_ENCODER"] = 1] = "POSITION_PRE_ENCODER"; - return VIDEO_MODULE_POSITION2; -})(VIDEO_MODULE_POSITION || {}); -var AUDIO_FRAME_TYPE = /* @__PURE__ */ ((AUDIO_FRAME_TYPE2) => { - AUDIO_FRAME_TYPE2[AUDIO_FRAME_TYPE2["FRAME_TYPE_PCM16"] = 0] = "FRAME_TYPE_PCM16"; - return AUDIO_FRAME_TYPE2; -})(AUDIO_FRAME_TYPE || {}); -var AudioFrame = class { -}; -var AUDIO_FRAME_POSITION = /* @__PURE__ */ ((AUDIO_FRAME_POSITION2) => { - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_NONE"] = 0] = "AUDIO_FRAME_POSITION_NONE"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_PLAYBACK"] = 1] = "AUDIO_FRAME_POSITION_PLAYBACK"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_RECORD"] = 2] = "AUDIO_FRAME_POSITION_RECORD"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_MIXED"] = 4] = "AUDIO_FRAME_POSITION_MIXED"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_BEFORE_MIXING"] = 8] = "AUDIO_FRAME_POSITION_BEFORE_MIXING"; - AUDIO_FRAME_POSITION2[AUDIO_FRAME_POSITION2["AUDIO_FRAME_POSITION_EAR_MONITORING"] = 16] = "AUDIO_FRAME_POSITION_EAR_MONITORING"; - return AUDIO_FRAME_POSITION2; -})(AUDIO_FRAME_POSITION || {}); -var AudioParams = class { -}; -var AudioSpectrumData = class { -}; -var UserAudioSpectrumInfo = class { -}; -var VIDEO_FRAME_PROCESS_MODE = /* @__PURE__ */ ((VIDEO_FRAME_PROCESS_MODE2) => { - VIDEO_FRAME_PROCESS_MODE2[VIDEO_FRAME_PROCESS_MODE2["PROCESS_MODE_READ_ONLY"] = 0] = "PROCESS_MODE_READ_ONLY"; - VIDEO_FRAME_PROCESS_MODE2[VIDEO_FRAME_PROCESS_MODE2["PROCESS_MODE_READ_WRITE"] = 1] = "PROCESS_MODE_READ_WRITE"; - return VIDEO_FRAME_PROCESS_MODE2; -})(VIDEO_FRAME_PROCESS_MODE || {}); -var EXTERNAL_VIDEO_SOURCE_TYPE = /* @__PURE__ */ ((EXTERNAL_VIDEO_SOURCE_TYPE2) => { - EXTERNAL_VIDEO_SOURCE_TYPE2[EXTERNAL_VIDEO_SOURCE_TYPE2["VIDEO_FRAME"] = 0] = "VIDEO_FRAME"; - EXTERNAL_VIDEO_SOURCE_TYPE2[EXTERNAL_VIDEO_SOURCE_TYPE2["ENCODED_VIDEO_FRAME"] = 1] = "ENCODED_VIDEO_FRAME"; - return EXTERNAL_VIDEO_SOURCE_TYPE2; -})(EXTERNAL_VIDEO_SOURCE_TYPE || {}); -var MediaRecorderContainerFormat = /* @__PURE__ */ ((MediaRecorderContainerFormat2) => { - MediaRecorderContainerFormat2[MediaRecorderContainerFormat2["FORMAT_MP4"] = 1] = "FORMAT_MP4"; - return MediaRecorderContainerFormat2; -})(MediaRecorderContainerFormat || {}); -var MediaRecorderStreamType = /* @__PURE__ */ ((MediaRecorderStreamType2) => { - MediaRecorderStreamType2[MediaRecorderStreamType2["STREAM_TYPE_AUDIO"] = 1] = "STREAM_TYPE_AUDIO"; - MediaRecorderStreamType2[MediaRecorderStreamType2["STREAM_TYPE_VIDEO"] = 2] = "STREAM_TYPE_VIDEO"; - MediaRecorderStreamType2[MediaRecorderStreamType2["STREAM_TYPE_BOTH"] = 3] = "STREAM_TYPE_BOTH"; - return MediaRecorderStreamType2; -})(MediaRecorderStreamType || {}); -var RecorderState = /* @__PURE__ */ ((RecorderState2) => { - RecorderState2[RecorderState2["RECORDER_STATE_ERROR"] = -1] = "RECORDER_STATE_ERROR"; - RecorderState2[RecorderState2["RECORDER_STATE_START"] = 2] = "RECORDER_STATE_START"; - RecorderState2[RecorderState2["RECORDER_STATE_STOP"] = 3] = "RECORDER_STATE_STOP"; - return RecorderState2; -})(RecorderState || {}); -var RecorderErrorCode = /* @__PURE__ */ ((RecorderErrorCode2) => { - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_NONE"] = 0] = "RECORDER_ERROR_NONE"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_WRITE_FAILED"] = 1] = "RECORDER_ERROR_WRITE_FAILED"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_NO_STREAM"] = 2] = "RECORDER_ERROR_NO_STREAM"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_OVER_MAX_DURATION"] = 3] = "RECORDER_ERROR_OVER_MAX_DURATION"; - RecorderErrorCode2[RecorderErrorCode2["RECORDER_ERROR_CONFIG_CHANGED"] = 4] = "RECORDER_ERROR_CONFIG_CHANGED"; - return RecorderErrorCode2; -})(RecorderErrorCode || {}); -var MediaRecorderConfiguration = class { -}; -var RecorderInfo = class { -}; - -// generate/AgoraMediaPlayerTypes.ts -var MEDIA_PLAYER_STATE = /* @__PURE__ */ ((MEDIA_PLAYER_STATE2) => { - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_IDLE"] = 0] = "PLAYER_STATE_IDLE"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_OPENING"] = 1] = "PLAYER_STATE_OPENING"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_OPEN_COMPLETED"] = 2] = "PLAYER_STATE_OPEN_COMPLETED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PLAYING"] = 3] = "PLAYER_STATE_PLAYING"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PAUSED"] = 4] = "PLAYER_STATE_PAUSED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PLAYBACK_COMPLETED"] = 5] = "PLAYER_STATE_PLAYBACK_COMPLETED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED"] = 6] = "PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_STOPPED"] = 7] = "PLAYER_STATE_STOPPED"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_PAUSING_INTERNAL"] = 50] = "PLAYER_STATE_PAUSING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_STOPPING_INTERNAL"] = 51] = "PLAYER_STATE_STOPPING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_SEEKING_INTERNAL"] = 52] = "PLAYER_STATE_SEEKING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_GETTING_INTERNAL"] = 53] = "PLAYER_STATE_GETTING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_NONE_INTERNAL"] = 54] = "PLAYER_STATE_NONE_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_DO_NOTHING_INTERNAL"] = 55] = "PLAYER_STATE_DO_NOTHING_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_SET_TRACK_INTERNAL"] = 56] = "PLAYER_STATE_SET_TRACK_INTERNAL"; - MEDIA_PLAYER_STATE2[MEDIA_PLAYER_STATE2["PLAYER_STATE_FAILED"] = 100] = "PLAYER_STATE_FAILED"; - return MEDIA_PLAYER_STATE2; -})(MEDIA_PLAYER_STATE || {}); -var MEDIA_PLAYER_ERROR = /* @__PURE__ */ ((MEDIA_PLAYER_ERROR2) => { - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_NONE"] = 0] = "PLAYER_ERROR_NONE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_ARGUMENTS"] = -1] = "PLAYER_ERROR_INVALID_ARGUMENTS"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INTERNAL"] = -2] = "PLAYER_ERROR_INTERNAL"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_NO_RESOURCE"] = -3] = "PLAYER_ERROR_NO_RESOURCE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_MEDIA_SOURCE"] = -4] = "PLAYER_ERROR_INVALID_MEDIA_SOURCE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_UNKNOWN_STREAM_TYPE"] = -5] = "PLAYER_ERROR_UNKNOWN_STREAM_TYPE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_OBJ_NOT_INITIALIZED"] = -6] = "PLAYER_ERROR_OBJ_NOT_INITIALIZED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_CODEC_NOT_SUPPORTED"] = -7] = "PLAYER_ERROR_CODEC_NOT_SUPPORTED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_VIDEO_RENDER_FAILED"] = -8] = "PLAYER_ERROR_VIDEO_RENDER_FAILED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_STATE"] = -9] = "PLAYER_ERROR_INVALID_STATE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_URL_NOT_FOUND"] = -10] = "PLAYER_ERROR_URL_NOT_FOUND"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INVALID_CONNECTION_STATE"] = -11] = "PLAYER_ERROR_INVALID_CONNECTION_STATE"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_SRC_BUFFER_UNDERFLOW"] = -12] = "PLAYER_ERROR_SRC_BUFFER_UNDERFLOW"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_INTERRUPTED"] = -13] = "PLAYER_ERROR_INTERRUPTED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_NOT_SUPPORTED"] = -14] = "PLAYER_ERROR_NOT_SUPPORTED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_TOKEN_EXPIRED"] = -15] = "PLAYER_ERROR_TOKEN_EXPIRED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_IP_EXPIRED"] = -16] = "PLAYER_ERROR_IP_EXPIRED"; - MEDIA_PLAYER_ERROR2[MEDIA_PLAYER_ERROR2["PLAYER_ERROR_UNKNOWN"] = -17] = "PLAYER_ERROR_UNKNOWN"; - return MEDIA_PLAYER_ERROR2; -})(MEDIA_PLAYER_ERROR || {}); -var MEDIA_STREAM_TYPE = /* @__PURE__ */ ((MEDIA_STREAM_TYPE2) => { - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_UNKNOWN"] = 0] = "STREAM_TYPE_UNKNOWN"; - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_VIDEO"] = 1] = "STREAM_TYPE_VIDEO"; - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_AUDIO"] = 2] = "STREAM_TYPE_AUDIO"; - MEDIA_STREAM_TYPE2[MEDIA_STREAM_TYPE2["STREAM_TYPE_SUBTITLE"] = 3] = "STREAM_TYPE_SUBTITLE"; - return MEDIA_STREAM_TYPE2; -})(MEDIA_STREAM_TYPE || {}); -var MEDIA_PLAYER_EVENT = /* @__PURE__ */ ((MEDIA_PLAYER_EVENT2) => { - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SEEK_BEGIN"] = 0] = "PLAYER_EVENT_SEEK_BEGIN"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SEEK_COMPLETE"] = 1] = "PLAYER_EVENT_SEEK_COMPLETE"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SEEK_ERROR"] = 2] = "PLAYER_EVENT_SEEK_ERROR"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_AUDIO_TRACK_CHANGED"] = 5] = "PLAYER_EVENT_AUDIO_TRACK_CHANGED"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_BUFFER_LOW"] = 6] = "PLAYER_EVENT_BUFFER_LOW"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_BUFFER_RECOVER"] = 7] = "PLAYER_EVENT_BUFFER_RECOVER"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_FREEZE_START"] = 8] = "PLAYER_EVENT_FREEZE_START"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_FREEZE_STOP"] = 9] = "PLAYER_EVENT_FREEZE_STOP"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SWITCH_BEGIN"] = 10] = "PLAYER_EVENT_SWITCH_BEGIN"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SWITCH_COMPLETE"] = 11] = "PLAYER_EVENT_SWITCH_COMPLETE"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_SWITCH_ERROR"] = 12] = "PLAYER_EVENT_SWITCH_ERROR"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_FIRST_DISPLAYED"] = 13] = "PLAYER_EVENT_FIRST_DISPLAYED"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_REACH_CACHE_FILE_MAX_COUNT"] = 14] = "PLAYER_EVENT_REACH_CACHE_FILE_MAX_COUNT"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_REACH_CACHE_FILE_MAX_SIZE"] = 15] = "PLAYER_EVENT_REACH_CACHE_FILE_MAX_SIZE"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_TRY_OPEN_START"] = 16] = "PLAYER_EVENT_TRY_OPEN_START"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_TRY_OPEN_SUCCEED"] = 17] = "PLAYER_EVENT_TRY_OPEN_SUCCEED"; - MEDIA_PLAYER_EVENT2[MEDIA_PLAYER_EVENT2["PLAYER_EVENT_TRY_OPEN_FAILED"] = 18] = "PLAYER_EVENT_TRY_OPEN_FAILED"; - return MEDIA_PLAYER_EVENT2; -})(MEDIA_PLAYER_EVENT || {}); -var PLAYER_PRELOAD_EVENT = /* @__PURE__ */ ((PLAYER_PRELOAD_EVENT2) => { - PLAYER_PRELOAD_EVENT2[PLAYER_PRELOAD_EVENT2["PLAYER_PRELOAD_EVENT_BEGIN"] = 0] = "PLAYER_PRELOAD_EVENT_BEGIN"; - PLAYER_PRELOAD_EVENT2[PLAYER_PRELOAD_EVENT2["PLAYER_PRELOAD_EVENT_COMPLETE"] = 1] = "PLAYER_PRELOAD_EVENT_COMPLETE"; - PLAYER_PRELOAD_EVENT2[PLAYER_PRELOAD_EVENT2["PLAYER_PRELOAD_EVENT_ERROR"] = 2] = "PLAYER_PRELOAD_EVENT_ERROR"; - return PLAYER_PRELOAD_EVENT2; -})(PLAYER_PRELOAD_EVENT || {}); -var PlayerStreamInfo = class { -}; -var SrcInfo = class { -}; -var MEDIA_PLAYER_METADATA_TYPE = /* @__PURE__ */ ((MEDIA_PLAYER_METADATA_TYPE2) => { - MEDIA_PLAYER_METADATA_TYPE2[MEDIA_PLAYER_METADATA_TYPE2["PLAYER_METADATA_TYPE_UNKNOWN"] = 0] = "PLAYER_METADATA_TYPE_UNKNOWN"; - MEDIA_PLAYER_METADATA_TYPE2[MEDIA_PLAYER_METADATA_TYPE2["PLAYER_METADATA_TYPE_SEI"] = 1] = "PLAYER_METADATA_TYPE_SEI"; - return MEDIA_PLAYER_METADATA_TYPE2; -})(MEDIA_PLAYER_METADATA_TYPE || {}); -var CacheStatistics = class { -}; -var PlayerUpdatedInfo = class { -}; -var MediaSource = class { -}; - -// generate/IAgoraLog.ts -var LOG_LEVEL = /* @__PURE__ */ ((LOG_LEVEL2) => { - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_NONE"] = 0] = "LOG_LEVEL_NONE"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_INFO"] = 1] = "LOG_LEVEL_INFO"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_WARN"] = 2] = "LOG_LEVEL_WARN"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_ERROR"] = 4] = "LOG_LEVEL_ERROR"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_FATAL"] = 8] = "LOG_LEVEL_FATAL"; - LOG_LEVEL2[LOG_LEVEL2["LOG_LEVEL_API_CALL"] = 16] = "LOG_LEVEL_API_CALL"; - return LOG_LEVEL2; -})(LOG_LEVEL || {}); -var LOG_FILTER_TYPE = /* @__PURE__ */ ((LOG_FILTER_TYPE2) => { - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_OFF"] = 0] = "LOG_FILTER_OFF"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_DEBUG"] = 2063] = "LOG_FILTER_DEBUG"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_INFO"] = 15] = "LOG_FILTER_INFO"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_WARN"] = 14] = "LOG_FILTER_WARN"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_ERROR"] = 12] = "LOG_FILTER_ERROR"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_CRITICAL"] = 8] = "LOG_FILTER_CRITICAL"; - LOG_FILTER_TYPE2[LOG_FILTER_TYPE2["LOG_FILTER_MASK"] = 2063] = "LOG_FILTER_MASK"; - return LOG_FILTER_TYPE2; -})(LOG_FILTER_TYPE || {}); -var LogConfig = class { -}; - -// generate/IAgoraMediaEngine.ts -var AUDIO_MIXING_DUAL_MONO_MODE = /* @__PURE__ */ ((AUDIO_MIXING_DUAL_MONO_MODE2) => { - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_AUTO"] = 0] = "AUDIO_MIXING_DUAL_MONO_AUTO"; - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_L"] = 1] = "AUDIO_MIXING_DUAL_MONO_L"; - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_R"] = 2] = "AUDIO_MIXING_DUAL_MONO_R"; - AUDIO_MIXING_DUAL_MONO_MODE2[AUDIO_MIXING_DUAL_MONO_MODE2["AUDIO_MIXING_DUAL_MONO_MIX"] = 3] = "AUDIO_MIXING_DUAL_MONO_MIX"; - return AUDIO_MIXING_DUAL_MONO_MODE2; -})(AUDIO_MIXING_DUAL_MONO_MODE || {}); - -// generate/IAgoraMediaStreamingSource.ts -var STREAMING_SRC_ERR = /* @__PURE__ */ ((STREAMING_SRC_ERR2) => { - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NONE"] = 0] = "STREAMING_SRC_ERR_NONE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_UNKNOWN"] = 1] = "STREAMING_SRC_ERR_UNKNOWN"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_INVALID_PARAM"] = 2] = "STREAMING_SRC_ERR_INVALID_PARAM"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_BAD_STATE"] = 3] = "STREAMING_SRC_ERR_BAD_STATE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NO_MEM"] = 4] = "STREAMING_SRC_ERR_NO_MEM"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_BUFFER_OVERFLOW"] = 5] = "STREAMING_SRC_ERR_BUFFER_OVERFLOW"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_BUFFER_UNDERFLOW"] = 6] = "STREAMING_SRC_ERR_BUFFER_UNDERFLOW"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NOT_FOUND"] = 7] = "STREAMING_SRC_ERR_NOT_FOUND"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_TIMEOUT"] = 8] = "STREAMING_SRC_ERR_TIMEOUT"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_EXPIRED"] = 9] = "STREAMING_SRC_ERR_EXPIRED"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_UNSUPPORTED"] = 10] = "STREAMING_SRC_ERR_UNSUPPORTED"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_NOT_EXIST"] = 11] = "STREAMING_SRC_ERR_NOT_EXIST"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_EXIST"] = 12] = "STREAMING_SRC_ERR_EXIST"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_OPEN"] = 13] = "STREAMING_SRC_ERR_OPEN"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CLOSE"] = 14] = "STREAMING_SRC_ERR_CLOSE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_READ"] = 15] = "STREAMING_SRC_ERR_READ"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_WRITE"] = 16] = "STREAMING_SRC_ERR_WRITE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_SEEK"] = 17] = "STREAMING_SRC_ERR_SEEK"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_EOF"] = 18] = "STREAMING_SRC_ERR_EOF"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CODECOPEN"] = 19] = "STREAMING_SRC_ERR_CODECOPEN"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CODECCLOSE"] = 20] = "STREAMING_SRC_ERR_CODECCLOSE"; - STREAMING_SRC_ERR2[STREAMING_SRC_ERR2["STREAMING_SRC_ERR_CODECPROC"] = 21] = "STREAMING_SRC_ERR_CODECPROC"; - return STREAMING_SRC_ERR2; -})(STREAMING_SRC_ERR || {}); -var STREAMING_SRC_STATE = /* @__PURE__ */ ((STREAMING_SRC_STATE2) => { - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_CLOSED"] = 0] = "STREAMING_SRC_STATE_CLOSED"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_OPENING"] = 1] = "STREAMING_SRC_STATE_OPENING"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_IDLE"] = 2] = "STREAMING_SRC_STATE_IDLE"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_PLAYING"] = 3] = "STREAMING_SRC_STATE_PLAYING"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_SEEKING"] = 4] = "STREAMING_SRC_STATE_SEEKING"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_EOF"] = 5] = "STREAMING_SRC_STATE_EOF"; - STREAMING_SRC_STATE2[STREAMING_SRC_STATE2["STREAMING_SRC_STATE_ERROR"] = 6] = "STREAMING_SRC_STATE_ERROR"; - return STREAMING_SRC_STATE2; -})(STREAMING_SRC_STATE || {}); -var InputSeiData = class { -}; - -// generate/IAgoraMusicContentCenter.ts -var PreloadStatusCode = /* @__PURE__ */ ((PreloadStatusCode2) => { - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusCompleted"] = 0] = "kPreloadStatusCompleted"; - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusFailed"] = 1] = "kPreloadStatusFailed"; - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusPreloading"] = 2] = "kPreloadStatusPreloading"; - PreloadStatusCode2[PreloadStatusCode2["kPreloadStatusRemoved"] = 3] = "kPreloadStatusRemoved"; - return PreloadStatusCode2; -})(PreloadStatusCode || {}); -var MusicContentCenterStatusCode = /* @__PURE__ */ ((MusicContentCenterStatusCode2) => { - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusOk"] = 0] = "kMusicContentCenterStatusOk"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErr"] = 1] = "kMusicContentCenterStatusErr"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrGateway"] = 2] = "kMusicContentCenterStatusErrGateway"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrPermissionAndResource"] = 3] = "kMusicContentCenterStatusErrPermissionAndResource"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrInternalDataParse"] = 4] = "kMusicContentCenterStatusErrInternalDataParse"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrMusicLoading"] = 5] = "kMusicContentCenterStatusErrMusicLoading"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrMusicDecryption"] = 6] = "kMusicContentCenterStatusErrMusicDecryption"; - MusicContentCenterStatusCode2[MusicContentCenterStatusCode2["kMusicContentCenterStatusErrHttpInternalError"] = 7] = "kMusicContentCenterStatusErrHttpInternalError"; - return MusicContentCenterStatusCode2; -})(MusicContentCenterStatusCode || {}); -var MusicChartInfo = class { -}; -var MUSIC_CACHE_STATUS_TYPE = /* @__PURE__ */ ((MUSIC_CACHE_STATUS_TYPE2) => { - MUSIC_CACHE_STATUS_TYPE2[MUSIC_CACHE_STATUS_TYPE2["MUSIC_CACHE_STATUS_TYPE_CACHED"] = 0] = "MUSIC_CACHE_STATUS_TYPE_CACHED"; - MUSIC_CACHE_STATUS_TYPE2[MUSIC_CACHE_STATUS_TYPE2["MUSIC_CACHE_STATUS_TYPE_CACHING"] = 1] = "MUSIC_CACHE_STATUS_TYPE_CACHING"; - return MUSIC_CACHE_STATUS_TYPE2; -})(MUSIC_CACHE_STATUS_TYPE || {}); -var MusicCacheInfo = class { -}; -var MvProperty = class { -}; -var ClimaxSegment = class { -}; -var Music = class { -}; -var MusicContentCenterConfiguration = class { -}; - -// generate/IAgoraRhythmPlayer.ts -var RHYTHM_PLAYER_STATE_TYPE = /* @__PURE__ */ ((RHYTHM_PLAYER_STATE_TYPE2) => { - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_IDLE"] = 810] = "RHYTHM_PLAYER_STATE_IDLE"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_OPENING"] = 811] = "RHYTHM_PLAYER_STATE_OPENING"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_DECODING"] = 812] = "RHYTHM_PLAYER_STATE_DECODING"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_PLAYING"] = 813] = "RHYTHM_PLAYER_STATE_PLAYING"; - RHYTHM_PLAYER_STATE_TYPE2[RHYTHM_PLAYER_STATE_TYPE2["RHYTHM_PLAYER_STATE_FAILED"] = 814] = "RHYTHM_PLAYER_STATE_FAILED"; - return RHYTHM_PLAYER_STATE_TYPE2; -})(RHYTHM_PLAYER_STATE_TYPE || {}); -var RHYTHM_PLAYER_ERROR_TYPE = /* @__PURE__ */ ((RHYTHM_PLAYER_ERROR_TYPE2) => { - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_OK"] = 0] = "RHYTHM_PLAYER_ERROR_OK"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_FAILED"] = 1] = "RHYTHM_PLAYER_ERROR_FAILED"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN"] = 801] = "RHYTHM_PLAYER_ERROR_CAN_NOT_OPEN"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY"] = 802] = "RHYTHM_PLAYER_ERROR_CAN_NOT_PLAY"; - RHYTHM_PLAYER_ERROR_TYPE2[RHYTHM_PLAYER_ERROR_TYPE2["RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT"] = 803] = "RHYTHM_PLAYER_ERROR_FILE_OVER_DURATION_LIMIT"; - return RHYTHM_PLAYER_ERROR_TYPE2; -})(RHYTHM_PLAYER_ERROR_TYPE || {}); -var AgoraRhythmPlayerConfig = class { -}; - -// generate/IAgoraRtcEngine.ts -var MEDIA_DEVICE_TYPE = /* @__PURE__ */ ((MEDIA_DEVICE_TYPE2) => { - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["UNKNOWN_AUDIO_DEVICE"] = -1] = "UNKNOWN_AUDIO_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_PLAYOUT_DEVICE"] = 0] = "AUDIO_PLAYOUT_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_RECORDING_DEVICE"] = 1] = "AUDIO_RECORDING_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["VIDEO_RENDER_DEVICE"] = 2] = "VIDEO_RENDER_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["VIDEO_CAPTURE_DEVICE"] = 3] = "VIDEO_CAPTURE_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_APPLICATION_PLAYOUT_DEVICE"] = 4] = "AUDIO_APPLICATION_PLAYOUT_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_VIRTUAL_PLAYOUT_DEVICE"] = 5] = "AUDIO_VIRTUAL_PLAYOUT_DEVICE"; - MEDIA_DEVICE_TYPE2[MEDIA_DEVICE_TYPE2["AUDIO_VIRTUAL_RECORDING_DEVICE"] = 6] = "AUDIO_VIRTUAL_RECORDING_DEVICE"; - return MEDIA_DEVICE_TYPE2; -})(MEDIA_DEVICE_TYPE || {}); -var AUDIO_MIXING_STATE_TYPE = /* @__PURE__ */ ((AUDIO_MIXING_STATE_TYPE2) => { - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_PLAYING"] = 710] = "AUDIO_MIXING_STATE_PLAYING"; - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_PAUSED"] = 711] = "AUDIO_MIXING_STATE_PAUSED"; - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_STOPPED"] = 713] = "AUDIO_MIXING_STATE_STOPPED"; - AUDIO_MIXING_STATE_TYPE2[AUDIO_MIXING_STATE_TYPE2["AUDIO_MIXING_STATE_FAILED"] = 714] = "AUDIO_MIXING_STATE_FAILED"; - return AUDIO_MIXING_STATE_TYPE2; -})(AUDIO_MIXING_STATE_TYPE || {}); -var AUDIO_MIXING_REASON_TYPE = /* @__PURE__ */ ((AUDIO_MIXING_REASON_TYPE2) => { - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_CAN_NOT_OPEN"] = 701] = "AUDIO_MIXING_REASON_CAN_NOT_OPEN"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_TOO_FREQUENT_CALL"] = 702] = "AUDIO_MIXING_REASON_TOO_FREQUENT_CALL"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_INTERRUPTED_EOF"] = 703] = "AUDIO_MIXING_REASON_INTERRUPTED_EOF"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED"] = 721] = "AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED"] = 723] = "AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_STOPPED_BY_USER"] = 724] = "AUDIO_MIXING_REASON_STOPPED_BY_USER"; - AUDIO_MIXING_REASON_TYPE2[AUDIO_MIXING_REASON_TYPE2["AUDIO_MIXING_REASON_OK"] = 0] = "AUDIO_MIXING_REASON_OK"; - return AUDIO_MIXING_REASON_TYPE2; -})(AUDIO_MIXING_REASON_TYPE || {}); -var INJECT_STREAM_STATUS = /* @__PURE__ */ ((INJECT_STREAM_STATUS2) => { - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_SUCCESS"] = 0] = "INJECT_STREAM_STATUS_START_SUCCESS"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_ALREADY_EXISTS"] = 1] = "INJECT_STREAM_STATUS_START_ALREADY_EXISTS"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_UNAUTHORIZED"] = 2] = "INJECT_STREAM_STATUS_START_UNAUTHORIZED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_TIMEDOUT"] = 3] = "INJECT_STREAM_STATUS_START_TIMEDOUT"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_START_FAILED"] = 4] = "INJECT_STREAM_STATUS_START_FAILED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_SUCCESS"] = 5] = "INJECT_STREAM_STATUS_STOP_SUCCESS"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_NOT_FOUND"] = 6] = "INJECT_STREAM_STATUS_STOP_NOT_FOUND"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_UNAUTHORIZED"] = 7] = "INJECT_STREAM_STATUS_STOP_UNAUTHORIZED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_TIMEDOUT"] = 8] = "INJECT_STREAM_STATUS_STOP_TIMEDOUT"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_STOP_FAILED"] = 9] = "INJECT_STREAM_STATUS_STOP_FAILED"; - INJECT_STREAM_STATUS2[INJECT_STREAM_STATUS2["INJECT_STREAM_STATUS_BROKEN"] = 10] = "INJECT_STREAM_STATUS_BROKEN"; - return INJECT_STREAM_STATUS2; -})(INJECT_STREAM_STATUS || {}); -var AUDIO_EQUALIZATION_BAND_FREQUENCY = /* @__PURE__ */ ((AUDIO_EQUALIZATION_BAND_FREQUENCY2) => { - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_31"] = 0] = "AUDIO_EQUALIZATION_BAND_31"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_62"] = 1] = "AUDIO_EQUALIZATION_BAND_62"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_125"] = 2] = "AUDIO_EQUALIZATION_BAND_125"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_250"] = 3] = "AUDIO_EQUALIZATION_BAND_250"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_500"] = 4] = "AUDIO_EQUALIZATION_BAND_500"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_1K"] = 5] = "AUDIO_EQUALIZATION_BAND_1K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_2K"] = 6] = "AUDIO_EQUALIZATION_BAND_2K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_4K"] = 7] = "AUDIO_EQUALIZATION_BAND_4K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_8K"] = 8] = "AUDIO_EQUALIZATION_BAND_8K"; - AUDIO_EQUALIZATION_BAND_FREQUENCY2[AUDIO_EQUALIZATION_BAND_FREQUENCY2["AUDIO_EQUALIZATION_BAND_16K"] = 9] = "AUDIO_EQUALIZATION_BAND_16K"; - return AUDIO_EQUALIZATION_BAND_FREQUENCY2; -})(AUDIO_EQUALIZATION_BAND_FREQUENCY || {}); -var AUDIO_REVERB_TYPE = /* @__PURE__ */ ((AUDIO_REVERB_TYPE2) => { - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_DRY_LEVEL"] = 0] = "AUDIO_REVERB_DRY_LEVEL"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_WET_LEVEL"] = 1] = "AUDIO_REVERB_WET_LEVEL"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_ROOM_SIZE"] = 2] = "AUDIO_REVERB_ROOM_SIZE"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_WET_DELAY"] = 3] = "AUDIO_REVERB_WET_DELAY"; - AUDIO_REVERB_TYPE2[AUDIO_REVERB_TYPE2["AUDIO_REVERB_STRENGTH"] = 4] = "AUDIO_REVERB_STRENGTH"; - return AUDIO_REVERB_TYPE2; -})(AUDIO_REVERB_TYPE || {}); -var STREAM_FALLBACK_OPTIONS = /* @__PURE__ */ ((STREAM_FALLBACK_OPTIONS2) => { - STREAM_FALLBACK_OPTIONS2[STREAM_FALLBACK_OPTIONS2["STREAM_FALLBACK_OPTION_DISABLED"] = 0] = "STREAM_FALLBACK_OPTION_DISABLED"; - STREAM_FALLBACK_OPTIONS2[STREAM_FALLBACK_OPTIONS2["STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW"] = 1] = "STREAM_FALLBACK_OPTION_VIDEO_STREAM_LOW"; - STREAM_FALLBACK_OPTIONS2[STREAM_FALLBACK_OPTIONS2["STREAM_FALLBACK_OPTION_AUDIO_ONLY"] = 2] = "STREAM_FALLBACK_OPTION_AUDIO_ONLY"; - return STREAM_FALLBACK_OPTIONS2; -})(STREAM_FALLBACK_OPTIONS || {}); -var PRIORITY_TYPE = /* @__PURE__ */ ((PRIORITY_TYPE2) => { - PRIORITY_TYPE2[PRIORITY_TYPE2["PRIORITY_HIGH"] = 50] = "PRIORITY_HIGH"; - PRIORITY_TYPE2[PRIORITY_TYPE2["PRIORITY_NORMAL"] = 100] = "PRIORITY_NORMAL"; - return PRIORITY_TYPE2; -})(PRIORITY_TYPE || {}); -var LocalVideoStats = class { -}; -var RemoteAudioStats = class { -}; -var RemoteVideoStats = class { -}; -var Region = class { -}; -var VideoCompositingLayout = class { -}; -var InjectStreamConfig = class { -}; -var RTMP_STREAM_LIFE_CYCLE_TYPE = /* @__PURE__ */ ((RTMP_STREAM_LIFE_CYCLE_TYPE2) => { - RTMP_STREAM_LIFE_CYCLE_TYPE2[RTMP_STREAM_LIFE_CYCLE_TYPE2["RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL"] = 1] = "RTMP_STREAM_LIFE_CYCLE_BIND2CHANNEL"; - RTMP_STREAM_LIFE_CYCLE_TYPE2[RTMP_STREAM_LIFE_CYCLE_TYPE2["RTMP_STREAM_LIFE_CYCLE_BIND2OWNER"] = 2] = "RTMP_STREAM_LIFE_CYCLE_BIND2OWNER"; - return RTMP_STREAM_LIFE_CYCLE_TYPE2; -})(RTMP_STREAM_LIFE_CYCLE_TYPE || {}); -var PublisherConfiguration = class { -}; -var CAMERA_DIRECTION = /* @__PURE__ */ ((CAMERA_DIRECTION2) => { - CAMERA_DIRECTION2[CAMERA_DIRECTION2["CAMERA_REAR"] = 0] = "CAMERA_REAR"; - CAMERA_DIRECTION2[CAMERA_DIRECTION2["CAMERA_FRONT"] = 1] = "CAMERA_FRONT"; - return CAMERA_DIRECTION2; -})(CAMERA_DIRECTION || {}); -var CLOUD_PROXY_TYPE = /* @__PURE__ */ ((CLOUD_PROXY_TYPE2) => { - CLOUD_PROXY_TYPE2[CLOUD_PROXY_TYPE2["NONE_PROXY"] = 0] = "NONE_PROXY"; - CLOUD_PROXY_TYPE2[CLOUD_PROXY_TYPE2["UDP_PROXY"] = 1] = "UDP_PROXY"; - CLOUD_PROXY_TYPE2[CLOUD_PROXY_TYPE2["TCP_PROXY"] = 2] = "TCP_PROXY"; - return CLOUD_PROXY_TYPE2; -})(CLOUD_PROXY_TYPE || {}); -var CameraCapturerConfiguration = class { -}; -var ScreenCaptureConfiguration = class { -}; -var SIZE = class { -}; -var ThumbImageBuffer = class { -}; -var ScreenCaptureSourceType = /* @__PURE__ */ ((ScreenCaptureSourceType2) => { - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Unknown"] = -1] = "ScreenCaptureSourceType_Unknown"; - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Window"] = 0] = "ScreenCaptureSourceType_Window"; - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Screen"] = 1] = "ScreenCaptureSourceType_Screen"; - ScreenCaptureSourceType2[ScreenCaptureSourceType2["ScreenCaptureSourceType_Custom"] = 2] = "ScreenCaptureSourceType_Custom"; - return ScreenCaptureSourceType2; -})(ScreenCaptureSourceType || {}); -var ScreenCaptureSourceInfo = class { -}; -var AdvancedAudioOptions = class { -}; -var ImageTrackOptions = class { -}; -var ChannelMediaOptions = class { -}; -var PROXY_TYPE = /* @__PURE__ */ ((PROXY_TYPE2) => { - PROXY_TYPE2[PROXY_TYPE2["NONE_PROXY_TYPE"] = 0] = "NONE_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["UDP_PROXY_TYPE"] = 1] = "UDP_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["TCP_PROXY_TYPE"] = 2] = "TCP_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["LOCAL_PROXY_TYPE"] = 3] = "LOCAL_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["TCP_PROXY_AUTO_FALLBACK_TYPE"] = 4] = "TCP_PROXY_AUTO_FALLBACK_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["HTTP_PROXY_TYPE"] = 5] = "HTTP_PROXY_TYPE"; - PROXY_TYPE2[PROXY_TYPE2["HTTPS_PROXY_TYPE"] = 6] = "HTTPS_PROXY_TYPE"; - return PROXY_TYPE2; -})(PROXY_TYPE || {}); -var FeatureType = /* @__PURE__ */ ((FeatureType2) => { - FeatureType2[FeatureType2["VIDEO_VIRTUAL_BACKGROUND"] = 1] = "VIDEO_VIRTUAL_BACKGROUND"; - FeatureType2[FeatureType2["VIDEO_BEAUTY_EFFECT"] = 2] = "VIDEO_BEAUTY_EFFECT"; - return FeatureType2; -})(FeatureType || {}); -var LeaveChannelOptions = class { -}; -var RtcEngineContext = class { -}; -var METADATA_TYPE = /* @__PURE__ */ ((METADATA_TYPE2) => { - METADATA_TYPE2[METADATA_TYPE2["UNKNOWN_METADATA"] = -1] = "UNKNOWN_METADATA"; - METADATA_TYPE2[METADATA_TYPE2["VIDEO_METADATA"] = 0] = "VIDEO_METADATA"; - return METADATA_TYPE2; -})(METADATA_TYPE || {}); -var MAX_METADATA_SIZE_TYPE = /* @__PURE__ */ ((MAX_METADATA_SIZE_TYPE2) => { - MAX_METADATA_SIZE_TYPE2[MAX_METADATA_SIZE_TYPE2["INVALID_METADATA_SIZE_IN_BYTE"] = -1] = "INVALID_METADATA_SIZE_IN_BYTE"; - MAX_METADATA_SIZE_TYPE2[MAX_METADATA_SIZE_TYPE2["DEFAULT_METADATA_SIZE_IN_BYTE"] = 512] = "DEFAULT_METADATA_SIZE_IN_BYTE"; - MAX_METADATA_SIZE_TYPE2[MAX_METADATA_SIZE_TYPE2["MAX_METADATA_SIZE_IN_BYTE"] = 1024] = "MAX_METADATA_SIZE_IN_BYTE"; - return MAX_METADATA_SIZE_TYPE2; -})(MAX_METADATA_SIZE_TYPE || {}); -var Metadata = class { -}; -var DIRECT_CDN_STREAMING_ERROR = /* @__PURE__ */ ((DIRECT_CDN_STREAMING_ERROR2) => { - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_OK"] = 0] = "DIRECT_CDN_STREAMING_ERROR_OK"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_FAILED"] = 1] = "DIRECT_CDN_STREAMING_ERROR_FAILED"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION"] = 2] = "DIRECT_CDN_STREAMING_ERROR_AUDIO_PUBLICATION"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION"] = 3] = "DIRECT_CDN_STREAMING_ERROR_VIDEO_PUBLICATION"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_NET_CONNECT"] = 4] = "DIRECT_CDN_STREAMING_ERROR_NET_CONNECT"; - DIRECT_CDN_STREAMING_ERROR2[DIRECT_CDN_STREAMING_ERROR2["DIRECT_CDN_STREAMING_ERROR_BAD_NAME"] = 5] = "DIRECT_CDN_STREAMING_ERROR_BAD_NAME"; - return DIRECT_CDN_STREAMING_ERROR2; -})(DIRECT_CDN_STREAMING_ERROR || {}); -var DIRECT_CDN_STREAMING_STATE = /* @__PURE__ */ ((DIRECT_CDN_STREAMING_STATE2) => { - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_IDLE"] = 0] = "DIRECT_CDN_STREAMING_STATE_IDLE"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_RUNNING"] = 1] = "DIRECT_CDN_STREAMING_STATE_RUNNING"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_STOPPED"] = 2] = "DIRECT_CDN_STREAMING_STATE_STOPPED"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_FAILED"] = 3] = "DIRECT_CDN_STREAMING_STATE_FAILED"; - DIRECT_CDN_STREAMING_STATE2[DIRECT_CDN_STREAMING_STATE2["DIRECT_CDN_STREAMING_STATE_RECOVERING"] = 4] = "DIRECT_CDN_STREAMING_STATE_RECOVERING"; - return DIRECT_CDN_STREAMING_STATE2; -})(DIRECT_CDN_STREAMING_STATE || {}); -var DirectCdnStreamingStats = class { -}; -var DirectCdnStreamingMediaOptions = class { -}; -var ExtensionInfo = class { -}; -var QUALITY_REPORT_FORMAT_TYPE = /* @__PURE__ */ ((QUALITY_REPORT_FORMAT_TYPE2) => { - QUALITY_REPORT_FORMAT_TYPE2[QUALITY_REPORT_FORMAT_TYPE2["QUALITY_REPORT_JSON"] = 0] = "QUALITY_REPORT_JSON"; - QUALITY_REPORT_FORMAT_TYPE2[QUALITY_REPORT_FORMAT_TYPE2["QUALITY_REPORT_HTML"] = 1] = "QUALITY_REPORT_HTML"; - return QUALITY_REPORT_FORMAT_TYPE2; -})(QUALITY_REPORT_FORMAT_TYPE || {}); -var MEDIA_DEVICE_STATE_TYPE = /* @__PURE__ */ ((MEDIA_DEVICE_STATE_TYPE2) => { - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_IDLE"] = 0] = "MEDIA_DEVICE_STATE_IDLE"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_ACTIVE"] = 1] = "MEDIA_DEVICE_STATE_ACTIVE"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_DISABLED"] = 2] = "MEDIA_DEVICE_STATE_DISABLED"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_NOT_PRESENT"] = 4] = "MEDIA_DEVICE_STATE_NOT_PRESENT"; - MEDIA_DEVICE_STATE_TYPE2[MEDIA_DEVICE_STATE_TYPE2["MEDIA_DEVICE_STATE_UNPLUGGED"] = 8] = "MEDIA_DEVICE_STATE_UNPLUGGED"; - return MEDIA_DEVICE_STATE_TYPE2; -})(MEDIA_DEVICE_STATE_TYPE || {}); -var VIDEO_PROFILE_TYPE = /* @__PURE__ */ ((VIDEO_PROFILE_TYPE2) => { - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_120P"] = 0] = "VIDEO_PROFILE_LANDSCAPE_120P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_120P_3"] = 2] = "VIDEO_PROFILE_LANDSCAPE_120P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_180P"] = 10] = "VIDEO_PROFILE_LANDSCAPE_180P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_180P_3"] = 12] = "VIDEO_PROFILE_LANDSCAPE_180P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_180P_4"] = 13] = "VIDEO_PROFILE_LANDSCAPE_180P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_240P"] = 20] = "VIDEO_PROFILE_LANDSCAPE_240P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_240P_3"] = 22] = "VIDEO_PROFILE_LANDSCAPE_240P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_240P_4"] = 23] = "VIDEO_PROFILE_LANDSCAPE_240P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P"] = 30] = "VIDEO_PROFILE_LANDSCAPE_360P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_3"] = 32] = "VIDEO_PROFILE_LANDSCAPE_360P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_4"] = 33] = "VIDEO_PROFILE_LANDSCAPE_360P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_6"] = 35] = "VIDEO_PROFILE_LANDSCAPE_360P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_7"] = 36] = "VIDEO_PROFILE_LANDSCAPE_360P_7"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_8"] = 37] = "VIDEO_PROFILE_LANDSCAPE_360P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_9"] = 38] = "VIDEO_PROFILE_LANDSCAPE_360P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_10"] = 39] = "VIDEO_PROFILE_LANDSCAPE_360P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_360P_11"] = 100] = "VIDEO_PROFILE_LANDSCAPE_360P_11"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P"] = 40] = "VIDEO_PROFILE_LANDSCAPE_480P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_3"] = 42] = "VIDEO_PROFILE_LANDSCAPE_480P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_4"] = 43] = "VIDEO_PROFILE_LANDSCAPE_480P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_6"] = 45] = "VIDEO_PROFILE_LANDSCAPE_480P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_8"] = 47] = "VIDEO_PROFILE_LANDSCAPE_480P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_9"] = 48] = "VIDEO_PROFILE_LANDSCAPE_480P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_480P_10"] = 49] = "VIDEO_PROFILE_LANDSCAPE_480P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P"] = 50] = "VIDEO_PROFILE_LANDSCAPE_720P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P_3"] = 52] = "VIDEO_PROFILE_LANDSCAPE_720P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P_5"] = 54] = "VIDEO_PROFILE_LANDSCAPE_720P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_720P_6"] = 55] = "VIDEO_PROFILE_LANDSCAPE_720P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1080P"] = 60] = "VIDEO_PROFILE_LANDSCAPE_1080P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1080P_3"] = 62] = "VIDEO_PROFILE_LANDSCAPE_1080P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1080P_5"] = 64] = "VIDEO_PROFILE_LANDSCAPE_1080P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1440P"] = 66] = "VIDEO_PROFILE_LANDSCAPE_1440P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_1440P_2"] = 67] = "VIDEO_PROFILE_LANDSCAPE_1440P_2"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_4K"] = 70] = "VIDEO_PROFILE_LANDSCAPE_4K"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_LANDSCAPE_4K_3"] = 72] = "VIDEO_PROFILE_LANDSCAPE_4K_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_120P"] = 1e3] = "VIDEO_PROFILE_PORTRAIT_120P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_120P_3"] = 1002] = "VIDEO_PROFILE_PORTRAIT_120P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_180P"] = 1010] = "VIDEO_PROFILE_PORTRAIT_180P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_180P_3"] = 1012] = "VIDEO_PROFILE_PORTRAIT_180P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_180P_4"] = 1013] = "VIDEO_PROFILE_PORTRAIT_180P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_240P"] = 1020] = "VIDEO_PROFILE_PORTRAIT_240P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_240P_3"] = 1022] = "VIDEO_PROFILE_PORTRAIT_240P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_240P_4"] = 1023] = "VIDEO_PROFILE_PORTRAIT_240P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P"] = 1030] = "VIDEO_PROFILE_PORTRAIT_360P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_3"] = 1032] = "VIDEO_PROFILE_PORTRAIT_360P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_4"] = 1033] = "VIDEO_PROFILE_PORTRAIT_360P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_6"] = 1035] = "VIDEO_PROFILE_PORTRAIT_360P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_7"] = 1036] = "VIDEO_PROFILE_PORTRAIT_360P_7"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_8"] = 1037] = "VIDEO_PROFILE_PORTRAIT_360P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_9"] = 1038] = "VIDEO_PROFILE_PORTRAIT_360P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_10"] = 1039] = "VIDEO_PROFILE_PORTRAIT_360P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_360P_11"] = 1100] = "VIDEO_PROFILE_PORTRAIT_360P_11"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P"] = 1040] = "VIDEO_PROFILE_PORTRAIT_480P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_3"] = 1042] = "VIDEO_PROFILE_PORTRAIT_480P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_4"] = 1043] = "VIDEO_PROFILE_PORTRAIT_480P_4"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_6"] = 1045] = "VIDEO_PROFILE_PORTRAIT_480P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_8"] = 1047] = "VIDEO_PROFILE_PORTRAIT_480P_8"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_9"] = 1048] = "VIDEO_PROFILE_PORTRAIT_480P_9"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_480P_10"] = 1049] = "VIDEO_PROFILE_PORTRAIT_480P_10"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P"] = 1050] = "VIDEO_PROFILE_PORTRAIT_720P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P_3"] = 1052] = "VIDEO_PROFILE_PORTRAIT_720P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P_5"] = 1054] = "VIDEO_PROFILE_PORTRAIT_720P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_720P_6"] = 1055] = "VIDEO_PROFILE_PORTRAIT_720P_6"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1080P"] = 1060] = "VIDEO_PROFILE_PORTRAIT_1080P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1080P_3"] = 1062] = "VIDEO_PROFILE_PORTRAIT_1080P_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1080P_5"] = 1064] = "VIDEO_PROFILE_PORTRAIT_1080P_5"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1440P"] = 1066] = "VIDEO_PROFILE_PORTRAIT_1440P"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_1440P_2"] = 1067] = "VIDEO_PROFILE_PORTRAIT_1440P_2"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_4K"] = 1070] = "VIDEO_PROFILE_PORTRAIT_4K"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_PORTRAIT_4K_3"] = 1072] = "VIDEO_PROFILE_PORTRAIT_4K_3"; - VIDEO_PROFILE_TYPE2[VIDEO_PROFILE_TYPE2["VIDEO_PROFILE_DEFAULT"] = 30] = "VIDEO_PROFILE_DEFAULT"; - return VIDEO_PROFILE_TYPE2; -})(VIDEO_PROFILE_TYPE || {}); - -// generate/IAgoraRtcEngineEx.ts -var RtcConnection = class { -}; - -// generate/IAgoraSpatialAudio.ts -var RemoteVoicePositionInfo = class { -}; -var SpatialAudioZone = class { -}; - -// generate/IAudioDeviceManager.ts -var MAX_DEVICE_ID_LENGTH_TYPE = /* @__PURE__ */ ((MAX_DEVICE_ID_LENGTH_TYPE2) => { - MAX_DEVICE_ID_LENGTH_TYPE2[MAX_DEVICE_ID_LENGTH_TYPE2["MAX_DEVICE_ID_LENGTH"] = 512] = "MAX_DEVICE_ID_LENGTH"; - return MAX_DEVICE_ID_LENGTH_TYPE2; -})(MAX_DEVICE_ID_LENGTH_TYPE || {}); - -export { AREA_CODE, AREA_CODE_EX, AUDIENCE_LATENCY_LEVEL_TYPE, AUDIO_AINS_MODE, AUDIO_CODEC_PROFILE_TYPE, AUDIO_CODEC_TYPE, AUDIO_DUAL_MONO_MODE, AUDIO_EFFECT_PRESET, AUDIO_ENCODED_FRAME_OBSERVER_POSITION, AUDIO_ENCODING_TYPE, AUDIO_EQUALIZATION_BAND_FREQUENCY, AUDIO_FILE_RECORDING_TYPE, AUDIO_FRAME_POSITION, AUDIO_FRAME_TYPE, AUDIO_MIXING_DUAL_MONO_MODE, AUDIO_MIXING_REASON_TYPE, AUDIO_MIXING_STATE_TYPE, AUDIO_PROFILE_TYPE, AUDIO_RECORDING_QUALITY_TYPE, AUDIO_REVERB_TYPE, AUDIO_SAMPLE_RATE_TYPE, AUDIO_SCENARIO_TYPE, AUDIO_SESSION_OPERATION_RESTRICTION, AUDIO_TRACK_TYPE, AdvanceOptions, AdvancedAudioOptions, AdvancedConfigInfo, AgoraRhythmPlayerConfig, AudioEncodedFrameInfo, AudioEncodedFrameObserverConfig, AudioFrame, AudioParameters, AudioParams, AudioPcmDataInfo, AudioPcmFrame, AudioRecordingConfiguration, AudioRoute, AudioSpectrumData, AudioTrackConfig, AudioVolumeInfo, BACKGROUND_BLUR_DEGREE, BACKGROUND_SOURCE_TYPE, BYTES_PER_SAMPLE, BeautyOptions, CAMERA_DIRECTION, CAMERA_VIDEO_SOURCE_TYPE, CAPTURE_BRIGHTNESS_LEVEL_TYPE, CHANNEL_MEDIA_RELAY_ERROR, CHANNEL_MEDIA_RELAY_EVENT, CHANNEL_MEDIA_RELAY_STATE, CHANNEL_PROFILE_TYPE, CLIENT_ROLE_CHANGE_FAILED_REASON, CLIENT_ROLE_TYPE, CLOUD_PROXY_TYPE, CODEC_CAP_MASK, COMPRESSION_PREFERENCE, CONFIG_FETCH_TYPE, CONNECTION_CHANGED_REASON_TYPE, CONNECTION_STATE_TYPE, CONTENT_INSPECT_RESULT, CONTENT_INSPECT_TYPE, CacheStatistics, CameraCapturerConfiguration, ChannelMediaInfo, ChannelMediaOptions, ChannelMediaRelayConfiguration, ClientRoleOptions, ClimaxSegment, CodecCapInfo, CodecCapLevels, ColorEnhanceOptions, ContentInspectConfig, ContentInspectModule, DEGRADATION_PREFERENCE, DIRECT_CDN_STREAMING_ERROR, DIRECT_CDN_STREAMING_STATE, DataStreamConfig, DeviceInfo, DirectCdnStreamingMediaOptions, DirectCdnStreamingStats, DownlinkNetworkInfo, EAR_MONITORING_FILTER_TYPE, EGL_CONTEXT_TYPE, ENCODING_PREFERENCE, ENCRYPTION_ERROR_TYPE, ENCRYPTION_MODE, ERROR_CODE_TYPE, EXPERIENCE_POOR_REASON, EXPERIENCE_QUALITY_TYPE, EXTERNAL_VIDEO_SOURCE_TYPE, EchoTestConfiguration, EncodedAudioFrameAdvancedSettings, EncodedAudioFrameInfo, EncodedVideoFrameInfo, EncryptionConfig, ExtensionInfo, ExternalVideoFrame, FIT_MODE_TYPE, FRAME_HEIGHT, FRAME_RATE, FRAME_WIDTH, FeatureType, H264PacketizeMode, HEADPHONE_EQUALIZER_PRESET, INJECT_STREAM_STATUS, INTERFACE_ID_TYPE, ImageTrackOptions, InjectStreamConfig, InputSeiData, LASTMILE_PROBE_RESULT_STATE, LICENSE_ERROR_TYPE, LIGHTENING_CONTRAST_LEVEL, LOCAL_AUDIO_STREAM_ERROR, LOCAL_AUDIO_STREAM_STATE, LOCAL_PROXY_MODE, LOCAL_VIDEO_STREAM_ERROR, LOCAL_VIDEO_STREAM_STATE, LOG_FILTER_TYPE, LOG_LEVEL, LOW_LIGHT_ENHANCE_LEVEL, LOW_LIGHT_ENHANCE_MODE, LastmileProbeConfig, LastmileProbeOneWayResult, LastmileProbeResult, LeaveChannelOptions, LiveStreamAdvancedFeature, LiveTranscoding, LocalAccessPointConfiguration, LocalAudioStats, LocalTranscoderConfiguration, LocalVideoStats, LogConfig, LogUploadServerInfo, LowlightEnhanceOptions, MAX_DEVICE_ID_LENGTH_TYPE, MAX_METADATA_SIZE_TYPE, MAX_USER_ACCOUNT_LENGTH_TYPE, MEDIA_DEVICE_STATE_TYPE, MEDIA_DEVICE_TYPE, MEDIA_PLAYER_ERROR, MEDIA_PLAYER_EVENT, MEDIA_PLAYER_METADATA_TYPE, MEDIA_PLAYER_SOURCE_TYPE, MEDIA_PLAYER_STATE, MEDIA_SOURCE_TYPE, MEDIA_STREAM_TYPE, MEDIA_TRACE_EVENT, METADATA_TYPE, MUSIC_CACHE_STATUS_TYPE, MediaRecorderConfiguration, MediaRecorderContainerFormat, MediaRecorderStreamType, MediaSource, Metadata, Music, MusicCacheInfo, MusicChartInfo, MusicContentCenterConfiguration, MusicContentCenterStatusCode, MvProperty, NETWORK_TYPE, ORIENTATION_MODE, PERMISSION_TYPE, PLAYER_PRELOAD_EVENT, PRIORITY_TYPE, PROXY_TYPE, Packet, PacketOptions, PeerDownlinkInfo, PlayerStreamInfo, PlayerUpdatedInfo, PreloadStatusCode, PublisherConfiguration, QUALITY_ADAPT_INDICATION, QUALITY_REPORT_FORMAT_TYPE, QUALITY_TYPE, RAW_AUDIO_FRAME_OP_MODE_TYPE, REMOTE_AUDIO_STATE, REMOTE_AUDIO_STATE_REASON, REMOTE_USER_STATE, REMOTE_VIDEO_DOWNSCALE_LEVEL, REMOTE_VIDEO_STATE, REMOTE_VIDEO_STATE_REASON, RENDER_MODE_TYPE, RHYTHM_PLAYER_ERROR_TYPE, RHYTHM_PLAYER_STATE_TYPE, RTMP_STREAMING_EVENT, RTMP_STREAM_LIFE_CYCLE_TYPE, RTMP_STREAM_PUBLISH_ERROR_TYPE, RTMP_STREAM_PUBLISH_STATE, RecorderErrorCode, RecorderInfo, RecorderState, RecorderStreamInfo, Rectangle, Region, RemoteAudioStats, RemoteVideoStats, RemoteVoicePositionInfo, RtcConnection, RtcEngineContext, RtcImage, RtcStats, SCREEN_CAPTURE_FRAMERATE_CAPABILITY, SCREEN_SCENARIO_TYPE, SEG_MODEL_TYPE, SIMULCAST_STREAM_MODE, SIZE, STREAMING_SRC_ERR, STREAMING_SRC_STATE, STREAM_FALLBACK_OPTIONS, STREAM_PUBLISH_STATE, STREAM_SUBSCRIBE_STATE, ScreenAudioParameters, ScreenCaptureConfiguration, ScreenCaptureParameters, ScreenCaptureParameters2, ScreenCaptureSourceInfo, ScreenCaptureSourceType, ScreenVideoParameters, SegmentationProperty, SenderOptions, SimulcastStreamConfig, SpatialAudioParams, SpatialAudioZone, SrcInfo, TCcMode, THREAD_PRIORITY_TYPE, ThumbImageBuffer, TranscodingUser, TranscodingVideoStream, UPLOAD_ERROR_REASON, USER_OFFLINE_REASON_TYPE, UplinkNetworkInfo, UserAudioSpectrumInfo, UserInfo, VIDEO_APPLICATION_SCENARIO_TYPE, VIDEO_BUFFER_TYPE, VIDEO_CODEC_CAPABILITY_LEVEL, VIDEO_CODEC_PROFILE_TYPE, VIDEO_CODEC_TYPE, VIDEO_CODEC_TYPE_FOR_STREAM, VIDEO_CONTENT_HINT, VIDEO_DENOISER_LEVEL, VIDEO_DENOISER_MODE, VIDEO_FRAME_PROCESS_MODE, VIDEO_FRAME_TYPE, VIDEO_MIRROR_MODE_TYPE, VIDEO_MODULE_POSITION, VIDEO_ORIENTATION, VIDEO_PIXEL_FORMAT, VIDEO_PROFILE_TYPE, VIDEO_SOURCE_TYPE, VIDEO_STREAM_TYPE, VIDEO_TRANSCODER_ERROR, VIDEO_VIEW_SETUP_MODE, VOICE_BEAUTIFIER_PRESET, VOICE_CONVERSION_PRESET, VideoCanvas, VideoCompositingLayout, VideoDenoiserOptions, VideoDimensions, VideoEncoderConfiguration, VideoFormat, VideoFrame, VideoRenderingTracingInfo, VideoSubscriptionOptions, VideoTrackInfo, VirtualBackgroundSource, WARN_CODE_TYPE, WATERMARK_FIT_MODE, WLACC_MESSAGE_REASON, WLACC_SUGGEST_ACTION, WatermarkOptions, WatermarkRatio, WlAccStats }; diff --git a/packages/@iris/rtc/tsup.config.ts b/packages/@iris/rtc/tsup.config.ts index 421ec90..cb9a1cf 100644 --- a/packages/@iris/rtc/tsup.config.ts +++ b/packages/@iris/rtc/tsup.config.ts @@ -23,7 +23,7 @@ export default defineConfig([ js: banner, }; }, - outDir: '.dist', + outDir: 'dist', format: ['cjs', 'esm'], splitting: false, sourcemap: false, diff --git a/packages/rtc/jest.config.ts b/packages/rtc/jest.config.ts index 00ed9e7..4d04b50 100644 --- a/packages/rtc/jest.config.ts +++ b/packages/rtc/jest.config.ts @@ -3,8 +3,9 @@ import type { Config } from 'jest'; const config: Config = { verbose: true, preset: 'ts-jest', + silent: true, testEnvironment: 'jsdom', - testMatch: ['**/test/impl/*.[jt]s?(x)'], + testMatch: ['**/test/impl/*.[jt]s?(x)', '**/test/binding/*.[jt]s?(x)'], setupFilesAfterEnv: ['./test/setup.ts'], }; diff --git a/packages/rtc/package.json b/packages/rtc/package.json index 75a9ada..69e4d5b 100644 --- a/packages/rtc/package.json +++ b/packages/rtc/package.json @@ -4,13 +4,13 @@ "description": "wait", "main": "./src/index.ts", "scripts": { - "test": "jest", + "test": "jest --collect-coverage", "test:watch": "jest --watch", - "build": "webpack", + "build": "NODE_ENV=production webpack", "watch": "webpack --watch", "start": "webpack serve --open", - "lint": "eslint --ext .ts ./src/binding", - "lint:fix": "eslint --fix --ext .ts ./src/binding" + "lint": "eslint --ext .ts ./src/binding ./test/binding", + "lint:fix": "eslint --fix --ext .ts ./src/binding ./test/binding" }, "author": "", "license": "ISC", diff --git a/packages/rtc/src/IrisRtcApi.ts b/packages/rtc/src/IrisRtcApi.ts index d9060c2..cef88e3 100644 --- a/packages/rtc/src/IrisRtcApi.ts +++ b/packages/rtc/src/IrisRtcApi.ts @@ -18,4 +18,7 @@ export function initIrisRtc( export let AgoraWrapper = { initIrisRtc: initIrisRtc, + // getIrisRtcEngine: (irisApiEngine: IrisApiEngine) => { + // return irisApiEngine.getApiInterceptor(); + // } }; diff --git a/packages/rtc/src/base/BaseType.ts b/packages/rtc/src/base/BaseType.ts index 8ecd9eb..d955aef 100644 --- a/packages/rtc/src/base/BaseType.ts +++ b/packages/rtc/src/base/BaseType.ts @@ -1,12 +1,5 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { - IBufferSourceAudioTrack, - ILocalAudioTrack, - ILocalVideoTrack, - IRemoteAudioTrack, - IRemoteVideoTrack, - UID, -} from 'agora-rtc-sdk-ng'; +import { ILocalVideoTrack, IRemoteVideoTrack, UID } from 'agora-rtc-sdk-ng'; export enum IRIS_VIDEO_PROCESS_ERR { ERR_OK = 0, @@ -15,18 +8,14 @@ export enum IRIS_VIDEO_PROCESS_ERR { ERR_BUFFER_EMPTY = 5, } -export enum IrisClientType { - kClientMain, - kClientSub, -} - export enum IrisAudioSourceType { - kAudioSourceTypeMicrophonePrimary, - kAudioSourceTypeMicrophoneSecondary, - kAudioSourceTypeScreenPrimary, - kAudioSourceTypeScreenSecondary, - kAudioSourceTypeCustom, - kAudioSourceTypeUnknown, + kAudioSourceTypeMicrophonePrimary = 2001, + kAudioSourceTypeMicrophoneSecondary = 2002, + kAudioSourceTypeScreenCapture = 2003, + kAudioSourceTypeCustom = 2004, + kAudioSourceTypeBufferSourceAudio = 2005, + kAudioSourceTypeRemote = 2006, + kAudioSourceTypeUnknown = 2007, } export interface IrisVideoFrameBufferConfig { @@ -57,28 +46,3 @@ export interface Size { width: number; height: number; } - -export interface VideoTrackPackage { - element?: string; - type?: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE; - track?: ILocalVideoTrack | IRemoteVideoTrack; -} - -export interface VideoViewHolder { - element?: string; - channelId?: string; - uid?: UID; - type?: NATIVE_RTC.VIDEO_SOURCE_TYPE; -} - -export interface AudioTrackPackage { - type: IrisAudioSourceType; - track: ILocalAudioTrack | IRemoteAudioTrack; -} - -export interface BufferSourceAudioTrackPackage { - soundId: number; - track: IBufferSourceAudioTrack; -} - -export interface EncryptionConfigPackage {} diff --git a/packages/rtc/src/base/IrisApiType.ts b/packages/rtc/src/base/IrisApiType.ts deleted file mode 100644 index 79c90cd..0000000 --- a/packages/rtc/src/base/IrisApiType.ts +++ /dev/null @@ -1,804 +0,0 @@ -export class IrisApiType { - public static FUNC_KEY_ERROR = ''; - public static FUNC_RTCENGINE_SETPARAMETERS = 'RtcEngine_setParameters'; - public static FUNC_RTCENGINE_SETAPPTYPE = 'RtcEngine_setAppType'; - public static FUNC_RTCENGINE_RELEASE = 'RtcEngine_release'; - public static FUNC_RTCENGINE_INITIALIZE = 'RtcEngine_initialize'; - public static FUNC_RTCENGINE_QUERYINTERFACE = 'RtcEngine_queryInterface'; - public static FUNC_RTCENGINE_GETVERSION = 'RtcEngine_getVersion'; - public static FUNC_RTCENGINE_GETERRORDESCRIPTION = - 'RtcEngine_getErrorDescription'; - public static FUNC_RTCENGINE_JOINCHANNEL = 'RtcEngine_joinChannel'; - public static FUNC_RTCENGINE_JOINCHANNEL2 = 'RtcEngine_joinChannel2'; - public static FUNC_RTCENGINE_UPDATECHANNELMEDIAOPTIONS = - 'RtcEngine_updateChannelMediaOptions'; - public static FUNC_RTCENGINE_LEAVECHANNEL = 'RtcEngine_leaveChannel'; - public static FUNC_RTCENGINE_LEAVECHANNEL2 = 'RtcEngine_leaveChannel2'; - public static FUNC_RTCENGINE_RENEWTOKEN = 'RtcEngine_renewToken'; - public static FUNC_RTCENGINE_SETCHANNELPROFILE = - 'RtcEngine_setChannelProfile'; - public static FUNC_RTCENGINE_SETCLIENTROLE = 'RtcEngine_setClientRole'; - public static FUNC_RTCENGINE_SETCLIENTROLE2 = 'RtcEngine_setClientRole2'; - public static FUNC_RTCENGINE_STARTECHOTEST = 'RtcEngine_startEchoTest'; - public static FUNC_RTCENGINE_STARTECHOTEST2 = 'RtcEngine_startEchoTest2'; - public static FUNC_RTCENGINE_STOPECHOTEST = 'RtcEngine_stopEchoTest'; - public static FUNC_RTCENGINE_ENABLEVIDEO = 'RtcEngine_enableVideo'; - public static FUNC_RTCENGINE_DISABLEVIDEO = 'RtcEngine_disableVideo'; - public static FUNC_RTCENGINE_STARTPREVIEW = 'RtcEngine_startPreview'; - public static FUNC_RTCENGINE_STARTPREVIEW2 = 'RtcEngine_startPreview2'; - public static FUNC_RTCENGINE_STOPPREVIEW = 'RtcEngine_stopPreview'; - public static FUNC_RTCENGINE_STOPPREVIEW2 = 'RtcEngine_stopPreview2'; - public static FUNC_RTCENGINE_STARTLASTMILEPROBETEST = - 'RtcEngine_startLastmileProbeTest'; - public static FUNC_RTCENGINE_STOPLASTMILEPROBETEST = - 'RtcEngine_stopLastmileProbeTest'; - public static FUNC_RTCENGINE_SETVIDEOENCODERCONFIGURATION = - 'RtcEngine_setVideoEncoderConfiguration'; - public static FUNC_RTCENGINE_SETBEAUTYEFFECTOPTIONS = - 'RtcEngine_setBeautyEffectOptions'; - public static FUNC_RTCENGINE_ENABLEVIRTUALBACKGROUND = - 'RtcEngine_enableVirtualBackground'; - public static FUNC_RTCENGINE_ENABLEREMOTESUPERRESOLUTION = - 'RtcEngine_enableRemoteSuperResolution'; - public static FUNC_RTCENGINE_SETUPREMOTEVIDEO = 'RtcEngine_setupRemoteVideo'; - public static FUNC_RTCENGINE_SETUPLOCALVIDEO = 'RtcEngine_setupLocalVideo'; - public static FUNC_RTCENGINE_ENABLEAUDIO = 'RtcEngine_enableAudio'; - public static FUNC_RTCENGINE_DISABLEAUDIO = 'RtcEngine_disableAudio'; - public static FUNC_RTCENGINE_SETAUDIOPROFILE = 'RtcEngine_setAudioProfile'; - public static FUNC_RTCENGINE_SETAUDIOPROFILE2 = 'RtcEngine_setAudioProfile2'; - public static FUNC_RTCENGINE_ENABLELOCALAUDIO = 'RtcEngine_enableLocalAudio'; - public static FUNC_RTCENGINE_MUTELOCALAUDIOSTREAM = - 'RtcEngine_muteLocalAudioStream'; - public static FUNC_RTCENGINE_MUTEALLREMOTEAUDIOSTREAMS = - 'RtcEngine_muteAllRemoteAudioStreams'; - public static FUNC_RTCENGINE_SETDEFAULTMUTEALLREMOTEAUDIOSTREAMS = - 'RtcEngine_setDefaultMuteAllRemoteAudioStreams'; - public static FUNC_RTCENGINE_MUTEREMOTEAUDIOSTREAM = - 'RtcEngine_muteRemoteAudioStream'; - public static FUNC_RTCENGINE_MUTELOCALVIDEOSTREAM = - 'RtcEngine_muteLocalVideoStream'; - public static FUNC_RTCENGINE_ENABLELOCALVIDEO = 'RtcEngine_enableLocalVideo'; - public static FUNC_RTCENGINE_MUTEALLREMOTEVIDEOSTREAMS = - 'RtcEngine_muteAllRemoteVideoStreams'; - public static FUNC_RTCENGINE_SETDEFAULTMUTEALLREMOTEVIDEOSTREAMS = - 'RtcEngine_setDefaultMuteAllRemoteVideoStreams'; - public static FUNC_RTCENGINE_MUTEREMOTEVIDEOSTREAM = - 'RtcEngine_muteRemoteVideoStream'; - public static FUNC_RTCENGINE_SETREMOTEVIDEOSTREAMTYPE = - 'RtcEngine_setRemoteVideoStreamType'; - public static FUNC_RTCENGINE_SETREMOTEDEFAULTVIDEOSTREAMTYPE = - 'RtcEngine_setRemoteDefaultVideoStreamType'; - public static FUNC_RTCENGINE_ENABLEAUDIOVOLUMEINDICATION = - 'RtcEngine_enableAudioVolumeIndication'; - public static FUNC_RTCENGINE_STARTAUDIORECORDING = - 'RtcEngine_startAudioRecording'; - public static FUNC_RTCENGINE_STARTAUDIORECORDING2 = - 'RtcEngine_startAudioRecording2'; - public static FUNC_RTCENGINE_STARTAUDIORECORDING3 = - 'RtcEngine_startAudioRecording3'; - public static FUNC_RTCENGINE_REGISTERAUDIOENCODEDFRAMEOBSERVER = - 'RtcEngine_registerAudioEncodedFrameObserver'; - public static FUNC_RTCENGINE_STOPAUDIORECORDING = - 'RtcEngine_stopAudioRecording'; - public static FUNC_RTCENGINE_CREATEMEDIAPLAYER = - 'RtcEngine_createMediaPlayer'; - public static FUNC_RTCENGINE_DESTROYMEDIAPLAYER = - 'RtcEngine_destroyMediaPlayer'; - public static FUNC_RTCENGINE_STARTAUDIOMIXING = 'RtcEngine_startAudioMixing'; - public static FUNC_RTCENGINE_STARTAUDIOMIXING2 = - 'RtcEngine_startAudioMixing2'; - public static FUNC_RTCENGINE_STOPAUDIOMIXING = 'RtcEngine_stopAudioMixing'; - public static FUNC_RTCENGINE_PAUSEAUDIOMIXING = 'RtcEngine_pauseAudioMixing'; - public static FUNC_RTCENGINE_RESUMEAUDIOMIXING = - 'RtcEngine_resumeAudioMixing'; - public static FUNC_RTCENGINE_ADJUSTAUDIOMIXINGVOLUME = - 'RtcEngine_adjustAudioMixingVolume'; - public static FUNC_RTCENGINE_ADJUSTAUDIOMIXINGPUBLISHVOLUME = - 'RtcEngine_adjustAudioMixingPublishVolume'; - public static FUNC_RTCENGINE_GETAUDIOMIXINGPUBLISHVOLUME = - 'RtcEngine_getAudioMixingPublishVolume'; - public static FUNC_RTCENGINE_ADJUSTAUDIOMIXINGPLAYOUTVOLUME = - 'RtcEngine_adjustAudioMixingPlayoutVolume'; - public static FUNC_RTCENGINE_GETAUDIOMIXINGPLAYOUTVOLUME = - 'RtcEngine_getAudioMixingPlayoutVolume'; - public static FUNC_RTCENGINE_GETAUDIOMIXINGDURATION = - 'RtcEngine_getAudioMixingDuration'; - public static FUNC_RTCENGINE_GETAUDIOMIXINGCURRENTPOSITION = - 'RtcEngine_getAudioMixingCurrentPosition'; - public static FUNC_RTCENGINE_SETAUDIOMIXINGPOSITION = - 'RtcEngine_setAudioMixingPosition'; - public static FUNC_RTCENGINE_SETAUDIOMIXINGPITCH = - 'RtcEngine_setAudioMixingPitch'; - public static FUNC_RTCENGINE_GETEFFECTSVOLUME = 'RtcEngine_getEffectsVolume'; - public static FUNC_RTCENGINE_SETEFFECTSVOLUME = 'RtcEngine_setEffectsVolume'; - public static FUNC_RTCENGINE_PRELOADEFFECT = 'RtcEngine_preloadEffect'; - public static FUNC_RTCENGINE_PLAYEFFECT = 'RtcEngine_playEffect'; - public static FUNC_RTCENGINE_PLAYALLEFFECTS = 'RtcEngine_playAllEffects'; - public static FUNC_RTCENGINE_GETVOLUMEOFEFFECT = - 'RtcEngine_getVolumeOfEffect'; - public static FUNC_RTCENGINE_SETVOLUMEOFEFFECT = - 'RtcEngine_setVolumeOfEffect'; - public static FUNC_RTCENGINE_PAUSEEFFECT = 'RtcEngine_pauseEffect'; - public static FUNC_RTCENGINE_PAUSEALLEFFECTS = 'RtcEngine_pauseAllEffects'; - public static FUNC_RTCENGINE_RESUMEEFFECT = 'RtcEngine_resumeEffect'; - public static FUNC_RTCENGINE_RESUMEALLEFFECTS = 'RtcEngine_resumeAllEffects'; - public static FUNC_RTCENGINE_STOPEFFECT = 'RtcEngine_stopEffect'; - public static FUNC_RTCENGINE_STOPALLEFFECTS = 'RtcEngine_stopAllEffects'; - public static FUNC_RTCENGINE_UNLOADEFFECT = 'RtcEngine_unloadEffect'; - public static FUNC_RTCENGINE_UNLOADALLEFFECTS = 'RtcEngine_unloadAllEffects'; - public static FUNC_RTCENGINE_ENABLESOUNDPOSITIONINDICATION = - 'RtcEngine_enableSoundPositionIndication'; - public static FUNC_RTCENGINE_SETREMOTEVOICEPOSITION = - 'RtcEngine_setRemoteVoicePosition'; - public static FUNC_RTCENGINE_ENABLESPATIALAUDIO = - 'RtcEngine_enableSpatialAudio'; - public static FUNC_RTCENGINE_SETREMOTEUSERSPATIALAUDIOPARAMS = - 'RtcEngine_setRemoteUserSpatialAudioParams'; - public static FUNC_RTCENGINE_SETVOICEBEAUTIFIERPRESET = - 'RtcEngine_setVoiceBeautifierPreset'; - public static FUNC_RTCENGINE_SETAUDIOEFFECTPRESET = - 'RtcEngine_setAudioEffectPreset'; - public static FUNC_RTCENGINE_SETVOICECONVERSIONPRESET = - 'RtcEngine_setVoiceConversionPreset'; - public static FUNC_RTCENGINE_SETAUDIOEFFECTPARAMETERS = - 'RtcEngine_setAudioEffectParameters'; - public static FUNC_RTCENGINE_SETVOICEBEAUTIFIERPARAMETERS = - 'RtcEngine_setVoiceBeautifierParameters'; - public static FUNC_RTCENGINE_SETVOICECONVERSIONPARAMETERS = - 'RtcEngine_setVoiceConversionParameters'; - public static FUNC_RTCENGINE_SETLOCALVOICEPITCH = - 'RtcEngine_setLocalVoicePitch'; - public static FUNC_RTCENGINE_SETLOCALVOICEEQUALIZATION = - 'RtcEngine_setLocalVoiceEqualization'; - public static FUNC_RTCENGINE_SETLOCALVOICEREVERB = - 'RtcEngine_setLocalVoiceReverb'; - public static FUNC_RTCENGINE_SETLOGFILE = 'RtcEngine_setLogFile'; - public static FUNC_RTCENGINE_SETLOGFILTER = 'RtcEngine_setLogFilter'; - public static FUNC_RTCENGINE_SETLOGLEVEL = 'RtcEngine_setLogLevel'; - public static FUNC_RTCENGINE_SETLOGFILESIZE = 'RtcEngine_setLogFileSize'; - public static FUNC_RTCENGINE_UPLOADLOGFILE = 'RtcEngine_uploadLogFile'; - public static FUNC_RTCENGINE_SETLOCALRENDERMODE = - 'RtcEngine_setLocalRenderMode'; - public static FUNC_RTCENGINE_SETREMOTERENDERMODE = - 'RtcEngine_setRemoteRenderMode'; - public static FUNC_RTCENGINE_SETLOCALRENDERMODE2 = - 'RtcEngine_setLocalRenderMode2'; - public static FUNC_RTCENGINE_SETLOCALVIDEOMIRRORMODE = - 'RtcEngine_setLocalVideoMirrorMode'; - public static FUNC_RTCENGINE_ENABLEDUALSTREAMMODE = - 'RtcEngine_enableDualStreamMode'; - public static FUNC_RTCENGINE_ENABLEDUALSTREAMMODE2 = - 'RtcEngine_enableDualStreamMode2'; - public static FUNC_RTCENGINE_ENABLEDUALSTREAMMODE3 = - 'RtcEngine_enableDualStreamMode3'; - public static FUNC_RTCENGINE_ENABLEECHOCANCELLATIONEXTERNAL = - 'RtcEngine_enableEchoCancellationExternal'; - public static FUNC_RTCENGINE_ENABLECUSTOMAUDIOLOCALPLAYBACK = - 'RtcEngine_enableCustomAudioLocalPlayback'; - public static FUNC_RTCENGINE_STARTPRIMARYCUSTOMAUDIOTRACK = - 'RtcEngine_startPrimaryCustomAudioTrack'; - public static FUNC_RTCENGINE_STOPPRIMARYCUSTOMAUDIOTRACK = - 'RtcEngine_stopPrimaryCustomAudioTrack'; - public static FUNC_RTCENGINE_STARTSECONDARYCUSTOMAUDIOTRACK = - 'RtcEngine_startSecondaryCustomAudioTrack'; - public static FUNC_RTCENGINE_STOPSECONDARYCUSTOMAUDIOTRACK = - 'RtcEngine_stopSecondaryCustomAudioTrack'; - public static FUNC_RTCENGINE_SETRECORDINGAUDIOFRAMEPARAMETERS = - 'RtcEngine_setRecordingAudioFrameParameters'; - public static FUNC_RTCENGINE_SETPLAYBACKAUDIOFRAMEPARAMETERS = - 'RtcEngine_setPlaybackAudioFrameParameters'; - public static FUNC_RTCENGINE_SETMIXEDAUDIOFRAMEPARAMETERS = - 'RtcEngine_setMixedAudioFrameParameters'; - public static FUNC_RTCENGINE_SETPLAYBACKAUDIOFRAMEBEFOREMIXINGPARAMETERS = - 'RtcEngine_setPlaybackAudioFrameBeforeMixingParameters'; - public static FUNC_RTCENGINE_ENABLEAUDIOSPECTRUMMONITOR = - 'RtcEngine_enableAudioSpectrumMonitor'; - public static FUNC_RTCENGINE_DISABLEAUDIOSPECTRUMMONITOR = - 'RtcEngine_disableAudioSpectrumMonitor'; - public static FUNC_RTCENGINE_REGISTERAUDIOSPECTRUMOBSERVER = - 'RtcEngine_registerAudioSpectrumObserver'; - public static FUNC_RTCENGINE_UNREGISTERAUDIOSPECTRUMOBSERVER = - 'RtcEngine_unregisterAudioSpectrumObserver'; - public static FUNC_RTCENGINE_ADJUSTRECORDINGSIGNALVOLUME = - 'RtcEngine_adjustRecordingSignalVolume'; - public static FUNC_RTCENGINE_MUTERECORDINGSIGNAL = - 'RtcEngine_muteRecordingSignal'; - public static FUNC_RTCENGINE_ADJUSTPLAYBACKSIGNALVOLUME = - 'RtcEngine_adjustPlaybackSignalVolume'; - public static FUNC_RTCENGINE_ADJUSTUSERPLAYBACKSIGNALVOLUME = - 'RtcEngine_adjustUserPlaybackSignalVolume'; - public static FUNC_RTCENGINE_SETLOCALPUBLISHFALLBACKOPTION = - 'RtcEngine_setLocalPublishFallbackOption'; - public static FUNC_RTCENGINE_SETREMOTESUBSCRIBEFALLBACKOPTION = - 'RtcEngine_setRemoteSubscribeFallbackOption'; - public static FUNC_RTCENGINE_ENABLELOOPBACKRECORDING = - 'RtcEngine_enableLoopbackRecording'; - public static FUNC_RTCENGINE_ADJUSTLOOPBACKRECORDINGVOLUME = - 'RtcEngine_adjustLoopbackRecordingVolume'; - public static FUNC_RTCENGINE_GETLOOPBACKRECORDINGVOLUME = - 'RtcEngine_getLoopbackRecordingVolume'; - public static FUNC_RTCENGINE_ENABLEINEARMONITORING = - 'RtcEngine_enableInEarMonitoring'; - public static FUNC_RTCENGINE_SETINEARMONITORINGVOLUME = - 'RtcEngine_setInEarMonitoringVolume'; - public static FUNC_RTCENGINE_LOADEXTENSIONPROVIDER = - 'RtcEngine_loadExtensionProvider'; - public static FUNC_RTCENGINE_SETEXTENSIONPROVIDERPROPERTY = - 'RtcEngine_setExtensionProviderProperty'; - public static FUNC_RTCENGINE_ENABLEEXTENSION = 'RtcEngine_enableExtension'; - public static FUNC_RTCENGINE_SETEXTENSIONPROPERTY = - 'RtcEngine_setExtensionProperty'; - public static FUNC_RTCENGINE_GETEXTENSIONPROPERTY = - 'RtcEngine_getExtensionProperty'; - public static FUNC_RTCENGINE_SETCAMERACAPTURERCONFIGURATION = - 'RtcEngine_setCameraCapturerConfiguration'; - public static FUNC_RTCENGINE_SWITCHCAMERA = 'RtcEngine_switchCamera'; - public static FUNC_RTCENGINE_ISCAMERAZOOMSUPPORTED = - 'RtcEngine_isCameraZoomSupported'; - public static FUNC_RTCENGINE_ISCAMERAFACEDETECTSUPPORTED = - 'RtcEngine_isCameraFaceDetectSupported'; - public static FUNC_RTCENGINE_ISCAMERATORCHSUPPORTED = - 'RtcEngine_isCameraTorchSupported'; - public static FUNC_RTCENGINE_ISCAMERAFOCUSSUPPORTED = - 'RtcEngine_isCameraFocusSupported'; - public static FUNC_RTCENGINE_ISCAMERAAUTOFOCUSFACEMODESUPPORTED = - 'RtcEngine_isCameraAutoFocusFaceModeSupported'; - public static FUNC_RTCENGINE_SETCAMERAZOOMFACTOR = - 'RtcEngine_setCameraZoomFactor'; - public static FUNC_RTCENGINE_ENABLEFACEDETECTION = - 'RtcEngine_enableFaceDetection'; - public static FUNC_RTCENGINE_GETCAMERAMAXZOOMFACTOR = - 'RtcEngine_getCameraMaxZoomFactor'; - public static FUNC_RTCENGINE_SETCAMERAFOCUSPOSITIONINPREVIEW = - 'RtcEngine_setCameraFocusPositionInPreview'; - public static FUNC_RTCENGINE_SETCAMERATORCHON = 'RtcEngine_setCameraTorchOn'; - public static FUNC_RTCENGINE_SETCAMERAAUTOFOCUSFACEMODEENABLED = - 'RtcEngine_setCameraAutoFocusFaceModeEnabled'; - public static FUNC_RTCENGINE_ISCAMERAEXPOSUREPOSITIONSUPPORTED = - 'RtcEngine_isCameraExposurePositionSupported'; - public static FUNC_RTCENGINE_SETCAMERAEXPOSUREPOSITION = - 'RtcEngine_setCameraExposurePosition'; - public static FUNC_RTCENGINE_ISCAMERAAUTOEXPOSUREFACEMODESUPPORTED = - 'RtcEngine_isCameraAutoExposureFaceModeSupported'; - public static FUNC_RTCENGINE_SETCAMERAAUTOEXPOSUREFACEMODEENABLED = - 'RtcEngine_setCameraAutoExposureFaceModeEnabled'; - public static FUNC_RTCENGINE_SETDEFAULTAUDIOROUTETOSPEAKERPHONE = - 'RtcEngine_setDefaultAudioRouteToSpeakerphone'; - public static FUNC_RTCENGINE_SETENABLESPEAKERPHONE = - 'RtcEngine_setEnableSpeakerphone'; - public static FUNC_RTCENGINE_ISSPEAKERPHONEENABLED = - 'RtcEngine_isSpeakerphoneEnabled'; - public static FUNC_RTCENGINE_GETSCREENCAPTURESOURCES = - 'RtcEngine_getScreenCaptureSources'; - public static FUNC_RTCENGINE_STARTSCREENCAPTUREBYSCREENRECT = - 'RtcEngine_startScreenCaptureByScreenRect'; - public static FUNC_RTCENGINE_STARTSCREENCAPTURE = - 'RtcEngine_startScreenCapture'; - public static FUNC_RTCENGINE_GETAUDIODEVICEINFO = - 'RtcEngine_getAudioDeviceInfo'; - public static FUNC_RTCENGINE_STARTSCREENCAPTUREBYWINDOWID = - 'RtcEngine_startScreenCaptureByWindowId'; - public static FUNC_RTCENGINE_SETSCREENCAPTURECONTENTHINT = - 'RtcEngine_setScreenCaptureContentHint'; - public static FUNC_RTCENGINE_UPDATESCREENCAPTUREREGION = - 'RtcEngine_updateScreenCaptureRegion'; - public static FUNC_RTCENGINE_UPDATESCREENCAPTUREPARAMETERS = - 'RtcEngine_updateScreenCaptureParameters'; - public static FUNC_RTCENGINE_STOPSCREENCAPTURE = - 'RtcEngine_stopScreenCapture'; - public static FUNC_RTCENGINE_GETCALLID = 'RtcEngine_getCallId'; - public static FUNC_RTCENGINE_RATE = 'RtcEngine_rate'; - public static FUNC_RTCENGINE_COMPLAIN = 'RtcEngine_complain'; - public static FUNC_RTCENGINE_ADDPUBLISHSTREAMURL = - 'RtcEngine_addPublishStreamUrl'; - public static FUNC_RTCENGINE_REMOVEPUBLISHSTREAMURL = - 'RtcEngine_removePublishStreamUrl'; - public static FUNC_RTCENGINE_SETLIVETRANSCODING = - 'RtcEngine_setLiveTranscoding'; - public static FUNC_RTCENGINE_STARTRTMPSTREAMWITHOUTTRANSCODING = - 'RtcEngine_startRtmpStreamWithoutTranscoding'; - public static FUNC_RTCENGINE_STARTRTMPSTREAMWITHTRANSCODING = - 'RtcEngine_startRtmpStreamWithTranscoding'; - public static FUNC_RTCENGINE_UPDATERTMPTRANSCODING = - 'RtcEngine_updateRtmpTranscoding'; - public static FUNC_RTCENGINE_STOPRTMPSTREAM = 'RtcEngine_stopRtmpStream'; - public static FUNC_RTCENGINE_STARTLOCALVIDEOTRANSCODER = - 'RtcEngine_startLocalVideoTranscoder'; - public static FUNC_RTCENGINE_UPDATELOCALTRANSCODERCONFIGURATION = - 'RtcEngine_updateLocalTranscoderConfiguration'; - public static FUNC_RTCENGINE_STOPLOCALVIDEOTRANSCODER = - 'RtcEngine_stopLocalVideoTranscoder'; - public static FUNC_RTCENGINE_STARTPRIMARYCAMERACAPTURE = - 'RtcEngine_startPrimaryCameraCapture'; - public static FUNC_RTCENGINE_STARTSECONDARYCAMERACAPTURE = - 'RtcEngine_startSecondaryCameraCapture'; - public static FUNC_RTCENGINE_STOPPRIMARYCAMERACAPTURE = - 'RtcEngine_stopPrimaryCameraCapture'; - public static FUNC_RTCENGINE_STOPSECONDARYCAMERACAPTURE = - 'RtcEngine_stopSecondaryCameraCapture'; - public static FUNC_RTCENGINE_SETCAMERADEVICEORIENTATION = - 'RtcEngine_setCameraDeviceOrientation'; - public static FUNC_RTCENGINE_SETSCREENCAPTUREORIENTATION = - 'RtcEngine_setScreenCaptureOrientation'; - public static FUNC_RTCENGINE_STARTPRIMARYSCREENCAPTURE = - 'RtcEngine_startPrimaryScreenCapture'; - public static FUNC_RTCENGINE_STARTSECONDARYSCREENCAPTURE = - 'RtcEngine_startSecondaryScreenCapture'; - public static FUNC_RTCENGINE_STOPPRIMARYSCREENCAPTURE = - 'RtcEngine_stopPrimaryScreenCapture'; - public static FUNC_RTCENGINE_STOPSECONDARYSCREENCAPTURE = - 'RtcEngine_stopSecondaryScreenCapture'; - public static FUNC_RTCENGINE_GETCONNECTIONSTATE = - 'RtcEngine_getConnectionState'; - public static FUNC_RTCENGINE_REGISTEREVENTHANDLER = - 'RtcEngine_registerEventHandler'; - public static FUNC_RTCENGINE_UNREGISTEREVENTHANDLER = - 'RtcEngine_unregisterEventHandler'; - public static FUNC_RTCENGINE_SETREMOTEUSERPRIORITY = - 'RtcEngine_setRemoteUserPriority'; - public static FUNC_RTCENGINE_REGISTERPACKETOBSERVER = - 'RtcEngine_registerPacketObserver'; - public static FUNC_RTCENGINE_SETENCRYPTIONMODE = - 'RtcEngine_setEncryptionMode'; - public static FUNC_RTCENGINE_SETENCRYPTIONSECRET = - 'RtcEngine_setEncryptionSecret'; - public static FUNC_RTCENGINE_ENABLEENCRYPTION = 'RtcEngine_enableEncryption'; - public static FUNC_RTCENGINE_CREATEDATASTREAM = 'RtcEngine_createDataStream'; - public static FUNC_RTCENGINE_CREATEDATASTREAM2 = - 'RtcEngine_createDataStream2'; - public static FUNC_RTCENGINE_SENDSTREAMMESSAGE = - 'RtcEngine_sendStreamMessage'; - public static FUNC_RTCENGINE_ADDVIDEOWATERMARK = - 'RtcEngine_addVideoWatermark'; - public static FUNC_RTCENGINE_ADDVIDEOWATERMARK2 = - 'RtcEngine_addVideoWatermark2'; - public static FUNC_RTCENGINE_CLEARVIDEOWATERMARK = - 'RtcEngine_clearVideoWatermark'; - public static FUNC_RTCENGINE_CLEARVIDEOWATERMARKS = - 'RtcEngine_clearVideoWatermarks'; - public static FUNC_RTCENGINE_ADDINJECTSTREAMURL = - 'RtcEngine_addInjectStreamUrl'; - public static FUNC_RTCENGINE_REMOVEINJECTSTREAMURL = - 'RtcEngine_removeInjectStreamUrl'; - public static FUNC_RTCENGINE_PAUSEAUDIO = 'RtcEngine_pauseAudio'; - public static FUNC_RTCENGINE_RESUMEAUDIO = 'RtcEngine_resumeAudio'; - public static FUNC_RTCENGINE_ENABLEWEBSDKINTEROPERABILITY = - 'RtcEngine_enableWebSdkInteroperability'; - public static FUNC_RTCENGINE_SENDCUSTOMREPORTMESSAGE = - 'RtcEngine_sendCustomReportMessage'; - public static FUNC_RTCENGINE_REGISTERMEDIAMETADATAOBSERVER = - 'RtcEngine_registerMediaMetadataObserver'; - public static FUNC_RTCENGINE_UNREGISTERMEDIAMETADATAOBSERVER = - 'RtcEngine_unregisterMediaMetadataObserver'; - public static FUNC_RTCENGINE_STARTAUDIOFRAMEDUMP = - 'RtcEngine_startAudioFrameDump'; - public static FUNC_RTCENGINE_STOPAUDIOFRAMEDUMP = - 'RtcEngine_stopAudioFrameDump'; - public static FUNC_RTCENGINE_REGISTERLOCALUSERACCOUNT = - 'RtcEngine_registerLocalUserAccount'; - public static FUNC_RTCENGINE_JOINCHANNELWITHUSERACCOUNT = - 'RtcEngine_joinChannelWithUserAccount'; - public static FUNC_RTCENGINE_JOINCHANNELWITHUSERACCOUNT2 = - 'RtcEngine_joinChannelWithUserAccount2'; - public static FUNC_RTCENGINE_JOINCHANNELWITHUSERACCOUNTEX = - 'RtcEngine_joinChannelWithUserAccountEx'; - public static FUNC_RTCENGINE_GETUSERINFOBYUSERACCOUNT = - 'RtcEngine_getUserInfoByUserAccount'; - public static FUNC_RTCENGINE_GETUSERINFOBYUID = 'RtcEngine_getUserInfoByUid'; - public static FUNC_RTCENGINE_STARTCHANNELMEDIARELAY = - 'RtcEngine_startChannelMediaRelay'; - public static FUNC_RTCENGINE_UPDATECHANNELMEDIARELAY = - 'RtcEngine_updateChannelMediaRelay'; - public static FUNC_RTCENGINE_STOPCHANNELMEDIARELAY = - 'RtcEngine_stopChannelMediaRelay'; - public static FUNC_RTCENGINE_PAUSEALLCHANNELMEDIARELAY = - 'RtcEngine_pauseAllChannelMediaRelay'; - public static FUNC_RTCENGINE_RESUMEALLCHANNELMEDIARELAY = - 'RtcEngine_resumeAllChannelMediaRelay'; - public static FUNC_RTCENGINE_SETDIRECTCDNSTREAMINGAUDIOCONFIGURATION = - 'RtcEngine_setDirectCdnStreamingAudioConfiguration'; - public static FUNC_RTCENGINE_SETDIRECTCDNSTREAMINGVIDEOCONFIGURATION = - 'RtcEngine_setDirectCdnStreamingVideoConfiguration'; - public static FUNC_RTCENGINE_STARTDIRECTCDNSTREAMING = - 'RtcEngine_startDirectCdnStreaming'; - public static FUNC_RTCENGINE_STOPDIRECTCDNSTREAMING = - 'RtcEngine_stopDirectCdnStreaming'; - public static FUNC_RTCENGINE_UPDATEDIRECTCDNSTREAMINGMEDIAOPTIONS = - 'RtcEngine_updateDirectCdnStreamingMediaOptions'; - public static FUNC_RTCENGINE_PUSHDIRECTCDNSTREAMINGCUSTOMVIDEOFRAME = - 'RtcEngine_pushDirectCdnStreamingCustomVideoFrame'; - public static FUNC_RTCENGINE_TAKESNAPSHOT = 'RtcEngine_takeSnapshot'; - public static FUNC_RTCENGINE_SETCONTENTINSPECT = - 'RtcEngine_SetContentInspect'; - public static FUNC_RTCENGINE_SWITCHCHANNEL = 'RtcEngine_switchChannel'; - public static FUNC_RTCENGINE_STARTRHYTHMPLAYER = - 'RtcEngine_startRhythmPlayer'; - public static FUNC_RTCENGINE_STOPRHYTHMPLAYER = 'RtcEngine_stopRhythmPlayer'; - public static FUNC_RTCENGINE_CONFIGRHYTHMPLAYER = - 'RtcEngine_configRhythmPlayer'; - public static FUNC_RTCENGINE_ADJUSTCUSTOMAUDIOPUBLISHVOLUME = - 'RtcEngine_adjustCustomAudioPublishVolume'; - public static FUNC_RTCENGINE_ADJUSTCUSTOMAUDIOPLAYOUTVOLUME = - 'RtcEngine_adjustCustomAudioPlayoutVolume'; - public static FUNC_RTCENGINE_SETCLOUDPROXY = 'RtcEngine_setCloudProxy'; - public static FUNC_RTCENGINE_SETLOCALACCESSPOINT = - 'RtcEngine_setLocalAccessPoint'; - public static FUNC_RTCENGINE_ENABLEFISHCORRECTION = - 'RtcEngine_enableFishCorrection'; - public static FUNC_RTCENGINE_SETADVANCEDAUDIOOPTIONS = - 'RtcEngine_setAdvancedAudioOptions'; - public static FUNC_RTCENGINE_SETAVSYNCSOURCE = 'RtcEngine_setAVSyncSource'; - public static FUNC_RTCENGINE_STARTSCREENCAPTUREBYDISPLAYID = - 'RtcEngine_startScreenCaptureByDisplayId'; - public static FUNC_RTCENGINE_SETMAXMETADATASIZE = - 'RtcEngine_setMaxMetadataSize'; - public static FUNC_RTCENGINE_SENDMETADATA = 'RtcEngine_sendMetaData'; - public static FUNC_RTCENGINE_RELEASESCREENCAPTURESOURCES = - 'RtcEngine_releaseScreenCaptureSources'; - // class IRtcEngine end - - // class IRtcEngineEx start - public static FUNC_RTCENGINEEX_JOINCHANNELEX = 'RtcEngineEx_joinChannelEx'; - public static FUNC_RTCENGINEEX_LEAVECHANNELEX = 'RtcEngineEx_leaveChannelEx'; - public static FUNC_RTCENGINEEX_UPDATECHANNELMEDIAOPTIONSEX = - 'RtcEngineEx_updateChannelMediaOptionsEx'; - public static FUNC_RTCENGINEEX_SETVIDEOENCODERCONFIGURATIONEX = - 'RtcEngineEx_setVideoEncoderConfigurationEx'; - public static FUNC_RTCENGINEEX_SETUPREMOTEVIDEOEX = - 'RtcEngineEx_setupRemoteVideoEx'; - public static FUNC_RTCENGINEEX_MUTEREMOTEAUDIOSTREAMEX = - 'RtcEngineEx_muteRemoteAudioStreamEx'; - public static FUNC_RTCENGINEEX_MUTEREMOTEVIDEOSTREAMEX = - 'RtcEngineEx_muteRemoteVideoStreamEx'; - public static FUNC_RTCENGINEEX_SETREMOTEVIDEOSTREAMTYPEEX = - 'RtcEngineEx_setRemoteVideoStreamTypeEx'; - public static FUNC_RTCENGINEEX_SETREMOTEVOICEPOSITIONEX = - 'RtcEngineEx_setRemoteVoicePositionEx'; - public static FUNC_RTCENGINEEX_SETREMOTEUSERSPATIALAUDIOPARAMSEX = - 'RtcEngineEx_setRemoteUserSpatialAudioParamsEx'; - public static FUNC_RTCENGINEEX_SETREMOTERENDERMODEEX = - 'RtcEngineEx_setRemoteRenderModeEx'; - public static FUNC_RTCENGINEEX_ENABLELOOPBACKRECORDINGEX = - 'RtcEngineEx_enableLoopbackRecordingEx'; - public static FUNC_RTCENGINEEX_GETCONNECTIONSTATEEX = - 'RtcEngineEx_getConnectionStateEx'; - public static FUNC_RTCENGINEEX_ENABLEENCRYPTIONEX = - 'RtcEngineEx_enableEncryptionEx'; - public static FUNC_RTCENGINEEX_CREATEDATASTREAMEX = - 'RtcEngineEx_createDataStreamEx'; - public static FUNC_RTCENGINEEX_CREATEDATASTREAMEX2 = - 'RtcEngineEx_createDataStreamEx2'; - public static FUNC_RTCENGINEEX_SENDSTREAMMESSAGEEX = - 'RtcEngineEx_sendStreamMessageEx'; - public static FUNC_RTCENGINEEX_ADDVIDEOWATERMARKEX = - 'RtcEngineEx_addVideoWatermarkEx'; - public static FUNC_RTCENGINEEX_CLEARVIDEOWATERMARKEX = - 'RtcEngineEx_clearVideoWatermarkEx'; - public static FUNC_RTCENGINEEX_SENDCUSTOMREPORTMESSAGEEX = - 'RtcEngineEx_sendCustomReportMessageEx'; - public static FUNC_RTCENGINEEX_ENABLEAUDIOVOLUMEINDICATIONEX = - 'RtcEngineEx_enableAudioVolumeIndicationEx'; - public static FUNC_RTCENGINEEX_GETUSERINFOBYUSERACCOUNTEX = - 'RtcEngineEx_getUserInfoByUserAccountEx'; - public static FUNC_RTCENGINEEX_GETUSERINFOBYUIDEX = - 'RtcEngineEx_getUserInfoByUidEx'; - public static FUNC_RTCENGINEEX_SETVIDEOPROFILEEX = - 'RtcEngineEx_setVideoProfileEx'; - public static FUNC_RTCENGINEEX_ENABLEDUALSTREAMMODEEX = - 'RtcEngineEx_enableDualStreamModeEx'; - public static FUNC_RTCENGINEEX_ADDPUBLISHSTREAMURLEX = - 'RtcEngineEx_addPublishStreamUrlEx'; - public static FUNC_RTCENGINE_SETAUDIOSESSIONOPERATIONRESTRICTION = - 'RtcEngine_setAudioSessionOperationRestriction'; - // class IRtcEngineEx end - - // class IMediaPlayer start - public static FUNC_MEDIAPLAYER_INITIALIZE = 'MediaPlayer_initialize'; - public static FUNC_MEDIAPLAYER_GETMEDIAPLAYERID = - 'MediaPlayer_getMediaPlayerId'; - public static FUNC_MEDIAPLAYER_OPEN = 'MediaPlayer_open'; - public static FUNC_MEDIAPLAYER_OPENWITHCUSTOMSOURCE = - 'MediaPlayer_openWithCustomSource'; - public static FUNC_MEDIAPLAYER_PLAY = 'MediaPlayer_play'; - public static FUNC_MEDIAPLAYER_PAUSE = 'MediaPlayer_pause'; - public static FUNC_MEDIAPLAYER_STOP = 'MediaPlayer_stop'; - public static FUNC_MEDIAPLAYER_RESUME = 'MediaPlayer_resume'; - public static FUNC_MEDIAPLAYER_SEEK = 'MediaPlayer_seek'; - public static FUNC_MEDIAPLAYER_SETAUDIOPITCH = 'MediaPlayer_setAudioPitch'; - public static FUNC_MEDIAPLAYER_GETDURATION = 'MediaPlayer_getDuration'; - public static FUNC_MEDIAPLAYER_GETPLAYPOSITION = - 'MediaPlayer_getPlayPosition'; - public static FUNC_MEDIAPLAYER_GETSTREAMCOUNT = 'MediaPlayer_getStreamCount'; - public static FUNC_MEDIAPLAYER_GETSTREAMINFO = 'MediaPlayer_getStreamInfo'; - public static FUNC_MEDIAPLAYER_SETLOOPCOUNT = 'MediaPlayer_setLoopCount'; - public static FUNC_MEDIAPLAYER_MUTEAUDIO = 'MediaPlayer_muteAudio'; - public static FUNC_MEDIAPLAYER_ISAUDIOMUTED = 'MediaPlayer_isAudioMuted'; - public static FUNC_MEDIAPLAYER_MUTEVIDEO = 'MediaPlayer_muteVideo'; - public static FUNC_MEDIAPLAYER_ISVIDEOMUTED = 'MediaPlayer_isVideoMuted'; - public static FUNC_MEDIAPLAYER_SETPLAYBACKSPEED = - 'MediaPlayer_setPlaybackSpeed'; - public static FUNC_MEDIAPLAYER_SELECTAUDIOTRACK = - 'MediaPlayer_selectAudioTrack'; - public static FUNC_MEDIAPLAYER_SETPLAYEROPTION = - 'MediaPlayer_setPlayerOption'; - public static FUNC_MEDIAPLAYER_SETPLAYEROPTION2 = - 'MediaPlayer_setPlayerOption2'; - public static FUNC_MEDIAPLAYER_TAKESCREENSHOT = 'MediaPlayer_takeScreenshot'; - public static FUNC_MEDIAPLAYER_SELECTINTERNALSUBTITLE = - 'MediaPlayer_selectInternalSubtitle'; - public static FUNC_MEDIAPLAYER_SETEXTERNALSUBTITLE = - 'MediaPlayer_setExternalSubtitle'; - public static FUNC_MEDIAPLAYER_GETSTATE = 'MediaPlayer_getState'; - public static FUNC_MEDIAPLAYER_MUTE = 'MediaPlayer_mute'; - public static FUNC_MEDIAPLAYER_GETMUTE = 'MediaPlayer_getMute'; - public static FUNC_MEDIAPLAYER_ADJUSTPLAYOUTVOLUME = - 'MediaPlayer_adjustPlayoutVolume'; - public static FUNC_MEDIAPLAYER_GETPLAYOUTVOLUME = - 'MediaPlayer_getPlayoutVolume'; - public static FUNC_MEDIAPLAYER_ADJUSTPUBLISHSIGNALVOLUME = - 'MediaPlayer_adjustPublishSignalVolume'; - public static FUNC_MEDIAPLAYER_GETPUBLISHSIGNALVOLUME = - 'MediaPlayer_getPublishSignalVolume'; - public static FUNC_MEDIAPLAYER_SETVIEW = 'MediaPlayer_setView'; - public static FUNC_MEDIAPLAYER_SETRENDERMODE = 'MediaPlayer_setRenderMode'; - public static FUNC_MEDIAPLAYER_REGISTERPLAYERSOURCEOBSERVER = - 'MediaPlayer_registerPlayerSourceObserver'; - public static FUNC_MEDIAPLAYER_UNREGISTERPLAYERSOURCEOBSERVER = - 'MediaPlayer_unregisterPlayerSourceObserver'; - public static FUNC_MEDIAPLAYER_REGISTERAUDIOFRAMEOBSERVER = - 'MediaPlayer_registerAudioFrameObserver'; - public static FUNC_MEDIAPLAYER_REGISTERAUDIOFRAMEOBSERVER2 = - 'MediaPlayer_registerAudioFrameObserver2'; - public static FUNC_MEDIAPLAYER_UNREGISTERAUDIOFRAMEOBSERVER = - 'MediaPlayer_unregisterAudioFrameObserver'; - public static FUNC_MEDIAPLAYER_REGISTERVIDEOFRAMEOBSERVER = - 'MediaPlayer_registerVideoFrameObserver'; - public static FUNC_MEDIAPLAYER_UNREGISTERVIDEOFRAMEOBSERVER = - 'MediaPlayer_unregisterVideoFrameObserver'; - public static FUNC_MEDIAPLAYER_REGISTERMEDIAPLAYERAUDIOSPECTRUMOBSERVER = - 'MediaPlayer_registerMediaPlayerAudioSpectrumObserver'; - public static FUNC_MEDIAPLAYER_UNREGISTERMEDIAPLAYERAUDIOSPECTRUMOBSERVER = - 'MediaPlayer_unregisterMediaPlayerAudioSpectrumObserver'; - public static FUNC_MEDIAPLAYER_SETAUDIODUALMONOMODE = - 'MediaPlayer_setAudioDualMonoMode'; - public static FUNC_MEDIAPLAYER_GETPLAYERSDKVERSION = - 'MediaPlayer_getPlayerSdkVersion'; - public static FUNC_MEDIAPLAYER_GETPLAYSRC = 'MediaPlayer_getPlaySrc'; - public static FUNC_MEDIAPLAYER_OPENWITHAGORACDNSRC = - 'MediaPlayer_openWithAgoraCDNSrc'; - public static FUNC_MEDIAPLAYER_GETAGORACDNLINECOUNT = - 'MediaPlayer_getAgoraCDNLineCount'; - public static FUNC_MEDIAPLAYER_SWITCHAGORACDNLINEBYINDEX = - 'MediaPlayer_switchAgoraCDNLineByIndex'; - public static FUNC_MEDIAPLAYER_GETCURRENTAGORACDNINDEX = - 'MediaPlayer_getCurrentAgoraCDNIndex'; - public static FUNC_MEDIAPLAYER_ENABLEAUTOSWITCHAGORACDN = - 'MediaPlayer_enableAutoSwitchAgoraCDN'; - public static FUNC_MEDIAPLAYER_RENEWAGORACDNSRCTOKEN = - 'MediaPlayer_renewAgoraCDNSrcToken'; - public static FUNC_MEDIAPLAYER_SWITCHAGORACDNSRC = - 'MediaPlayer_switchAgoraCDNSrc'; - public static FUNC_MEDIAPLAYER_SWITCHSRC = 'MediaPlayer_switchSrc'; - public static FUNC_MEDIAPLAYER_PRELOADSRC = 'MediaPlayer_preloadSrc'; - public static FUNC_MEDIAPLAYER_PLAYPRELOADEDSRC = - 'MediaPlayer_playPreloadedSrc'; - public static FUNC_MEDIAPLAYER_UNLOADSRC = 'MediaPlayer_unloadSrc'; - public static FUNC_MEDIAPLAYER_SETSPATIALAUDIOPARAMS = - 'MediaPlayer_setSpatialAudioParams'; - // class IMediaPlayer end - - // class IAudioDeviceManager start - public static FUNC_AUDIODEVICEMANAGER_ENUMERATEPLAYBACKDEVICES = - 'AudioDeviceManager_enumeratePlaybackDevices'; - public static FUNC_AUDIODEVICEMANAGER_ENUMERATERECORDINGDEVICES = - 'AudioDeviceManager_enumerateRecordingDevices'; - public static FUNC_AUDIODEVICEMANAGER_SETPLAYBACKDEVICE = - 'AudioDeviceManager_setPlaybackDevice'; - public static FUNC_AUDIODEVICEMANAGER_GETPLAYBACKDEVICE = - 'AudioDeviceManager_getPlaybackDevice'; - public static FUNC_AUDIODEVICEMANAGER_GETPLAYBACKDEVICEINFO = - 'AudioDeviceManager_getPlaybackDeviceInfo'; - public static FUNC_AUDIODEVICEMANAGER_SETPLAYBACKDEVICEVOLUME = - 'AudioDeviceManager_setPlaybackDeviceVolume'; - public static FUNC_AUDIODEVICEMANAGER_GETPLAYBACKDEVICEVOLUME = - 'AudioDeviceManager_getPlaybackDeviceVolume'; - public static FUNC_AUDIODEVICEMANAGER_SETRECORDINGDEVICE = - 'AudioDeviceManager_setRecordingDevice'; - public static FUNC_AUDIODEVICEMANAGER_GETRECORDINGDEVICE = - 'AudioDeviceManager_getRecordingDevice'; - public static FUNC_AUDIODEVICEMANAGER_GETRECORDINGDEVICEINFO = - 'AudioDeviceManager_getRecordingDeviceInfo'; - public static FUNC_AUDIODEVICEMANAGER_SETRECORDINGDEVICEVOLUME = - 'AudioDeviceManager_setRecordingDeviceVolume'; - public static FUNC_AUDIODEVICEMANAGER_GETRECORDINGDEVICEVOLUME = - 'AudioDeviceManager_getRecordingDeviceVolume'; - public static FUNC_AUDIODEVICEMANAGER_SETPLAYBACKDEVICEMUTE = - 'AudioDeviceManager_setPlaybackDeviceMute'; - public static FUNC_AUDIODEVICEMANAGER_GETPLAYBACKDEVICEMUTE = - 'AudioDeviceManager_getPlaybackDeviceMute'; - public static FUNC_AUDIODEVICEMANAGER_SETRECORDINGDEVICEMUTE = - 'AudioDeviceManager_setRecordingDeviceMute'; - public static FUNC_AUDIODEVICEMANAGER_GETRECORDINGDEVICEMUTE = - 'AudioDeviceManager_getRecordingDeviceMute'; - public static FUNC_AUDIODEVICEMANAGER_STARTPLAYBACKDEVICETEST = - 'AudioDeviceManager_startPlaybackDeviceTest'; - public static FUNC_AUDIODEVICEMANAGER_STOPPLAYBACKDEVICETEST = - 'AudioDeviceManager_stopPlaybackDeviceTest'; - public static FUNC_AUDIODEVICEMANAGER_STARTRECORDINGDEVICETEST = - 'AudioDeviceManager_startRecordingDeviceTest'; - public static FUNC_AUDIODEVICEMANAGER_STOPRECORDINGDEVICETEST = - 'AudioDeviceManager_stopRecordingDeviceTest'; - public static FUNC_AUDIODEVICEMANAGER_STARTAUDIODEVICELOOPBACKTEST = - 'AudioDeviceManager_startAudioDeviceLoopbackTest'; - public static FUNC_AUDIODEVICEMANAGER_STOPAUDIODEVICELOOPBACKTEST = - 'AudioDeviceManager_stopAudioDeviceLoopbackTest'; - public static FUNC_AUDIODEVICEMANAGER_RELEASE = 'AudioDeviceManager_release'; - // class IAudioDeviceManager end - - // class IVideoDeviceManager start - public static FUNC_VIDEODEVICEMANAGER_ENUMERATEVIDEODEVICES = - 'VideoDeviceManager_enumerateVideoDevices'; - public static FUNC_VIDEODEVICEMANAGER_SETDEVICE = - 'VideoDeviceManager_setDevice'; - public static FUNC_VIDEODEVICEMANAGER_GETDEVICE = - 'VideoDeviceManager_getDevice'; - public static FUNC_VIDEODEVICEMANAGER_STARTDEVICETEST = - 'VideoDeviceManager_startDeviceTest'; - public static FUNC_VIDEODEVICEMANAGER_STOPDEVICETEST = - 'VideoDeviceManager_stopDeviceTest'; - public static FUNC_VIDEODEVICEMANAGER_RELEASE = 'VideoDeviceManager_release'; - // class IVideoDeviceManager end - - // class ICloudSpatialAudioEngine start - public static FUNC_CLOUDSPATIALAUDIOENGINE_SETMAXAUDIORECVCOUNT = - 'CloudSpatialAudioEngine_setMaxAudioRecvCount'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_SETAUDIORECVRANGE = - 'CloudSpatialAudioEngine_setAudioRecvRange'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_SETDISTANCEUNIT = - 'CloudSpatialAudioEngine_setDistanceUnit'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_UPDATESELFPOSITION = - 'CloudSpatialAudioEngine_updateSelfPosition'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_UPDATESELFPOSITIONEX = - 'CloudSpatialAudioEngine_updateSelfPositionEx'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_UPDATEPLAYERPOSITIONINFO = - 'CloudSpatialAudioEngine_updatePlayerPositionInfo'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_SETPARAMETERS = - 'CloudSpatialAudioEngine_setParameters'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_INITIALIZE = - 'CloudSpatialAudioEngine_initialize'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_ADDEVENTHANDLER = - 'CloudSpatialAudioEngine_addEventHandler'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_REMOVEEVENTHANDLER = - 'CloudSpatialAudioEngine_removeEventHandler'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_ENABLESPATIALIZER = - 'CloudSpatialAudioEngine_enableSpatializer'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_SETTEAMID = - 'CloudSpatialAudioEngine_setTeamId'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_SETAUDIORANGEMODE = - 'CloudSpatialAudioEngine_setAudioRangeMode'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_ENTERROOM = - 'CloudSpatialAudioEngine_enterRoom'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_RENEWTOKEN = - 'CloudSpatialAudioEngine_renewToken'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_EXITROOM = - 'CloudSpatialAudioEngine_exitRoom'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_GETTEAMMATES = - 'CloudSpatialAudioEngine_getTeammates'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_MUTELOCALAUDIOSTREAM = - 'CloudSpatialAudioEngine_muteLocalAudioStream'; - public static FUNC_CLOUDSPATIALAUDIOENGINE_MUTEALLREMOTEAUDIOSTREAMS = - 'CloudSpatialAudioEngine_muteAllRemoteAudioStreams'; - // class ICloudSpatialAudioEngine end - - // class ILocalSpatialAudioEngine start - public static FUNC_LOCALSPATIALAUDIOENGINE_SETMAXAUDIORECVCOUNT = - 'LocalSpatialAudioEngine_setMaxAudioRecvCount'; - public static FUNC_LOCALSPATIALAUDIOENGINE_SETAUDIORECVRANGE = - 'LocalSpatialAudioEngine_setAudioRecvRange'; - public static FUNC_LOCALSPATIALAUDIOENGINE_SETDISTANCEUNIT = - 'LocalSpatialAudioEngine_setDistanceUnit'; - public static FUNC_LOCALSPATIALAUDIOENGINE_UPDATESELFPOSITION = - 'LocalSpatialAudioEngine_updateSelfPosition'; - public static FUNC_LOCALSPATIALAUDIOENGINE_UPDATESELFPOSITIONEX = - 'LocalSpatialAudioEngine_updateSelfPositionEx'; - public static FUNC_LOCALSPATIALAUDIOENGINE_UPDATEPLAYERPOSITIONINFO = - 'LocalSpatialAudioEngine_updatePlayerPositionInfo'; - public static FUNC_LOCALSPATIALAUDIOENGINE_SETPARAMETERS = - 'LocalSpatialAudioEngine_setParameters'; - public static FUNC_LOCALSPATIALAUDIOENGINE_UPDATEREMOTEPOSITION = - 'LocalSpatialAudioEngine_updateRemotePosition'; - public static FUNC_LOCALSPATIALAUDIOENGINE_REMOVEREMOTEPOSITION = - 'LocalSpatialAudioEngine_removeRemotePosition'; - public static FUNC_LOCALSPATIALAUDIOENGINE_CLEARREMOTEPOSITIONS = - 'LocalSpatialAudioEngine_clearRemotePositions'; - public static FUNC_LOCALSPATIALAUDIOENGINE_UPDATEREMOTEPOSITIONEX = - 'LocalSpatialAudioEngine_updateRemotePositionEx'; - public static FUNC_LOCALSPATIALAUDIOENGINE_REMOVEREMOTEPOSITIONEX = - 'LocalSpatialAudioEngine_removeRemotePositionEx'; - public static FUNC_LOCALSPATIALAUDIOENGINE_CLEARREMOTEPOSITIONSEX = - 'LocalSpatialAudioEngine_clearRemotePositionsEx'; - public static FUNC_LOCALSPATIALAUDIOENGINE_MUTELOCALAUDIOSTREAM = - 'LocalSpatialAudioEngine_muteLocalAudioStream'; - public static FUNC_LOCALSPATIALAUDIOENGINE_MUTEALLREMOTEAUDIOSTREAMS = - 'LocalSpatialAudioEngine_muteAllRemoteAudioStreams'; - public static FUNC_LOCALSPATIALAUDIOENGINE_INITIALIZE = - 'LocalSpatialAudioEngine_initialize'; - // class ILocalSpatialAudioEngine end - - // class RtcRawDataPluginManager start - public static FUNC_RTCRAWDATAPLUGINMANAGER_REGISTERPLUGIN = - 'RtcRawDataPluginManager_registerPlugin'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_GETPLUGINPARAMETER = - 'RtcRawDataPluginManager_getPluginParameter'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_UNREGISTERPLUGIN = - 'RtcRawDataPluginManager_unRegisterPlugin'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_HASPLUGIN = - 'RtcRawDataPluginManager_hasPlugin'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_ENABLEPLUGIN = - 'RtcRawDataPluginManager_enablePlugin'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_DELETEPLUGIN = - 'RtcRawDataPluginManager_deletePlugin'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_GETPLUGINS = - 'RtcRawDataPluginManager_getPlugins'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_SETPLUGINPARAMETER = - 'RtcRawDataPluginManager_setPluginParameter'; - public static FUNC_RTCRAWDATAPLUGINMANAGER_REMOVEALLPLUGINS = - 'RtcRawDataPluginManager_removeAllPlugins'; - // class RtcRawDataPluginManager end - - // class IMediaEngine start - public static FUNC_MEDIAENGINE_REGISTERAUDIOFRAMEOBSERVER = - 'MediaEngine_registerAudioFrameObserver'; - public static FUNC_MEDIAENGINE_REGISTERVIDEOFRAMEOBSERVER = - 'MediaEngine_registerVideoFrameObserver'; - public static FUNC_MEDIAENGINE_REGISTERVIDEOENCODEDIMAGERECEIVER = - 'MediaEngine_registerVideoEncodedImageReceiver'; - public static FUNC_MEDIAENGINE_PUSHAUDIOFRAME = 'MediaEngine_pushAudioFrame'; - public static FUNC_MEDIAENGINE_PUSHCAPTUREAUDIOFRAME = - 'MediaEngine_pushCaptureAudioFrame'; - public static FUNC_MEDIAENGINE_PUSHREVERSEAUDIOFRAME = - 'MediaEngine_pushReverseAudioFrame'; - public static FUNC_MEDIAENGINE_PUSHDIRECTAUDIOFRAME = - 'MediaEngine_pushDirectAudioFrame'; - public static FUNC_MEDIAENGINE_PULLAUDIOFRAME = 'MediaEngine_pullAudioFrame'; - public static FUNC_MEDIAENGINE_SETEXTERNALVIDEOSOURCE = - 'MediaEngine_setExternalVideoSource'; - public static FUNC_MEDIAENGINE_SETEXTERNALAUDIOSOURCE = - 'MediaEngine_setExternalAudioSource'; - public static FUNC_MEDIAENGINE_SETEXTERNALAUDIOSINK = - 'MediaEngine_setExternalAudioSink'; - public static FUNC_MEDIAENGINE_ENABLECUSTOMAUDIOLOCALPLAYBACK = - 'MediaEngine_enableCustomAudioLocalPlayback'; - public static FUNC_MEDIAENGINE_SETDIRECTEXTERNALAUDIOSOURCE = - 'MediaEngine_setDirectExternalAudioSource'; - public static FUNC_MEDIAENGINE_PUSHVIDEOFRAME = 'MediaEngine_pushVideoFrame'; - public static FUNC_MEDIAENGINE_PUSHVIDEOFRAME2 = - 'MediaEngine_pushVideoFrame2'; - public static FUNC_MEDIAENGINE_PUSHENCODEDVIDEOIMAGE = - 'MediaEngine_pushEncodedVideoImage'; - public static FUNC_MEDIAENGINE_PUSHENCODEDVIDEOIMAGE2 = - 'MediaEngine_pushEncodedVideoImage2'; - public static FUNC_MEDIAENGINE_RELEASE = 'MediaEngine_release'; - // class IMediaEngine end - - // class RtcRawData start - public static FUNC_RTCRAWDATA_REGISTERAUDIOFRAMEOBSERVER = - 'RtcRawData_registerAudioFrameObserver'; - public static FUNC_RTCRAWDATA_UNREGISTERAUDIOFRAMEOBSERVER = - 'RtcRawData_unRegisterAudioFrameObserver'; - public static FUNC_RTCRAWDATA_REGISTERVIDEOFRAMEOBSERVER = - 'RtcRawData_registerVideoFrameObserver'; - public static FUNC_RTCRAWDATA_UNREGISTERVIDEOFRAMEOBSERVER = - 'RtcRawData_unRegisterVideoFrameObserver'; - public static FUNC_RTCRAWDATA_REGISTERVIDEOENCODEDIMAGERECEIVER = - 'RtcRawData_registerVideoEncodedImageReceiver'; - public static FUNC_RTCRAWDATA_UNREGISTERVIDEOENCODEDIMAGERECEIVER = - 'RtcRawData_unRegisterVideoEncodedImageReceiver'; - public static FUNC_RTCRAWDATA_REGISTERAUDIOENCODEDFRAMEOBSERVER = - 'RtcRawData_registerAudioEncodedFrameObserver'; - public static FUNC_RTCRAWDATA_UNREGISTERAUDIOENCODEDFRAMEOBSERVER = - 'RtcRawData_unRegisterAudioEncodedFrameObserver'; - public static FUNC_RTCRAWDATA_ATTACH = 'RtcRawData_attach'; - public static FUNC_RTCRAWDATA_DETACH = 'RtcRawData_detach'; - // class RtcRawData -} diff --git a/packages/rtc/src/binding/IAgoraMusicContentCenterDispatch.ts b/packages/rtc/src/binding/IAgoraMusicContentCenterDispatch.ts index 2d32f32..e2df4e1 100644 --- a/packages/rtc/src/binding/IAgoraMusicContentCenterDispatch.ts +++ b/packages/rtc/src/binding/IAgoraMusicContentCenterDispatch.ts @@ -234,7 +234,7 @@ export class IMusicContentCenterDispatch { unregisterEventHandler(apiParam: ApiParam): CallApiReturnType { let eventHandler = apiParam.buffer[0]; //obj.eventHandler; if (eventHandler === undefined) throw 'eventHandler is undefined'; - return this._impl.registerEventHandler(eventHandler); + return this._impl.unregisterEventHandler(); } createMusicPlayer(): CallApiReturnType { diff --git a/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts b/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts index 307bd78..35231c4 100644 --- a/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts +++ b/packages/rtc/src/binding/IAgoraRtcEngineDispatch.ts @@ -3813,7 +3813,7 @@ export class IRtcEngineDispatch { unregisterEventHandler(apiParam: ApiParam): CallApiReturnType { let eventHandler = apiParam.buffer[0]; //obj.eventHandler; if (eventHandler === undefined) throw 'eventHandler is undefined'; - return this._impl.registerEventHandler(eventHandler); + return this._impl.unregisterEventHandler(eventHandler); } setRemoteUserPriority(apiParam: ApiParam): CallApiReturnType { diff --git a/packages/rtc/src/engine/IrisClient.ts b/packages/rtc/src/engine/IrisClient.ts new file mode 100644 index 0000000..1994e6b --- /dev/null +++ b/packages/rtc/src/engine/IrisClient.ts @@ -0,0 +1,279 @@ +import * as NATIVE_RTC from '@iris/native-rtc-binding'; +import { + ClientConfig, + EncryptionMode, + IAgoraRTCClient, +} from 'agora-rtc-sdk-ng'; + +import { IrisClientEventHandler } from '../event_handler/IrisClientEventHandler'; + +import { IrisClientState } from '../state/IrisClientState'; +import { AgoraConsole, AgoraTranslate } from '../util'; + +import { AudioTrackPackage, VideoTrackPackage } from './IrisClientManager'; +import { IrisRtcEngine } from './IrisRtcEngine'; + +/** + * 通过engine.initialize创建的client将会是默认的一个client + * 默认固定在this._engine.irisClientManager.irisClientList[0] + * engineEx.joinChannelEx不会使用,只有engine.joinChannel才会使用 + * 轨道发布在哪个channel不受此逻辑影响,轨道是否发布只看client的irisClientState配置来 + */ + +export class IrisClient { + id: string; + agoraRTCClient: IAgoraRTCClient; + _engine: IrisRtcEngine; + irisClientState: IrisClientState; + clientEventHandler: IrisClientEventHandler; + + audioTrackPackages: Array = new Array(); + videoTrackPackage: VideoTrackPackage; + + connection: NATIVE_RTC.RtcConnection; + + constructor(engine: IrisRtcEngine, connection?: NATIVE_RTC.RtcConnection) { + this._engine = engine; + this.irisClientState = new IrisClientState(this._engine.globalState); + if (connection) { + this.connection = connection; + } + this.id = `irisClient_${Math.floor(Math.random() * new Date().getTime())}`; + this._engine.irisClientManager.irisClientList.push(this); + } + + setConnection(connection: NATIVE_RTC.RtcConnection) { + this.connection = connection; + } + + setClientConfig(): ClientConfig { + let irisClientState = this.irisClientState; + let config: ClientConfig = { + codec: + irisClientState.videoEncoderConfiguration != null + ? AgoraTranslate.NATIVE_RTCVIDEO_CODEC_TYPE2SDK_CODEC( + irisClientState.videoEncoderConfiguration.codecType + ) + : 'vp8', + mode: irisClientState.channelProfile + ? AgoraTranslate.NATIVE_RTC_CHANNEL_PROFILE_TYPE2SDK_MODE( + irisClientState.channelProfile + ) + : 'live', + }; + if (irisClientState.clientRoleType != null) { + config.role = AgoraTranslate.NATIVE_RTC_CLIENT_ROLE_TYPE2ClientRole( + irisClientState.clientRoleType + ); + } + if (irisClientState.clientRoleOptions != null) { + config.clientRoleOptions = AgoraTranslate.NATIVE_RTCClientRoleOptions2ClientRoleOptions( + irisClientState.clientRoleOptions + ); + } + return config; + } + + createClient(options: NATIVE_RTC.ChannelMediaOptions) { + if (options) { + this.irisClientState.mergeChannelMediaOptions(options); + } + + let irisClientState = this.irisClientState; + let globalState = this._engine.globalState; + + let config = this.setClientConfig(); + this.agoraRTCClient = this._engine.globalState.AgoraRTC.createClient( + config + ); + + //设置远端默认是 大流还是小流 + if (irisClientState.remoteDefaultVideoStreamType != null) { + this.agoraRTCClient + .setRemoteDefaultVideoStreamType( + AgoraTranslate.NATIVE_RTCVIDEO_STREAM_TYPE2RemoteStreamType( + irisClientState.remoteDefaultVideoStreamType + ) + ) + .then(() => {}) + .catch(() => {}) + .finally(() => {}); + } + //设置指定的远端uid具体是大流还是小流 + for (let e of irisClientState.remoteVideoStreamTypes) { + this.agoraRTCClient + .setRemoteVideoStreamType( + e[0], + AgoraTranslate.NATIVE_RTCVIDEO_STREAM_TYPE2RemoteStreamType(e[1]) + ) + .then(() => {}) + .catch(() => {}) + .finally(() => {}); + } + + // + let videoSourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE; + if (irisClientState.publishCameraTrack == true) { + videoSourceType = + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; + } else if (irisClientState.publishSecondaryCameraTrack == true) { + videoSourceType = + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY; + } else if (irisClientState.publishScreenCaptureVideo == true) { + videoSourceType = + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; + } + + //如果当前轨道被特别指定了,那么就设置一下 + if (irisClientState.enabledDualStreamModes.has(videoSourceType)) { + let steamMode = irisClientState.enabledDualStreamModes.get( + videoSourceType + ); + if (steamMode.enabled) { + this.agoraRTCClient + .enableDualStream() + .then(() => {}) + .catch(() => {}) + .finally(() => {}); + + if (steamMode.streamConfig != null) { + this.agoraRTCClient.setLowStreamParameter( + AgoraTranslate.NATIVE_RTCSimulcastStreamConfig2LowStreamParameter( + steamMode.streamConfig + ) + ); + } + } else { + this.agoraRTCClient + .disableDualStream() + .then(() => {}) + .catch(() => {}) + .finally(() => {}); + } + } else { + if (irisClientState.enabledDualStreamMode) { + this.agoraRTCClient + .enableDualStream() + .then(() => {}) + .catch(() => {}) + .finally(() => {}); + } + } + + //设置是否报告说话的人 + if (irisClientState.enabledAudioVolumeIndication) { + this.agoraRTCClient.enableAudioVolumeIndicator(); + irisClientState.enabledAudioVolumeIndication = null; + } + + //是否开启了加密 + if (irisClientState.encryptionConfig?.enabled) { + let encryptionConfig: NATIVE_RTC.EncryptionConfig = + irisClientState.encryptionConfig.config; + let encryptionMode: EncryptionMode = AgoraTranslate.NATIVE_RTCENCRYPTION_MODE2EncryptionMode( + encryptionConfig.encryptionMode + ); + let salt: Uint8Array = new Uint8Array(encryptionConfig.encryptionKdfSalt); + this.agoraRTCClient.setEncryptionConfig( + encryptionMode, + encryptionConfig.encryptionKey, + salt + ); + //加密只有一次生效 + irisClientState.encryptionConfig.enabled = false; + } + + //是否开启了鉴黄 + if (irisClientState.contentInspect != null) { + this.agoraRTCClient + .enableContentInspect( + AgoraTranslate.NATIVE_RTCContentInspectConfig2InspectConfiguration( + irisClientState.contentInspect + ) + ) + .then(() => {}) + .catch(() => {}) + .finally(() => {}); + } + + //是否开启了cloudProxy + if (globalState.cloudProxy != null) { + let proxyType = globalState.cloudProxy; + if (proxyType == NATIVE_RTC.CLOUD_PROXY_TYPE.UDP_PROXY) { + this.agoraRTCClient.startProxyServer(3); + } else if (proxyType == NATIVE_RTC.CLOUD_PROXY_TYPE.TCP_PROXY) { + this.agoraRTCClient.startProxyServer(5); + } + } + + this.clientEventHandler = new IrisClientEventHandler(this, this._engine); + } + + addLocalAudioTrack(trackPackage: AudioTrackPackage) { + this.audioTrackPackages.push(trackPackage); + trackPackage.setIrisClient(this); + } + + removeLocalAudioTrack(trackPackage: AudioTrackPackage) { + for (let i = 0; i < this.audioTrackPackages.length; i++) { + let _trackPackage = this.audioTrackPackages[i]; + if (_trackPackage.track == trackPackage.track) { + this.audioTrackPackages.splice(i, 1); + i--; + break; + } + } + } + + setLocalVideoTrack(trackPackage: VideoTrackPackage) { + this.videoTrackPackage = trackPackage; + trackPackage.setIrisClient(this); + } + + clearLocalVideoTrack() { + this.videoTrackPackage = null; + } + + async release() { + //client event + if (this.clientEventHandler) { + this.clientEventHandler.release(); + } + + if (this.agoraRTCClient?.channelName) { + try { + await this.agoraRTCClient.leave(); + AgoraConsole.debug('client leave success'); + } catch (e) { + throw e; + } + } + + this.audioTrackPackages = []; + this.videoTrackPackage = null; + this.agoraRTCClient = null; + for ( + let i = 0; + i < this._engine.irisClientManager.remoteUserPackages.length; + i++ + ) { + let remoteUserPackage = this._engine.irisClientManager.remoteUserPackages[ + i + ]; + if ( + remoteUserPackage.connection?.channelId == this.connection?.channelId && + remoteUserPackage.connection?.localUid == this.connection?.localUid + ) { + this._engine.irisClientManager.remoteUserPackages.splice(i, 1); + i--; + } + } + this.connection = null; + //不删除通过engine.initialize创建的client + if (this._engine.irisClientManager.irisClientList[0]?.id !== this.id) { + this._engine.irisClientManager.irisClientList = this._engine.irisClientManager.irisClientList.filter( + (item) => item.id != this.id + ); + } + } +} diff --git a/packages/rtc/src/engine/IrisClientManager.ts b/packages/rtc/src/engine/IrisClientManager.ts new file mode 100644 index 0000000..52dd970 --- /dev/null +++ b/packages/rtc/src/engine/IrisClientManager.ts @@ -0,0 +1,608 @@ +import * as NATIVE_RTC from '@iris/native-rtc-binding'; +import { + IAgoraRTCClient, + IAgoraRTCRemoteUser, + IBufferSourceAudioTrack, + ILocalAudioTrack, + ILocalTrack, + ILocalVideoTrack, + IMicrophoneAudioTrack, + IRemoteAudioTrack, + IRemoteVideoTrack, + ITrack, + UID, +} from 'agora-rtc-sdk-ng'; + +import { + IRIS_VIDEO_PROCESS_ERR, + IrisAudioSourceType, + IrisVideoFrameBufferConfig, + VideoParams, +} from '../base/BaseType'; +import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler'; + +import { AgoraConsole } from '../util'; + +import { IrisClient } from './IrisClient'; +import { IrisClientObserver } from './IrisClientObserver'; +import { IrisRtcEngine } from './IrisRtcEngine'; + +export type WalkILocalVideoPackageTrackFun = (track: VideoTrackPackage) => void; + +export class RemoteUserPackage { + connection: NATIVE_RTC.RtcConnection; + element?: string; + uid?: UID; + videoSourceType?: NATIVE_RTC.VIDEO_SOURCE_TYPE; + audioSourceType?: IrisAudioSourceType; + + constructor( + connection: NATIVE_RTC.RtcConnection, + element?: string, + uid?: UID, + videoSourceType?: NATIVE_RTC.VIDEO_SOURCE_TYPE, + audioSourceType?: IrisAudioSourceType + ) { + this.connection = connection; + this.element = element; + this.uid = uid; + this.videoSourceType = videoSourceType; + this.audioSourceType = audioSourceType; + } + + update({ + element = this.element, + uid = this.uid, + videoSourceType = this.videoSourceType, + audioSourceType = this.audioSourceType, + }: { + element?: string; + uid?: UID; + videoSourceType?: NATIVE_RTC.VIDEO_SOURCE_TYPE; + audioSourceType?: IrisAudioSourceType; + }) { + this.element = element; + this.uid = uid; + this.videoSourceType = videoSourceType; + this.audioSourceType = audioSourceType; + } + + dispose() { + this.connection = null; + this.element = null; + this.uid = null; + this.videoSourceType = null; + this.audioSourceType = null; + } +} + +export class VideoTrackPackage { + element?: string; + type?: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE; + track?: ILocalVideoTrack | IRemoteVideoTrack; + isPreview: boolean = false; + irisClient: IrisClient; + + constructor( + element?: string, + type?: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE, + track?: ILocalVideoTrack | IRemoteVideoTrack + ) { + this.element = element; + this.type = type; + this.track = track; + } + + setPreview(isPreview: boolean) { + this.isPreview = isPreview; + } + + setIrisClient(irisClient: IrisClient) { + this.irisClient = irisClient; + } + + update({ + type = this.type, + track = this.track, + element = this.element, + }: { + type?: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE; + track?: ILocalVideoTrack | IRemoteVideoTrack; + element?: string; + }) { + this.element = element; + this.type = type; + this.track = track; + } + + dispose() { + this.element = null; + this.type = null; + this.isPreview = false; + try { + if (this.track) { + if (this.track.isPlaying) { + this.track.stop(); + } + if ((this.track as ILocalTrack).enabled) { + (this.track as ILocalTrack).close(); + } + } + } catch {} + this.track = null; + this.irisClient = null; + } +} + +export class AudioTrackPackage { + type: IrisAudioSourceType; + track: + | ILocalAudioTrack + | IRemoteAudioTrack + | IMicrophoneAudioTrack + | ILocalTrack; + irisClient: IrisClient; + + constructor( + type?: IrisAudioSourceType, + track?: ILocalAudioTrack | IRemoteAudioTrack + ) { + this.type = type; + this.track = track; + } + + setIrisClient(irisClient: IrisClient) { + this.irisClient = irisClient; + } + + update({ + type = this.type, + track = this.track, + }: { + type?: IrisAudioSourceType; + track?: + | ILocalAudioTrack + | IRemoteAudioTrack + | IMicrophoneAudioTrack + | ILocalTrack; + }) { + this.type = type; + this.track = track; + } + + dispose() { + this.type = null; + try { + if (this.track) { + if (this.track.isPlaying) { + this.track.stop(); + } + (this.track as ILocalTrack).close(); + } + } catch {} + this.irisClient = null; + this.track = null; + } +} + +export class BufferSourceAudioTrackPackage extends AudioTrackPackage { + soundId: number; + type: IrisAudioSourceType; + track: IBufferSourceAudioTrack; + + constructor( + type?: IrisAudioSourceType, + track?: IBufferSourceAudioTrack, + soundId?: number + ) { + super(); + this.type = type; + this.track = track; + this.soundId = soundId; + } +} + +export type MultiAudioTrackPackage = + | AudioTrackPackage + | BufferSourceAudioTrackPackage; + +export type TrackPackage = + | AudioTrackPackage + | BufferSourceAudioTrackPackage + | VideoTrackPackage; + +// 存放一堆东西的 +export class IrisClientManager { + private _engine: IrisRtcEngine = null; + + irisClientList: IrisClient[] = []; + localVideoTrackPackages: VideoTrackPackage[] = []; + localAudioTrackPackages: MultiAudioTrackPackage[] = []; + irisClientObserver: IrisClientObserver; + trackEventHandlers: Array = new Array< + IrisTrackEventHandler + >(); + + public remoteUserPackages: Array = new Array< + RemoteUserPackage + >(); + + constructor(engine: IrisRtcEngine) { + this._engine = engine; + this.irisClientObserver = new IrisClientObserver(engine); + } + + addLocalVideoTrackPackage(videoTrackPackage: VideoTrackPackage) { + this.localVideoTrackPackages.push(videoTrackPackage); + this.irisClientObserver.addVideoTrackPackageObserver(videoTrackPackage); + } + + removeLocalVideoTrackPackage(videoTrackPackage: VideoTrackPackage) { + for (let i = 0; i < this.localVideoTrackPackages.length; i++) { + let trackPackage = this.localVideoTrackPackages[i]; + if ( + trackPackage.track == videoTrackPackage.track && + trackPackage.type == trackPackage.type + ) { + this.localVideoTrackPackages.splice(i, 1); + i--; + this.irisClientObserver.removeVideoTrackPackageObserver( + videoTrackPackage + ); + videoTrackPackage.dispose(); + break; + } + } + } + + getLocalVideoTrackPackageBySourceType( + sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.VIDEO_SOURCE_TYPE[] + ): VideoTrackPackage[] { + return this.localVideoTrackPackages.filter((trackPackage) => { + if (Array.isArray(sourceType)) { + for (let type of sourceType) { + if (trackPackage.type == type) { + return true; + } + } + } else { + return trackPackage.type == sourceType; + } + }); + } + + addLocalAudioTrackPackage(audioTrackPackage: MultiAudioTrackPackage) { + this.localAudioTrackPackages.push(audioTrackPackage); + this.irisClientObserver.addAudioTrackPackageObserver(audioTrackPackage); + } + + getLocalAudioTrackPackageBySourceType( + sourceType: IrisAudioSourceType | IrisAudioSourceType[] + ): MultiAudioTrackPackage[] { + return this.localAudioTrackPackages.filter((trackPackage) => { + if (Array.isArray(sourceType)) { + for (let type of sourceType) { + if (trackPackage.type == type) { + return true; + } + } + } else { + return trackPackage.type == sourceType; + } + }); + } + + removeLocalAudioTrackPackage(audioTrackPackage: MultiAudioTrackPackage) { + for (let i = 0; i < this.localAudioTrackPackages.length; i++) { + let trackPackage = this.localAudioTrackPackages[i]; + if ( + trackPackage.track == audioTrackPackage.track && + trackPackage.type == trackPackage.type + ) { + this.localAudioTrackPackages.splice(i, 1); + i--; + this.irisClientObserver.removeAudioTrackPackageObserver( + audioTrackPackage + ); + audioTrackPackage.dispose(); + + break; + } + } + } + + getRemoteUserPackageByUid(uid: UID): RemoteUserPackage { + return this.remoteUserPackages.filter((remoteUserPackage) => { + return remoteUserPackage.uid == uid; + })[0]; + } + + addRemoteUserPackage(remoteUserPackage: RemoteUserPackage) { + this.remoteUserPackages.push(remoteUserPackage); + this.irisClientObserver.addRemoteUserPackageObserver(remoteUserPackage); + } + + removeRemoteUserPackage(uid: UID) { + for (let i = 0; i < this.remoteUserPackages.length; i++) { + let userPackage = this.remoteUserPackages[i]; + if (userPackage.uid == uid) { + this.remoteUserPackages.splice(i, 1); + i--; + this.irisClientObserver.removeRemoteUserPackageObserver(userPackage); + userPackage.dispose(); + + break; + } + } + } + + public getVideoFrame(uid: UID, channel_id: string): VideoParams { + this._engine.irisClientManager.irisClientList.map((irisClient) => { + //当存在于本地 + if ( + irisClient.agoraRTCClient.channelName == channel_id && + irisClient.agoraRTCClient.uid == uid + ) { + return { + video_track: irisClient.videoTrackPackage.track, + is_new_frame: true, //todo how to know is a new frame + process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, + }; + } else { + if (irisClient.agoraRTCClient?.channelName == channel_id) { + irisClient.agoraRTCClient.remoteUsers.map((remoteUser) => { + if ( + remoteUser.uid == uid && + remoteUser.hasVideo && + remoteUser.videoTrack + ) { + return { + video_track: remoteUser.videoTrack, + is_new_frame: true, //todo how to know is a new frame + process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, + }; + } + }); + } + } + }); + + return null; + } + + public getVideoFrameByConfig( + config: IrisVideoFrameBufferConfig + ): VideoParams { + let uid = config.id; + let channel_id = config.key; + let type = config.type; + + this._engine.irisClientManager.irisClientList.map((irisClient) => { + //当存在于本地 + if (irisClient.videoTrackPackage?.type == type) { + return { + video_track: irisClient.videoTrackPackage.track, + is_new_frame: true, //todo how to know is a new frame + process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, + }; + } else { + if (irisClient.agoraRTCClient?.channelName == channel_id) { + irisClient.agoraRTCClient.remoteUsers.map((remoteUser) => { + if ( + remoteUser.uid == uid && + remoteUser.hasVideo && + remoteUser.videoTrack + ) { + return { + video_track: remoteUser.videoTrack, + is_new_frame: true, //todo how to know is a new frame + process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, + }; + } + }); + } + } + }); + + return null; + } + + getIrisClient() { + if (this.irisClientList.length == 0) { + this._engine.irisRtcErrorHandler.notInitialized(); + } else { + return this.irisClientList[0]; + } + } + + getIrisClientByConnection( + connection: NATIVE_RTC.RtcConnection + ): IrisClient | null { + if (connection) { + return this.irisClientList.filter((irisClient: IrisClient) => { + if ( + irisClient.connection?.channelId == connection.channelId && + irisClient.connection?.localUid == connection.localUid + ) { + return irisClient; + } + })[0]; + } else { + return this.getIrisClient(); + } + } + + getScreenCaptureStatus(): boolean { + let result = false; + let videoTrackPackages = this.getLocalVideoTrackPackageBySourceType([ + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY, + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_THIRD, + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_FOURTH, + ]); + videoTrackPackages.map((videoTrackPackage) => { + if (videoTrackPackage.track) { + result = true; + return; + } + }); + return result; + } + + addTrackEventHandler(trackEventHandler: IrisTrackEventHandler) {} + + removeTrackEventHandlerByTrack(track: ITrack) { + for (let i = 0; i < this.trackEventHandlers.length; i++) { + let trackEventHandler = this.trackEventHandlers[i]; + if (trackEventHandler.getTrack() == track) { + trackEventHandler.release(); + this.trackEventHandlers.splice(i, 1); + i--; + break; + } + } + } + + removetrackEventHandlerByRemoteUser( + user: IAgoraRTCRemoteUser, + mediaType: 'audio' | 'video' | 'all' + ) { + this.trackEventHandlers = this.trackEventHandlers.filter( + (trackEventHandler: IrisTrackEventHandler) => { + if (trackEventHandler.getRemoteUser() != user) return true; + + if (mediaType == 'all') { + trackEventHandler.release(); + return false; + } + + if ( + mediaType == 'audio' && + trackEventHandler.getTrackType() == 'IRemoteTrack' + ) { + trackEventHandler.release(); + return false; + } + + if ( + mediaType == 'video' && + trackEventHandler.getTrackType() == 'IRemoteVideoTrack' + ) { + trackEventHandler.release(); + return false; + } + + return true; + } + ); + } + + async processBufferSourceAudioTrackClose( + bufferSourceAudioTrackPackage: BufferSourceAudioTrackPackage, + agoraRTCClient: IAgoraRTCClient + ) { + let track = bufferSourceAudioTrackPackage.track; + if (agoraRTCClient && agoraRTCClient.localTracks.indexOf(track) != -1) { + try { + await agoraRTCClient.unpublish(track); + AgoraConsole.log('unpublish success'); + } catch (e) { + this._engine.returnResult(false); + throw e; + } + } + + //删除完毕后进行stop,close + track.stopProcessAudioBuffer(); + track.close(); + + this.removeTrackEventHandlerByTrack(track); + } + + async processAudioTrackClose( + audioTrackPackage: AudioTrackPackage, + agoraRTCClient: IAgoraRTCClient + ) { + let audioTrack = audioTrackPackage.track as ILocalAudioTrack; + if ( + agoraRTCClient && + agoraRTCClient.localTracks.indexOf(audioTrack) != -1 + ) { + try { + await agoraRTCClient.unpublish(audioTrack); + AgoraConsole.log('unpublish success'); + } catch (e) { + this._engine.returnResult(false); + throw e; + } + } + //删除完毕后进行stop + if (audioTrack.isPlaying) { + this._engine.trackHelper.stop(audioTrack); + } + if (!audioTrack.muted) { + await this._engine.trackHelper.setEnabled(audioTrack, false); + } + this.removeTrackEventHandlerByTrack(audioTrack); + } + + async processVideoTrackClose( + videoTrackPackage: VideoTrackPackage, + agoraRTCClient: IAgoraRTCClient + ) { + let videoTrack = videoTrackPackage.track as ILocalVideoTrack; + if ( + agoraRTCClient && + agoraRTCClient.localTracks.indexOf(videoTrack) != -1 + ) { + try { + await agoraRTCClient.unpublish(videoTrack); + AgoraConsole.log('unpublish success'); + } catch (e) { + this._engine.returnResult(false); + throw e; + } + } + + //如果isPreview是false则停止播放以及设置为不可用 + if (!videoTrackPackage.isPreview) { + if (videoTrack.isPlaying) { + this._engine.trackHelper.stop(videoTrack); + } + if (!videoTrack.muted) { + await this._engine.trackHelper.setEnabled(videoTrack, false); + } + } + this.removeTrackEventHandlerByTrack(videoTrack); + } + + async release() { + this._engine.clearIrisInterval(); + //销毁iris html element + this._engine.irisElement.release(); + //释放所有 + + this.localVideoTrackPackages.map((trackPackage) => { + trackPackage.dispose(); + }); + this.localAudioTrackPackages.map((trackPackage) => { + trackPackage.dispose(); + }); + + for (let irisClient of this.irisClientList) { + await irisClient.release(); + } + + //trackEvent + this.trackEventHandlers.forEach((element) => { + element.release(); + }); + + //重置IrisClientManager状态 + this.irisClientList = []; + this.localAudioTrackPackages = []; + this.localVideoTrackPackages = []; + this.trackEventHandlers = []; + this.irisClientObserver.release(); + } +} diff --git a/packages/rtc/src/engine/IrisClientObserver.ts b/packages/rtc/src/engine/IrisClientObserver.ts new file mode 100644 index 0000000..7bf879b --- /dev/null +++ b/packages/rtc/src/engine/IrisClientObserver.ts @@ -0,0 +1,494 @@ +import * as NATIVE_RTC from '@iris/native-rtc-binding'; +import { ILocalTrack, IMicrophoneAudioTrack } from 'agora-rtc-sdk-ng'; + +import { IrisAudioSourceType } from '../base/BaseType'; +import { + IrisTrackEventHandler, + IrisTrackEventHandlerParam, +} from '../event_handler/IrisTrackEventHandler'; + +import { AgoraConsole } from '../util'; + +import { IrisClient } from './IrisClient'; +import { + AudioTrackPackage, + BufferSourceAudioTrackPackage, + RemoteUserPackage, + TrackPackage, + VideoTrackPackage, +} from './IrisClientManager'; +import { IrisRtcEngine } from './IrisRtcEngine'; + +export enum NotifyType { + 'PUBLISH_TRACK', + 'UNPUBLISH_TRACK', + 'ENABLE_TRACK', + 'UNABLE_TRACK', + 'UPDATE_TRACK', +} +export enum NotifyRemoteType { + 'SUBSCRIBE_VIDEO_TRACK', + 'SUBSCRIBE_AUDIO_TRACK', + 'UNSUBSCRIBE_VIDEO_TRACK', + 'UNSUBSCRIBE_AUDIO_TRACK', +} + +export class IrisClientObserver { + audioTrackPackageObservers: AudioTrackPackage[]; + videoTrackPackageObservers: VideoTrackPackage[]; + remoteUserPackageObservers: RemoteUserPackage[]; + _engine: IrisRtcEngine; + + constructor(engine: IrisRtcEngine) { + this.audioTrackPackageObservers = []; + this.videoTrackPackageObservers = []; + this.remoteUserPackageObservers = []; + this._engine = engine; + } + addAudioTrackPackageObserver(observer: AudioTrackPackage) { + this.audioTrackPackageObservers.push(observer); + } + addVideoTrackPackageObserver(observer: VideoTrackPackage) { + this.videoTrackPackageObservers.push(observer); + } + addRemoteUserPackageObserver(observer: RemoteUserPackage) { + this.remoteUserPackageObservers.push(observer); + } + removeRemoteUserPackageObserver(observer: RemoteUserPackage) { + this.remoteUserPackageObservers = this.remoteUserPackageObservers.filter( + (item) => item !== observer + ); + } + removeAudioTrackPackageObserver(observer: AudioTrackPackage) { + this.audioTrackPackageObservers = this.audioTrackPackageObservers.filter( + (item) => item !== observer + ); + } + removeVideoTrackPackageObserver(observer: VideoTrackPackage) { + this.videoTrackPackageObservers = this.videoTrackPackageObservers.filter( + (item) => item !== observer + ); + } + + //根据每个irisClient的options,分配对应的轨道,如果irisClient的agoraRTCClient已经加入频道,则发布轨道 + async publishTrack(trackPackage: TrackPackage, irisClientList: IrisClient[]) { + let publishTrack: ILocalTrack; + let globalState = this._engine.globalState; + for (let irisClient of irisClientList) { + let options = irisClient.irisClientState; + if (globalState.enabledAudio && globalState.enabledLocalAudio) { + if (options.publishMicrophoneTrack) { + if ( + trackPackage.track && + (trackPackage.type === + IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary || + trackPackage.type === + IrisAudioSourceType.kAudioSourceTypeMicrophoneSecondary) + ) { + this._engine.trackHelper.setMuted( + trackPackage.track as IMicrophoneAudioTrack, + false + ); + publishTrack = trackPackage.track as ILocalTrack; + irisClient.addLocalAudioTrack(trackPackage); + } + } + if (options.publishScreenCaptureAudio) { + if ( + trackPackage.track && + trackPackage.type === + IrisAudioSourceType.kAudioSourceTypeScreenCapture + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.addLocalAudioTrack(trackPackage); + } + } + } + if (globalState.enabledVideo && globalState.enabledLocalVideo) { + if (options.publishScreenCaptureVideo) { + if (options.publishScreenTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishSecondaryScreenTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishThirdScreenTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_THIRD + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishFourthScreenTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_FOURTH + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + } + if (options.publishCameraTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishSecondaryCameraTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishThirdCameraTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_THIRD + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishFourthCameraTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_FOURTH + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + if (options.publishCustomVideoTrack) { + if ( + trackPackage.track && + trackPackage.type === + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM + ) { + publishTrack = trackPackage.track as ILocalTrack; + irisClient.setLocalVideoTrack(trackPackage); + } + } + } + + //发布轨道必须保证该client的options满足条件,并且client已经加入频道,并且该轨道没有被发布过 + if (irisClient.agoraRTCClient?.channelName) { + for (let i = 0; i < irisClient.agoraRTCClient.localTracks.length; i++) { + let localTrack = irisClient.agoraRTCClient.localTracks[i]; + if (localTrack === publishTrack) { + publishTrack = null; + } + } + } else { + publishTrack = null; + } + if (publishTrack) { + if (!publishTrack.enabled) { + await this._engine.trackHelper.setEnabled(publishTrack, true); + } + try { + AgoraConsole.debug(`publishTrack ${publishTrack}`); + await irisClient.agoraRTCClient.publish(publishTrack); + } catch (reason) { + AgoraConsole.error(reason); + } + } + } + } + + async enableTrack(trackPackage: TrackPackage) { + let track = trackPackage.track as ILocalTrack; + if (!track?.enabled) { + await this._engine.trackHelper.setEnabled( + trackPackage.track as ILocalTrack, + true + ); + } + } + + async unableTrack(trackPackage: TrackPackage) { + let track = trackPackage.track as ILocalTrack; + if (track?.enabled) { + await this._engine.trackHelper.setEnabled( + trackPackage.track as ILocalTrack, + false + ); + } + } + + async stopTrack(trackPackage: TrackPackage) { + let irisClientManager = this._engine.irisClientManager; + try { + if (!trackPackage.track) { + return; + } + + AgoraConsole.debug(`stopTrack ${trackPackage.track}`); + //还没有分配给对应的irisClient时,track会放到engine.initialize创建的client + let irisClient = trackPackage.irisClient; + if (!trackPackage.irisClient) { + irisClient = irisClientManager.irisClientList[0]; + } + if (this._engine.implHelper.isAudio(trackPackage.type)) { + await irisClientManager.processAudioTrackClose( + trackPackage as AudioTrackPackage, + irisClient.agoraRTCClient + ); + if ( + trackPackage.type === + IrisAudioSourceType.kAudioSourceTypeScreenCapture + ) { + this._engine.rtcEngineEventHandler.onLocalAudioStateChanged( + NATIVE_RTC.LOCAL_AUDIO_STREAM_STATE + .LOCAL_AUDIO_STREAM_STATE_STOPPED, + 0 + ); + irisClientManager.removeLocalAudioTrackPackage(trackPackage); + irisClient.removeLocalAudioTrack(trackPackage); + } + } else if ( + IrisAudioSourceType.kAudioSourceTypeBufferSourceAudio === + trackPackage.type + ) { + await irisClientManager.processBufferSourceAudioTrackClose( + trackPackage as BufferSourceAudioTrackPackage, + irisClient.agoraRTCClient + ); + irisClient.removeLocalAudioTrack(trackPackage); + irisClientManager.removeLocalAudioTrackPackage(trackPackage); + } else if (this._engine.implHelper.isVideoCamera(trackPackage.type)) { + await irisClientManager.processVideoTrackClose( + trackPackage as VideoTrackPackage, + irisClient?.agoraRTCClient + ); + } else if (this._engine.implHelper.isScreenCapture(trackPackage.type)) { + await irisClientManager.processVideoTrackClose( + trackPackage as VideoTrackPackage, + irisClient?.agoraRTCClient + ); + this._engine.rtcEngineEventHandler.onLocalVideoStateChanged( + trackPackage.type as NATIVE_RTC.VIDEO_SOURCE_TYPE, + NATIVE_RTC.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_STOPPED, + 0 + ); + irisClientManager.removeLocalVideoTrackPackage( + trackPackage as VideoTrackPackage + ); + irisClient.clearLocalVideoTrack(); + } else { + } + } catch (reason) { + AgoraConsole.error(reason); + throw reason; + } + } + + async updateTrack(trackPackage: TrackPackage) {} + + async notifyLocal( + type: NotifyType, + scopePackages: TrackPackage[], + irisClientList?: IrisClient[] + ) { + for (let scopePackage of scopePackages) { + switch (type) { + case NotifyType.PUBLISH_TRACK: + if (scopePackage) { + await this.publishTrack(scopePackage, irisClientList); + } + break; + case NotifyType.ENABLE_TRACK: + if (scopePackage) { + await this.enableTrack(scopePackage); + } + break; + case NotifyType.UNABLE_TRACK: + if (scopePackage) { + await this.unableTrack(scopePackage); + } + break; + + case NotifyType.UNPUBLISH_TRACK: + if (scopePackage) { + await this.stopTrack(scopePackage); + } + break; + case NotifyType.UPDATE_TRACK: + if (scopePackage) { + await this.updateTrack(scopePackage); + } + break; + } + } + } + + subscribeVideoTrack(userPackage: RemoteUserPackage) { + let irisClient = this._engine.irisClientManager.getIrisClientByConnection( + userPackage.connection + ); + if (!irisClient) { + return; + } + let autoSubscribeVideo: boolean = + irisClient.irisClientState.autoSubscribeVideo; + let enableVideo: boolean = this._engine.globalState.enabledVideo; + if (enableVideo && autoSubscribeVideo && irisClient.agoraRTCClient) { + let user = irisClient.agoraRTCClient.remoteUsers.find( + (item) => item.uid === userPackage.uid + ); + if (!user || !user.hasVideo) { + return; + } + irisClient.agoraRTCClient.subscribe(user, 'video').then(() => { + AgoraConsole.debug('onEventUserPublished subscribe video success'); + if (userPackage.element) { + this._engine.trackHelper.play(user.videoTrack, userPackage.element); + } + let param: IrisTrackEventHandlerParam = { + channelName: irisClient.agoraRTCClient.channelName, + client: irisClient.agoraRTCClient, + remoteUser: user, + track: user.videoTrack, + trackType: 'IRemoteVideoTrack', + }; + let trackEventHandler = new IrisTrackEventHandler(param, this._engine); + this._engine.irisClientManager.addTrackEventHandler(trackEventHandler); + }); + } + } + subscribeAudioTrack(userPackage: RemoteUserPackage) { + let irisClient = this._engine.irisClientManager.getIrisClientByConnection( + userPackage.connection + ); + if (!irisClient) { + return; + } + let autoSubscribeAudio: boolean = + irisClient.irisClientState.autoSubscribeAudio; + let enableAudio: boolean = this._engine.globalState.enabledAudio; + if (enableAudio && autoSubscribeAudio && irisClient.agoraRTCClient) { + let user = irisClient.agoraRTCClient.remoteUsers.find( + (item) => item.uid === userPackage.uid + ); + if (!user || !user.hasAudio) { + return; + } + irisClient.agoraRTCClient.subscribe(user, 'audio').then(() => { + AgoraConsole.debug('onEventUserPublished subscribe audio success'); + this._engine.trackHelper.play(user.audioTrack); + let param: IrisTrackEventHandlerParam = { + channelName: irisClient.agoraRTCClient.channelName, + client: irisClient.agoraRTCClient, + remoteUser: user, + track: user.audioTrack, + trackType: 'IRemoteTrack', + }; + let trackEventHandler = new IrisTrackEventHandler(param, this._engine); + this._engine.irisClientManager.addTrackEventHandler(trackEventHandler); + }); + } + } + + unsubscribeVideoTrack(userPackage: RemoteUserPackage) { + let irisClient = this._engine.irisClientManager.getIrisClientByConnection( + userPackage.connection + ); + if (irisClient?.agoraRTCClient) { + let user = irisClient.agoraRTCClient.remoteUsers.find( + (item) => item.uid === userPackage.uid + ); + if (!user || !user.videoTrack) { + return; + } + irisClient.agoraRTCClient.unsubscribe(user, 'video').then(() => { + AgoraConsole.debug('onEventUserPublished unsubscribe video success'); + this._engine.irisClientManager.removetrackEventHandlerByRemoteUser( + user, + 'video' + ); + }); + } + } + + unsubscribeAudioTrack(userPackage: RemoteUserPackage) { + let irisClient = this._engine.irisClientManager.getIrisClientByConnection( + userPackage.connection + ); + if (irisClient?.agoraRTCClient) { + let user = irisClient.agoraRTCClient.remoteUsers.find( + (item) => item.uid === userPackage.uid + ); + if (!user || !user.videoTrack) { + return; + } + irisClient.agoraRTCClient.unsubscribe(user, 'audio').then(() => { + AgoraConsole.debug('onEventUserPublished unsubscribe audio success'); + this._engine.irisClientManager.removetrackEventHandlerByRemoteUser( + user, + 'audio' + ); + }); + } + } + + notifyRemote(type: NotifyRemoteType, scopePackages: RemoteUserPackage[]) { + for (let scopePackage of scopePackages) { + switch (type) { + case NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK: + if (scopePackage) { + this.subscribeVideoTrack(scopePackage); + } + break; + case NotifyRemoteType.SUBSCRIBE_AUDIO_TRACK: + if (scopePackage) { + this.subscribeAudioTrack(scopePackage); + } + break; + case NotifyRemoteType.UNSUBSCRIBE_AUDIO_TRACK: + if (scopePackage) { + this.unsubscribeAudioTrack(scopePackage); + } + break; + case NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK: + if (scopePackage) { + this.unsubscribeVideoTrack(scopePackage); + } + break; + } + } + } + + release() { + this.audioTrackPackageObservers = []; + this.videoTrackPackageObservers = []; + this.remoteUserPackageObservers = []; + } +} diff --git a/packages/rtc/src/engine/IrisEntitiesContainer.ts b/packages/rtc/src/engine/IrisEntitiesContainer.ts deleted file mode 100644 index e7e7a0b..0000000 --- a/packages/rtc/src/engine/IrisEntitiesContainer.ts +++ /dev/null @@ -1,1269 +0,0 @@ -import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { - IAgoraRTCClient, - IAgoraRTCRemoteUser, - IBufferSourceAudioTrack, - ILocalAudioTrack, - ILocalVideoTrack, - ITrack, - UID, -} from 'agora-rtc-sdk-ng'; - -import { CallIrisApiResult } from 'iris-web-core'; - -import { - AudioTrackPackage, - BufferSourceAudioTrackPackage, - IRIS_VIDEO_PROCESS_ERR, - IrisAudioSourceType, - IrisVideoFrameBufferConfig, - VideoParams, - VideoTrackPackage, - VideoViewHolder, -} from '../base/BaseType'; -import { IrisClientEventHandler } from '../event_handler/IrisClientEventHandler'; -import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler'; -import { AgoraConsole } from '../util/AgoraConsole'; -import { AgoraTool } from '../util/AgoraTool'; -import { Container } from '../util/Container'; - -import { IrisRtcEngine } from './IrisRtcEngine'; - -export type WalkILocalVideoPackageTrackFun = (track: VideoTrackPackage) => void; - -//存放一堆东西的 -export class IrisEntitiesContainer { - private _engine: IrisRtcEngine = null; - - //mainClient - private _mainClient: IAgoraRTCClient = null; - private _mainClientEventHandler: IrisClientEventHandler = null; - private _mainClientLocalAudioTracks: Array = new Array< - AudioTrackPackage - >(); - private _mainClientLocalBufferSourceAudioTracks: Array< - BufferSourceAudioTrackPackage - > = new Array(); - private _mainClientLocalVideoTrack: VideoTrackPackage = null; - private _mainClientTrackEventHandlers: Array< - IrisTrackEventHandler - > = new Array(); - - //all local tracks - private _localBufferSourceAudioTracks: Array< - BufferSourceAudioTrackPackage - > = new Array(); - private _localAudioTracks: Array = new Array< - AudioTrackPackage - >(); - private _localVideoTracks: Array = new Array< - VideoTrackPackage - >(); - private _remoteVideoViewHolders: Array = new Array< - VideoViewHolder - >(); - - //subClient - private _subClients: Container = new Container< - IAgoraRTCClient - >(); - private _subClientEventHandlers: Container< - IrisClientEventHandler - > = new Container(); - private _subClientAudioTracks: Container< - Array - > = new Container>(); - private _subClientVideoTracks: Container = new Container< - VideoTrackPackage - >(); - private _subClientTrackEventHandlers: Container< - Array - > = new Container>(); - - //remoteUser 这个地方有问题,不同client的remoterUser要分开存,不然会出现 - //A, B 先后加入频道1。然后频道中C,D,E加入。此时B离开频道了。导致A应该观察到的C,D,E被删除了。 - //算了,自己不处理了,自己去IAgoraRTCClient里找吧 - // _remoteUsers: Container = new Container(); - - constructor(engine: IrisRtcEngine) { - this._engine = engine; - } - - // getRemoteUser(connection: NATIVE_RTC.RtcConnection): IAgoraRTCRemoteUser { - // return this._remoteUsers.getT(connection.channelId, connection.localUid); - // } - - // addRemoteUser(connection: NATIVE_RTC.RtcConnection, remoteUser: IAgoraRTCRemoteUser) { - // this._remoteUsers.addT(connection.channelId, connection.localUid, remoteUser); - // } - - getAllRemoteUsers(): Array { - let ret: Array = []; - if (this._mainClient && this._mainClient.channelName) { - AgoraTool.mergeArray(ret, this._mainClient.remoteUsers); - } - - this._subClients.walkT((channel_id, uid, client) => { - AgoraTool.mergeArray(ret, client.remoteUsers); - }); - - return ret; - } - - //这里返回一个数组,是可能我方用A,B,C 同时加入频道1,然后D,E加入。会有三个相同Uid的 remoteUser - getMainClientRemoteUserByUid(uid: UID): IAgoraRTCRemoteUser { - if (this._mainClient && this._mainClient.channelName) { - let remoteUsers = this._mainClient.remoteUsers; - for (let i = 0; i < remoteUsers.length; i++) { - if (remoteUsers[i].uid == uid) { - return remoteUsers[i]; - } - } - } - return null; - } - - getSubClientRemoteUserByUid(uid: UID, connection: NATIVE_RTC.RtcConnection) { - let subClient = this._subClients.getT( - connection.channelId, - connection.localUid - ); - if (subClient) { - let remoteUsers = subClient.remoteUsers; - for (let i = 0; i < remoteUsers.length; i++) { - if (remoteUsers[i].uid == uid) { - return remoteUsers[i]; - } - } - } - return null; - } - - getAllRemoteUserByUid(uid: UID): Array { - let ret: Array = []; - - if (this._mainClient && this._mainClient.channelName) { - let remoteUsers = this._mainClient.remoteUsers; - for (let remoteUser of remoteUsers) { - if (remoteUser.uid == uid) { - ret.push(remoteUser); - } - } - } - - this._subClients.walkT((channel_id, unuseUid, subClient) => { - let remoteUsers = subClient.remoteUsers; - for (let remoteUser of remoteUsers) { - if (remoteUser.uid == uid) { - ret.push(remoteUser); - } - } - }); - - return ret; - } - - // getRemoteUserByChannelName(channelName: string): Map { - // return this._remoteUsers.getTs(channelName); - // } - - //从数组中移除远端用户,并且如果当前轨道监听中有属于这个远端用户的轨道,也一起移除掉。 - removeRemoteUserAndClearTrackEvent( - connection: NATIVE_RTC.RtcConnection, - user: IAgoraRTCRemoteUser - ) { - // let userInContainer = this._remoteUsers.getT(connection.channelId, connection.localUid); - // if (userInContainer == user) { - // this._remoteUsers.removeT(connection.channelId, connection.localUid); - // } - - this._mainClientTrackEventHandlers.filter( - (trackEvent: IrisTrackEventHandler) => { - if (trackEvent.getRemoteUser() == user) { - trackEvent.destruction(); - return false; - } - return true; - } - ); - - let subClientTrackEventHandlers = this._subClientTrackEventHandlers.getT( - connection.channelId, - connection.localUid - ); - subClientTrackEventHandlers && - subClientTrackEventHandlers.filter( - (trackEvent: IrisTrackEventHandler) => { - if (trackEvent.getRemoteUser() == user) { - trackEvent.destruction(); - return false; - } - return true; - } - ); - } - - addLocalVideoTrack(trackPackage: VideoTrackPackage) { - let item = this._localVideoTracks.find((value) => { - return value.type == trackPackage.type; - }); - - // Update the exist one - if (item) { - if (trackPackage.element) { - item.element = trackPackage.element; - } - if (trackPackage.track) { - item.track = trackPackage.track; - } - if (trackPackage.type) { - item.type = trackPackage.type; - } - console.log(`localVideoTrack updated: ${JSON.stringify(item)}`); - - return; - } - - console.log(`addLocalVideoTrack add new: ${JSON.stringify(trackPackage)}`); - - this._localVideoTracks.push(trackPackage); - } - - getLocalVideoTrackByType( - type: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE - ): VideoTrackPackage { - for (let trackPack of this._localVideoTracks) { - if (trackPack.type == type && trackPack.track) { - return trackPack; - } - } - return null; - } - - removeLocalVideoTrack(trackPackage: VideoTrackPackage) { - for (let i = 0; i < this._localVideoTracks.length; i++) { - let trackPack = this._localVideoTracks[i]; - if (trackPack == trackPackage) { - this._localVideoTracks.splice(i, 1); - break; - } - } - } - - removeLocalVideoTrackByTrack(track: ILocalVideoTrack) { - for (let i = 0; i < this._localVideoTracks.length; i++) { - let trackPack = this._localVideoTracks[i]; - if (trackPack.track == track) { - this._localVideoTracks.splice(i, 1); - break; - } - } - } - - removeLocalVideoTrackByType(type: NATIVE_RTC.VIDEO_SOURCE_TYPE) { - for (let i = 0; i < this._localVideoTracks.length; i++) { - let trackPack = this._localVideoTracks[i]; - if (trackPack.type == type) { - let track: ILocalVideoTrack = trackPack.track as ILocalVideoTrack; - this._localVideoTracks.splice(i, 1); - break; - } - } - } - - async clearLocalVideoTracks(closeTrack: boolean) { - if (closeTrack) { - for (let i = 0; i < this._localVideoTracks.length; i++) { - let trackPack = this._localVideoTracks[i]; - let track = trackPack.track as ILocalVideoTrack; - AgoraConsole.debug( - 'clearLocalVideoTracks clearLocalVideoTracks clearLocalVideoTracks' - ); - if (track) { - track.stop(); - await track.setEnabled(false); - track.close(); - } - } - } - this._localVideoTracks = []; - } - - addLocalBufferSourceAudioTrack(trackPackage: BufferSourceAudioTrackPackage) { - this._localBufferSourceAudioTracks.push(trackPackage); - } - - getLocalBufferSourceAudioTrackBySoundId( - soundId: number - ): BufferSourceAudioTrackPackage { - for (let trackPack of this._localBufferSourceAudioTracks) { - if (trackPack.soundId == soundId) { - return trackPack; - } - } - return null; - } - - getLocalBufferSourceAudioTrackSoundIdByTrack( - track: IBufferSourceAudioTrack - ): number { - for (let trackPack of this._localBufferSourceAudioTracks) { - if (trackPack.track == track) { - return trackPack.soundId; - } - } - return null; - } - - removeLocalBufferSourceAudioTrackBySoundId(soundId: number) { - for (let i = 0; i < this._localBufferSourceAudioTracks.length; i++) { - let trackPack = this._localBufferSourceAudioTracks[i]; - if (trackPack.soundId == soundId) { - this._localBufferSourceAudioTracks.splice(i, 1); - break; - } - } - } - - removeLocalBufferSourceAudioTrackByTrack(track: IBufferSourceAudioTrack) { - for (let i = 0; i < this._localBufferSourceAudioTracks.length; i++) { - let trackPack = this._localBufferSourceAudioTracks[i]; - if (trackPack.track == track) { - this._localBufferSourceAudioTracks.splice(i, 1); - break; - } - } - } - - addMainClientLocalBufferSourceAudioTrack( - trackPackage: BufferSourceAudioTrackPackage - ) { - this._mainClientLocalBufferSourceAudioTracks.push(trackPackage); - } - - removeMainClientLocalBufferSourceAudioTrack(track: IBufferSourceAudioTrack) { - for ( - let i = 0; - i < this._mainClientLocalBufferSourceAudioTracks.length; - i++ - ) { - let trackPackage = this._mainClientLocalBufferSourceAudioTracks[i]; - if (trackPackage.track == track) { - this._mainClientLocalBufferSourceAudioTracks.splice(i, 1); - break; - } - } - } - - addLocalAudioTrack(trackPackage: AudioTrackPackage) { - this._localAudioTracks.push(trackPackage); - } - - getLocalAudioTrackByType(type: IrisAudioSourceType): AudioTrackPackage { - for (let trackPack of this._localAudioTracks) { - if (trackPack.type == type) { - return trackPack; - } - } - return null; - } - - removeLocalAudioTrackByTrack(track: ILocalAudioTrack) { - for (let i = 0; i < this._localAudioTracks.length; i++) { - let trackPack = this._localAudioTracks[i]; - if (trackPack.track == track) { - this._localAudioTracks.splice(i, 1); - break; - } - } - } - - removeLocalAudioTrackByType(type: IrisAudioSourceType) { - for (let i = 0; i < this._localAudioTracks.length; i++) { - let trackPack = this._localAudioTracks[i]; - if (trackPack.type == type) { - this._localAudioTracks.splice(i, 1); - break; - } - } - } - - getLocalVideoTracks(): Array { - return this._localVideoTracks; - } - - getRemoteVideoViewHolders(): Array { - return this._remoteVideoViewHolders; - } - - addOrUpdateRemoteVideoViewHolder(viewHolder: VideoViewHolder) { - let item = this._remoteVideoViewHolders.find((value) => { - return ( - value.uid == viewHolder.uid && - value.channelId == viewHolder.channelId && - value.type == viewHolder.type - ); - }); - - // Update the exist one - if (item) { - console.log( - `addOrUpdateRemoteVideoViewHolder add to item: ${JSON.stringify(item)}` - ); - if (viewHolder.element) { - item.element = viewHolder.element; - } - - if (viewHolder.type) { - item.type = viewHolder.type; - } - - if (viewHolder.channelId) { - item.channelId = viewHolder.channelId; - } - - if (viewHolder.uid) { - item.uid = viewHolder.uid; - } - - return; - } - - console.log( - `addOrUpdateRemoteVideoViewHolder add to item new: ${JSON.stringify( - viewHolder - )}` - ); - - this._remoteVideoViewHolders.push(viewHolder); - } - - getLocalAudioTracks(): Array { - return this._localAudioTracks; - } - - async clearLocalAudioTracks(closeTrack: boolean) { - for (let i = 0; i < this._localAudioTracks.length; i++) { - let trackPack = this._localAudioTracks[i]; - let track = trackPack.track as ILocalAudioTrack; - await track.setEnabled(false); - track.close(); - } - this._localAudioTracks = []; - } - - addMainClientLocalAudioTrack(trackPackage: AudioTrackPackage) { - this._mainClientLocalAudioTracks.push(trackPackage); - } - - removeMainClientLocalAudioTrack(track: ILocalAudioTrack) { - for (let i = 0; i < this._mainClientLocalAudioTracks.length; i++) { - let trackPackage = this._mainClientLocalAudioTracks[i]; - if (trackPackage.track == track) { - this._mainClientLocalAudioTracks.splice(i, 1); - break; - } - } - } - - setMainClientLocalVideoTrack(trackPack: VideoTrackPackage) { - this._mainClientLocalVideoTrack = trackPack; - } - - clearMainClientLocalVideoTrack() { - this._mainClientLocalVideoTrack = null; - } - - walkAllILocalVideoTrack(fun: WalkILocalVideoPackageTrackFun) { - if (this._mainClientLocalVideoTrack) fun(this._mainClientLocalVideoTrack); - - this._subClientVideoTracks.walkT( - (channelId: string, uid: UID, trackPack: VideoTrackPackage) => { - fun(trackPack); - } - ); - - for (let trackPack of this._localVideoTracks) { - fun(trackPack); - } - } - - addSubClientLocalAudioTrack( - connection: NATIVE_RTC.RtcConnection, - trackPackage: AudioTrackPackage - ) { - let array = this._subClientAudioTracks.getT( - connection.channelId, - connection.localUid - ); - if (array == null) { - array = []; - this._subClientAudioTracks.addT( - connection.channelId, - connection.localUid, - array - ); - } - - array.push(trackPackage); - } - - removeSubClientLocalAudioTrack( - connection: NATIVE_RTC.RtcConnection, - track: ILocalAudioTrack - ) { - let array = this._subClientAudioTracks.getT( - connection.channelId, - connection.localUid - ); - - if (array == null) return; - - for (let i = 0; i < array.length; i++) { - let trackPackage = array[i]; - if (trackPackage.track == track) { - array.splice(i, 1); - break; - } - } - } - - setSubClientLocalVideoTrack( - connection: NATIVE_RTC.RtcConnection, - trackPack: VideoTrackPackage - ) { - this._subClientVideoTracks.addT( - connection.channelId, - connection.localUid, - trackPack - ); - } - - clearSubClientLocalVideoTrack(connection: NATIVE_RTC.RtcConnection) { - this._subClientVideoTracks.removeT( - connection.channelId, - connection.localUid - ); - } - - public getVideoFrame(uid: UID, channel_id: string): VideoParams { - if (uid == 0) { - if (this._mainClientLocalVideoTrack) { - return { - video_track: this._mainClientLocalVideoTrack.track, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - - if (this._localVideoTracks.length > 0) { - let frameData = this._localVideoTracks[0].track.getCurrentFrameData(); - return { - video_track: this._localVideoTracks[0].track, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - - return null; - } else { - //是否是子账户的video - let subVideoTrack = this._subClientVideoTracks.getT(channel_id, uid); - if (subVideoTrack) { - return { - video_track: subVideoTrack.track, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - - //是否是主账户的远端用户 - if (this._mainClient && this._mainClient.channelName == channel_id) { - for (let remoteUser of this._mainClient.remoteUsers) { - if ( - remoteUser.uid == uid && - remoteUser.hasVideo && - remoteUser.videoTrack - ) { - return { - video_track: remoteUser.videoTrack, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - } - } - - //是否是子账户的远端用户 - let subClients = this._subClients.getTs(channel_id); - if (subClients) { - for (let e of subClients) { - let subClient = e[1]; - for (let remoteUser of subClient.remoteUsers) { - if ( - remoteUser.uid == uid && - remoteUser.hasVideo && - remoteUser.videoTrack - ) { - return { - video_track: remoteUser.videoTrack, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - } - } - } - - return null; - } - } - - public getVideoFrameByConfig( - config: IrisVideoFrameBufferConfig - ): VideoParams { - let uid = config.id; - let channel_id = config.key; - let type = config.type; - if (uid == 0) { - if ( - this._mainClientLocalVideoTrack && - this._mainClientLocalVideoTrack.type == type - ) { - return { - video_track: this._mainClientLocalVideoTrack.track, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } else if (this._localVideoTracks.length > 0) { - for (let trackPackage of this._localVideoTracks) { - if (trackPackage.type == type) { - return { - video_track: trackPackage.track, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - } - } else { - return null; - } - } else { - //是否是子账号的视频流 - let subVideoTrack = this._subClientVideoTracks.getT(channel_id, uid); - if (subVideoTrack && subVideoTrack.type == type) { - return { - video_track: subVideoTrack.track, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - - //是否是主账户的远端用户 - if (this._mainClient && this._mainClient.channelName == channel_id) { - for (let remoteUser of this._mainClient.remoteUsers) { - if ( - remoteUser.uid == uid && - remoteUser.hasVideo && - remoteUser.videoTrack - ) { - return { - video_track: remoteUser.videoTrack, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - } - } - - //是否是子账户的远端用户 - let subClients = this._subClients.getTs(channel_id); - if (subClients) { - for (let e of subClients) { - let subClient = e[1]; - for (let remoteUser of subClient.remoteUsers) { - if ( - remoteUser.uid == uid && - remoteUser.hasVideo && - remoteUser.videoTrack - ) { - return { - video_track: remoteUser.videoTrack, - is_new_frame: true, //todo how to know is a new frame - process_err: IRIS_VIDEO_PROCESS_ERR.ERR_OK, - }; - } - } - } - } - - return null; - } - } - - setMainClient(mainClient: IAgoraRTCClient) { - this._mainClient = mainClient; - } - - getMainClient(): IAgoraRTCClient { - return this._mainClient; - } - - setMainClientEventHandler(eventHandler: IrisClientEventHandler) { - this._mainClientEventHandler = eventHandler; - } - - getMainClientEventHandler(): IrisClientEventHandler { - return this._mainClientEventHandler; - } - - addMainClientTrackEventHandler(trackEventHandler: IrisTrackEventHandler) { - this._mainClientTrackEventHandlers.push(trackEventHandler); - } - - removeMainClientTrackEventHandlerByTrack(track: ITrack) { - for (let i = 0; i < this._mainClientTrackEventHandlers.length; i++) { - let trackEventHander = this._mainClientTrackEventHandlers[i]; - if (trackEventHander.getTrack() == track) { - trackEventHander.destruction(); - this._mainClientTrackEventHandlers.splice(i, 1); - break; - } - } - } - - removeMainClientTrackEventHandlerByRemoteUser( - user: IAgoraRTCRemoteUser, - mediaType: 'audio' | 'video' | 'all' - ) { - this._mainClientTrackEventHandlers = this._mainClientTrackEventHandlers.filter( - (trackEventHander: IrisTrackEventHandler) => { - if (trackEventHander.getRemoteUser() != user) return true; - - if (mediaType == 'all') { - trackEventHander.destruction(); - return false; - } - - if ( - mediaType == 'audio' && - trackEventHander.getTrackType() == 'IRemoteTrack' - ) { - trackEventHander.destruction(); - return false; - } - - if ( - mediaType == 'video' && - trackEventHander.getTrackType() == 'IRemoteVideoTrack' - ) { - trackEventHander.destruction(); - return false; - } - - return true; - } - ); - } - - isMainClientPublishedVideoTrack(): boolean { - if (this._mainClient) { - for (let track of this._mainClient.localTracks) { - if (track.trackMediaType == 'video') { - return true; - } - } - } - return false; - } - - addSubClientTrackEventHandler( - connection: NATIVE_RTC.RtcConnection, - eventHandler: IrisTrackEventHandler - ) { - let array = this._subClientTrackEventHandlers.getT( - connection.channelId, - connection.localUid - ); - if (array == null) { - array = []; - this._subClientTrackEventHandlers.addT( - connection.channelId, - connection.localUid, - array - ); - } - array.push(eventHandler); - } - - removeSubClientTrackEventHandlerByTrack( - connection: NATIVE_RTC.RtcConnection, - track: ITrack - ) { - let array = this._subClientTrackEventHandlers.getT( - connection.channelId, - connection.localUid - ); - if (array == null) return; - - for (let i = 0; i < array.length; i++) { - let event = array[i]; - if (event.getTrack() == track) { - array[i].destruction(); - array.splice(i, 1); - break; - } - } - } - - removeSubClientTrackEventHandlerByRemoteUser( - connection: NATIVE_RTC.RtcConnection, - user: IAgoraRTCRemoteUser, - mediaType: 'audio' | 'video' | 'all' - ) { - let array = this._subClientTrackEventHandlers.getT( - connection.channelId, - connection.localUid - ); - if (array == null) return; - - array = array.filter((trackEventHander: IrisTrackEventHandler) => { - if (trackEventHander.getRemoteUser() != user) return true; - - if (mediaType == 'all') { - trackEventHander.destruction(); - return false; - } - - if ( - mediaType == 'audio' && - trackEventHander.getTrackType() == 'IRemoteTrack' - ) { - trackEventHander.destruction(); - return false; - } - - if ( - mediaType == 'video' && - trackEventHander.getTrackType() == 'IRemoteVideoTrack' - ) { - trackEventHander.destruction(); - return false; - } - - return true; - }); - - this._subClientTrackEventHandlers.removeT( - connection.channelId, - connection.localUid - ); - this._subClientTrackEventHandlers.addT( - connection.channelId, - connection.localUid, - array - ); - } - - clearMainClientAll(channelId: string) { - //client - if (this._mainClient) { - this._mainClient = null; - } - - //client event - if (this._mainClientEventHandler) { - this._mainClientEventHandler.destruction(); - this._mainClientEventHandler = null; - } - - //audio,video track - this._mainClientLocalAudioTracks = []; - this._mainClientLocalVideoTrack = null; - - //trackEvent - this._mainClientTrackEventHandlers.forEach((element) => { - element.destruction(); - }); - this._mainClientTrackEventHandlers = []; - - //remoteUser - // if (channelId != '' && channelId != null) { - // this._remoteUsers.removeTs(channelId); - // } - } - - addSubClient(connection: NATIVE_RTC.RtcConnection, client: IAgoraRTCClient) { - this._subClients.addT(connection.channelId, connection.localUid, client); - } - - addSubClientEventHandler( - connection: NATIVE_RTC.RtcConnection, - clientEventHandler: IrisClientEventHandler - ) { - this._subClientEventHandlers.addT( - connection.channelId, - connection.localUid, - clientEventHandler - ); - } - - getSubClientEventHandler( - connection: NATIVE_RTC.RtcConnection - ): IrisClientEventHandler { - return this._subClientEventHandlers.getT( - connection.channelId, - connection.localUid - ); - } - - clearSubClientAll(connection: NATIVE_RTC.RtcConnection) { - let channelId = connection.channelId; - let uid = connection.localUid; - - //client - this._subClients.removeT(channelId, uid); - - //client event - let clientEventHander = this._subClientEventHandlers.getT(channelId, uid); - clientEventHander && clientEventHander.destruction(); - this._subClientEventHandlers.removeT(channelId, uid); - - //client audio, video track - this._subClientAudioTracks.removeT(channelId, uid); - this._subClientVideoTracks.removeT(channelId, uid); - - //client track event - let trackEventHandlers = this._subClientTrackEventHandlers.getT( - channelId, - uid - ); - if (trackEventHandlers) { - for (let event of trackEventHandlers) { - event.destruction(); - } - } - this._subClientTrackEventHandlers.removeT(channelId, uid); - - //remoteUser - // this._remoteUsers.removeTs(connection.channelId); - } - - //注意自己的mainClient可能也满足要求哦 - // getAllClient(connection: NATIVE_RTC.RtcConnection): IAgoraRTCClient { - // if (this._mainClient?.channelName == connection.channelId) - // return this._mainClient; - - // return this._subClients.getT(connection.channelId, connection.localUid); - // } - - getClientsByChannelName(channelName: string): Map { - return this._subClients.getTs(channelName); - } - - getSubClient(connection: NATIVE_RTC.RtcConnection): IAgoraRTCClient { - return this._subClients.getT(connection.channelId, connection.localUid); - } - - getSubClients(): Container { - return this._subClients; - } - - getSubClientVideoTrack( - connection: NATIVE_RTC.RtcConnection - ): VideoTrackPackage { - return this._subClientVideoTracks.getT( - connection.channelId, - connection.localUid - ); - } - - // 当一个轨道将被close的时候。会去所有保存这个track, 以及trackEvent 的容器里去删除这个track. 并且停止发流 记住是所有哦 - async processBufferSourceAudioTrackClose(track: IBufferSourceAudioTrack) { - //local - this.removeLocalBufferSourceAudioTrackByTrack(track); - - //main - this.removeMainClientLocalBufferSourceAudioTrack(track); - this.removeMainClientTrackEventHandlerByTrack(track); - if (this._mainClient && this._mainClient.localTracks.indexOf(track) != -1) { - try { - await this._mainClient.unpublish(track); - AgoraConsole.log('unpublish success'); - } catch (e) { - AgoraConsole.error(e); - Promise.resolve( - new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) - ); - throw e; - } - } - - //删除完毕后进行stop,close - track.stopProcessAudioBuffer(); - track.close(); - } - - // 当一个轨道将被close的时候。会去所有保存这个track, 以及trackEvent 的容器里去删除这个track. 并且停止发流 记住是所有哦 - async processAudioTrackClose(audioTrack: ILocalAudioTrack) { - //local - this.removeLocalAudioTrackByTrack(audioTrack); - - //main - this.removeMainClientLocalAudioTrack(audioTrack); - this.removeMainClientTrackEventHandlerByTrack(audioTrack); - if ( - this._mainClient && - this._mainClient.localTracks.indexOf(audioTrack) != -1 - ) { - try { - await this._mainClient.unpublish(audioTrack); - AgoraConsole.log('unpublish success'); - } catch (e) { - AgoraConsole.error(e); - Promise.resolve( - new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) - ); - throw e; - } - } - - //sub - this._subClientAudioTracks.walkT( - (channelId: string, uid: UID, packages: AudioTrackPackage[]) => { - for (let i = 0; i < packages.length; i++) { - let pack = packages[i]; - if (pack.track == audioTrack) { - packages.splice(i, 1); - break; - } - } - } - ); - - this._subClientTrackEventHandlers.walkT( - (channelId: string, uid: UID, events: IrisTrackEventHandler[]) => { - for (let i = 0; i < events.length; i++) { - let event = events[i]; - if (event.getTrack() == audioTrack) { - event.destruction(); - events.splice(i, 1); - } - } - } - ); - - let container = this._subClients.getContainer(); - for (let _container of container) { - let clients = _container[1]; - for (let _client of clients) { - let client = _client[1]; - if (client.localTracks.indexOf(audioTrack) != -1) { - try { - await client.unpublish(audioTrack); - AgoraConsole.log('unpublish success'); - } catch (e) { - AgoraConsole.error(e); - Promise.resolve( - new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) - ); - throw e; - } - } - } - } - //删除完毕后进行stop,close - if (audioTrack.isPlaying) { - audioTrack.stop(); - } - audioTrack.close(); - } - - // 当一个轨道将被close的时候。会去所有保存这个track, 以及trackEvent 的容器里去删除这个track. 记住是所有哦 - async processVideoTrackClose(videoTrack: ILocalVideoTrack) { - //local - this.removeLocalVideoTrackByTrack(videoTrack); - - //main - if (this._mainClientLocalVideoTrack?.track == videoTrack) { - this._mainClientLocalVideoTrack = null; - } - this.removeMainClientTrackEventHandlerByTrack(videoTrack); - if ( - this._mainClient && - this._mainClient.localTracks.indexOf(videoTrack) != -1 - ) { - try { - await this._mainClient.unpublish(videoTrack); - AgoraConsole.log('unpublish success'); - } catch (e) { - AgoraConsole.error(e); - Promise.resolve( - new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) - ); - throw e; - } - } - - //sub - let deleteChannelIds: Array = []; - let deleteUids: Array = []; - this._subClientVideoTracks.walkT( - (channelId: string, uid: UID, pack: VideoTrackPackage) => { - if (pack.track == videoTrack) { - deleteChannelIds.push(channelId); - deleteUids.push(uid); - } - } - ); - - for (let i = 0; i < deleteChannelIds.length; i++) { - let deleteChannelId = deleteChannelIds[i]; - let deleteUid = deleteUids[i]; - this._subClientAudioTracks.removeT(deleteChannelId, deleteUid); - } - - this._subClientTrackEventHandlers.walkT( - (channelId: string, uid: UID, events: IrisTrackEventHandler[]) => { - for (let i = 0; i < events.length; i++) { - let event = events[i]; - if (event.getTrack() == videoTrack) { - event.destruction(); - events.splice(i, 1); - } - } - } - ); - - let container = this._subClients.getContainer(); - for (let _container of container) { - let clients = _container[1]; - for (let _client of clients) { - let client = _client[1]; - if (client.localTracks.indexOf(videoTrack) != -1) { - try { - await client.unpublish(videoTrack); - AgoraConsole.log('unpublish success'); - } catch (e) { - AgoraConsole.error(e); - Promise.resolve( - new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) - ); - throw e; - } - } - } - } - //删除完毕后进行stop,close - if (videoTrack.isPlaying) { - videoTrack.stop(); - } - videoTrack.close(); - } - - getLocalAudioTrackType(track: ILocalAudioTrack): IrisAudioSourceType { - for (let e of this._localAudioTracks) { - if (e.track == track) { - return e.type; - } - } - return IrisAudioSourceType.kAudioSourceTypeUnknown; - } - - getLocalVideoTrackType( - track: ILocalVideoTrack - ): NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE { - for (let e of this._localVideoTracks) { - if (e.track == track) { - return e.type; - } - } - return NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN; - } - - isMainClientOrSubClient(connection: NATIVE_RTC.RtcConnection): boolean { - if ( - this._mainClient && - this._mainClient.channelName == connection.channelId && - this._mainClient.uid == connection.localUid - ) { - return true; - } - - if (this.getSubClient(connection) != null) { - return true; - } - - return false; - } - - async destruction() { - await this.clearLocalAudioTracks(true); - await this.clearLocalVideoTracks(true); - - this._engine.clearIrisInterval(); - //销毁iris html element - this._engine.irisElement.dispose(); - //mainClient - if (this._mainClient && this._mainClient.channelName) { - try { - await this._mainClient.leave(); - AgoraConsole.log('main client leave success'); - } catch (e) { - AgoraConsole.error('mainClient leave failed'); - e && AgoraConsole.error(e); - } - } - this._mainClient = null; - - //mainEvent, mainTrackEvent - if (this._mainClientEventHandler) { - this._mainClientEventHandler.destruction(); - this._mainClientEventHandler = null; - } - - this._mainClientTrackEventHandlers.forEach( - (trackEventHandler: IrisTrackEventHandler) => { - trackEventHandler.destruction(); - } - ); - this._mainClientTrackEventHandlers = []; - - //subClient - let subClients = this._subClients.getContainer(); - for (let e of subClients) { - let map = e[1]; - for (let m of map) { - let subClient = m[1]; - if (subClient.channelName) { - try { - await subClient.leave(); - AgoraConsole.log('sub client leave success'); - } catch (e) { - AgoraConsole.error('subClient leave faield'); - e && AgoraConsole.error(e); - } - } - } - } - this._subClients = new Container(); - - //subEvent, subTrackEvent - this._subClientEventHandlers.walkT( - (channelId: string, uid: UID, t: IrisClientEventHandler) => { - t.destruction(); - } - ); - this._subClientEventHandlers = new Container(); - this._subClientTrackEventHandlers.walkT( - (channelId: string, uid: UID, t: Array) => { - t.forEach((trackEventHandler: IrisTrackEventHandler) => { - trackEventHandler.destruction(); - }); - } - ); - this._subClientTrackEventHandlers = new Container(); - - // this._remoteUsers = new Container(); - } -} diff --git a/packages/rtc/src/engine/IrisRtcEngine.ts b/packages/rtc/src/engine/IrisRtcEngine.ts index 51160bb..930f9a8 100644 --- a/packages/rtc/src/engine/IrisRtcEngine.ts +++ b/packages/rtc/src/engine/IrisRtcEngine.ts @@ -1,18 +1,18 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { UID } from 'agora-rtc-sdk-ng'; +import { UID } from 'agora-rtc-sdk-ng'; import { ApiInterceptor, ApiInterceptorReturnType, ApiParam, + AsyncTaskType, CallApiExecutor, + CallApiReturnType, CallIrisApiResult, - IrisEventHandler, IrisEventHandlerManager, } from 'iris-web-core'; import { InitIrisRtcOptions } from '../IrisRtcApi'; - import { IrisVideoFrameBufferConfig, VideoParams } from '../base/BaseType'; import { IMediaEngineDispatch } from '../binding/IAgoraMediaEngineDispatch'; @@ -40,52 +40,39 @@ import { IAudioDeviceManagerDispatch } from '../binding/IAudioDeviceManagerDispa import { IrisAgoraEventHandler } from '../event_handler/IrisAgoraEventHandler'; import { RtcEngineDispatchExtensions } from '../extensions/IAgoraRtcEngineExtensions'; +import { ClientHelper } from '../helper/ClientHelper'; import { IrisElement } from '../helper/DomHelper'; -import { IrisGlobalVariables } from '../states/IrisGlobalVariables'; -import { IrisMainClientVariables } from '../states/IrisMainClientVariables'; -import { IrisSubClientVariables } from '../states/IrisSubClientVariables'; +import { ImplHelper } from '../helper/ImplHelper'; +import { TrackHelper } from '../helper/TrackHelper'; +import { IrisGlobalState } from '../state/IrisGlobalState'; import { AgoraActionQueue } from '../util/AgoraActionQueue'; import { AgoraConsole } from '../util/AgoraConsole'; +import IrisRtcErrorHandler from '../util/ErrorHandler'; -import { IrisEntitiesContainer } from './IrisEntitiesContainer'; - -export type CallApiType = ( - params: string, - paramLength: number, - buffer: Array, - bufferLength: number, - result: any -) => number; -export type CallApiAsyncType = ( - params: string, - paramLength: number, - buffer: Array, - bufferLength: number, - result: any -) => Promise; -export type GenerateVideoTrackLabelOrHtmlElementCb = ( - channelName: string, - uid: number, - type: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE -) => string; +import { IrisClientManager } from './IrisClientManager'; + +// export type GenerateVideoTrackLabelOrHtmlElementCb = ( +// channelName: string, +// uid: number, +// type: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE +// ) => string; export enum IrisIntervalType { enableAudioVolumeIndication = 0, } export class IrisRtcEngine implements ApiInterceptor { - //EventHandler - private _eventHandler: IrisEventHandler = null; + // private _generateVideoTrackLabelOrHtmlElementCb: GenerateVideoTrackLabelOrHtmlElementCb = null; - private _generateVideoTrackLabelOrHtmlElementCb: GenerateVideoTrackLabelOrHtmlElementCb = null; + public implDispatchesMap: Map = new Map(); + public implHelper: ImplHelper = new ImplHelper(this); + public trackHelper: TrackHelper = new TrackHelper(this); + public clientHelper: ClientHelper = new ClientHelper(this); - public implDispatchsMap: Map = null; - public entitiesContainer: IrisEntitiesContainer = null; + public irisClientManager: IrisClientManager = new IrisClientManager(this); public rtcEngineEventHandler: NATIVE_RTC.IRtcEngineEventHandlerEx = null; - public globalVariables: IrisGlobalVariables = null; - public mainClientVariables: IrisMainClientVariables = null; - public subClientVariables: IrisSubClientVariables = null; + public globalState: IrisGlobalState = null; public agoraEventHandler: IrisAgoraEventHandler = null; public actionQueue: AgoraActionQueue = null; public executor: CallApiExecutor = null; @@ -95,64 +82,39 @@ export class IrisRtcEngine implements ApiInterceptor { type: IrisIntervalType; interval: NodeJS.Timeout; }[] = []; + public irisRtcErrorHandler: IrisRtcErrorHandler = new IrisRtcErrorHandler( + this + ); constructor( irisEventHandlerManager: IrisEventHandlerManager, options: InitIrisRtcOptions ) { - this.implDispatchsMap = new Map(); - this.implDispatchsMap.set('MediaPlayer', new IMediaPlayerDispatch(this)); - this.implDispatchsMap.set( - 'MediaPlayerCacheManager', - new IMediaPlayerCacheManagerDispatch(this) - ); - this.implDispatchsMap.set('MediaEngine', new IMediaEngineDispatch(this)); - this.implDispatchsMap.set( - 'MediaRecorder', - new IMediaRecorderDispatch(this) - ); - this.implDispatchsMap.set( - 'MusicChartCollection', - new MusicChartCollectionDispatch(this) - ); - this.implDispatchsMap.set( - 'MusicCollection', - new MusicCollectionDispatch(this) - ); - this.implDispatchsMap.set('MusicPlayer', new IMusicPlayerDispatch(this)); - this.implDispatchsMap.set( - 'MusicContentCenter', - new IMusicContentCenterDispatch(this) - ); - this.implDispatchsMap.set( - 'AudioDeviceManager', - new IAudioDeviceManagerDispatch(this) - ); - this.implDispatchsMap.set( - 'VideoDeviceManager', - new IVideoDeviceManagerDispatch(this) - ); - this.implDispatchsMap.set( - 'RtcEngine', - new RtcEngineDispatchExtensions(this) - ); - this.implDispatchsMap.set('RtcEngineEx', new IRtcEngineExDispatch(this)); - this.implDispatchsMap.set( - 'BaseSpatialAudioEngine', - new IBaseSpatialAudioEngineDispatch(this) - ); - this.implDispatchsMap.set( - 'LocalSpatialAudioEngine', - new ILocalSpatialAudioEngineDispatch(this) + const mapData = [ + ['MediaPlayer', new IMediaPlayerDispatch(this)], + ['MediaPlayerCacheManager', new IMediaPlayerCacheManagerDispatch(this)], + ['MediaEngine', new IMediaEngineDispatch(this)], + ['MediaRecorder', new IMediaRecorderDispatch(this)], + ['MusicChartCollection', new MusicChartCollectionDispatch(this)], + ['MusicCollection', new MusicCollectionDispatch(this)], + ['MusicPlayer', new IMusicPlayerDispatch(this)], + ['MusicContentCenter', new IMusicContentCenterDispatch(this)], + ['AudioDeviceManager', new IAudioDeviceManagerDispatch(this)], + ['VideoDeviceManager', new IVideoDeviceManagerDispatch(this)], + ['RtcEngine', new RtcEngineDispatchExtensions(this)], + ['RtcEngineEx', new IRtcEngineExDispatch(this)], + ['BaseSpatialAudioEngine', new IBaseSpatialAudioEngineDispatch(this)], + ['LocalSpatialAudioEngine', new ILocalSpatialAudioEngineDispatch(this)], + ]; + + mapData.forEach(([key, value]: [string, any]) => + this.implDispatchesMap.set(key, value) ); this.actionQueue = new AgoraActionQueue(); this.rtcEngineEventHandler = new IRtcEngineEventHandlerEx(this); - this.entitiesContainer = new IrisEntitiesContainer(this); - this.globalVariables = new IrisGlobalVariables(); + this.globalState = new IrisGlobalState(); this.irisElement = new IrisElement(); - this.mainClientVariables = new IrisMainClientVariables(); - this.subClientVariables = new IrisSubClientVariables(); this.agoraEventHandler = new IrisAgoraEventHandler(this); this.executor = new CallApiExecutor(true); @@ -160,7 +122,7 @@ export class IrisRtcEngine implements ApiInterceptor { if (options && options.fakeAgoraRTC) { AgoraConsole.debug('use fake agora rtc'); - this.globalVariables.AgoraRTC = options.fakeAgoraRTC; + this.globalState.AgoraRTC = options.fakeAgoraRTC; } } @@ -168,50 +130,6 @@ export class IrisRtcEngine implements ApiInterceptor { return this.callIrisApiAsync(apiParam); } - public callIrisApi(apiParam: ApiParam): number { - let func_name = apiParam.event; - let params: string = apiParam.data; - let paramLength: number = apiParam.data_size; - let buffer: Array = apiParam.buffer; - let bufferLength: Array = apiParam.length; - let buffer_count = apiParam.buffer_count; - let result: any = apiParam.result; - let resultObj: any = {}; - - let array = func_name.split('_'); - let className = array[0]; - let funName = array[1]; - - AgoraConsole.log(`[callIrisApi][start] ${JSON.stringify(apiParam)}`); - - let obj = this.implDispatchsMap.get(className); - if (obj) { - let callApiFun: CallApiType = obj[funName]; - if (callApiFun) { - let ret = callApiFun.call( - obj, - params, - paramLength, - buffer, - bufferLength, - resultObj - ); - AgoraConsole.log(`[callIrisApi][result] ${func_name} ret ${ret.code}`); - return ret; - } else { - AgoraConsole.error( - `[callIrisApi][result] ${func_name} not found in ${className}Dispatch` - ); - return -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - } else { - AgoraConsole.error( - `[callIrisApi][result] ${className} not found in DispatchsMap` - ); - return -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - } - public async callIrisApiAsync( apiParam: ApiParam ): Promise { @@ -219,15 +137,30 @@ export class IrisRtcEngine implements ApiInterceptor { let array = func_name.split('_'); let className = array[0]; let funName = array[1]; - let buffer = apiParam.buffer; - AgoraConsole.log(`[callIrisApiAsync][start] ${JSON.stringify(apiParam)}`); - let obj = this.implDispatchsMap.get(className); + AgoraConsole.log( + `[callIrisApiAsync][start] ${(() => { + let printData = JSON.parse(JSON.stringify(apiParam)); + delete printData?.buffer; + return JSON.stringify(printData); + })()}` + ); + let obj = this.implDispatchesMap.get(className); if (obj) { - let callApiFun: CallApiAsyncType = obj[funName]; + let callApiFun = obj[funName]; if (callApiFun) { + if ( + func_name !== 'RtcEngine_initialize' && + this.irisClientManager.irisClientList.length == 0 + ) { + AgoraConsole.error('you have not initialize yet'); + return new CallIrisApiResult( + -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_INITIALIZED, + '' + ); + } let ret = await callApiFun.call(obj, apiParam); - AgoraConsole.debug( + AgoraConsole.log( `[callIrisApiAsync][result] ${func_name} ret ${ret.code}` ); return ret; @@ -248,63 +181,58 @@ export class IrisRtcEngine implements ApiInterceptor { } } - public setEventHandler(event_handler: IrisEventHandler) { - console.log(`IrisRtcEngine setEventHandler ${event_handler}`); - console.log(`IrisRtcEngine setEventHandler 3333 ${event_handler}`); - this._eventHandler = event_handler; - } - - public setGenerateVideoTrackLabelOrHtmlElementCb( - cb: GenerateVideoTrackLabelOrHtmlElementCb - ) { - this._generateVideoTrackLabelOrHtmlElementCb = cb; - } - - public getEventHandler(): IrisEventHandler { - return this._eventHandler; - } - public getVideoFrame(uid: UID, channel_id: string): VideoParams { - return this.entitiesContainer.getVideoFrame(uid, channel_id); + return this.irisClientManager.getVideoFrame(uid, channel_id); } public getVideoFrameByConfig( config: IrisVideoFrameBufferConfig ): VideoParams { - return this.entitiesContainer.getVideoFrameByConfig(config); + return this.irisClientManager.getVideoFrameByConfig(config); } - public destruction() { - this.agoraEventHandler.destruction(); - - this.actionQueue.putAction({ - fun: (next) => { - let process = async () => { - await this.entitiesContainer.destruction(); - next(); - }; - setTimeout(process, 0); - }, - args: [], - }); + public execute(task: AsyncTaskType): CallApiReturnType { + return this.executor.execute(task); } - public generateVideoTrackLabelOrHtmlElement( - channelName: string, - uid: number, - type: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE - ): string { - if (this._generateVideoTrackLabelOrHtmlElementCb) { - return this._generateVideoTrackLabelOrHtmlElementCb( - channelName, - uid, - type - ); + // public setGenerateVideoTrackLabelOrHtmlElementCb( + // cb: GenerateVideoTrackLabelOrHtmlElementCb + // ) { + // this._generateVideoTrackLabelOrHtmlElementCb = cb; + // } + + public returnResult( + isSuccess: boolean = true, + code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, + data: string = '{"result": 0}' + ): Promise { + if (!isSuccess) { + code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; } + return Promise.resolve(new CallIrisApiResult(code, data)); + } - return channelName + '_' + uid + '_' + type; + public async release() { + this.agoraEventHandler.release(); + await this.irisClientManager.release(); } + // public generateVideoTrackLabelOrHtmlElement( + // channelName: string, + // uid: number, + // type: NATIVE_RTC.VIDEO_SOURCE_TYPE | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE + // ): string { + // if (this._generateVideoTrackLabelOrHtmlElementCb) { + // return this._generateVideoTrackLabelOrHtmlElementCb( + // channelName, + // uid, + // type + // ); + // } + + // return channelName + '_' + uid + '_' + type; + // } + public addIrisInterval(type: IrisIntervalType, interval: NodeJS.Timeout) { this.irisIntervalList.push({ type, @@ -327,8 +255,8 @@ export class IrisRtcEngine implements ApiInterceptor { }); } - dispose(): Promise { - this.destruction(); + async dispose(): Promise { + await this.release(); return Promise.resolve(); } } diff --git a/packages/rtc/src/event_handler/IrisAgoraEventHandler.ts b/packages/rtc/src/event_handler/IrisAgoraEventHandler.ts index ba8bf16..c38b21c 100644 --- a/packages/rtc/src/event_handler/IrisAgoraEventHandler.ts +++ b/packages/rtc/src/event_handler/IrisAgoraEventHandler.ts @@ -70,10 +70,10 @@ export class IrisAgoraEventHandler { // this._engine.rtcEngineEventHandler.onMediaDeviceChanged(deviceType); } - destruction() { - this._engine.globalVariables.AgoraRTC.onAutoplayFailed = undefined; - this._engine.globalVariables.AgoraRTC.onCameraChanged = undefined; - this._engine.globalVariables.AgoraRTC.onMicrophoneChanged = undefined; - this._engine.globalVariables.AgoraRTC.onPlaybackDeviceChanged = undefined; + release() { + this._engine.globalState.AgoraRTC.onAutoplayFailed = undefined; + this._engine.globalState.AgoraRTC.onCameraChanged = undefined; + this._engine.globalState.AgoraRTC.onMicrophoneChanged = undefined; + this._engine.globalState.AgoraRTC.onPlaybackDeviceChanged = undefined; } } diff --git a/packages/rtc/src/event_handler/IrisClientEventHandler.ts b/packages/rtc/src/event_handler/IrisClientEventHandler.ts index 701108b..44090c8 100644 --- a/packages/rtc/src/event_handler/IrisClientEventHandler.ts +++ b/packages/rtc/src/event_handler/IrisClientEventHandler.ts @@ -1,480 +1,493 @@ -import * as NATIVE_RTC from "@iris/native-rtc-binding"; -import { ChannelMediaRelayError, ChannelMediaRelayEvent, ChannelMediaRelayState, ConnectionDisconnectedReason, ConnectionState, IAgoraRTCClient, IAgoraRTCError, IAgoraRTCRemoteUser, NetworkQuality, RemoteStreamType, UID } from "agora-rtc-sdk-ng"; - - - -import { IrisClientType } from "../base/BaseType"; -import { IrisRtcEngine } from "../engine/IrisRtcEngine"; -import { AgoraTranslate } from "../util/AgoraTranslate"; -import { InspectState } from "../web_sdk"; - -import { IrisTrackEventHandler, IrisTrackEventHandlerParam } from "./IrisTrackEventHandler"; +import * as NATIVE_RTC from '@iris/native-rtc-binding'; +import { + ChannelMediaRelayError, + ChannelMediaRelayEvent, + ChannelMediaRelayState, + ConnectionDisconnectedReason, + ConnectionState, + IAgoraRTCClient, + IAgoraRTCError, + IAgoraRTCRemoteUser, + NetworkQuality, + RemoteStreamType, + UID, +} from 'agora-rtc-sdk-ng'; + +import { IrisAudioSourceType } from '../base/BaseType'; + +import { IrisClient } from '../engine/IrisClient'; +import { RemoteUserPackage } from '../engine/IrisClientManager'; +import { NotifyRemoteType } from '../engine/IrisClientObserver'; + +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; +import { AgoraTranslate } from '../util/AgoraTranslate'; export class IrisClientEventHandler { - - private _client: IAgoraRTCClient; - private _engine: IrisRtcEngine; - private _clientType: IrisClientType; - - constructor(client: IAgoraRTCClient, type: IrisClientType, engine: IrisRtcEngine) { - this._client = client; - this._clientType = type; - this._engine = engine; - - this._client.on("connection-state-change", this.onEventConnectionStateChange.bind(this)); - this._client.on("user-joined", this.onEventUserJoined.bind(this)); - this._client.on("user-left", this.onEventUserLeft.bind(this)); - this._client.on("user-published", this.onEventUserPublished.bind(this)); - this._client.on("user-unpublished", this.onEventUserUnpublished.bind(this)); - this._client.on("user-info-updated", this.onEventUserInfoUpdated.bind(this)); - this._client.on("media-reconnect-start", this.onEventMediaReconnectStart.bind(this)); - this._client.on("media-reconnect-end", this.onEventMediaReconnectEnd.bind(this)); - this._client.on("stream-type-changed", this.onEventStreamTypeChanged.bind(this)); - this._client.on("stream-fallback", this.onEventStreamFallback.bind(this)); - this._client.on("channel-media-relay-state", this.onEventChannelMediaRelayState.bind(this)); - this._client.on("channel-media-relay-event", this.onEventChannelMediaRelayEvent.bind(this)); - this._client.on("volume-indicator", this.onEventVolumeIndicator.bind(this)); - this._client.on("crypt-error", this.onEventCryptError.bind(this)); - this._client.on("token-privilege-will-expire", this.onEventTokenPrivilegeWillExpire.bind(this)); - this._client.on("token-privilege-did-expire", this.onEventTokenPrivilegeDidExpire.bind(this)); - this._client.on("network-quality", this.onEventNetworkQuality.bind(this)); - this._client.on("live-streaming-error", this.onEventLiveStreamingError.bind(this)); - this._client.on("live-streaming-warning", this.onEventLiveStreamingWarning.bind(this)); - this._client.on("exception", this.onEventException.bind(this)); - this._client.on("is-using-cloud-proxy", this.onEventIsUsingCloudProxy.bind(this)); - this._client.on("join-fallback-to-proxy", this.onEventJoinFallbackToProxy.bind(this)); - this._client.on("published-user-list", this.onEventPublishedUserList.bind(this)); - this._client.on("content-inspect-connection-state-change", this.onEventContentInspectConnectionStateChange.bind(this)); - this._client.on("content-inspect-error", this.onEventContentInspectError.bind(this)); - this._client.on("content_inspect_result", this.onEventContentInspectResult.bind(this)); - } - - onEventConnectionStateChange(curState: ConnectionState, revState: ConnectionState, reason?: ConnectionDisconnectedReason): void { - - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - - if (curState == 'DISCONNECTED') - this._engine.rtcEngineEventHandler.onConnectionLostEx(connection); - else if (reason == ConnectionDisconnectedReason.CHANNEL_BANNED - || reason == ConnectionDisconnectedReason.IP_BANNED - || reason == ConnectionDisconnectedReason.UID_BANNED - ) { - this._engine.rtcEngineEventHandler.onConnectionBannedEx(connection); - } - else if (reason == ConnectionDisconnectedReason.NETWORK_ERROR - || reason == ConnectionDisconnectedReason.SERVER_ERROR - ) { - this._engine.rtcEngineEventHandler.onConnectionInterruptedEx(connection); - } - - - if (curState != "DISCONNECTING") { - let state = AgoraTranslate.ConnectionState2NATIVE_RTCCONNECTION_STATE_TYPE(curState); - let reason2: NATIVE_RTC.CONNECTION_CHANGED_REASON_TYPE = NATIVE_RTC.CONNECTION_CHANGED_REASON_TYPE.CONNECTION_CHANGED_INTERRUPTED; - if (reason != null) { - reason2 = AgoraTranslate.ConnectionDisconnectedReason2NATIVE_RTCCONNECTION_CHANGED_REASON_TYPE(reason); - } - this._engine.rtcEngineEventHandler.onConnectionStateChangedEx(connection, state, reason2); - } - - } - - /* - * 假设我们主客户端A和子客户端B,同时加入频道1, 此时另外一个用户C加入了频道1 - * 1.用户C 加入离开,开始推流,结束推流等行为会触发2次 - * 2.主客户端A会触发 用户B加入(需要过滤掉这个值) - * 3.子客户端B会触发 用户A加入(需要过滤点这个值) - **/ - onEventUserJoined(user: IAgoraRTCRemoteUser): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: user.uid as number, - }; - let remoteUid = user.uid; - let elapsed = 0; - this._engine.rtcEngineEventHandler.onUserJoinedEx(connection, remoteUid as number, elapsed); - - - // let con2: NATIVE_RTC.RtcConnection = { - // channelId: this._client.channelName, - // localUid: remoteUid as number - // }; - - //过滤掉情况 2,3 - // if (this._engine.entitiesContainer.isMainClientOrSubClient(con2)) - // return; - - // //此时如果是情况1下的的第二次触发C加入。那么第二次的加入会被过滤掉 - // if (this._engine.entitiesContainer.getRemoteUser(con2) == null) { - // this._engine.entitiesContainer.addRemoteUser(connection, user); - // } - } - - onEventUserLeft(user: IAgoraRTCRemoteUser, reason: string): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - let remoteUid = user.uid; - let reason2 = AgoraTranslate.string2NATIVE_RTCUSER_OFFLINE_REASON_TYPE(reason); - this._engine.rtcEngineEventHandler.onUserOfflineEx(connection, remoteUid as number, reason2); - - - let con2: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: remoteUid as number - }; - - //过滤掉情况 2,3 - if (this._engine.entitiesContainer.isMainClientOrSubClient(con2)) - return; - - // if (this._engine.entitiesContainer.getRemoteUser(con2) != user) - // return; - - - if (this._clientType == IrisClientType.kClientMain) { - this._engine.entitiesContainer.removeMainClientTrackEventHandlerByRemoteUser(user, "all"); - } - else { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - this._engine.entitiesContainer.removeSubClientTrackEventHandlerByRemoteUser(connection, user, "all"); - } - } - - onEventUserPublished(user: IAgoraRTCRemoteUser, mediaType: "audio" | "video"): void { - - let con2: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: user.uid as number - }; - - //过滤掉情况 2,3 - if (this._engine.entitiesContainer.isMainClientOrSubClient(con2)) - return; - - //这里有bug。 如果A(不订阅), B(订阅先后加入频道) - //那么A先捕获到C,并且不订阅 - //B加入频道好后就不能捕获C了。即使订阅也看不到人‘ - //我认为这个情况是可以接受的,用户不要这么干最好s - //在情况1下。C触发了第二次发布流。但是此时的容器里存放的是前一个触发回调。所以自己不做处理了。 - // if (this._engine.entitiesContainer.getRemoteUser(con2) != user) - // return; - - let enableAudio: boolean = this._engine.globalVariables.enabledAudio; - let enableVideo: boolean = this._engine.globalVariables.enabledVideo - - if (mediaType == 'audio' && enableAudio) { - let autoSubscribeAudio: boolean = false; - if (this._clientType == IrisClientType.kClientMain) { - if (this._engine.mainClientVariables.autoSubscribeAudio == true) - autoSubscribeAudio = true; - } - else { - let options = this._engine.subClientVariables.channelMediaOptions.getT(this._client.channelName, this._client.uid); - if (options && options.autoSubscribeAudio == true) { - autoSubscribeAudio = true; - } - } - - if (autoSubscribeAudio) { - this._client.subscribe(user, mediaType) - .then(() => { - console.log("onEventUserPublished subcribe audio success"); - if (this._engine.globalVariables.playbackSignalVolumes.has(user.uid)) { - user.audioTrack.setVolume(this._engine.globalVariables.playbackSignalVolumes.get(user.uid)); - } - else { - user.audioTrack.setVolume(this._engine.globalVariables.playbackSignalVolume); - } - user.audioTrack.play(); - - let param: IrisTrackEventHandlerParam = { - channelName: this._client.channelName, - client: this._client, - remoteUser: user, - track: user.audioTrack, - trackType: "IRemoteTrack", - }; - let trackEventHandler = new IrisTrackEventHandler(param, this._engine); - - if (this._clientType == IrisClientType.kClientMain) { - this._engine.entitiesContainer.addMainClientTrackEventHandler(trackEventHandler); - } - else { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - this._engine.entitiesContainer.addSubClientTrackEventHandler(connection, trackEventHandler); - } - }) - .catch(() => { - console.log("onEventUserPublished subcribe audio failed"); - }); - } - } - else if (mediaType == 'video' && enableVideo) { - //video - let autoSubscribeVideo: boolean = false; - if (this._clientType == IrisClientType.kClientMain) { - if (this._engine.mainClientVariables.autoSubscribeVideo == true) - autoSubscribeVideo = true; - } - else { - let options = this._engine.subClientVariables.channelMediaOptions.getT(this._client.channelName, this._client.uid); - if (options && options.autoSubscribeVideo == true) { - autoSubscribeVideo = true; - } - } - - if (autoSubscribeVideo) { - this._client.subscribe(user, mediaType) - .then(() => { - console.log("onEventUserPublished subscribe video success"); - // user.videoTrack.play(this._engine.generateVideoTrackLabelOrHtmlElement(this._client.channelName, user.uid as number, NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE)); - - this._engine.entitiesContainer.addOrUpdateRemoteVideoViewHolder({ channelId: this._client.channelName, uid: user.uid, type: NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE }); - for (let holder of this._engine.entitiesContainer.getRemoteVideoViewHolders()) { - if (holder.element && holder.channelId == this._client.channelName && holder.uid == user.uid) { - user.videoTrack.play(holder.element); - break; - } - } - - let param: IrisTrackEventHandlerParam = { - channelName: this._client.channelName, - client: this._client, - remoteUser: user, - track: user.videoTrack, - trackType: 'IRemoteVideoTrack', - }; - let trackEventHandler = new IrisTrackEventHandler(param, this._engine); - - if (this._clientType == IrisClientType.kClientMain) { - this._engine.entitiesContainer.addMainClientTrackEventHandler(trackEventHandler); - } - else { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - this._engine.entitiesContainer.addSubClientTrackEventHandler(connection, trackEventHandler); - } - }) - .catch(() => { - console.log("onEventUserPublished subcribe video failed"); - }) - } - } - - } - - onEventUserUnpublished(user: IAgoraRTCRemoteUser, mediaType: "audio" | "video"): void { - - let con2: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: user.uid as number - }; - - //过滤掉情况 2,3 - if (this._engine.entitiesContainer.isMainClientOrSubClient(con2)) - return; - - - //在情况1下。C触发了第二次发布流。但是此时的容器里存放的是前一个触发回调的user。所以自己不做处理了。 - // if (this._engine.entitiesContainer.getRemoteUser(con2) != user) - // return; - - if (this._clientType == IrisClientType.kClientMain) { - this._engine.entitiesContainer.removeMainClientTrackEventHandlerByRemoteUser(user, mediaType); - } - else { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - this._engine.entitiesContainer.removeSubClientTrackEventHandlerByRemoteUser(connection, user, mediaType); - } - } - - onEventUserInfoUpdated(uid: UID, msg: "mute-audio" | "mute-video" | "enable-local-video" | "unmute-audio" | "unmute-video" | "disable-local-video"): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - let remoteUid = uid as number; - - switch (msg) { - case 'mute-audio': - this._engine.rtcEngineEventHandler.onUserMuteAudioEx(connection, remoteUid, true); - this._engine.rtcEngineEventHandler.onUserStateChangedEx(connection, remoteUid, NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_AUDIO); - break; - case 'mute-video': - this._engine.rtcEngineEventHandler.onUserMuteVideoEx(connection, remoteUid, true); - this._engine.rtcEngineEventHandler.onUserStateChangedEx(connection, remoteUid, NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_VIDEO); - - break; - case 'unmute-audio': - this._engine.rtcEngineEventHandler.onUserMuteAudioEx(connection, remoteUid, false); - break; - case 'unmute-video': - this._engine.rtcEngineEventHandler.onUserMuteVideoEx(connection, remoteUid, false); - break; - case 'enable-local-video': - this._engine.rtcEngineEventHandler.onUserEnableLocalVideoEx(connection, remoteUid, true); - this._engine.rtcEngineEventHandler.onUserStateChangedEx(connection, remoteUid, NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_ENABLE_LOCAL_VIDEO); - break; - case 'disable-local-video': - this._engine.rtcEngineEventHandler.onUserEnableLocalVideoEx(connection, remoteUid, false); - break; - } - } - - onEventMediaReconnectStart(uid: UID): void { - //暂时没有找到对应的回调 - } - - onEventMediaReconnectEnd(uid: UID): void { - //展示没有找到合适的回调 - } - onEventStreamTypeChanged(uid: UID, streamType: RemoteStreamType): void { - //展示没有合适的回调 - } - - onEventStreamFallback(uid: UID, isFallbackOrRecover: "fallback" | "recover"): void { - this._engine.rtcEngineEventHandler.onRemoteSubscribeFallbackToAudioOnly(uid as number, isFallbackOrRecover == 'fallback' ? true : false); + private _irisClient: IrisClient; + private _engine: IrisRtcEngine; + private agoraRTCClient: IAgoraRTCClient; + + constructor(irisClient: IrisClient, engine: IrisRtcEngine) { + this._irisClient = irisClient; + this._engine = engine; + this.agoraRTCClient = irisClient.agoraRTCClient; + this.agoraRTCClient.on( + 'connection-state-change', + this.onEventConnectionStateChange.bind(this) + ); + this.agoraRTCClient.on('user-joined', this.onEventUserJoined.bind(this)); + this.agoraRTCClient.on('user-left', this.onEventUserLeft.bind(this)); + this.agoraRTCClient.on( + 'user-published', + this.onEventUserPublished.bind(this) + ); + this.agoraRTCClient.on( + 'user-unpublished', + this.onEventUserUnpublished.bind(this) + ); + this.agoraRTCClient.on( + 'user-info-updated', + this.onEventUserInfoUpdated.bind(this) + ); + this.agoraRTCClient.on( + 'media-reconnect-start', + this.onEventMediaReconnectStart.bind(this) + ); + this.agoraRTCClient.on( + 'media-reconnect-end', + this.onEventMediaReconnectEnd.bind(this) + ); + this.agoraRTCClient.on( + 'stream-type-changed', + this.onEventStreamTypeChanged.bind(this) + ); + this.agoraRTCClient.on( + 'stream-fallback', + this.onEventStreamFallback.bind(this) + ); + this.agoraRTCClient.on( + 'channel-media-relay-state', + this.onEventChannelMediaRelayState.bind(this) + ); + this.agoraRTCClient.on( + 'channel-media-relay-event', + this.onEventChannelMediaRelayEvent.bind(this) + ); + this.agoraRTCClient.on( + 'volume-indicator', + this.onEventVolumeIndicator.bind(this) + ); + this.agoraRTCClient.on('crypt-error', this.onEventCryptError.bind(this)); + this.agoraRTCClient.on( + 'token-privilege-will-expire', + this.onEventTokenPrivilegeWillExpire.bind(this) + ); + this.agoraRTCClient.on( + 'token-privilege-did-expire', + this.onEventTokenPrivilegeDidExpire.bind(this) + ); + this.agoraRTCClient.on( + 'network-quality', + this.onEventNetworkQuality.bind(this) + ); + this.agoraRTCClient.on( + 'live-streaming-error', + this.onEventLiveStreamingError.bind(this) + ); + this.agoraRTCClient.on( + 'live-streaming-warning', + this.onEventLiveStreamingWarning.bind(this) + ); + this.agoraRTCClient.on('exception', this.onEventException.bind(this)); + this.agoraRTCClient.on( + 'is-using-cloud-proxy', + this.onEventIsUsingCloudProxy.bind(this) + ); + this.agoraRTCClient.on( + 'join-fallback-to-proxy', + this.onEventJoinFallbackToProxy.bind(this) + ); + this.agoraRTCClient.on( + 'published-user-list', + this.onEventPublishedUserList.bind(this) + ); + this.agoraRTCClient.on( + 'content-inspect-error', + this.onEventContentInspectError.bind(this) + ); + this.agoraRTCClient.on( + 'content_inspect_result', + this.onEventContentInspectResult.bind(this) + ); + } + + onEventConnectionStateChange( + curState: ConnectionState, + revState: ConnectionState, + reason?: ConnectionDisconnectedReason + ): void { + if (curState == 'DISCONNECTED') + this._engine.rtcEngineEventHandler.onConnectionLostEx( + this._irisClient.connection + ); + else if ( + reason == ConnectionDisconnectedReason.CHANNEL_BANNED || + reason == ConnectionDisconnectedReason.IP_BANNED || + reason == ConnectionDisconnectedReason.UID_BANNED + ) { + this._engine.rtcEngineEventHandler.onConnectionBannedEx( + this._irisClient.connection + ); + } else if ( + reason == ConnectionDisconnectedReason.NETWORK_ERROR || + reason == ConnectionDisconnectedReason.SERVER_ERROR + ) { + this._engine.rtcEngineEventHandler.onConnectionInterruptedEx( + this._irisClient.connection + ); } - onEventChannelMediaRelayState(state: ChannelMediaRelayState, code: ChannelMediaRelayError): void { - let state2 = AgoraTranslate.ChannelMediaRelayState2NATIVE_RTCCHANNEL_MEDIA_RELAY_STATE(state); - let code2 = AgoraTranslate.ChannelMediaRelayError2NATIVE_RTCCHANNEL_MEDIA_RELAY_ERROR(code); - this._engine.rtcEngineEventHandler.onChannelMediaRelayStateChanged(state2, code2); + if (curState != 'DISCONNECTING') { + let state = AgoraTranslate.ConnectionState2NATIVE_RTCCONNECTION_STATE_TYPE( + curState + ); + let reason2: NATIVE_RTC.CONNECTION_CHANGED_REASON_TYPE = + NATIVE_RTC.CONNECTION_CHANGED_REASON_TYPE + .CONNECTION_CHANGED_INTERRUPTED; + if (reason != null) { + reason2 = AgoraTranslate.ConnectionDisconnectedReason2NATIVE_RTCCONNECTION_CHANGED_REASON_TYPE( + reason + ); + } + this._engine.rtcEngineEventHandler.onConnectionStateChangedEx( + this._irisClient.connection, + state, + reason2 + ); } - - onEventChannelMediaRelayEvent(event: ChannelMediaRelayEvent): void { - let event2 = AgoraTranslate.ChannelMediaRelayEvent2NATIVE_RTCCHANNEL_MEDIA_RELAY_EVENT(event); - this._engine.rtcEngineEventHandler.onChannelMediaRelayEvent(event2); - } - - onEventVolumeIndicator(result: { level: number; uid: UID; }[]): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - - let speakers: NATIVE_RTC.AudioVolumeInfo[] = []; - for (let i = 0; i < result.length; i++) { - speakers.push(AgoraTranslate.volumeIndicatorResult2NATIVE_RTCAudioVolumeInfo(result[i])); - } - let speakerNumber = result.length; - /* todo - * - In the local user's callback, `totalVolume` is the sum of the voice volume and audio-mixing volume - * of the local user. - * - In the remote users' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume - * of all the remote speakers. - */ - let totalVolume = 0; - this._engine.rtcEngineEventHandler.onAudioVolumeIndicationEx(connection, speakers, speakerNumber, totalVolume); - } - - onEventCryptError(): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - let errorType: NATIVE_RTC.ENCRYPTION_ERROR_TYPE = NATIVE_RTC.ENCRYPTION_ERROR_TYPE.ENCRYPTION_ERROR_INTERNAL_FAILURE; - this._engine.rtcEngineEventHandler.onEncryptionErrorEx(connection, errorType); + } + + /* + * 假设我们主客户端A和子客户端B,同时加入频道1, 此时另外一个用户C加入了频道1 + * 1.用户C 加入离开,开始推流,结束推流等行为会触发2次 + * 2.主客户端A会触发 用户B加入(需要过滤掉这个值) + * 3.子客户端B会触发 用户A加入(需要过滤点这个值) + **/ + onEventUserJoined(user: IAgoraRTCRemoteUser): void { + let connection: NATIVE_RTC.RtcConnection = { + channelId: this.agoraRTCClient.channelName, + localUid: this.agoraRTCClient.uid as number, + }; + let remoteUid = user.uid; + let elapsed = 0; + this._engine.rtcEngineEventHandler.onUserJoinedEx( + connection, + remoteUid as number, + elapsed + ); + + let userPackage = this._engine.irisClientManager.getRemoteUserPackageByUid( + user.uid + ); + if (!userPackage) { + userPackage = new RemoteUserPackage( + connection, + null, + user.uid, + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE, + IrisAudioSourceType.kAudioSourceTypeRemote + ); + this._engine.irisClientManager.addRemoteUserPackage(userPackage); + } else { + userPackage.update({ + uid: user.uid, + }); } - - onEventTokenPrivilegeWillExpire(): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - - let token: string = ""; - if (this._clientType == IrisClientType.kClientMain) { - if (this._engine.mainClientVariables.token) { - token = this._engine.mainClientVariables.token - } - } - else { - let options = this._engine.subClientVariables.channelMediaOptions.getT(this._client.channelName, this._client.uid); - if (options && options.token) { - token = options.token; - } - } - this._engine.rtcEngineEventHandler.onTokenPrivilegeWillExpireEx(connection, token); + } + + onEventUserLeft(user: IAgoraRTCRemoteUser, reason: string): void { + let remoteUser = this._engine.irisClientManager.getRemoteUserPackageByUid( + user.uid + ); + let reason2 = AgoraTranslate.string2NATIVE_RTCUSER_OFFLINE_REASON_TYPE( + reason + ); + this._engine.rtcEngineEventHandler.onUserOfflineEx( + this._irisClient.connection, + user.uid as number, + reason2 + ); + + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.UNSUBSCRIBE_AUDIO_TRACK, + [remoteUser] + ); + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.UNSUBSCRIBE_AUDIO_TRACK, + [remoteUser] + ); + this._engine.irisClientManager.removeRemoteUserPackage(user.uid); + this._engine.irisClientManager.removetrackEventHandlerByRemoteUser( + user, + 'all' + ); + } + + onEventUserPublished( + user: IAgoraRTCRemoteUser, + mediaType: 'audio' | 'video' + ): void { + let remoteUser = this._engine.irisClientManager.getRemoteUserPackageByUid( + user.uid + ); + if (remoteUser) { + if (mediaType == 'audio') { + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.SUBSCRIBE_AUDIO_TRACK, + [remoteUser] + ); + } else if (mediaType == 'video') { + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + [remoteUser] + ); + } } - - - onEventTokenPrivilegeDidExpire(): void { - let connection: NATIVE_RTC.RtcConnection = { - channelId: this._client.channelName, - localUid: this._client.uid as number - }; - this._engine.rtcEngineEventHandler.onRequestTokenEx(connection); + } + + onEventUserUnpublished( + user: IAgoraRTCRemoteUser, + mediaType: 'audio' | 'video' + ): void { + let remoteUser = this._engine.irisClientManager.getRemoteUserPackageByUid( + user.uid + ); + if (remoteUser) { + if (mediaType == 'audio') { + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.UNSUBSCRIBE_AUDIO_TRACK, + [remoteUser] + ); + } else if (mediaType == 'video') { + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK, + [remoteUser] + ); + } } - - onEventNetworkQuality(stats: NetworkQuality): void { - //不能对应 onNetworkQuality, 因为这里是得到自己的网络状况,而 onNetworkQuality 是别人的网络状况 - //暂时没有找到对应的回调 + } + + onEventUserInfoUpdated( + uid: UID, + msg: + | 'mute-audio' + | 'mute-video' + | 'enable-local-video' + | 'unmute-audio' + | 'unmute-video' + | 'disable-local-video' + ): void { + let remoteUid = uid as number; + + switch (msg) { + case 'mute-audio': + this._engine.rtcEngineEventHandler.onUserMuteAudioEx( + this._irisClient.connection, + remoteUid, + true + ); + this._engine.rtcEngineEventHandler.onUserStateChangedEx( + this._irisClient.connection, + remoteUid, + NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_AUDIO + ); + break; + case 'mute-video': + this._engine.rtcEngineEventHandler.onUserMuteVideoEx( + this._irisClient.connection, + remoteUid, + true + ); + this._engine.rtcEngineEventHandler.onUserStateChangedEx( + this._irisClient.connection, + remoteUid, + NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_MUTE_VIDEO + ); + + break; + case 'unmute-audio': + this._engine.rtcEngineEventHandler.onUserMuteAudioEx( + this._irisClient.connection, + remoteUid, + false + ); + break; + case 'unmute-video': + this._engine.rtcEngineEventHandler.onUserMuteVideoEx( + this._irisClient.connection, + remoteUid, + false + ); + break; + case 'enable-local-video': + this._engine.rtcEngineEventHandler.onUserEnableLocalVideoEx( + this._irisClient.connection, + remoteUid, + true + ); + this._engine.rtcEngineEventHandler.onUserStateChangedEx( + this._irisClient.connection, + remoteUid, + NATIVE_RTC.REMOTE_USER_STATE.USER_STATE_ENABLE_LOCAL_VIDEO + ); + break; + case 'disable-local-video': + this._engine.rtcEngineEventHandler.onUserEnableLocalVideoEx( + this._irisClient.connection, + remoteUid, + false + ); + break; } - - //todo 后边再做 - onEventLiveStreamingError(url: string, err: IAgoraRTCError): void { - - + } + + onEventMediaReconnectStart(uid: UID): void { + //暂时没有找到对应的回调 + } + + onEventMediaReconnectEnd(uid: UID): void { + //展示没有找到合适的回调 + } + onEventStreamTypeChanged(uid: UID, streamType: RemoteStreamType): void { + //展示没有合适的回调 + } + + onEventStreamFallback( + uid: UID, + isFallbackOrRecover: 'fallback' | 'recover' + ): void { + this._engine.rtcEngineEventHandler.onRemoteSubscribeFallbackToAudioOnly( + uid as number, + isFallbackOrRecover == 'fallback' ? true : false + ); + } + + onEventChannelMediaRelayState( + state: ChannelMediaRelayState, + code: ChannelMediaRelayError + ): void { + let state2 = AgoraTranslate.ChannelMediaRelayState2NATIVE_RTCCHANNEL_MEDIA_RELAY_STATE( + state + ); + let code2 = AgoraTranslate.ChannelMediaRelayError2NATIVE_RTCCHANNEL_MEDIA_RELAY_ERROR( + code + ); + this._engine.rtcEngineEventHandler.onChannelMediaRelayStateChanged( + state2, + code2 + ); + } + + onEventChannelMediaRelayEvent(event: ChannelMediaRelayEvent): void { + let event2 = AgoraTranslate.ChannelMediaRelayEvent2NATIVE_RTCCHANNEL_MEDIA_RELAY_EVENT( + event + ); + this._engine.rtcEngineEventHandler.onChannelMediaRelayEvent(event2); + } + + onEventVolumeIndicator(result: { level: number; uid: UID }[]): void { + let speakers: NATIVE_RTC.AudioVolumeInfo[] = []; + for (let i = 0; i < result.length; i++) { + speakers.push( + AgoraTranslate.volumeIndicatorResult2NATIVE_RTCAudioVolumeInfo( + result[i] + ) + ); } - - //todo 后边再做 - onEventLiveStreamingWarning(url: string, warning: IAgoraRTCError): void { - + let speakerNumber = result.length; + /* todo + * - In the local user's callback, `totalVolume` is the sum of the voice volume and audio-mixing volume + * of the local user. + * - In the remote users' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume + * of all the remote speakers. + */ + let totalVolume = 0; + this._engine.rtcEngineEventHandler.onAudioVolumeIndicationEx( + this._irisClient.connection, + speakers, + speakerNumber, + totalVolume + ); + } + + onEventCryptError(): void { + let errorType: NATIVE_RTC.ENCRYPTION_ERROR_TYPE = + NATIVE_RTC.ENCRYPTION_ERROR_TYPE.ENCRYPTION_ERROR_INTERNAL_FAILURE; + this._engine.rtcEngineEventHandler.onEncryptionErrorEx( + this._irisClient.connection, + errorType + ); + } + + onEventTokenPrivilegeWillExpire(): void { + let token: string = this._irisClient.irisClientState.token; + this._engine.rtcEngineEventHandler.onTokenPrivilegeWillExpireEx( + this._irisClient.connection, + token + ); + } + + onEventTokenPrivilegeDidExpire(): void { + this._engine.rtcEngineEventHandler.onRequestTokenEx( + this._irisClient.connection + ); + } + + onEventNetworkQuality(stats: NetworkQuality): void { + //不能对应 onNetworkQuality, 因为这里是得到自己的网络状况,而 onNetworkQuality 是别人的网络状况 + //暂时没有找到对应的回调 + } + + //todo 后边再做 + onEventLiveStreamingError(url: string, err: IAgoraRTCError): void {} + + //todo 后边再做 + onEventLiveStreamingWarning(url: string, warning: IAgoraRTCError): void {} + + onEventException(event: { code: number; msg: string; uid: UID }): void { + //触发不了onError和onWarning, 错误吗几乎没有重合的部分 + } + + onEventIsUsingCloudProxy(isUsingProxy: boolean): void { + //todo 暂时没有找到对应的回调 + } + + onEventJoinFallbackToProxy(proxyServer: string): void { + //todo 暂时没有找到对应的回调 + } + + onEventPublishedUserList(users: IAgoraRTCRemoteUser): void { + //todo 暂时没有找到对应的回调 + } + + onEventContentInspectError(error?: IAgoraRTCError): void { + this._engine.rtcEngineEventHandler.onError( + NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, + error?.message || 'Content Inspect Error' + ); + } + + onEventContentInspectResult( + data?: 'porn' | 'sexy' | 'neutral', + error?: IAgoraRTCError + ) { + if (data) { + let result = AgoraTranslate.data2NATIVE_RTC_CONNECT_INSPECT_RESULT(data); + this._engine.rtcEngineEventHandler.onContentInspectResult(result); } + } - - onEventException(event: { code: number; msg: string; uid: UID; }): void { - //触发不了onError和onWarning, 错误吗几乎没有重合的部分 - - } - - onEventIsUsingCloudProxy(isUsingProxy: boolean): void { - //todo 暂时没有找到对应的回调 - } - - onEventJoinFallbackToProxy(proxyServer: string): void { - //todo 暂时没有找到对应的回调 - } - - onEventPublishedUserList(users: IAgoraRTCRemoteUser): void { - //todo 暂时没有找到对应的回调 - console.log("onEventPublishedUserList"); - console.log(users); - } - - onEventContentInspectConnectionStateChange(preState: `${InspectState}`, newState: `${InspectState}`): void { - //没有合适的回调 - } - - onEventContentInspectError(error?: IAgoraRTCError): void { - this._engine.rtcEngineEventHandler.onError(NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, error?.message || "Content Inspect Error"); - } - - onEventContentInspectResult(data?: "porn" | "sexy" | "neutral", error?: IAgoraRTCError) { - if (data) { - let result = AgoraTranslate.data2NATIVE_RTC_CONNECT_INSPECT_RESULT(data); - this._engine.rtcEngineEventHandler.onContentInspectResult(result); - } - } - - destruction() { - this._client.removeAllListeners(); - } -} \ No newline at end of file + release() { + this.agoraRTCClient.removeAllListeners(); + } +} diff --git a/packages/rtc/src/event_handler/IrisTrackEventHandler.ts b/packages/rtc/src/event_handler/IrisTrackEventHandler.ts index 15ded52..4ac10ae 100644 --- a/packages/rtc/src/event_handler/IrisTrackEventHandler.ts +++ b/packages/rtc/src/event_handler/IrisTrackEventHandler.ts @@ -10,6 +10,10 @@ import { ITrack, } from 'agora-rtc-sdk-ng'; +import { IrisAudioSourceType } from '../base/BaseType'; + +import { BufferSourceAudioTrackPackage } from '../engine/IrisClientManager'; + import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { CheckVideoVisibleResult } from '../web_sdk'; @@ -33,7 +37,6 @@ export interface IrisTrackEventHandlerParam { //一个track可能被多个Client发布出去,所以一个track可以同事存在多个TrackEventHandler export class IrisTrackEventHandler { - private _channelName: string = null; private _client: IAgoraRTCClient = null; private _remoteUser: IAgoraRTCRemoteUser = null; private _track: ITrack | IBufferSourceAudioTrack = null; @@ -52,7 +55,6 @@ export class IrisTrackEventHandler { private __onEventSourceStateChange = null; constructor(params: IrisTrackEventHandlerParam, engine: IrisRtcEngine) { - this._channelName = params.channelName; this._client = params.client; this._remoteUser = params.remoteUser; this._track = params.track; @@ -111,10 +113,11 @@ export class IrisTrackEventHandler { case 'ILocalTrack': // 屏幕共享的case if ( - this._videoSourceType === - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY + this._engine.implHelper.isScreenCapture( + this._videoSourceType as NATIVE_RTC.VIDEO_SOURCE_TYPE + ) ) { - this._engine.implDispatchsMap + this._engine.implDispatchesMap .get('RtcEngine') ._impl.stopScreenCapture(); } @@ -126,9 +129,9 @@ export class IrisTrackEventHandler { onEventSourceStateChange() { if (this._trackType === 'IBufferSourceAudioTrack') { - let soundId = this._engine.entitiesContainer.getLocalBufferSourceAudioTrackSoundIdByTrack( - this._track as IBufferSourceAudioTrack - ); + let soundId = (this._engine.irisClientManager.getLocalAudioTrackPackageBySourceType( + IrisAudioSourceType.kAudioSourceTypeBufferSourceAudio + )[0] as BufferSourceAudioTrackPackage).soundId; this._engine.rtcEngineEventHandler.onAudioEffectFinished(soundId); } } @@ -206,7 +209,7 @@ export class IrisTrackEventHandler { return this._trackType; } - destruction() { + release() { if (this._trackType == 'ILocalTrack') { let track = this._track as ILocalTrack; track.off('track-ended', this.__onEventTrackEnded); diff --git a/packages/rtc/src/extensions/CallApiBufferExtensions.ts b/packages/rtc/src/extensions/CallApiBufferExtensions.ts index e28cf5b..6886539 100644 --- a/packages/rtc/src/extensions/CallApiBufferExtensions.ts +++ b/packages/rtc/src/extensions/CallApiBufferExtensions.ts @@ -1,17 +1,15 @@ -import * as NATIVE_RTC from '@iris/native-rtc-binding'; - import { ApiParam } from 'iris-web-core'; -import { IrisApiType } from '../base/IrisApiType'; - export function callApiBufferExtension( - func_name: IrisApiType, + func_name: string, data: any, buffer: Array ): ApiParam { switch (func_name) { - case IrisApiType.FUNC_MEDIAENGINE_PUSHVIDEOFRAME: - (data.frame as NATIVE_RTC.ExternalVideoFrame).buffer = buffer; + case 'MediaEngine_pushVideoFrame': + if (typeof data?.frame === 'object') { + data.frame.buffer = buffer; + } break; } return data; diff --git a/packages/rtc/src/helper/ClientHelper.ts b/packages/rtc/src/helper/ClientHelper.ts index 89e8efe..0a1a103 100644 --- a/packages/rtc/src/helper/ClientHelper.ts +++ b/packages/rtc/src/helper/ClientHelper.ts @@ -2,11 +2,18 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; import { ClientRole, IAgoraRTCClient } from 'agora-rtc-sdk-ng'; import { CallIrisApiResult } from 'iris-web-core'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + import { AgoraConsole } from '../util/AgoraConsole'; import { AgoraTranslate } from '../util/AgoraTranslate'; export class ClientHelper { - public static async setClientRole( + _engine: IrisRtcEngine; + constructor(engine: IrisRtcEngine) { + this._engine = engine; + } + + public async setClientRole( client: IAgoraRTCClient, role: NATIVE_RTC.CLIENT_ROLE_TYPE, audienceLatencyLevel: NATIVE_RTC.AUDIENCE_LATENCY_LEVEL_TYPE diff --git a/packages/rtc/src/helper/DomHelper.ts b/packages/rtc/src/helper/DomHelper.ts index 6444d4e..eed6905 100644 --- a/packages/rtc/src/helper/DomHelper.ts +++ b/packages/rtc/src/helper/DomHelper.ts @@ -24,7 +24,7 @@ export class IrisElement { this.containerElement = null; } - dispose() { + release() { this.remove(); } } diff --git a/packages/rtc/src/helper/ImplHelper.ts b/packages/rtc/src/helper/ImplHelper.ts new file mode 100644 index 0000000..80b893a --- /dev/null +++ b/packages/rtc/src/helper/ImplHelper.ts @@ -0,0 +1,431 @@ +import * as NATIVE_RTC from '@iris/native-rtc-binding'; +import { + BufferSourceAudioTrackInitConfig, + CameraVideoTrackInitConfig, + IBufferSourceAudioTrack, + ICameraVideoTrack, + ILocalAudioTrack, + ILocalVideoTrack, + IMicrophoneAudioTrack, + ScreenVideoTrackInitConfig, +} from 'agora-rtc-sdk-ng'; + +import { IrisAudioSourceType } from '../base/BaseType'; +import { + AudioTrackPackage, + BufferSourceAudioTrackPackage, + VideoTrackPackage, +} from '../engine/IrisClientManager'; +import { NotifyType } from '../engine/IrisClientObserver'; + +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; +import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler'; + +import { IrisGlobalState } from '../state/IrisGlobalState'; +import { AgoraConsole } from '../util/AgoraConsole'; +import { AgoraTranslate } from '../util/AgoraTranslate'; + +export class ImplHelper { + _engine: IrisRtcEngine; + constructor(engine: IrisRtcEngine) { + this._engine = engine; + } + + public async createBufferSourceAudioTrack( + soundId: number, + bufferSourceAudioTrackInitConfig: BufferSourceAudioTrackInitConfig + ): Promise { + let bufferSourceAudioTrack: IBufferSourceAudioTrack = null; + + try { + bufferSourceAudioTrack = await this._engine.globalState.AgoraRTC.createBufferSourceAudioTrack( + bufferSourceAudioTrackInitConfig + ); + } catch (e) { + AgoraConsole.error('createBufferSourceAudioTrack failed'); + AgoraConsole.error(e); + } + await this.processAudioTrack(bufferSourceAudioTrack); + let bufferSourceAudioTrackPackage = new BufferSourceAudioTrackPackage( + IrisAudioSourceType.kAudioSourceTypeBufferSourceAudio, + bufferSourceAudioTrack, + soundId + ); + this._engine.irisClientManager.addLocalAudioTrackPackage( + bufferSourceAudioTrackPackage + ); + + let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( + { + track: bufferSourceAudioTrack, + trackType: 'IBufferSourceAudioTrack', + }, + this._engine + ); + this._engine.irisClientManager.addTrackEventHandler(trackEventHandler); + + return bufferSourceAudioTrackPackage; + } + + public async createCustomVideoTrack( + videoType: NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM, + mediaStreamTrack: MediaStreamTrack + ): Promise { + let videoTrackPackage: VideoTrackPackage = this._engine.irisClientManager.getLocalVideoTrackPackageBySourceType( + videoType + )[0]; + let videoTrack: ILocalVideoTrack = null; + let config = { + mediaStreamTrack, + }; + + //如果已经有track了,就不需要再创建了 + if (videoTrackPackage?.track) { + return videoTrackPackage; + } + //如果没有track,但是有package,就需要创建track + try { + videoTrack = this._engine.globalState.AgoraRTC.createCustomVideoTrack( + config + ); + } catch (e) { + AgoraConsole.error('createCustomVideoTrack failed'); + AgoraConsole.error(e); + } + await this.processVideoTrack(videoTrack); + + if (!videoTrackPackage) { + videoTrackPackage = new VideoTrackPackage(null, videoType, videoTrack); + this._engine.irisClientManager.addLocalVideoTrackPackage( + videoTrackPackage + ); + } else { + videoTrackPackage.update({ track: videoTrack }); + } + let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( + { + track: videoTrack, + trackType: 'ILocalVideoTrack', + }, + this._engine + ); + this._engine.irisClientManager.addTrackEventHandler(trackEventHandler); + + return videoTrackPackage; + } + + public async createScreenTrack( + captureParams: NATIVE_RTC.ScreenCaptureParameters2, + videoType: NATIVE_RTC.VIDEO_SOURCE_TYPE + ) { + let videoTrackPackage: VideoTrackPackage = this._engine.irisClientManager.getLocalVideoTrackPackageBySourceType( + videoType + )[0]; + + //如果已经有track了,就不需要再创建了 + if (videoTrackPackage?.track) { + return; + } + //如果没有track,但是有package,就需要创建track + let audioTrack: ILocalAudioTrack = null; + let videoTrack: ILocalVideoTrack = null; + let screenTrack = [null, null]; + try { + let conf: ScreenVideoTrackInitConfig = this.generateScreenVideoTrackInitConfig(); + let result = await this._engine.globalState.AgoraRTC.createScreenVideoTrack( + conf, + captureParams.captureAudio ? 'disable' : 'auto' + ); + if (Array.isArray(result)) { + screenTrack = result; + } else { + screenTrack = [result, null]; + } + if (screenTrack) { + //每一个track都可能是null + audioTrack = screenTrack[1]; + if (audioTrack) { + await this.processScreenShareAudioTrack(audioTrack); + let audioTrackPackage = new AudioTrackPackage( + IrisAudioSourceType.kAudioSourceTypeScreenCapture, + audioTrack + ); + this._engine.irisClientManager.addLocalAudioTrackPackage( + audioTrackPackage + ); + } + videoTrack = screenTrack[0]; + if (videoTrack) { + await this.processScreenShareVideoTrack(videoTrack); + + if (!videoTrackPackage) { + videoTrackPackage = new VideoTrackPackage( + null, + videoType, + videoTrack + ); + this._engine.irisClientManager.addLocalVideoTrackPackage( + videoTrackPackage + ); + } else { + videoTrackPackage.update({ track: videoTrack }); + } + + //设置屏幕共享特殊的事件 + let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( + { + track: videoTrack, + videoSourceType: videoType, + trackType: 'ILocalTrack', + }, + this._engine + ); + this._engine.irisClientManager.addTrackEventHandler( + trackEventHandler + ); + } + } + } catch (e) { + throw e; + } + } + + public async createAudioTrack(audioType: IrisAudioSourceType) { + let audioTrackPackage: AudioTrackPackage; + let audioTrack: IMicrophoneAudioTrack = null; + try { + audioTrack = await this._engine.globalState.AgoraRTC.createMicrophoneAudioTrack(); + //受全局enabledAudio控制 + await this._engine.trackHelper.setEnabled(audioTrack, false); + } catch (e) { + AgoraConsole.error('createMicrophoneAudioTrack failed'); + throw e; + } + + await this.processAudioTrack(audioTrack); + audioTrackPackage = new AudioTrackPackage(audioType, audioTrack); + this._engine.irisClientManager.addLocalAudioTrackPackage(audioTrackPackage); + return audioTrackPackage; + } + + public async createVideoCameraTrack(): Promise { + let videoTrack: ICameraVideoTrack = null; + try { + videoTrack = await this._engine.globalState.AgoraRTC.createCameraVideoTrack(); + //受全局enabledVideo控制 + await this._engine.trackHelper.setEnabled(videoTrack, false); + } catch (e) { + AgoraConsole.error('createCameraVideoTrack failed'); + AgoraConsole.error(e); + } + + await this.processVideoTrack(videoTrack); + return videoTrack; + } + + //当一个audioTrack被创建的时候,要拆解这些参数 + public async processScreenShareAudioTrack(audioTrack: ILocalAudioTrack) { + let globalState = this._engine.globalState; + + if (globalState.enabledAudio) { + this._engine.trackHelper.play(audioTrack); + } + if (globalState.pausedAudio) { + await this._engine.trackHelper.setEnabled(audioTrack, false); + } + + if (globalState.mutedLocalAudioStream) { + await this._engine.trackHelper.setMuted(audioTrack, true); + } + } + + public async processScreenShareVideoTrack(videoTrack: ILocalVideoTrack) { + let globalState = this._engine.globalState; + + if (globalState.pausedVideo) { + await this._engine.trackHelper.setEnabled(videoTrack, false); + } + if (globalState.mutedLocalVideoStream) { + await this._engine.trackHelper.setMuted(videoTrack, true); + } + } + + public async processAudioTrack( + audioTrack: IMicrophoneAudioTrack | IBufferSourceAudioTrack + ) { + let globalState = this._engine.globalState; + if (globalState.pausedAudio) { + await this._engine.trackHelper.setEnabled(audioTrack, false); + } + if (globalState.mutedLocalAudioStream) { + await this._engine.trackHelper.setMuted(audioTrack, true); + } + } + + public async processVideoTrack( + videoTrack: ICameraVideoTrack | ILocalVideoTrack + ) { + let globalState = this._engine.globalState; + + if (globalState.pausedVideo) { + await this._engine.trackHelper.setEnabled(videoTrack, false); + } + if (globalState.mutedLocalVideoStream) { + await this._engine.trackHelper.setMuted(videoTrack, true); + } + } + + public generateScreenVideoTrackInitConfig(): ScreenVideoTrackInitConfig { + let videoConfig: CameraVideoTrackInitConfig = {}; + let conf: ScreenVideoTrackInitConfig = {}; + let globalState: IrisGlobalState = this._engine.globalState; + if ( + globalState.screenCaptureContentHint != null && + globalState.screenCaptureContentHint != + NATIVE_RTC.VIDEO_CONTENT_HINT.CONTENT_HINT_NONE + ) { + conf.optimizationMode = AgoraTranslate.NATIVE_RTCVIDEO_CONTENT_HINT2string( + globalState.screenCaptureContentHint + ); + } + + if (globalState.screenCaptureParameters2 != null) { + conf.encoderConfig = AgoraTranslate.NATIVE_RTCScreenCaptureParameters2VideoEncoderConfiguration( + globalState.screenCaptureParameters2 + ); + } + return conf; + } + + public async enumerateDevices(): Promise<{ + playbackDevices: NATIVE_RTC.DeviceInfo[]; + recordingDevices: NATIVE_RTC.DeviceInfo[]; + videoDevices: NATIVE_RTC.DeviceInfo[]; + }> { + let info = await this._engine.globalState.AgoraRTC.getDevices(); + let playbackDevices: any[] = []; + let recordingDevices: any[] = []; + let videoDevices: any[] = []; + for (let e of info) { + if (e.kind == 'audiooutput') { + playbackDevices.push({ + deviceId: e.deviceId, + deviceName: e.label, + }); + } else if (e.kind == 'audioinput') { + recordingDevices.push({ + deviceId: e.deviceId, + deviceName: e.label, + }); + } else if (e.kind == 'videoinput') { + videoDevices.push({ + deviceId: e.deviceId, + deviceName: e.label, + }); + } + } + + this._engine.globalState.playbackDevices = playbackDevices; + this._engine.globalState.recordingDevices = recordingDevices; + this._engine.globalState.videoDevices = videoDevices; + return { + playbackDevices: playbackDevices, + recordingDevices: recordingDevices, + videoDevices: videoDevices, + }; + } + + public async updateChannelMediaOptions( + options: NATIVE_RTC.ChannelMediaOptions, + connection?: NATIVE_RTC.RtcConnection + ) { + const irisClientManager = this._engine.irisClientManager; + const irisClient = irisClientManager.getIrisClientByConnection(connection); + + let agoraRTCClient = irisClient?.agoraRTCClient; + if (!agoraRTCClient) { + return this._engine.returnResult( + false, + -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED + ); + } + + let audioTrackPackages = irisClient.audioTrackPackages; + let videoTrackPackage = irisClient.videoTrackPackage; + let irisClientObserver = irisClientManager.irisClientObserver; + irisClientObserver.notifyLocal(NotifyType.UNPUBLISH_TRACK, [ + ...audioTrackPackages, + videoTrackPackage, + ]); + + let irisClientState = irisClient.irisClientState; + irisClientState.mergeChannelMediaOptions(options); + if (irisClientState.clientRoleType) { + await this._engine.clientHelper.setClientRole( + agoraRTCClient, + irisClientState.clientRoleType, + irisClientState.audienceLatencyLevel + ); + } + if (irisClientState.token) { + try { + await agoraRTCClient.renewToken(irisClientState.token); + } catch (e) { + return this._engine.returnResult(false); + } + } + irisClientObserver.notifyLocal( + NotifyType.PUBLISH_TRACK, + [ + ...irisClientManager.localAudioTrackPackages, + ...irisClientManager.localVideoTrackPackages, + ], + [irisClient] + ); + } + + public isScreenCapture( + sourceType: + | NATIVE_RTC.VIDEO_SOURCE_TYPE + | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE + | IrisAudioSourceType + ) { + return ( + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY || + sourceType == + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY || + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_THIRD || + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_FOURTH + ); + } + + public isVideoCamera( + sourceType: + | NATIVE_RTC.VIDEO_SOURCE_TYPE + | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE + | IrisAudioSourceType + ) { + return ( + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY || + sourceType == + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY || + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_THIRD || + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_FOURTH + ); + } + + public isAudio( + sourceType: + | NATIVE_RTC.VIDEO_SOURCE_TYPE + | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE + | IrisAudioSourceType + ) { + return ( + sourceType === IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary || + sourceType === IrisAudioSourceType.kAudioSourceTypeMicrophoneSecondary || + sourceType === IrisAudioSourceType.kAudioSourceTypeScreenCapture || + sourceType === IrisAudioSourceType.kAudioSourceTypeCustom || + sourceType === IrisAudioSourceType.kAudioSourceTypeUnknown + ); + } +} diff --git a/packages/rtc/src/helper/TrackHelper.ts b/packages/rtc/src/helper/TrackHelper.ts index c9032fd..ceb86b4 100644 --- a/packages/rtc/src/helper/TrackHelper.ts +++ b/packages/rtc/src/helper/TrackHelper.ts @@ -1,16 +1,57 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { ICameraVideoTrack, ILocalTrack } from 'agora-rtc-sdk-ng'; +import { ICameraVideoTrack, ILocalTrack, ITrack } from 'agora-rtc-sdk-ng'; import { CallIrisApiResult } from 'iris-web-core'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + import { AgoraConsole } from '../util/AgoraConsole'; export class TrackHelper { - public static async setEnabled( - track: ILocalTrack, - enabled: boolean - ): Promise { + _engine: IrisRtcEngine; + constructor(engine: IrisRtcEngine) { + this._engine = engine; + } + + public play(track: ITrack, element?: string): void { + try { + track?.play(element); + } catch (e) { + AgoraConsole.error(e); + Promise.resolve( + new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) + ); + throw e; + } + } + + public stop(track: ITrack): void { + try { + track?.stop(); + } catch (e) { + AgoraConsole.error(e); + Promise.resolve( + new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) + ); + throw e; + } + } + + public async setEnabled(track: ILocalTrack, enabled: boolean): Promise { + try { + await track?.setEnabled(enabled); + } catch (e) { + AgoraConsole.error(e); + Promise.resolve( + new CallIrisApiResult(-NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, e) + ); + throw e; + } + } + public async setMuted(track: ILocalTrack, enabled: boolean): Promise { try { - await track.setEnabled(enabled); + if (track?.enabled) { + await track?.setMuted(enabled); + } } catch (e) { AgoraConsole.error(e); Promise.resolve( @@ -19,12 +60,12 @@ export class TrackHelper { throw e; } } - public static async setDevice( + public async setDevice( track: ICameraVideoTrack, deviceId: string ): Promise { try { - await track.setDevice(deviceId); + await track?.setDevice(deviceId); } catch (e) { AgoraConsole.error(e); Promise.resolve( diff --git a/packages/rtc/src/impl/IAgoraMediaEngineImpl.ts b/packages/rtc/src/impl/IAgoraMediaEngineImpl.ts index 48b39ee..fa1d369 100644 --- a/packages/rtc/src/impl/IAgoraMediaEngineImpl.ts +++ b/packages/rtc/src/impl/IAgoraMediaEngineImpl.ts @@ -1,22 +1,15 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { ILocalAudioTrack, ILocalVideoTrack } from 'agora-rtc-sdk-ng'; -import { - AsyncTaskType, - CallApiReturnType, - CallIrisApiResult, -} from 'iris-web-core'; +import { ILocalVideoTrack } from 'agora-rtc-sdk-ng'; +import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; -import { IrisAudioSourceType, IrisClientType } from '../base/BaseType'; -import { IrisApiType } from '../base/IrisApiType'; +import { VideoTrackPackage } from '../engine/IrisClientManager'; + +import { NotifyType } from '../engine/IrisClientObserver'; import { IrisRtcEngine } from '../engine/IrisRtcEngine'; -import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler'; -import { TrackHelper } from '../helper/TrackHelper'; import { AgoraConsole } from '../util/AgoraConsole'; import { drawRGBABufferToCanvas } from '../util/BufferConvert'; -import { ImplHelper } from './ImplHelper'; - export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { private _engine: IrisRtcEngine; @@ -24,21 +17,6 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { this._engine = engine; } - private execute(task: AsyncTaskType): CallApiReturnType { - return this._engine.executor.execute(task); - } - - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - setExternalVideoSource( enabled: boolean, useTexture: boolean, @@ -46,14 +24,14 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { encodedVideoOption: NATIVE_RTC.SenderOptions ): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.pushVideoFrameEnabled = enabled; - this._engine.globalVariables.pushVideoFrameUseTexture = useTexture; - this._engine.globalVariables.pushVideoFrameSourceType = sourceType; - this._engine.globalVariables.pushVideoFrameEncodedVideoOption = encodedVideoOption; + this._engine.globalState.pushVideoFrameEnabled = enabled; + this._engine.globalState.pushVideoFrameUseTexture = useTexture; + this._engine.globalState.pushVideoFrameSourceType = sourceType; + this._engine.globalState.pushVideoFrameEncodedVideoOption = encodedVideoOption; - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } registerVideoEncodedFrameObserver( observer: NATIVE_RTC.IVideoEncodedFrameObserver @@ -61,7 +39,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { AgoraConsole.warn( 'registerVideoEncodedFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -71,7 +49,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { trackId: number ): CallApiReturnType { AgoraConsole.warn('pushAudioFrame not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -84,7 +62,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { publish: boolean ): CallApiReturnType { AgoraConsole.warn('setExternalAudioSource not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -94,7 +72,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { config: NATIVE_RTC.AudioTrackConfig ): CallApiReturnType { AgoraConsole.warn('createCustomAudioTrack not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -103,7 +81,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { AgoraConsole.warn( 'destroyCustomAudioTrack not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -114,7 +92,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { channels: number ): CallApiReturnType { AgoraConsole.warn('setExternalAudioSink not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -126,7 +104,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { AgoraConsole.warn( 'enableCustomAudioLocalPlayback not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -138,14 +116,14 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { videoTrackId: number ): CallApiReturnType { AgoraConsole.warn('pushEncodedVideoImage not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } release(): CallApiReturnType { AgoraConsole.warn('release not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -157,7 +135,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { AgoraConsole.warn( 'registerAudioFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -169,7 +147,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { AgoraConsole.warn( 'registerVideoFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -177,7 +155,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { pushCaptureAudioFrame(frame: NATIVE_RTC.AudioFrame): CallApiReturnType { AgoraConsole.warn('pushCaptureAudioFrame not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -185,7 +163,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { pushReverseAudioFrame(frame: NATIVE_RTC.AudioFrame): CallApiReturnType { AgoraConsole.warn('pushReverseAudioFrame not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -193,7 +171,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { pushDirectAudioFrame(frame: NATIVE_RTC.AudioFrame): CallApiReturnType { AgoraConsole.warn('pushDirectAudioFrame not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -201,7 +179,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { pullAudioFrame(frame: NATIVE_RTC.AudioFrame): CallApiReturnType { AgoraConsole.warn('pullAudioFrame not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -214,7 +192,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { AgoraConsole.warn( 'setDirectExternalAudioSource not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -226,18 +204,22 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { ): CallApiReturnType { //调用engine.release后才会创建新的track let processFunc = async (): Promise => { - if (!this._engine.globalVariables.pushVideoFrameEnabled) { + if (this._engine.globalState.enabledVideo == false) { + AgoraConsole.error('call enableVideo(true) before startPreview'); + return this._engine.returnResult(false); + } + if (!this._engine.globalState.pushVideoFrameEnabled) { AgoraConsole.error( 'pushVideoFrameEnabled is disabled , call setExternalVideoSource first' ); - return this.returnResult(false); + return this._engine.returnResult(false); } //创建custom track的html element let irisContainer = this._engine.irisElement.getIrisElement(); if (!irisContainer) { irisContainer = this._engine.irisElement.createIrisElement(); } - let canvasID = `${IrisApiType.FUNC_MEDIAENGINE_PUSHVIDEOFRAME}_CANVAS`; + let canvasID = `MediaEngine_pushVideoFrame_CANVAS`; let canvas: HTMLCanvasElement = document.querySelector(`#${canvasID}`); if (!canvas) { canvas = document.createElement('canvas'); @@ -249,7 +231,7 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { frame.format !== NATIVE_RTC.VIDEO_PIXEL_FORMAT.VIDEO_PIXEL_RGBA ) { AgoraConsole.error(`format${frame.format} not supported`); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -264,63 +246,37 @@ export class IMediaEngineImpl implements NATIVE_RTC.IMediaEngine { irisContainer.appendChild(canvas); document.body.appendChild(irisContainer); const stream = canvas.captureStream(); + let mediaStreamTrack = stream.getVideoTracks()[0]; - let audioType = IrisAudioSourceType.kAudioSourceTypeUnknown; let videoType = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM; - let clientType = IrisClientType.kClientMain; - - let trackArray: [ILocalAudioTrack, ILocalVideoTrack] = [null, null]; + let videoTrackPackage: VideoTrackPackage; try { - trackArray = await ImplHelper.getOrCreateCustomAudioAndVideoTrackAsync( - this._engine, - audioType, + videoTrackPackage = await this._engine.implHelper.createCustomVideoTrack( videoType, - stream.getVideoTracks()[0], - clientType, - null + mediaStreamTrack ); } catch (err) { err && AgoraConsole.error(err); - return this.returnResult(false); + return this._engine.returnResult(false); } - let videoTrack: ILocalVideoTrack = trackArray[1] as ILocalVideoTrack; + let videoTrack: ILocalVideoTrack = videoTrackPackage.track as ILocalVideoTrack; if (videoTrack) { - let videoPackage = this._engine.entitiesContainer.getLocalVideoTrackByType( - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM - ); if (!videoTrack.enabled) { - await TrackHelper.setEnabled(videoTrack, true); + await this._engine.trackHelper.setEnabled(videoTrack, true); } - //如果没有播放,需要play - if (!videoTrack.isPlaying) { - videoTrack.play(videoPackage.element); - } - //如果已经加入频道,需要publish - if (this._engine.globalVariables.isJoinChannel) { - let mainClient = this._engine.entitiesContainer.getMainClient(); - try { - await mainClient.publish(videoTrack); - } catch (reason) { - AgoraConsole.error(reason); - } - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: mainClient.channelName, - client: mainClient, - track: videoTrack, - trackType: 'ILocalVideoTrack', - }, - this._engine - ); - this._engine.entitiesContainer.addMainClientTrackEventHandler( - trackEventHandler - ); + if (!videoTrack.isPlaying && videoTrackPackage.element) { + this._engine.trackHelper.play(videoTrack, videoTrackPackage.element); } + this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.PUBLISH_TRACK, + [videoTrackPackage], + this._engine.irisClientManager.irisClientList + ); } - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } } diff --git a/packages/rtc/src/impl/IAgoraMediaPlayerImpl.ts b/packages/rtc/src/impl/IAgoraMediaPlayerImpl.ts index 5f64804..c4f19c5 100644 --- a/packages/rtc/src/impl/IAgoraMediaPlayerImpl.ts +++ b/packages/rtc/src/impl/IAgoraMediaPlayerImpl.ts @@ -1,5 +1,5 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; +import { CallApiReturnType } from 'iris-web-core'; import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { AgoraConsole } from '../util/AgoraConsole'; @@ -11,20 +11,9 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - setPlayerOption2(key: string, value: string): CallApiReturnType { AgoraConsole.warn('setPlayerOption2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -37,7 +26,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'registerAudioFrameObserver2 not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -49,7 +38,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'unregisterMediaPlayerAudioSpectrumObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -57,7 +46,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { getMediaPlayerId(): CallApiReturnType { AgoraConsole.warn('getMediaPlayerId not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -65,77 +54,77 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { open(url: string, startPos: number): CallApiReturnType { AgoraConsole.warn('open not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } openWithMediaSource(source: NATIVE_RTC.MediaSource): CallApiReturnType { AgoraConsole.warn('openWithMediaSource not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } play(): CallApiReturnType { AgoraConsole.warn('play not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } pause(): CallApiReturnType { AgoraConsole.warn('pause not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stop(): CallApiReturnType { AgoraConsole.warn('stop not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } resume(): CallApiReturnType { AgoraConsole.warn('resume not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } seek(newPos: number): CallApiReturnType { AgoraConsole.warn('seek not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setAudioPitch(pitch: number): CallApiReturnType { AgoraConsole.warn('setAudioPitch not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getDuration(duration: number): CallApiReturnType { AgoraConsole.warn('getDuration not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPlayPosition(pos: number): CallApiReturnType { AgoraConsole.warn('getPlayPosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getStreamCount(count: number): CallApiReturnType { AgoraConsole.warn('getStreamCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -145,91 +134,91 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { info: NATIVE_RTC.PlayerStreamInfo[] ): CallApiReturnType { AgoraConsole.warn('getStreamInfo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setLoopCount(loopCount: number): CallApiReturnType { AgoraConsole.warn('setLoopCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setPlaybackSpeed(speed: number): CallApiReturnType { AgoraConsole.warn('setPlaybackSpeed not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } selectAudioTrack(index: number): CallApiReturnType { AgoraConsole.warn('selectAudioTrack not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setPlayerOption(key: string, value: number): CallApiReturnType { AgoraConsole.warn('setPlayerOption not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } takeScreenshot(filename: string): CallApiReturnType { AgoraConsole.warn('takeScreenshot not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } selectInternalSubtitle(index: number): CallApiReturnType { AgoraConsole.warn('selectInternalSubtitle not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setExternalSubtitle(url: string): CallApiReturnType { AgoraConsole.warn('setExternalSubtitle not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getState(): CallApiReturnType { AgoraConsole.warn('getState not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } mute(muted: boolean): CallApiReturnType { AgoraConsole.warn('mute not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getMute(muted: boolean): CallApiReturnType { AgoraConsole.warn('getMute not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } adjustPlayoutVolume(volume: number): CallApiReturnType { AgoraConsole.warn('adjustPlayoutVolume not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPlayoutVolume(volume: number): CallApiReturnType { AgoraConsole.warn('getPlayoutVolume not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -238,28 +227,28 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'adjustPublishSignalVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPublishSignalVolume(volume: number): CallApiReturnType { AgoraConsole.warn('getPublishSignalVolume not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setView(view: number): CallApiReturnType { AgoraConsole.warn('setView not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setRenderMode(renderMode: NATIVE_RTC.RENDER_MODE_TYPE): CallApiReturnType { AgoraConsole.warn('setRenderMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -270,7 +259,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'registerPlayerSourceObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -281,7 +270,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'unregisterPlayerSourceObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -292,7 +281,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'registerAudioFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -303,7 +292,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'unregisterAudioFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -314,7 +303,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'registerVideoFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -325,7 +314,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'unregisterVideoFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -337,7 +326,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'registerMediaPlayerAudioSpectrumObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -346,35 +335,35 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { mode: NATIVE_RTC.AUDIO_DUAL_MONO_MODE ): CallApiReturnType { AgoraConsole.warn('setAudioDualMonoMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPlayerSdkVersion(): CallApiReturnType { AgoraConsole.warn('getPlayerSdkVersion not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPlaySrc(): CallApiReturnType { AgoraConsole.warn('getPlaySrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } openWithAgoraCDNSrc(src: string, startPos: number): CallApiReturnType { AgoraConsole.warn('openWithAgoraCDNSrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getAgoraCDNLineCount(): CallApiReturnType { AgoraConsole.warn('getAgoraCDNLineCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -383,7 +372,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'switchAgoraCDNLineByIndex not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -392,7 +381,7 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'getCurrentAgoraCDNIndex not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -401,49 +390,49 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { AgoraConsole.warn( 'enableAutoSwitchAgoraCDN not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } renewAgoraCDNSrcToken(token: string, ts: number): CallApiReturnType { AgoraConsole.warn('renewAgoraCDNSrcToken not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } switchAgoraCDNSrc(src: string, syncPts: boolean): CallApiReturnType { AgoraConsole.warn('switchAgoraCDNSrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } switchSrc(src: string, syncPts: boolean): CallApiReturnType { AgoraConsole.warn('switchSrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } preloadSrc(src: string, startPos: number): CallApiReturnType { AgoraConsole.warn('preloadSrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } playPreloadedSrc(src: string): CallApiReturnType { AgoraConsole.warn('playPreloadedSrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } unloadSrc(src: string): CallApiReturnType { AgoraConsole.warn('unloadSrc not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -452,14 +441,14 @@ export class IMediaPlayerImpl implements NATIVE_RTC.IMediaPlayer { params: NATIVE_RTC.SpatialAudioParams ): CallApiReturnType { AgoraConsole.warn('setSpatialAudioParams not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setSoundPositionParams(pan: number, gain: number): CallApiReturnType { AgoraConsole.warn('setSoundPositionParams not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -474,90 +463,79 @@ export class IMediaPlayerCacheManagerImpl this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - removeAllCaches(): CallApiReturnType { AgoraConsole.warn('removeAllCaches not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } removeOldCache(): CallApiReturnType { AgoraConsole.warn('removeOldCache not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } removeCacheByUri(uri: string): CallApiReturnType { AgoraConsole.warn('removeCacheByUri not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setCacheDir(path: string): CallApiReturnType { AgoraConsole.warn('setCacheDir not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setMaxCacheFileCount(count: number): CallApiReturnType { AgoraConsole.warn('setMaxCacheFileCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setMaxCacheFileSize(cacheSize: number): CallApiReturnType { AgoraConsole.warn('setMaxCacheFileSize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableAutoRemoveCache(enable: boolean): CallApiReturnType { AgoraConsole.warn('enableAutoRemoveCache not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getCacheDir(path: string, length: number): CallApiReturnType { AgoraConsole.warn('getCacheDir not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getMaxCacheFileCount(): CallApiReturnType { AgoraConsole.warn('getMaxCacheFileCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getMaxCacheFileSize(): CallApiReturnType { AgoraConsole.warn('getMaxCacheFileSize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getCacheFileCount(): CallApiReturnType { AgoraConsole.warn('getCacheFileCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); diff --git a/packages/rtc/src/impl/IAgoraMediaRecorderImpl.ts b/packages/rtc/src/impl/IAgoraMediaRecorderImpl.ts index 050bd4e..2846b3d 100644 --- a/packages/rtc/src/impl/IAgoraMediaRecorderImpl.ts +++ b/packages/rtc/src/impl/IAgoraMediaRecorderImpl.ts @@ -1,5 +1,5 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; +import { CallApiReturnType } from 'iris-web-core'; import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { AgoraConsole } from '../util/AgoraConsole'; @@ -11,24 +11,13 @@ export class IMediaRecorderImpl implements NATIVE_RTC.IMediaRecorder { this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - setMediaRecorderObserver( callback: NATIVE_RTC.IMediaRecorderObserver ): CallApiReturnType { AgoraConsole.warn( 'setMediaRecorderObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -37,14 +26,14 @@ export class IMediaRecorderImpl implements NATIVE_RTC.IMediaRecorder { config: NATIVE_RTC.MediaRecorderConfiguration ): CallApiReturnType { AgoraConsole.warn('startRecording not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopRecording(): CallApiReturnType { AgoraConsole.warn('stopRecording not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); diff --git a/packages/rtc/src/impl/IAgoraMusicContentCenterImpl.ts b/packages/rtc/src/impl/IAgoraMusicContentCenterImpl.ts index 160d398..eb9c0a6 100644 --- a/packages/rtc/src/impl/IAgoraMusicContentCenterImpl.ts +++ b/packages/rtc/src/impl/IAgoraMusicContentCenterImpl.ts @@ -1,5 +1,5 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; +import { CallApiReturnType } from 'iris-web-core'; import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { AgoraConsole } from '../util/AgoraConsole'; @@ -11,36 +11,25 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - initialize( configuration: NATIVE_RTC.MusicContentCenterConfiguration ): CallApiReturnType { AgoraConsole.warn('initialize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } renewToken(token: string): CallApiReturnType { AgoraConsole.warn('renewToken not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } release(): CallApiReturnType { AgoraConsole.warn('release not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -49,28 +38,28 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { eventHandler: NATIVE_RTC.IMusicContentCenterEventHandler ): CallApiReturnType { AgoraConsole.warn('registerEventHandler not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } unregisterEventHandler(): CallApiReturnType { AgoraConsole.warn('unregisterEventHandler not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } createMusicPlayer(): CallApiReturnType { AgoraConsole.warn('createMusicPlayer not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getMusicCharts(requestId: string): CallApiReturnType { AgoraConsole.warn('getMusicCharts not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -85,7 +74,7 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { AgoraConsole.warn( 'getMusicCollectionByMusicChartId not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -98,28 +87,28 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { jsonOption: string ): CallApiReturnType { AgoraConsole.warn('searchMusic not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } preload(songCode: number, jsonOption: string): CallApiReturnType { AgoraConsole.warn('preload not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } preload2(requestId: string, songCode: number): CallApiReturnType { AgoraConsole.warn('preload2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } removeCache(songCode: number): CallApiReturnType { AgoraConsole.warn('removeCache not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -129,14 +118,14 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { cacheInfoSize: number[] ): CallApiReturnType { AgoraConsole.warn('getCaches not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } isPreloaded(songCode: number): CallApiReturnType { AgoraConsole.warn('isPreloaded not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -147,14 +136,14 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { LyricType: number ): CallApiReturnType { AgoraConsole.warn('getLyric not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getSongSimpleInfo(requestId: string, songCode: number): CallApiReturnType { AgoraConsole.warn('getSongSimpleInfo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -165,7 +154,7 @@ export class IMusicContentCenterImpl implements NATIVE_RTC.IMusicContentCenter { internalSongCode: number ): CallApiReturnType { AgoraConsole.warn('getInternalSongCode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -180,27 +169,16 @@ export class MusicChartCollectionImpl this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - getCount(): CallApiReturnType { AgoraConsole.warn('getCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } get(index: number): CallApiReturnType { AgoraConsole.warn('get not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -213,17 +191,6 @@ export class IMusicPlayerImpl implements NATIVE_RTC.IMusicPlayer { public constructor(engine: IrisRtcEngine) { this._engine = engine; } - - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } } export class MusicCollectionImpl implements NATIVE_RTC.MusicCollection { @@ -233,48 +200,37 @@ export class MusicCollectionImpl implements NATIVE_RTC.MusicCollection { this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - getCount(): CallApiReturnType { AgoraConsole.warn('getCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getTotal(): CallApiReturnType { AgoraConsole.warn('getTotal not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPage(): CallApiReturnType { AgoraConsole.warn('getPage not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getPageSize(): CallApiReturnType { AgoraConsole.warn('getPageSize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getMusic(index: number): CallApiReturnType { AgoraConsole.warn('getMusic not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); diff --git a/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts b/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts index b7c3025..763ee23 100644 --- a/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts +++ b/packages/rtc/src/impl/IAgoraRtcEngineExImpl.ts @@ -1,29 +1,15 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { - IAgoraRTCClient, - ILocalAudioTrack, - ILocalVideoTrack, -} from 'agora-rtc-sdk-ng'; -import { - AsyncTaskType, - CallApiReturnType, - CallIrisApiResult, -} from 'iris-web-core'; +import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; -import { IrisAudioSourceType, IrisClientType } from '../base/BaseType'; +import { IrisClient } from '../engine/IrisClient'; +import { RemoteUserPackage } from '../engine/IrisClientManager'; -import { IrisRtcEngine } from '../engine/IrisRtcEngine'; -import { IrisClientEventHandler } from '../event_handler/IrisClientEventHandler'; +import { NotifyRemoteType, NotifyType } from '../engine/IrisClientObserver'; -import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler'; -import { ClientHelper } from '../helper/ClientHelper'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { AgoraConsole } from '../util/AgoraConsole'; -import { Container } from '../util/Container'; - -import { ImplHelper } from './ImplHelper'; - export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { private _engine: IrisRtcEngine; @@ -31,28 +17,13 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { this._engine = engine; } - private execute(task: AsyncTaskType): CallApiReturnType { - return this._engine.executor.execute(task); - } - - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - enableContentInspectEx( enabled: boolean, config: NATIVE_RTC.ContentInspectConfig, connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('enableContentInspectEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -64,56 +35,14 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { options: NATIVE_RTC.ChannelMediaOptions ): CallApiReturnType { let processJoinChannel = async (): Promise => { - //设置全局已经建立过连接 - this._engine.globalVariables.isJoinChannel = true; - - let subClientVariables = this._engine.subClientVariables; - let fullOptions = subClientVariables.mergeChannelMediaOptions( - connection, - options - ); - fullOptions.token = token; - - let subClient: IAgoraRTCClient = ImplHelper.createSubClient( - this._engine, - connection - ); - let audioSource = IrisAudioSourceType.kAudioSourceTypeUnknown; - let videoSource = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN; - let clientType = IrisClientType.kClientSub; - - if (options.publishMicrophoneTrack) { - audioSource = IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary; - } else if (options.publishScreenCaptureAudio) { - audioSource = IrisAudioSourceType.kAudioSourceTypeScreenPrimary; - } - if (options.publishCameraTrack) { - videoSource = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; - } else if (options.publishSecondaryCameraTrack) { - videoSource = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY; - } else if ( - options.publishScreenTrack || - options.publishScreenCaptureVideo - ) { - videoSource = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; - } - - let entitiesContainer = this._engine.entitiesContainer; - entitiesContainer.addSubClient(connection, subClient); - let subClientEventHandler = new IrisClientEventHandler( - subClient, - IrisClientType.kClientSub, - this._engine - ); - entitiesContainer.addSubClientEventHandler( - connection, - subClientEventHandler - ); + let irisClient = new IrisClient(this._engine, connection); + irisClient.createClient(options); + irisClient.irisClientState.token = token; + let agoraRTCClient = irisClient.agoraRTCClient; try { - await subClient.join( - this._engine.globalVariables.rtcEngineContext.appId, + await agoraRTCClient.join( + this._engine.globalState.rtcEngineContext.appId, connection.channelId, token ? token : null, connection.localUid @@ -124,106 +53,49 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { NATIVE_RTC.ERROR_CODE_TYPE.ERR_JOIN_CHANNEL_REJECTED, '' ); - this._engine.entitiesContainer.clearSubClientAll(connection); - return this.returnResult(false); + irisClient.release(); + return this._engine.returnResult(false); } - this._engine.rtcEngineEventHandler.onJoinChannelSuccessEx(connection, 0); - //检查是否已经创建了屏幕共享的video track,如果没有则跳出 - if ( - !ImplHelper.getAudioAndVideoTrack( - this._engine, - audioSource, - videoSource - )[1] - ) { - AgoraConsole.log('screen share track not found, skip joinChannel call'); - return this.returnResult(); - } - - let trackArray: [ILocalAudioTrack, ILocalVideoTrack] = [null, null]; - try { - trackArray = await ImplHelper.getOrCreateAudioAndVideoTrackAsync( - this._engine, - audioSource, - videoSource, - clientType, - connection - ); - } catch (e) { - AgoraConsole.error(e); - return this.returnResult(false); - } - - // 推送audioTrack - let audioTrack: ILocalAudioTrack = trackArray[0] as ILocalAudioTrack; - if (audioTrack) { - try { - await subClient.publish(audioTrack); - } catch (reason) { - AgoraConsole.error(reason); - } - entitiesContainer.addSubClientLocalAudioTrack(connection, { - type: audioSource, - track: audioTrack, - }); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: connection.channelId, - client: subClient, - track: audioTrack, - trackType: 'ILocalTrack', - }, - this._engine - ); - entitiesContainer.addSubClientTrackEventHandler( - connection, - trackEventHandler - ); - } + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.PUBLISH_TRACK, + [ + ...this._engine.irisClientManager.localAudioTrackPackages, + ...this._engine.irisClientManager.localVideoTrackPackages, + ], + [irisClient] + ); - //推送videoTrack - let videoTrack: ILocalVideoTrack = trackArray[1] as ILocalVideoTrack; - if (videoTrack) { - try { - await subClient.publish(videoTrack); - } catch (reason) { - AgoraConsole.error(reason); - } - entitiesContainer.setSubClientLocalVideoTrack(connection, { - type: videoSource, - track: videoTrack, - }); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: connection.channelId, - client: subClient, - track: videoTrack, - trackType: 'ILocalTrack', - }, - this._engine - ); - entitiesContainer.addSubClientTrackEventHandler( - connection, - trackEventHandler - ); - } - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processJoinChannel); + return this._engine.execute(processJoinChannel); } leaveChannelEx(connection: NATIVE_RTC.RtcConnection): CallApiReturnType { let processFunc = async (): Promise => { - let subClient: IAgoraRTCClient = this._engine.entitiesContainer.getSubClient( + if (this._engine.irisClientManager.irisClientList.length === 0) { + return this._engine.returnResult(); + } + + let irisClient = this._engine.irisClientManager.getIrisClientByConnection( connection ); - if (subClient) { + + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNPUBLISH_TRACK, + [ + ...this._engine.irisClientManager.localAudioTrackPackages, + ...this._engine.irisClientManager.localVideoTrackPackages, + ] + ); + + let agoraRTCClient = irisClient?.agoraRTCClient; + if (agoraRTCClient) { try { - await subClient.leave(); + await agoraRTCClient.leave(); } catch (e) { AgoraConsole.error(e); - this.returnResult(false); + this._engine.returnResult(false); this._engine.rtcEngineEventHandler.onError( NATIVE_RTC.ERROR_CODE_TYPE.ERR_LEAVE_CHANNEL_REJECTED, '' @@ -233,23 +105,19 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection, new NATIVE_RTC.RtcStats() ); - this._engine.entitiesContainer.clearSubClientAll(connection); + irisClient.release(); } - //如果已经没有subClient, 则需要将连接状态更改 - let subClients: Container = this._engine.entitiesContainer.getSubClients(); - let container = subClients.getContainer(); - this._engine.globalVariables.isJoinChannel = container.size > 0; - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } leaveChannelEx2( connection: NATIVE_RTC.RtcConnection, options: NATIVE_RTC.LeaveChannelOptions ): CallApiReturnType { AgoraConsole.warn('leaveChannelEx2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -259,415 +127,15 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { let processInSequence = async () => { - this._engine.subClientVariables.mergeChannelMediaOptions( - connection, - options + await this._engine.implHelper.updateChannelMediaOptions( + options, + connection ); - //必须先依次 unpublish, 完毕之后,再依次去publish - let entitiesContainer = this._engine.entitiesContainer; - let subClient = entitiesContainer.getSubClient(connection); - if (subClient == null) { - return this.returnResult(false); - } - - let argsUnpublish: Array<[ - string, - IrisAudioSourceType | NATIVE_RTC.VIDEO_SOURCE_TYPE, - 'audio' | 'video' - ]> = []; - let argsPublish: Array<[ - string, - IrisAudioSourceType | NATIVE_RTC.VIDEO_SOURCE_TYPE, - 'audio' | 'video' - ]> = []; - - if (!options.publishCameraTrack) { - argsUnpublish.push([ - 'publishCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY, - 'video', - ]); - } else if (options.publishCameraTrack) { - argsPublish.push([ - 'publishCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY, - 'video', - ]); - } - - if (!options.publishSecondaryCameraTrack) { - argsUnpublish.push([ - 'publishSecondaryCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY, - 'video', - ]); - } else if (options.publishSecondaryCameraTrack) { - argsPublish.push([ - 'publishSecondaryCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY, - 'video', - ]); - } - - if (!options.publishThirdCameraTrack) { - argsUnpublish.push([ - 'publishThirdCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_THIRD, - 'video', - ]); - } else if (options.publishThirdCameraTrack) { - argsPublish.push([ - 'publishThirdCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_THIRD, - 'video', - ]); - } - - if (!options.publishFourthCameraTrack) { - argsUnpublish.push([ - 'publishFourthCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_FOURTH, - 'video', - ]); - } else if (options.publishFourthCameraTrack) { - argsPublish.push([ - 'publishFourthCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_FOURTH, - 'video', - ]); - } - - if (!options.publishMicrophoneTrack) { - argsUnpublish.push([ - 'publishMicrophoneTrack', - IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary, - 'audio', - ]); - } else if (options.publishMicrophoneTrack) { - argsPublish.push([ - 'publishMicrophoneTrack', - IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary, - 'audio', - ]); - } - - if (!options.publishScreenCaptureVideo) { - argsUnpublish.push([ - 'publishScreenCaptureVideo', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, - 'audio', - ]); - } else if (options.publishScreenCaptureVideo) { - argsPublish.push([ - 'publishScreenCaptureVideo', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, - 'audio', - ]); - } - - if (!options.publishScreenCaptureAudio) { - argsUnpublish.push([ - 'publishScreenCaptureAudio', - IrisAudioSourceType.kAudioSourceTypeScreenPrimary, - 'audio', - ]); - } else if (options.publishScreenCaptureAudio) { - argsPublish.push([ - 'publishScreenCaptureAudio', - IrisAudioSourceType.kAudioSourceTypeScreenPrimary, - 'audio', - ]); - } - - if (!options.publishScreenTrack) { - argsUnpublish.push([ - 'publishScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, - 'video', - ]); - } else if (options.publishScreenTrack) { - argsPublish.push([ - 'publishScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, - 'video', - ]); - } - - if (!options.publishSecondaryScreenTrack) { - argsUnpublish.push([ - 'publishSecondaryScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY, - 'video', - ]); - } else if (options.publishSecondaryScreenTrack) { - argsPublish.push([ - 'publishSecondaryScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY, - 'video', - ]); - } - - if (!options.publishThirdScreenTrack) { - argsUnpublish.push([ - 'publishThirdScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_THIRD, - 'video', - ]); - } else if (options.publishThirdScreenTrack) { - argsPublish.push([ - 'publishThirdScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_THIRD, - 'video', - ]); - } - - if (!options.publishFourthScreenTrack) { - argsUnpublish.push([ - 'publishFourthScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_FOURTH, - 'video', - ]); - } else if (options.publishFourthScreenTrack) { - argsPublish.push([ - 'publishFourthScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_FOURTH, - 'video', - ]); - } - - if (!options.publishCustomAudioTrack) { - argsUnpublish.push([ - 'publishCustomAudioTrack', - IrisAudioSourceType.kAudioSourceTypeCustom, - 'audio', - ]); - } else if (options.publishCustomAudioTrack) { - argsPublish.push([ - 'publishCustomAudioTrack', - IrisAudioSourceType.kAudioSourceTypeCustom, - 'audio', - ]); - } - - if (!options.publishCustomVideoTrack) { - argsUnpublish.push([ - 'publishCustomVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM, - 'video', - ]); - } else if (options.publishCustomVideoTrack) { - argsPublish.push([ - 'publishCustomVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM, - 'video', - ]); - } - - if (!options.publishEncodedVideoTrack) { - argsUnpublish.push([ - 'publishEncodedVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN, - 'video', - ]); - } else if (options.publishEncodedVideoTrack) { - argsPublish.push([ - 'publishEncodedVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN, - 'video', - ]); - } - - if (!options.publishMediaPlayerAudioTrack) { - argsUnpublish.push([ - 'publishMediaPlayerAudioTrack', - IrisAudioSourceType.kAudioSourceTypeUnknown, - 'audio', - ]); - } else if (options.publishMediaPlayerAudioTrack) { - argsPublish.push([ - 'publishMediaPlayerAudioTrack', - IrisAudioSourceType.kAudioSourceTypeUnknown, - 'audio', - ]); - } - - if (!options.publishMediaPlayerVideoTrack) { - argsUnpublish.push([ - 'publishMediaPlayerVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_MEDIA_PLAYER, - 'video', - ]); - } else if (options.publishMediaPlayerVideoTrack) { - argsPublish.push([ - 'publishMediaPlayerVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_MEDIA_PLAYER, - 'video', - ]); - } - - if (!options.publishTranscodedVideoTrack) { - argsUnpublish.push([ - 'publishTranscodedVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_TRANSCODED, - 'video', - ]); - } else if (options.publishTranscodedVideoTrack) { - argsPublish.push([ - 'publishTranscodedVideoTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_TRANSCODED, - 'video', - ]); - } - - for (let UnpublishArgs of argsUnpublish) { - let optionName = UnpublishArgs[0]; - let audioOrVideoType = UnpublishArgs[1]; - let type = UnpublishArgs[2]; - - if (type == 'audio') { - //unpublish audio - let audioPackage = entitiesContainer.getLocalAudioTrackByType( - audioOrVideoType as IrisAudioSourceType - ); - if (audioPackage) { - let track = audioPackage.track as ILocalAudioTrack; - if (subClient.localTracks.indexOf(track) != -1) { - try { - await subClient.unpublish(track); - AgoraConsole.log(optionName + '(false) changed success'); - entitiesContainer.removeSubClientTrackEventHandlerByTrack( - connection, - track - ); - entitiesContainer.removeSubClientLocalAudioTrack( - connection, - track - ); - } catch (reason) { - AgoraConsole.error(optionName + '(false) changed failed'); - } - } - } - } else { - //unpublish video - let videoPackage = entitiesContainer.getLocalVideoTrackByType( - audioOrVideoType as NATIVE_RTC.VIDEO_SOURCE_TYPE - ); - if (videoPackage) { - let track = videoPackage.track as ILocalVideoTrack; - if (subClient.localTracks.indexOf(track) != -1) { - try { - await subClient.unpublish(track); - AgoraConsole.log(optionName + '(false) changed success'); - entitiesContainer.removeSubClientTrackEventHandlerByTrack( - connection, - track - ); - entitiesContainer.clearSubClientLocalVideoTrack(connection); - } catch (reason) { - AgoraConsole.error(optionName + '(false) changed failed'); - } - } - } - } - } - - for (let publishArgs of argsPublish) { - let optionName = publishArgs[0]; - let audioOrVideoType = publishArgs[1]; - let type = publishArgs[2]; - if (type == 'audio') { - //publish audio - let audioPackage = entitiesContainer.getLocalAudioTrackByType( - audioOrVideoType as IrisAudioSourceType - ); - if (audioPackage) { - let track = audioPackage.track as ILocalAudioTrack; - if (subClient.localTracks.indexOf(track) == -1) { - try { - await subClient.publish(track); - AgoraConsole.log(optionName + '(true) changed success'); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: subClient.channelName, - client: subClient, - track: track, - trackType: 'ILocalTrack', - }, - this._engine - ); - - entitiesContainer.addSubClientTrackEventHandler( - connection, - trackEventHandler - ); - entitiesContainer.addSubClientLocalAudioTrack(connection, { - type: audioOrVideoType as IrisAudioSourceType, - track: track, - }); - } catch (reason) { - AgoraConsole.error(optionName + '(true) changed failed'); - } - } - } - } else { - //publish video - let videoPackage = entitiesContainer.getLocalVideoTrackByType( - audioOrVideoType as NATIVE_RTC.VIDEO_SOURCE_TYPE - ); - if (videoPackage) { - let track = videoPackage.track as ILocalVideoTrack; - if (subClient.localTracks.indexOf(track) == -1) { - try { - await subClient.publish(track); - AgoraConsole.log(optionName + '(true) changed success'); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: subClient.channelName, - client: subClient, - track: track, - trackType: 'ILocalVideoTrack', - }, - this._engine - ); - - entitiesContainer.addSubClientTrackEventHandler( - connection, - trackEventHandler - ); - entitiesContainer.setSubClientLocalVideoTrack(connection, { - type: audioOrVideoType as NATIVE_RTC.VIDEO_SOURCE_TYPE, - track: track, - }); - } catch (reason) { - AgoraConsole.error(optionName + '(true) changed failed'); - } - } - } - } - } - - if (options.clientRoleType != null) { - await ClientHelper.setClientRole( - subClient, - options.clientRoleType, - options.audienceLatencyLevel - ); - } - - if (options.token != null) { - try { - await subClient.renewToken(options.token); - } catch (e) { - return this.returnResult(false); - } - } - - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processInSequence); + return this._engine.execute(processInSequence); } setVideoEncoderConfigurationEx( config: NATIVE_RTC.VideoEncoderConfiguration, @@ -676,7 +144,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setVideoEncoderConfigurationEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -686,53 +154,31 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { let processVideoTrack = async (): Promise => { - let holder = { - element: canvas.view, - channelId: connection.channelId, - uid: canvas.uid, - type: NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE, - }; - this._engine.entitiesContainer.addOrUpdateRemoteVideoViewHolder(holder); - - let mainClient = this._engine.entitiesContainer.getMainClient(); - if (mainClient && mainClient.channelName == holder.channelId) { - for (let remoteUser of mainClient.remoteUsers) { - if (remoteUser.uid == holder.uid) { - if (remoteUser.videoTrack?.isPlaying) { - remoteUser.videoTrack.stop(); - } - if (holder.element) { - remoteUser.videoTrack?.play(holder.element); - } - break; - } - } + let remoteUser = this._engine.irisClientManager.getRemoteUserPackageByUid( + canvas.uid + ); + if (remoteUser) { + remoteUser.update({ + element: canvas.view, + }); + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + [remoteUser] + ); + } else { + let userPackage = new RemoteUserPackage( + connection, + canvas.view, + canvas.uid, + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE + ); + this._engine.irisClientManager.addRemoteUserPackage(userPackage); } - let subClients = this._engine.entitiesContainer.getSubClients(); - subClients?.walkT((channel_id, unuseUid, subClient) => { - if ( - channel_id == connection.channelId && - unuseUid == connection.localUid - ) { - let remoteUsers = subClient.remoteUsers; - for (let remoteUser of remoteUsers) { - if (remoteUser.uid == holder.uid) { - if (remoteUser.videoTrack?.isPlaying) { - remoteUser.videoTrack.stop(); - } - if (holder.element) { - remoteUser.videoTrack?.play(holder.element); - } - } - } - } - }); - - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processVideoTrack); + return this._engine.execute(processVideoTrack); } muteRemoteAudioStreamEx( uid: number, @@ -742,7 +188,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'muteRemoteAudioStreamEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -755,7 +201,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'muteRemoteVideoStreamEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -768,7 +214,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setRemoteVideoStreamTypeEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -778,7 +224,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('muteLocalAudioStreamEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -788,7 +234,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('muteLocalVideoStreamEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -800,7 +246,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'muteAllRemoteAudioStreamsEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -812,7 +258,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'muteAllRemoteVideoStreamsEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -825,7 +271,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setSubscribeAudioBlocklistEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -838,7 +284,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setSubscribeAudioAllowlistEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -851,7 +297,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setSubscribeVideoBlocklistEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -864,7 +310,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setSubscribeVideoAllowlistEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -877,7 +323,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setRemoteVideoSubscriptionOptionsEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -891,7 +337,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setRemoteVoicePositionEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -904,7 +350,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setRemoteUserSpatialAudioParamsEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -916,7 +362,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('setRemoteRenderModeEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -929,7 +375,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'enableLoopbackRecordingEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -941,7 +387,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'adjustRecordingSignalVolumeEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -951,7 +397,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('muteRecordingSignalEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -964,7 +410,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'adjustUserPlaybackSignalVolumeEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -973,7 +419,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('getConnectionStateEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -984,7 +430,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { config: NATIVE_RTC.EncryptionConfig ): CallApiReturnType { AgoraConsole.warn('enableEncryptionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -996,7 +442,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('createDataStreamEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1007,7 +453,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('createDataStreamEx2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1019,7 +465,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('sendStreamMessageEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1030,7 +476,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('addVideoWatermarkEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1039,7 +485,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('clearVideoWatermarkEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1055,7 +501,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'sendCustomReportMessageEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1069,7 +515,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'enableAudioVolumeIndicationEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1081,7 +527,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'startRtmpStreamWithoutTranscodingEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1094,7 +540,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'startRtmpStreamWithTranscodingEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1106,7 +552,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'updateRtmpTranscodingEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1116,7 +562,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('stopRtmpStreamEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1128,7 +574,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'startOrUpdateChannelMediaRelayEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1140,7 +586,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'startChannelMediaRelayEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1152,7 +598,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'updateChannelMediaRelayEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1163,7 +609,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'stopChannelMediaRelayEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1174,7 +620,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'pauseAllChannelMediaRelayEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1185,7 +631,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'resumeAllChannelMediaRelayEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1198,7 +644,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'getUserInfoByUserAccountEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1209,7 +655,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('getUserInfoByUidEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1220,7 +666,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('enableDualStreamModeEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1231,7 +677,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('setDualStreamModeEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1245,7 +691,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'setHighPriorityUserListEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1256,7 +702,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { filePath: string ): CallApiReturnType { AgoraConsole.warn('takeSnapshotEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1267,7 +713,7 @@ export class IRtcEngineExImpl implements NATIVE_RTC.IRtcEngineEx { AgoraConsole.warn( 'startMediaRenderingTracingEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); diff --git a/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts b/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts index f34c170..afb193b 100644 --- a/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts +++ b/packages/rtc/src/impl/IAgoraRtcEngineImpl.ts @@ -3,10 +3,7 @@ import { AudioSourceOptions, BufferSourceAudioTrackInitConfig, IAgoraRTCClient, - IAgoraRTCRemoteUser, - IBufferSourceAudioTrack, ICameraVideoTrack, - ILocalAudioTrack, ILocalVideoTrack, IMicrophoneAudioTrack, } from 'agora-rtc-sdk-ng'; @@ -16,26 +13,19 @@ import { CallIrisApiResult, } from 'iris-web-core'; +import { IrisAudioSourceType } from '../base/BaseType'; +import { IrisClient } from '../engine/IrisClient'; import { - IrisAudioSourceType, - IrisClientType, + BufferSourceAudioTrackPackage, VideoTrackPackage, -} from '../base/BaseType'; +} from '../engine/IrisClientManager'; +import { NotifyRemoteType, NotifyType } from '../engine/IrisClientObserver'; import { IrisIntervalType, IrisRtcEngine } from '../engine/IrisRtcEngine'; -import { IrisClientEventHandler } from '../event_handler/IrisClientEventHandler'; - -import { IrisTrackEventHandler } from '../event_handler/IrisTrackEventHandler'; import { IRtcEngineExtensions } from '../extensions/IAgoraRtcEngineExtensions'; -import { ClientHelper } from '../helper/ClientHelper'; -import { TrackHelper } from '../helper/TrackHelper'; -import { IrisMainClientVariables } from '../states/IrisMainClientVariables'; -import { Container } from '../util'; import { AgoraConsole } from '../util/AgoraConsole'; import { AgoraTranslate } from '../util/AgoraTranslate'; -import { ImplHelper } from './ImplHelper'; - export const RTCENGINE_KEY = 'RtcEngine'; export class IRtcEngineImpl implements IRtcEngineExtensions { @@ -45,26 +35,11 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { this._engine = engine; } - private execute(task: AsyncTaskType): CallApiReturnType { - return this._engine.executor.execute(task); - } - - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - isFeatureAvailableOnDevice(type: NATIVE_RTC.FeatureType): CallApiReturnType { AgoraConsole.warn( 'isFeatureAvailableOnDevice not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -72,52 +47,62 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { release(sync: boolean): CallApiReturnType { let processFunc = async (): Promise => { - await this._engine.entitiesContainer.destruction(); - - return this.returnResult(); + await this._engine.irisClientManager.release(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } setAppType(appType: number): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.AgoraRTC.setAppType(appType); - return this.returnResult(); + this._engine.globalState.AgoraRTC.setAppType(appType); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } initialize(context: NATIVE_RTC.RtcEngineContext): CallApiReturnType { - let processFunc = () => { - this._engine.globalVariables.rtcEngineContext = context; - this._engine.mainClientVariables.channelProfile = context.channelProfile; + if (this._engine.irisClientManager.irisClientList.length > 0) { + return this._engine.irisRtcErrorHandler.failed( + 'you have already initialized' + ); + } + let processFunc = async () => { + new IrisClient(this._engine); - this._engine.globalVariables.AgoraRTC.setArea([ + this._engine.globalState.rtcEngineContext = context; + + this._engine.globalState.AgoraRTC.setArea([ AgoraTranslate.NATIVE_RTCAREA_CODE2AREAS(context.areaCode), ]); - this._engine.globalVariables.AgoraRTC.setLogLevel( - AgoraTranslate.NATIVE_RTCLOG_LEVEL2Number(context?.logConfig?.level) + if (context?.logConfig?.level) { + this._engine.globalState.AgoraRTC.setLogLevel( + AgoraTranslate.NATIVE_RTCLOG_LEVEL2Number(context?.logConfig?.level) + ); + } + //音频模块默认是开启的,所以默认创建音频轨道 + await this._engine.implHelper.createAudioTrack( + IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary ); - let result = this._engine.globalVariables.AgoraRTC.checkSystemRequirements(); - return this.returnResult(result); + let result = this._engine.globalState.AgoraRTC.checkSystemRequirements(); + return this._engine.returnResult(result); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } getVersion(): CallApiReturnType { - AgoraConsole.warn('getVersion not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getErrorDescription(code: number): CallApiReturnType { AgoraConsole.warn('getErrorDescription not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -127,7 +112,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { size: number ): CallApiReturnType { AgoraConsole.warn('queryCodecCapability not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -138,7 +123,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { uid: number ): CallApiReturnType { AgoraConsole.warn('preloadChannel not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -149,7 +134,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { userAccount: string ): CallApiReturnType { AgoraConsole.warn('preloadChannel2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -158,7 +143,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'updatePreloadChannelToken not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -169,33 +154,8 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { info: string, uid: number ): CallApiReturnType { - let mvs = this._engine.mainClientVariables; - let options: NATIVE_RTC.ChannelMediaOptions = { - publishCameraTrack: - mvs.publishCameraTrack != null ? mvs.publishCameraTrack : true, - publishSecondaryCameraTrack: - mvs.publishSecondaryCameraTrack != null - ? mvs.publishSecondaryCameraTrack - : false, - // publishAudioTrack: - // mvs.publishAudioTrack != null ? mvs.publishAudioTrack : true, - autoSubscribeAudio: - mvs.autoSubscribeAudio != null ? mvs.autoSubscribeAudio : true, - autoSubscribeVideo: - mvs.autoSubscribeVideo != null ? mvs.autoSubscribeVideo : true, - clientRoleType: - mvs.clientRoleType != null - ? mvs.clientRoleType - : NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER, - defaultVideoStreamType: - mvs.defaultVideoStreamType != null - ? mvs.defaultVideoStreamType - : NATIVE_RTC.VIDEO_STREAM_TYPE.VIDEO_STREAM_HIGH, - channelProfile: - mvs.channelProfile || - NATIVE_RTC.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_COMMUNICATION, - }; - return this.joinChannel2(token, channelId, uid, options); + let irisClient = this._engine.irisClientManager.getIrisClient(); + return this.joinChannel2(token, channelId, uid, irisClient.irisClientState); } joinChannel2( token: string, @@ -203,405 +163,60 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { uid: number, options: NATIVE_RTC.ChannelMediaOptions ): CallApiReturnType { - if (this._engine.globalVariables.isJoinChannel == true) { - AgoraConsole.error('you have already joinChannel'); - return this.returnResult( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_JOIN_CHANNEL_REJECTED - ); - } - - this._engine.globalVariables.isJoinChannel = true; + let globalState = this._engine.globalState; let processJoinChannel = async (): Promise => { - // this._engine.mainClientVariables.startPreviewed = false; - let mainClientVariables: IrisMainClientVariables = this._engine - .mainClientVariables; - let globalVariables = this._engine.globalVariables; - mainClientVariables.mergeChannelMediaOptions(options); - let mainClient: IAgoraRTCClient = ImplHelper.createMainClient( - this._engine - ); + let irisClient = this._engine.irisClientManager.getIrisClient(); - //在JoinChannel之前就必须监听client的event,不然在Join过程中触发的回调会丢失呢 - let entitiesContainer = this._engine.entitiesContainer; - entitiesContainer.setMainClient(mainClient); - let clientEventHandler = new IrisClientEventHandler( - mainClient, - IrisClientType.kClientMain, - this._engine - ); - entitiesContainer.setMainClientEventHandler(clientEventHandler); + irisClient.createClient(options); + options = irisClient.irisClientState; + irisClient.irisClientState.token = token; + + let agoraRTCClient = irisClient.agoraRTCClient; try { - uid = (await mainClient.join( - globalVariables.rtcEngineContext.appId, + await agoraRTCClient.join( + globalState.rtcEngineContext.appId, channelId, token ? token : null, uid - )) as number; + ); } catch (reason) { AgoraConsole.error(reason); this._engine.rtcEngineEventHandler.onError( NATIVE_RTC.ERROR_CODE_TYPE.ERR_JOIN_CHANNEL_REJECTED, '' ); - this._engine.globalVariables.isJoinChannel = false; - this._engine.entitiesContainer.clearMainClientAll(null); - return this.returnResult(false); - } - - this._engine.mainClientVariables.token = token; - - let audioSource: IrisAudioSourceType = - IrisAudioSourceType.kAudioSourceTypeUnknown; - if (globalVariables.enabledAudio && globalVariables.enabledLocalAudio) { - if (mainClientVariables.publishAudioTrack) { - audioSource = IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary; - } else if (mainClientVariables.publishScreenCaptureAudio) { - audioSource = IrisAudioSourceType.kAudioSourceTypeScreenPrimary; - } + irisClient.release(); + return this._engine.returnResult(false); } - - let videoSource: NATIVE_RTC.VIDEO_SOURCE_TYPE = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN; - if (globalVariables.enabledVideo && globalVariables.enabledLocalVideo) { - if (mainClientVariables.publishCameraTrack) { - videoSource = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; - } else if (mainClientVariables.publishSecondaryCameraTrack) { - videoSource = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY; - } else if (mainClientVariables.publishScreenTrack) { - videoSource = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; - } else if (mainClientVariables.publishSecondaryScreenTrack) { - videoSource = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY; - } - } - let clientType = IrisClientType.kClientMain; - let trackArray: [ILocalAudioTrack, ILocalVideoTrack] = [null, null]; - try { - trackArray = await ImplHelper.getOrCreateAudioAndVideoTrackAsync( - this._engine, - audioSource, - videoSource, - clientType, - null - ); - } catch (e) { - AgoraConsole.error(e); - return this.returnResult(false); - } - let con: NATIVE_RTC.RtcConnection = { channelId: channelId, - localUid: mainClient.uid as number, + localUid: agoraRTCClient.uid as number, }; - //joinChannel success咯 + irisClient.setConnection(con); this._engine.rtcEngineEventHandler.onJoinChannelSuccessEx(con, 0); + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.PUBLISH_TRACK, + [ + ...this._engine.irisClientManager.localAudioTrackPackages, + ...this._engine.irisClientManager.localVideoTrackPackages, + ], + [irisClient] + ); - //推送audioTrack - let audioTrack: ILocalAudioTrack = trackArray[0] as ILocalAudioTrack; - if (audioTrack) { - try { - await mainClient.publish(audioTrack); - } catch (reason) { - AgoraConsole.error(reason); - } - - entitiesContainer.addMainClientLocalAudioTrack({ - type: audioSource, - track: audioTrack, - }); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: channelId, - client: mainClient, - track: audioTrack, - trackType: 'ILocalTrack', - }, - this._engine - ); - entitiesContainer.addMainClientTrackEventHandler(trackEventHandler); - } - - //推送video - let videoTrack: ILocalVideoTrack = trackArray[1] as ILocalVideoTrack; - if (videoTrack) { - try { - await mainClient.publish(videoTrack); - } catch (reason) { - AgoraConsole.error(reason); - } - entitiesContainer.setMainClientLocalVideoTrack({ - type: videoSource, - track: videoTrack, - }); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: channelId, - client: mainClient, - track: videoTrack, - trackType: 'ILocalVideoTrack', - }, - this._engine - ); - entitiesContainer.addMainClientTrackEventHandler(trackEventHandler); - } - - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processJoinChannel); + return this._engine.execute(processJoinChannel); } updateChannelMediaOptions( options: NATIVE_RTC.ChannelMediaOptions ): CallApiReturnType { let processFunc: AsyncTaskType = async (): Promise => { - this._engine.mainClientVariables.mergeChannelMediaOptions(options); - - //必须先依次 unpublish, 完毕之后,再依次去publish - let entitiesContainer = this._engine.entitiesContainer; - let mainClient = entitiesContainer.getMainClient(); - if (mainClient == null) { - return; - } - - let argsUnpublish: Array<[ - string, - IrisAudioSourceType | NATIVE_RTC.VIDEO_SOURCE_TYPE, - 'audio' | 'video' - ]> = []; - let argsPublish: Array<[ - string, - IrisAudioSourceType | NATIVE_RTC.VIDEO_SOURCE_TYPE, - 'audio' | 'video' - ]> = []; - - // if (options.publishAudioTrack == false) { - // argsUnpublish.push([ - // 'publishAudioTrack', - // IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary, - // 'audio', - // ]); - // } else if (options.publishAudioTrack == true) { - // argsPublish.push([ - // 'publishAudioTrack', - // IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary, - // 'audio', - // ]); - // } - - if (options.publishCameraTrack == false) { - argsUnpublish.push([ - 'publishCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY, - 'video', - ]); - } else if (options.publishCameraTrack == true) { - argsPublish.push([ - 'publishCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY, - 'video', - ]); - } - - if (options.publishSecondaryCameraTrack == false) { - argsUnpublish.push([ - 'publishSecondaryCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY, - 'video', - ]); - } else if (options.publishSecondaryCameraTrack == true) { - argsPublish.push([ - 'publishSecondaryCameraTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY, - 'video', - ]); - } - - if (options.publishScreenCaptureAudio == false) { - argsUnpublish.push([ - 'publishScreenCaptureAudio', - IrisAudioSourceType.kAudioSourceTypeScreenPrimary, - 'audio', - ]); - } else if (options.publishScreenCaptureAudio == true) { - argsPublish.push([ - 'publishScreenCaptureAudio', - IrisAudioSourceType.kAudioSourceTypeScreenPrimary, - 'audio', - ]); - } - - if (options.publishScreenTrack == false) { - argsUnpublish.push([ - 'publishScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, - 'video', - ]); - } else if (options.publishScreenTrack == true) { - argsPublish.push([ - 'publishScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY, - 'video', - ]); - } - - if (options.publishSecondaryScreenTrack == false) { - argsUnpublish.push([ - 'publishSecondaryScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY, - 'video', - ]); - } else if (options.publishSecondaryScreenTrack == true) { - argsPublish.push([ - 'publishSecondaryScreenTrack', - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY, - 'video', - ]); - } - - for (let UnpublishArgs of argsUnpublish) { - let optionName = UnpublishArgs[0]; - let audioOrVideoType = UnpublishArgs[1]; - let type = UnpublishArgs[2]; - - if (type == 'audio') { - //unpublish audio - let audioPackage = entitiesContainer.getLocalAudioTrackByType( - audioOrVideoType as IrisAudioSourceType - ); - if (audioPackage) { - let track = audioPackage.track as ILocalAudioTrack; - if (mainClient.localTracks.indexOf(track) != -1) { - try { - await mainClient.unpublish(track); - AgoraConsole.log(optionName + '(false) changed success'); - entitiesContainer.removeMainClientTrackEventHandlerByTrack( - track - ); - entitiesContainer.removeMainClientLocalAudioTrack(track); - } catch (reason) { - AgoraConsole.error(optionName + '(false) changed failed'); - } - } - } - } else { - //unpublish video - let videoPackage = entitiesContainer.getLocalVideoTrackByType( - audioOrVideoType as NATIVE_RTC.VIDEO_SOURCE_TYPE - ); - if (videoPackage) { - let track = videoPackage.track as ILocalVideoTrack; - if (mainClient.localTracks.indexOf(track) != -1) { - try { - await mainClient.unpublish(track); - AgoraConsole.log(optionName + '(false) changed success'); - entitiesContainer.removeMainClientTrackEventHandlerByTrack( - track - ); - entitiesContainer.setMainClientLocalVideoTrack(null); - } catch (reason) { - AgoraConsole.error(optionName + '(false) changed failed'); - } - } - } - } - } - - for (let publishArgs of argsPublish) { - let optionName = publishArgs[0]; - let audioOrVideoType = publishArgs[1]; - let type = publishArgs[2]; - if (type == 'audio') { - //publish audio - let audioPackage = entitiesContainer.getLocalAudioTrackByType( - audioOrVideoType as IrisAudioSourceType - ); - if (audioPackage) { - let track = audioPackage.track as ILocalAudioTrack; - if (mainClient.localTracks.indexOf(track) == -1) { - try { - await mainClient.publish(track); - AgoraConsole.log(optionName + '(true) changed success'); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: mainClient.channelName, - client: mainClient, - track: track, - trackType: 'ILocalTrack', - }, - this._engine - ); - - entitiesContainer.addMainClientTrackEventHandler( - trackEventHandler - ); - entitiesContainer.addMainClientLocalAudioTrack({ - type: audioOrVideoType as IrisAudioSourceType, - track: track, - }); - } catch (reason) { - AgoraConsole.error(optionName + '(true) changed failed'); - } - } - } - } else { - //publish video - let videoPackage = entitiesContainer.getLocalVideoTrackByType( - audioOrVideoType as NATIVE_RTC.VIDEO_SOURCE_TYPE - ); - if (videoPackage) { - let track = videoPackage.track as ILocalVideoTrack; - if (mainClient.localTracks.indexOf(track) == -1) { - try { - await mainClient.publish(track); - AgoraConsole.log(optionName + '(true) changed success'); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: mainClient.channelName, - client: mainClient, - track: track, - trackType: 'ILocalVideoTrack', - }, - this._engine - ); - - entitiesContainer.addMainClientTrackEventHandler( - trackEventHandler - ); - entitiesContainer.setMainClientLocalVideoTrack({ - type: audioOrVideoType as NATIVE_RTC.VIDEO_SOURCE_TYPE, - track: track, - }); - } catch (reason) { - AgoraConsole.error(optionName + '(true) changed failed'); - } - } - } - } - } + await this._engine.implHelper.updateChannelMediaOptions(options); - if (options.clientRoleType != null) { - await ClientHelper.setClientRole( - mainClient, - options.clientRoleType, - options.audienceLatencyLevel - ); - } - - if (options.token != null) { - try { - await mainClient.renewToken(options.token); - //这里的新token已经在 fun 的第一行被保存了 - } catch (e) { - AgoraConsole.error('renewToken failed'); - } - } - return CallIrisApiResult.success(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } leaveChannel(): CallApiReturnType { let options: NATIVE_RTC.LeaveChannelOptions = { @@ -613,92 +228,83 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { } leaveChannel2(options: NATIVE_RTC.LeaveChannelOptions): CallApiReturnType { let processFunc: AsyncTaskType = async (): Promise => { - //离开频道啦 稍后处理 - if (!this._engine.globalVariables.isJoinChannel) { - // AgoraConsole.error("you must join channel before you call this method"); - // return CallIrisApiResult.failed(0, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED); - return CallIrisApiResult.success(); + //离开频道后重置参数 + // this._engine.globalState.reset(); + if (this._engine.irisClientManager.irisClientList.length === 0) { + return this._engine.returnResult(); } - this._engine.globalVariables.isJoinChannel = false; + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNPUBLISH_TRACK, + [ + ...this._engine.irisClientManager.localAudioTrackPackages, + ...this._engine.irisClientManager.localVideoTrackPackages, + ] + ); - let mainClient: IAgoraRTCClient = this._engine.entitiesContainer.getMainClient(); - if (mainClient) { - //读取 options - let channelId = mainClient.channelName; - let audioTrack = this._engine.entitiesContainer.getLocalAudioTrackByType( - IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary - ); - if (audioTrack) { - let track = audioTrack.track as IMicrophoneAudioTrack; - if (options.stopMicrophoneRecording && !track.muted) { - await track.setMuted(true); - } else if (!options.stopMicrophoneRecording && track.muted) { - await track.setMuted(false); + for (let irisClient of this._engine.irisClientManager.irisClientList) { + irisClient.irisClientState.mergeChannelMediaOptions(options); + let agoraRTCClient = irisClient.agoraRTCClient; + options = irisClient.irisClientState; + + if (agoraRTCClient) { + //读取 options + for (let trackPackage of irisClient.audioTrackPackages) { + if (trackPackage.track) { + let track = trackPackage.track as IMicrophoneAudioTrack; + if (options.stopMicrophoneRecording) { + await this._engine.trackHelper.setMuted(track, true); + } + if (options.stopAllEffect) { + this.stopAllEffects(); + //todo effect + } + if (options.stopAudioMixing) { + //todo audio Mixing + } + } } - track.isPlaying && track.stop(); - track.close(); - } - //为了防止离开频道后丢失了channelName和uid,所以需要先保存一下 - let con: NATIVE_RTC.RtcConnection = { - channelId: mainClient.channelName, - localUid: mainClient.uid as number, - }; + //为了防止离开频道后丢失了channelName和uid,所以需要先保存一下 + let con: NATIVE_RTC.RtcConnection = { + channelId: agoraRTCClient.channelName, + localUid: agoraRTCClient.uid as number, + }; - this._engine.entitiesContainer.clearMainClientAll(channelId); - try { - // webSDK在leave的时候会直接reset client 没有release方法 - await mainClient.leave(); - AgoraConsole.log(`leaveChannel success`); - } catch (e) { - AgoraConsole.error(`leaveChannel failed:${e}`); - this._engine.rtcEngineEventHandler.onError( - NATIVE_RTC.ERROR_CODE_TYPE.ERR_LEAVE_CHANNEL_REJECTED, - '' - ); - } - this._engine.rtcEngineEventHandler.onLeaveChannelEx( - con, - new NATIVE_RTC.RtcStats() - ); - } + agoraRTCClient.remoteUsers.map((remoteUser) => { + this._engine.rtcEngineEventHandler.onUserOfflineEx( + irisClient.connection ?? con, + remoteUser.uid as number, + NATIVE_RTC.USER_OFFLINE_REASON_TYPE.USER_OFFLINE_DROPPED + ); + }); - let subClients: Container = this._engine.entitiesContainer.getSubClients(); - let container = subClients.getContainer(); - for (let _container of container) { - let clients = _container[1]; - for (let _client of clients) { - let client = _client[1]; try { - await client.leave(); + // webSDK在leave的时候会直接reset client 没有release方法 + await agoraRTCClient.leave(); + AgoraConsole.log(`leaveChannel success`); } catch (e) { - AgoraConsole.error(e); - this.returnResult(false); + AgoraConsole.error(`leaveChannel failed:${e}`); this._engine.rtcEngineEventHandler.onError( NATIVE_RTC.ERROR_CODE_TYPE.ERR_LEAVE_CHANNEL_REJECTED, '' ); } - let con: NATIVE_RTC.RtcConnection = { - channelId: client.channelName, - localUid: client.uid as number, - }; this._engine.rtcEngineEventHandler.onLeaveChannelEx( - con, + irisClient.connection ?? con, new NATIVE_RTC.RtcStats() ); - this._engine.entitiesContainer.clearSubClientAll(con); + irisClient.release(); } } - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } renewToken(token: string): CallApiReturnType { AgoraConsole.warn('renewToken not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -707,7 +313,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { profile: NATIVE_RTC.CHANNEL_PROFILE_TYPE ): CallApiReturnType { AgoraConsole.warn('setChannelProfile not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -728,321 +334,246 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { options: NATIVE_RTC.ClientRoleOptions ): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.mainClientVariables.clientRoleType = role; + let irisClient = this._engine.irisClientManager.getIrisClient(); + irisClient.irisClientState.clientRoleType = role; - let client = this._engine.entitiesContainer.getMainClient(); + let client = irisClient?.agoraRTCClient; client && - (await ClientHelper.setClientRole( + (await this._engine.clientHelper.setClientRole( client, role, options.audienceLatencyLevel )); - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } startEchoTest(): CallApiReturnType { AgoraConsole.warn('startEchoTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } startEchoTest2(intervalInSeconds: number): CallApiReturnType { AgoraConsole.warn('startEchoTest2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } + startEchoTest3(config: NATIVE_RTC.EchoTestConfiguration): CallApiReturnType { AgoraConsole.warn('startEchoTest3 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } + stopEchoTest(): CallApiReturnType { AgoraConsole.warn('stopEchoTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } + enableMultiCamera( enabled: boolean, config: NATIVE_RTC.CameraCapturerConfiguration ): CallApiReturnType { AgoraConsole.warn('enableMultiCamera not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } + enableVideo(): CallApiReturnType { let processVideoTrack = async (): Promise => { - this._engine.globalVariables.enabledVideo = true; - - //找到本端video - if (this._engine.globalVariables.enabledLocalVideo) { - let trackPackages = this._engine.entitiesContainer.getLocalVideoTracks(); - for (let trackPackage of trackPackages) { - if (!trackPackage.track) { - continue; - } + this._engine.globalState.enabledVideo = true; + this._engine.globalState.autoSubscribeVideo = true; - let track = trackPackage.track as ILocalVideoTrack; - if (!track.isPlaying) { - try { - // TODO(littlegnal): This is a WebGL specific requirement - // await track.play(this._engine.generateVideoTrackLabelOrHtmlElement("", 0, trackPackage.type)); - } catch (e) { - AgoraConsole.error('ILocalVideoTrack play(true) failed'); - AgoraConsole.error(e); - } - } - if (!track.enabled) { - await TrackHelper.setEnabled(track, true); - } - } - } - - //找到远端video - //mainClient的远端用户 - let entitiesContainer = this._engine.entitiesContainer; - let mainClient = entitiesContainer.getMainClient(); - if (mainClient && mainClient.channelName) { - let remoteUsers = mainClient.remoteUsers; - for (let remoteUser of remoteUsers) { - //todo 远端用户发流的时候。我不订阅,那么他的hasVideo为true, 但是他们的videoTrack是null - if ( - remoteUser.hasVideo && - remoteUser.videoTrack && - remoteUser.videoTrack.isPlaying == false - ) { - // TODO(littlegnal): This is a WebGL specific requirement - // remoteUser.videoTrack.play(this._engine.generateVideoTrackLabelOrHtmlElement(mainClient.channelName, remoteUser.uid as number, NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE)) - } - } + //local + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.ENABLE_TRACK, + [...this._engine.irisClientManager.localVideoTrackPackages] + ); + for (let irisClient of this._engine.irisClientManager.irisClientList) { + irisClient.irisClientState.autoSubscribeVideo = true; + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.PUBLISH_TRACK, + [...this._engine.irisClientManager.localVideoTrackPackages], + [irisClient] + ); } - //subClient的远端用户 - entitiesContainer.getSubClients().walkT((channel_id, uid, subClient) => { - let remoteUsers = subClient.remoteUsers; - for (let remoteUser of remoteUsers) { - if ( - remoteUser.hasVideo && - remoteUser.videoTrack && - remoteUser.videoTrack.isPlaying == false - ) { - // TODO(littlegnal): This is a WebGL specific requirement - // remoteUser.videoTrack.play(this._engine.generateVideoTrackLabelOrHtmlElement(mainClient.channelName, remoteUser.uid as number, NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_REMOTE)) - } - } - }); + //remote + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.SUBSCRIBE_VIDEO_TRACK, + this._engine.irisClientManager.remoteUserPackages + ); - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processVideoTrack); + return this._engine.execute(processVideoTrack); } disableVideo(): CallApiReturnType { let processVideoTrack = async (): Promise => { - this._engine.globalVariables.enabledVideo = false; - - //todo 一股脑的全部enable或者disable是否合理? - //找到本端video - let trackPackages = this._engine.entitiesContainer.getLocalVideoTracks(); - for (let trackPackage of trackPackages) { - let track = trackPackage.track as ILocalVideoTrack; - if (track.enabled) { - await TrackHelper.setEnabled(track, false); - } - } + this._engine.globalState.enabledVideo = false; + this._engine.globalState.autoSubscribeVideo = false; - //mainClient的远端用户 - let entitiesContainer = this._engine.entitiesContainer; - let mainClient = entitiesContainer.getMainClient(); - if (mainClient && mainClient.channelName) { - let remoteUsers = mainClient.remoteUsers; - for (let remoteUser of remoteUsers) { - //todo 远端用户发流的时候。我不订阅,那么他的hasVideo为true, 但是他们的videoTrack是null - if ( - remoteUser.hasVideo && - remoteUser.videoTrack && - remoteUser.videoTrack.isPlaying - ) { - remoteUser.videoTrack.stop(); - } - } + //local + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNABLE_TRACK, + [...this._engine.irisClientManager.localVideoTrackPackages] + ); + for (let irisClient of this._engine.irisClientManager.irisClientList) { + irisClient.irisClientState.autoSubscribeVideo = false; + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNPUBLISH_TRACK, + [...this._engine.irisClientManager.localVideoTrackPackages], + [irisClient] + ); } - //subClient的远端用户 - entitiesContainer.getSubClients().walkT((channel_id, uid, subClient) => { - let remoteUsers = subClient.remoteUsers; - for (let remoteUser of remoteUsers) { - if ( - remoteUser.hasVideo && - remoteUser.videoTrack && - remoteUser.videoTrack.isPlaying - ) { - remoteUser.videoTrack.stop(); - } - } - }); - return this.returnResult(); + //remote + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.UNSUBSCRIBE_VIDEO_TRACK, + this._engine.irisClientManager.remoteUserPackages + ); + + return this._engine.returnResult(); }; - return this.execute(processVideoTrack); + return this._engine.execute(processVideoTrack); } startPreview(): CallApiReturnType { return this.startPreview2(NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA); } startPreview2(sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE): CallApiReturnType { - let mainClient = this._engine.entitiesContainer.getMainClient(); let process = async (): Promise => { - if (this._engine.globalVariables.enabledVideo == false) { + if (this._engine.globalState.enabledVideo == false) { AgoraConsole.error('call enableVideo(true) before startPreview'); - return; + return this._engine.returnResult(false); } if (sourceType >= 5) { AgoraConsole.error('Invalid source type'); - return this.returnResult(false); + return this._engine.returnResult(false); } - let audioSource: IrisAudioSourceType = - IrisAudioSourceType.kAudioSourceTypeUnknown; - let videoSource: NATIVE_RTC.VIDEO_SOURCE_TYPE = sourceType as number; + AgoraConsole.debug(`startPreview2 videoSource: ${sourceType}`); - AgoraConsole.log(`startPreview2 videoSource: ${videoSource}`); - - if ( - sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM && - this._engine.globalVariables.pushVideoFrameEnabled - ) { - //开启了pushVideoFrame,先什么都不做 + if (sourceType == null) { + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; } - try { - await ImplHelper.getOrCreateAudioAndVideoTrackAsync( - this._engine, - audioSource, - videoSource, - IrisClientType.kClientMain, - null + let videoTrackPackage: VideoTrackPackage; + videoTrackPackage = this._engine.irisClientManager.getLocalVideoTrackPackageBySourceType( + sourceType + )[0]; + if (!videoTrackPackage) { + let cTrack = null; + if (this._engine.implHelper.isVideoCamera(sourceType)) { + cTrack = await this._engine.implHelper.createVideoCameraTrack(); + } + videoTrackPackage = new VideoTrackPackage(null, sourceType, cTrack); + this._engine.irisClientManager.addLocalVideoTrackPackage( + videoTrackPackage ); - - let trackPackages = this._engine.entitiesContainer.getLocalVideoTracks(); - for (let trackPackage of trackPackages) { - let track = trackPackage.track as ILocalVideoTrack; - if (!track) { - continue; - } - - if (!track.enabled) { - await TrackHelper.setEnabled(track, true); - } - - if (track.isPlaying) { - track.stop(); - } - - if (trackPackage.element) { - track.play(trackPackage.element); - - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - client: mainClient, - track: track, - trackType: 'ILocalVideoTrack', - videoSourceType: sourceType, - }, - this._engine - ); - this._engine.entitiesContainer.addMainClientTrackEventHandler( - trackEventHandler - ); - - AgoraConsole.log( - `startPreview2 videoSource: ${videoSource} success` - ); - this._engine.rtcEngineEventHandler.onLocalVideoStateChanged( - videoSource, - NATIVE_RTC.LOCAL_VIDEO_STREAM_STATE - .LOCAL_VIDEO_STREAM_STATE_ENCODING, - 0 - ); + } + videoTrackPackage.setPreview(true); + try { + let track = videoTrackPackage?.track as ILocalVideoTrack; + if (track) { + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.ENABLE_TRACK, + [videoTrackPackage] + ); + if (videoTrackPackage.element) { + this._engine.trackHelper.play(track, videoTrackPackage.element); } } } catch (err) { AgoraConsole.error(err); - return this.returnResult(false); + return this._engine.returnResult(false); } - - return this.returnResult(); + this._engine.rtcEngineEventHandler.onLocalVideoStateChanged( + sourceType, + NATIVE_RTC.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_ENCODING, + 0 + ); + return this._engine.returnResult(); }; - return this.execute(process); + return this._engine.execute(process); } stopPreview(): CallApiReturnType { return this.stopPreview2(NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA); } stopPreview2(sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE): CallApiReturnType { let process = async (): Promise => { - let audioSource: IrisAudioSourceType = - IrisAudioSourceType.kAudioSourceTypeUnknown; - let videoSource: NATIVE_RTC.VIDEO_SOURCE_TYPE = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN; - if ( - sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY - ) { - audioSource = IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary; - videoSource = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; - } else if ( - sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY - ) { - audioSource = IrisAudioSourceType.kAudioSourceTypeScreenPrimary; - videoSource = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; + if (sourceType >= 5) { + AgoraConsole.error('Invalid source type'); + return this._engine.returnResult(false); } - let audioTrackPackage = this._engine.entitiesContainer.getLocalAudioTrackByType( - audioSource - ); - if (audioTrackPackage) { - let audioTrack = audioTrackPackage.track as ILocalAudioTrack; - if (audioTrack.enabled) { - await TrackHelper.setEnabled(audioTrack, false); - } + AgoraConsole.debug(`stopPreview2 videoSource: ${sourceType}`); + + if (sourceType == null) { + sourceType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; } - let videoTrackPackage = this._engine.entitiesContainer.getLocalVideoTrackByType( - videoSource - ); - if (videoTrackPackage) { - let videoTrack = videoTrackPackage.track as ILocalVideoTrack; - if (videoTrack.enabled) { - await TrackHelper.setEnabled(videoTrack, false); + let videoTrackPackage: VideoTrackPackage; + videoTrackPackage = this._engine.irisClientManager.getLocalVideoTrackPackageBySourceType( + sourceType + )[0]; + videoTrackPackage?.setPreview(false); + try { + let track = videoTrackPackage?.track as ILocalVideoTrack; + + if (track) { + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNABLE_TRACK, + [videoTrackPackage] + ); + if (videoTrackPackage.element) { + this._engine.trackHelper.play( + videoTrackPackage.track, + videoTrackPackage.element + ); + } } + } catch (err) { + AgoraConsole.error(err); + return this._engine.returnResult(false); } - return this.returnResult(); + this._engine.rtcEngineEventHandler.onLocalVideoStateChanged( + sourceType, + NATIVE_RTC.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_STOPPED, + 0 + ); + return this._engine.returnResult(); }; - return this.execute(process); + return this._engine.execute(process); } startLastmileProbeTest( config: NATIVE_RTC.LastmileProbeConfig ): CallApiReturnType { AgoraConsole.warn('startLastmileProbeTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopLastmileProbeTest(): CallApiReturnType { AgoraConsole.warn('stopLastmileProbeTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1051,23 +582,23 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.VideoEncoderConfiguration ): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.videoEncoderConfiguration = config; - this._engine.mainClientVariables.videoEncoderConfiguration = config; - //todo 找到所有mainClient 的 ICameraTrack。如果存在则 setEncoderConfiguration() 一下 - let videoTrack = this._engine.entitiesContainer.getLocalVideoTrackByType( - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY - ); - if (videoTrack) { - let track = videoTrack.track as ICameraVideoTrack; - await track.setEncoderConfiguration( - AgoraTranslate.NATIVE_RTCVideoEncoderConfiguration2VideoEncoderConfiguration( - config - ) - ); + this._engine.globalState.videoEncoderConfiguration = config; + + for (let videoTrackPackage of this._engine.irisClientManager + .localVideoTrackPackages) { + if (videoTrackPackage.track) { + let track = videoTrackPackage.track as ICameraVideoTrack; + await track.setEncoderConfiguration( + AgoraTranslate.NATIVE_RTCVideoEncoderConfiguration2VideoEncoderConfiguration( + config + ) + ); + } } - return this.returnResult(); + + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } setBeautyEffectOptions( enabled: boolean, @@ -1075,7 +606,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { type: NATIVE_RTC.MEDIA_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('setBeautyEffectOptions not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1088,7 +619,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setLowlightEnhanceOptions not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1101,7 +632,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setVideoDenoiserOptions not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1112,7 +643,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { type: NATIVE_RTC.MEDIA_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('setColorEnhanceOptions not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1126,140 +657,172 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableVirtualBackground not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setupRemoteVideo(canvas: NATIVE_RTC.VideoCanvas): CallApiReturnType { AgoraConsole.warn('setupRemoteVideo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setupLocalVideo(canvas: NATIVE_RTC.VideoCanvas): CallApiReturnType { let processVideoTrack = async (): Promise => { - this._engine.entitiesContainer.addLocalVideoTrack({ - element: canvas.view, - type: - canvas.sourceType || - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY, - }); - - let trackPackages = this._engine.entitiesContainer.getLocalVideoTracks(); - for (let trackPackage of trackPackages) { - let track = trackPackage.track as ILocalVideoTrack; - if (!track) { - continue; - } - if (!track.enabled) { - await TrackHelper.setEnabled(track, true); + let sourceType = + canvas.sourceType || + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; + let trackPackage = this._engine.irisClientManager.getLocalVideoTrackPackageBySourceType( + sourceType + )[0]; + if (!trackPackage) { + let cTrack = null; + if (this._engine.implHelper.isVideoCamera(sourceType)) { + cTrack = await this._engine.implHelper.createVideoCameraTrack(); } + trackPackage = new VideoTrackPackage(canvas.view, sourceType, cTrack); + this._engine.irisClientManager.addLocalVideoTrackPackage(trackPackage); + } + trackPackage.update({ type: sourceType, element: canvas.view }); - if (track.isPlaying) { - track.stop(); - } + let track = trackPackage.track as ILocalVideoTrack; + if (track) { + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.ENABLE_TRACK, + [trackPackage] + ); - track.play(trackPackage.element); + if (trackPackage.element && trackPackage.isPreview) { + this._engine.trackHelper.play(track, trackPackage.element); + } } - - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processVideoTrack); + return this._engine.execute(processVideoTrack); } setVideoScenario( scenarioType: NATIVE_RTC.VIDEO_APPLICATION_SCENARIO_TYPE ): CallApiReturnType { AgoraConsole.warn('setVideoScenario not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableAudio(): CallApiReturnType { let processAudioTracks = async (): Promise => { - this._engine.globalVariables.enabledAudio = true; - if (this._engine.globalVariables.enabledLocalAudio) { - //找到本地audio - let trackPackages = this._engine.entitiesContainer.getLocalAudioTracks(); - for (let trackPackage of trackPackages) { - let track = trackPackage.track as ILocalAudioTrack; - if (!track.enabled) { - await TrackHelper.setEnabled(track, true); - } - } + this._engine.globalState.enabledAudio = true; + + //local + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.ENABLE_TRACK, + this._engine.irisClientManager.localAudioTrackPackages + ); + for (let irisClient of this._engine.irisClientManager.irisClientList) { + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.PUBLISH_TRACK, + [...this._engine.irisClientManager.localAudioTrackPackages], + [irisClient] + ); } - //找到远端audio - let remoteUsers = this._engine.entitiesContainer.getAllRemoteUsers(); - remoteUsers.map((remoteUser: IAgoraRTCRemoteUser) => { - if (remoteUser.audioTrack && !remoteUser.audioTrack.isPlaying) { - remoteUser.audioTrack.play(); - } - }); + //remote + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.SUBSCRIBE_AUDIO_TRACK, + this._engine.irisClientManager.remoteUserPackages + ); - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processAudioTracks); + return this._engine.execute(processAudioTracks); } disableAudio(): CallApiReturnType { - AgoraConsole.warn('disableAudio not supported in this platform!'); - return this.returnResult( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + let processAudioTracks = async (): Promise => { + this._engine.globalState.enabledAudio = false; + + //local + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNABLE_TRACK, + this._engine.irisClientManager.localAudioTrackPackages + ); + for (let irisClient of this._engine.irisClientManager.irisClientList) { + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNPUBLISH_TRACK, + [...this._engine.irisClientManager.localAudioTrackPackages], + [irisClient] + ); + } + + //remote + this._engine.irisClientManager.irisClientObserver.notifyRemote( + NotifyRemoteType.UNSUBSCRIBE_AUDIO_TRACK, + this._engine.irisClientManager.remoteUserPackages + ); + + return this._engine.returnResult(); + }; + + return this._engine.execute(processAudioTracks); } setAudioProfile( profile: NATIVE_RTC.AUDIO_PROFILE_TYPE, scenario: NATIVE_RTC.AUDIO_SCENARIO_TYPE ): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.audioProfile = profile; - this._engine.globalVariables.rtcEngineContext.audioScenario = scenario; + this._engine.globalState.audioProfile = profile; + this._engine.globalState.rtcEngineContext.audioScenario = scenario; - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } setAudioProfile2(profile: NATIVE_RTC.AUDIO_PROFILE_TYPE): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.audioProfile = profile; + this._engine.globalState.audioProfile = profile; - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } setAudioScenario( scenario: NATIVE_RTC.AUDIO_SCENARIO_TYPE ): CallApiReturnType { AgoraConsole.warn('setAudioScenario not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableLocalAudio(enabled: boolean): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.enabledLocalAudio = enabled; + this._engine.globalState.enabledLocalAudio = enabled; + //找到本地audio - let trackPackages = this._engine.entitiesContainer.getLocalAudioTracks(); - for (let trackPackage of trackPackages) { - let track = trackPackage.track as ILocalAudioTrack; - await TrackHelper.setEnabled(track, enabled); - } - return this.returnResult(); + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + enabled ? NotifyType.ENABLE_TRACK : NotifyType.UNABLE_TRACK, + this._engine.irisClientManager.localAudioTrackPackages + ); + + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + enabled ? NotifyType.PUBLISH_TRACK : NotifyType.UNPUBLISH_TRACK, + this._engine.irisClientManager.localAudioTrackPackages, + this._engine.irisClientManager.irisClientList + ); + + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } muteLocalAudioStream(mute: boolean): CallApiReturnType { - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1268,7 +831,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'muteAllRemoteAudioStreams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1277,28 +840,28 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setDefaultMuteAllRemoteAudioStreams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteRemoteAudioStream(uid: number, mute: boolean): CallApiReturnType { AgoraConsole.warn('muteRemoteAudioStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteLocalVideoStream(mute: boolean): CallApiReturnType { AgoraConsole.warn('muteLocalVideoStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableLocalVideo(enabled: boolean): CallApiReturnType { AgoraConsole.warn('enableLocalVideo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1307,7 +870,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'muteAllRemoteVideoStreams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1316,14 +879,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setDefaultMuteAllRemoteVideoStreams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteRemoteVideoStream(uid: number, mute: boolean): CallApiReturnType { AgoraConsole.warn('muteRemoteVideoStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1335,7 +898,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRemoteVideoStreamType not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1347,7 +910,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRemoteVideoSubscriptionOptions not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1358,7 +921,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRemoteDefaultVideoStreamType not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1370,7 +933,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setSubscribeAudioBlocklist not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1382,7 +945,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setSubscribeAudioAllowlist not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1394,7 +957,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setSubscribeVideoBlocklist not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1406,7 +969,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setSubscribeVideoAllowlist not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1417,29 +980,30 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { reportVad: boolean ): CallApiReturnType { let processFunc = async (): Promise => { - this._engine.globalVariables.enableAudioVolumeIndicationConfig = { - ...this._engine.globalVariables.enableAudioVolumeIndicationConfig, + this._engine.globalState.enableAudioVolumeIndicationConfig = { + ...this._engine.globalState.enableAudioVolumeIndicationConfig, ...(interval && { interval }), ...(smooth && { smooth }), ...(reportVad && { reportVad }), }; //只有在初次的时候才注册onAudioVolumeIndication事件 - let mainClient: IAgoraRTCClient = this._engine.entitiesContainer.getMainClient(); + let agoraRTCClient: IAgoraRTCClient = this._engine.irisClientManager.getIrisClient() + ?.agoraRTCClient; - if (!this._engine.globalVariables.enableAudioVolumeIndication) { + if (!this._engine.globalState.enableAudioVolumeIndication) { let intervalFunction = setInterval(() => { - if (mainClient) { - const localStats = mainClient.getLocalAudioStats(); + if (agoraRTCClient) { + const localStats = agoraRTCClient.getLocalAudioStats(); let connection: NATIVE_RTC.RtcConnection = { - channelId: mainClient.channelName, - localUid: mainClient.uid as number, + channelId: agoraRTCClient.channelName, + localUid: agoraRTCClient.uid as number, }; if (reportVad) { this._engine.rtcEngineEventHandler.onAudioVolumeIndicationEx( connection, [ { - uid: mainClient.uid as number, + uid: agoraRTCClient.uid as number, volume: localStats.sendVolumeLevel, vad: localStats.sendVolumeLevel > 0 ? 1 : 0, // voicePitch: number, web没有 @@ -1449,7 +1013,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { localStats.sendVolumeLevel ); } - const remoteStats = mainClient.getRemoteAudioStats(); + const remoteStats = agoraRTCClient.getRemoteAudioStats(); let remoteSpeakers = []; for (let uid in remoteStats) { remoteSpeakers.push({ @@ -1477,17 +1041,17 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { intervalFunction ); } - this._engine.globalVariables.enableAudioVolumeIndication = true; - return this.returnResult(); + this._engine.globalState.enableAudioVolumeIndication = true; + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } startAudioRecording( filePath: string, quality: NATIVE_RTC.AUDIO_RECORDING_QUALITY_TYPE ): CallApiReturnType { AgoraConsole.warn('startAudioRecording not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1498,7 +1062,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { quality: NATIVE_RTC.AUDIO_RECORDING_QUALITY_TYPE ): CallApiReturnType { AgoraConsole.warn('startAudioRecording2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1507,7 +1071,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.AudioRecordingConfiguration ): CallApiReturnType { AgoraConsole.warn('startAudioRecording3 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1519,35 +1083,35 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'registerAudioEncodedFrameObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopAudioRecording(): CallApiReturnType { AgoraConsole.warn('stopAudioRecording not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } createMediaPlayer(): CallApiReturnType { AgoraConsole.warn('createMediaPlayer not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } destroyMediaPlayer(media_player: NATIVE_RTC.IMediaPlayer): CallApiReturnType { AgoraConsole.warn('destroyMediaPlayer not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } createMediaRecorder(info: NATIVE_RTC.RecorderStreamInfo): CallApiReturnType { AgoraConsole.warn('createMediaRecorder not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1556,7 +1120,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { mediaRecorder: NATIVE_RTC.IMediaRecorder ): CallApiReturnType { AgoraConsole.warn('destroyMediaRecorder not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1567,7 +1131,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { cycle: number ): CallApiReturnType { AgoraConsole.warn('startAudioMixing not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1579,42 +1143,42 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { startPos: number ): CallApiReturnType { AgoraConsole.warn('startAudioMixing2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopAudioMixing(): CallApiReturnType { AgoraConsole.warn('stopAudioMixing not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } pauseAudioMixing(): CallApiReturnType { AgoraConsole.warn('pauseAudioMixing not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } resumeAudioMixing(): CallApiReturnType { AgoraConsole.warn('resumeAudioMixing not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } selectAudioTrack(index: number): CallApiReturnType { AgoraConsole.warn('selectAudioTrack not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getAudioTrackCount(): CallApiReturnType { AgoraConsole.warn('getAudioTrackCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1623,7 +1187,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustAudioMixingVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1632,7 +1196,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustAudioMixingPublishVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1641,7 +1205,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getAudioMixingPublishVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1650,7 +1214,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustAudioMixingPlayoutVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1659,14 +1223,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getAudioMixingPlayoutVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getAudioMixingDuration(): CallApiReturnType { AgoraConsole.warn('getAudioMixingDuration not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1675,14 +1239,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getAudioMixingCurrentPosition not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setAudioMixingPosition(pos: number): CallApiReturnType { AgoraConsole.warn('setAudioMixingPosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1693,28 +1257,28 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setAudioMixingDualMonoMode not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setAudioMixingPitch(pitch: number): CallApiReturnType { AgoraConsole.warn('setAudioMixingPitch not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getEffectsVolume(): CallApiReturnType { AgoraConsole.warn('getEffectsVolume not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setEffectsVolume(volume: number): CallApiReturnType { AgoraConsole.warn('setEffectsVolume not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1725,7 +1289,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { startPos: number ): CallApiReturnType { AgoraConsole.warn('preloadEffect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1742,16 +1306,21 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { ): CallApiReturnType { let processFunc = async (): Promise => { if ( - !this._engine.globalVariables.enabledAudio || - !this._engine.globalVariables.enabledLocalAudio + !this._engine.globalState.enabledAudio || + !this._engine.globalState.enabledLocalAudio ) { AgoraConsole.error('please enableAudio first'); - return this.returnResult(false); + return this._engine.returnResult(false); } - let clientType = IrisClientType.kClientMain; + let irisClient = this._engine.irisClientManager.getIrisClient(); + let agoraRTCClient = irisClient?.agoraRTCClient; + if (!agoraRTCClient.channelName) { + AgoraConsole.log('please join channel first'); + return this._engine.returnResult(false); + } - let bufferSourceAudioTrack: IBufferSourceAudioTrack = null; + let bufferSourceAudioTrackPackage: BufferSourceAudioTrackPackage = null; let bufferSourceAudioTrackInitConfig: BufferSourceAudioTrackInitConfig = { source: null, }; @@ -1763,23 +1332,20 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { } try { - bufferSourceAudioTrack = await ImplHelper.createBufferSourceAudioTrackAsync( - this._engine, + bufferSourceAudioTrackPackage = await this._engine.implHelper.createBufferSourceAudioTrack( soundId, - bufferSourceAudioTrackInitConfig, - clientType + bufferSourceAudioTrackInitConfig ); AgoraConsole.log('createBufferSourceAudioTrack success'); } catch (err) { err && AgoraConsole.error(err); - return this.returnResult(false); + return this._engine.returnResult(false); } - if (publish && bufferSourceAudioTrack) { + if (publish && bufferSourceAudioTrackPackage.track) { //设置音效 if (gain) { - bufferSourceAudioTrack.setVolume(gain); + bufferSourceAudioTrackPackage.track.setVolume(gain); } - let mainClient = this._engine.entitiesContainer.getMainClient(); try { //https://docportal.shengwang.cn/cn/video-call-4.x/audio_effect_mixing_web_ng?platform=Web#发布多个音频轨道以实现混音 let config: AudioSourceOptions = { @@ -1795,33 +1361,15 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { if (startPos) { config.startPlayTime = Math.floor(startPos / 1000); } - bufferSourceAudioTrack.startProcessAudioBuffer(config); - await mainClient.publish(bufferSourceAudioTrack); + bufferSourceAudioTrackPackage.track.startProcessAudioBuffer(config); + await agoraRTCClient.publish(bufferSourceAudioTrackPackage.track); } catch (reason) { AgoraConsole.error(reason); } - this._engine.entitiesContainer.addMainClientLocalBufferSourceAudioTrack( - { - soundId: soundId, - track: bufferSourceAudioTrack, - } - ); - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - channelName: mainClient.channelName, - client: mainClient, - track: bufferSourceAudioTrack, - trackType: 'IBufferSourceAudioTrack', - }, - this._engine - ); - this._engine.entitiesContainer.addMainClientTrackEventHandler( - trackEventHandler - ); } - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } playAllEffects( loopCount: number, @@ -1831,120 +1379,118 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { publish: boolean ): CallApiReturnType { AgoraConsole.warn('playAllEffects not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getVolumeOfEffect(soundId: number): CallApiReturnType { AgoraConsole.warn('getVolumeOfEffect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setVolumeOfEffect(soundId: number, volume: number): CallApiReturnType { AgoraConsole.warn('setVolumeOfEffect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } pauseEffect(soundId: number): CallApiReturnType { AgoraConsole.warn('pauseEffect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } pauseAllEffects(): CallApiReturnType { AgoraConsole.warn('pauseAllEffects not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } resumeEffect(soundId: number): CallApiReturnType { AgoraConsole.warn('resumeEffect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } resumeAllEffects(): CallApiReturnType { AgoraConsole.warn('resumeAllEffects not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopEffect(soundId: number): CallApiReturnType { let processFunc = async (): Promise => { - let bufferSourceAudioTrack: IBufferSourceAudioTrack = this._engine.entitiesContainer.getLocalBufferSourceAudioTrackBySoundId( - soundId - )?.track; - if (!bufferSourceAudioTrack) { + let bufferSourceAudioTrackPackage: BufferSourceAudioTrackPackage = this._engine.irisClientManager.getLocalAudioTrackPackageBySourceType( + IrisAudioSourceType.kAudioSourceTypeBufferSourceAudio + )[0] as BufferSourceAudioTrackPackage; + if (!bufferSourceAudioTrackPackage?.track) { AgoraConsole.error(`soundId:${soundId} not found`); this._engine.rtcEngineEventHandler.onError( NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, `soundId:${soundId} not found` ); - return this.returnResult(false); + return this._engine.returnResult(); } - try { - bufferSourceAudioTrack.stopProcessAudioBuffer(); - let mainClient = this._engine.entitiesContainer.getMainClient(); - await mainClient?.unpublish([bufferSourceAudioTrack]); - } catch (err) { - err && AgoraConsole.error(err); - this._engine.rtcEngineEventHandler.onError( - NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED, - `stopEffect:${soundId} stopEffect failed` - ); - return this.returnResult(false); - } - this._engine.entitiesContainer.removeLocalBufferSourceAudioTrackBySoundId( - soundId - ); - await this._engine.entitiesContainer.processBufferSourceAudioTrackClose( - bufferSourceAudioTrack + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNPUBLISH_TRACK, + [bufferSourceAudioTrackPackage] ); - return this.returnResult(); + + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } stopAllEffects(): CallApiReturnType { - AgoraConsole.warn('stopAllEffects not supported in this platform!'); - return this.returnResult( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); + let processFunc = async (): Promise => { + let bufferSourceAudioTrackPackages: BufferSourceAudioTrackPackage[] = this._engine.irisClientManager.getLocalAudioTrackPackageBySourceType( + IrisAudioSourceType.kAudioSourceTypeBufferSourceAudio + ) as BufferSourceAudioTrackPackage[]; + bufferSourceAudioTrackPackages.map((bufferSourceAudioTrackPackage) => { + if ( + bufferSourceAudioTrackPackage.track && + bufferSourceAudioTrackPackage.soundId + ) { + this.stopEffect(bufferSourceAudioTrackPackage.soundId); + } + }); + return this._engine.returnResult(); + }; + + return this._engine.execute(processFunc); } unloadEffect(soundId: number): CallApiReturnType { AgoraConsole.warn('unloadEffect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } unloadAllEffects(): CallApiReturnType { AgoraConsole.warn('unloadAllEffects not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getEffectDuration(filePath: string): CallApiReturnType { AgoraConsole.warn('getEffectDuration not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setEffectPosition(soundId: number, pos: number): CallApiReturnType { AgoraConsole.warn('setEffectPosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1953,7 +1499,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getEffectCurrentPosition not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1962,7 +1508,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableSoundPositionIndication not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1973,14 +1519,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { gain: number ): CallApiReturnType { AgoraConsole.warn('setRemoteVoicePosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableSpatialAudio(enabled: boolean): CallApiReturnType { AgoraConsole.warn('enableSpatialAudio not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -1992,7 +1538,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRemoteUserSpatialAudioParams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2003,7 +1549,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setVoiceBeautifierPreset not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2012,7 +1558,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { preset: NATIVE_RTC.AUDIO_EFFECT_PRESET ): CallApiReturnType { AgoraConsole.warn('setAudioEffectPreset not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2023,7 +1569,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setVoiceConversionPreset not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2036,7 +1582,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setAudioEffectParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2049,7 +1595,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setVoiceBeautifierParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2062,21 +1608,21 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setVoiceConversionParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setLocalVoicePitch(pitch: number): CallApiReturnType { AgoraConsole.warn('setLocalVoicePitch not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setLocalVoiceFormant(formantRatio: number): CallApiReturnType { AgoraConsole.warn('setLocalVoiceFormant not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2088,7 +1634,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setLocalVoiceEqualization not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2098,7 +1644,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { value: number ): CallApiReturnType { AgoraConsole.warn('setLocalVoiceReverb not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2107,7 +1653,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { preset: NATIVE_RTC.HEADPHONE_EQUALIZER_PRESET ): CallApiReturnType { AgoraConsole.warn('setHeadphoneEQPreset not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2119,23 +1665,23 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setHeadphoneEQParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setLogFile(filePath: string): CallApiReturnType { AgoraConsole.warn('setLogFile not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setLogFilter(filter: number): CallApiReturnType { - return this.execute( + return this._engine.execute( (): Promise => { AgoraConsole.warn('setLogFilter not supported in this platform!'); - return this.returnResult(); + return this._engine.returnResult(); } ); } @@ -2145,22 +1691,22 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { let numberLevel: number = AgoraTranslate.NATIVE_RTCLOG_LEVEL2Number( level ); - this._engine.globalVariables.AgoraRTC.setLogLevel(numberLevel); - return CallIrisApiResult.success(); + this._engine.globalState.AgoraRTC.setLogLevel(numberLevel); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } setLogFileSize(fileSizeInKBytes: number): CallApiReturnType { AgoraConsole.warn('setLogFileSize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } uploadLogFile(requestId: string): CallApiReturnType { AgoraConsole.warn('uploadLogFile not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2170,7 +1716,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { mirrorMode: NATIVE_RTC.VIDEO_MIRROR_MODE_TYPE ): CallApiReturnType { AgoraConsole.warn('setLocalRenderMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2181,7 +1727,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { mirrorMode: NATIVE_RTC.VIDEO_MIRROR_MODE_TYPE ): CallApiReturnType { AgoraConsole.warn('setRemoteRenderMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2190,7 +1736,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { renderMode: NATIVE_RTC.RENDER_MODE_TYPE ): CallApiReturnType { AgoraConsole.warn('setLocalRenderMode2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2201,14 +1747,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setLocalVideoMirrorMode not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableDualStreamMode(enabled: boolean): CallApiReturnType { AgoraConsole.warn('enableDualStreamMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2218,14 +1764,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { streamConfig: NATIVE_RTC.SimulcastStreamConfig ): CallApiReturnType { AgoraConsole.warn('enableDualStreamMode2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setDualStreamMode(mode: NATIVE_RTC.SIMULCAST_STREAM_MODE): CallApiReturnType { AgoraConsole.warn('setDualStreamMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2235,7 +1781,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { streamConfig: NATIVE_RTC.SimulcastStreamConfig ): CallApiReturnType { AgoraConsole.warn('setDualStreamMode2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2247,7 +1793,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableCustomAudioLocalPlayback not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2261,7 +1807,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRecordingAudioFrameParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2275,7 +1821,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setPlaybackAudioFrameParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2288,7 +1834,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setMixedAudioFrameParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2302,7 +1848,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setEarMonitoringAudioFrameParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2314,7 +1860,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setPlaybackAudioFrameBeforeMixingParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2323,7 +1869,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableAudioSpectrumMonitor not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2332,7 +1878,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'disableAudioSpectrumMonitor not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2343,7 +1889,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'registerAudioSpectrumObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2354,7 +1900,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'unregisterAudioSpectrumObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2363,14 +1909,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustRecordingSignalVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteRecordingSignal(mute: boolean): CallApiReturnType { AgoraConsole.warn('muteRecordingSignal not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2379,7 +1925,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustPlaybackSignalVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2391,7 +1937,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustUserPlaybackSignalVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2402,7 +1948,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setLocalPublishFallbackOption not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2413,7 +1959,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRemoteSubscribeFallbackOption not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2426,7 +1972,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setHighPriorityUserList not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2438,7 +1984,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableLoopbackRecording not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2447,7 +1993,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustLoopbackSignalVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2456,7 +2002,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getLoopbackRecordingVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2466,7 +2012,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { includeAudioFilters: number ): CallApiReturnType { AgoraConsole.warn('enableInEarMonitoring not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2475,7 +2021,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setInEarMonitoringVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2485,7 +2031,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { unload_after_use: boolean ): CallApiReturnType { AgoraConsole.warn('loadExtensionProvider not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2498,7 +2044,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setExtensionProviderProperty not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2509,7 +2055,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { type: NATIVE_RTC.MEDIA_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('registerExtension not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2521,7 +2067,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { type: NATIVE_RTC.MEDIA_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('enableExtension not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2533,7 +2079,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { enable: boolean ): CallApiReturnType { AgoraConsole.warn('enableExtension2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2546,7 +2092,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { type: NATIVE_RTC.MEDIA_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('setExtensionProperty not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2560,7 +2106,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { type: NATIVE_RTC.MEDIA_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('getExtensionProperty not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2573,7 +2119,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { value: string ): CallApiReturnType { AgoraConsole.warn('setExtensionProperty2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2587,7 +2133,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { buf_len: number ): CallApiReturnType { AgoraConsole.warn('getExtensionProperty2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2598,14 +2144,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraCapturerConfiguration not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } createCustomVideoTrack(): CallApiReturnType { AgoraConsole.warn('createCustomVideoTrack not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2616,7 +2162,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'createCustomEncodedVideoTrack not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2625,7 +2171,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'destroyCustomVideoTrack not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2634,53 +2180,21 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'destroyCustomEncodedVideoTrack not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } switchCamera(): CallApiReturnType { - AgoraConsole.warn('isCameraZoomSupported not supported in this platform!'); - return this.returnResult( - false, - -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED - ); - // let process = async ():Promise => { - // let trackPack = this._engine.entitiesContainer.getLocalVideoTrackByType( - // NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY - // ); - // let videoTrack: ICameraVideoTrack = trackPack.track as ICameraVideoTrack; - // let curDeviceName: string = (videoTrack as any)._deviceName; - - // try { - // let allDevices = (await ImplHelper.enumerateDevices(this._engine)) - // .videoDevices; - // let curIndex = -1; - // for (let i = 0; i < allDevices.length; i++) { - // if (allDevices[i].deviceName == curDeviceName) { - // curIndex = i; - // break; - // } - // } - // curIndex++; - // let nextDevice = allDevices[curIndex % allDevices.length]; - // try { - // await videoTrack.setDevice(nextDevice.deviceId); - // } catch (e) { - // AgoraConsole.error('switchCamera setDevice failed'); - // AgoraConsole.log(e); - // } - // } catch (e) { - // AgoraConsole.error('switchCamera enumerateDevices failed'); - // AgoraConsole.log(e); - // } - // return CallIrisApiResult.success(); - // }; - // return this.execute(process); + AgoraConsole.warn('switchCamera not supported in this platform!'); + return this._engine.returnResult( + false, + -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED + ); } isCameraZoomSupported(): CallApiReturnType { AgoraConsole.warn('isCameraZoomSupported not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2689,21 +2203,21 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'isCameraFaceDetectSupported not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } isCameraTorchSupported(): CallApiReturnType { AgoraConsole.warn('isCameraTorchSupported not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } isCameraFocusSupported(): CallApiReturnType { AgoraConsole.warn('isCameraFocusSupported not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2712,28 +2226,28 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'isCameraAutoFocusFaceModeSupported not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setCameraZoomFactor(factor: number): CallApiReturnType { AgoraConsole.warn('setCameraZoomFactor not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } enableFaceDetection(enabled: boolean): CallApiReturnType { AgoraConsole.warn('enableFaceDetection not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getCameraMaxZoomFactor(): CallApiReturnType { AgoraConsole.warn('getCameraMaxZoomFactor not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2745,14 +2259,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraFocusPositionInPreview not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setCameraTorchOn(isOn: boolean): CallApiReturnType { AgoraConsole.warn('setCameraTorchOn not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2761,7 +2275,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraAutoFocusFaceModeEnabled not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2770,7 +2284,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'isCameraExposurePositionSupported not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2782,7 +2296,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraExposurePosition not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2791,7 +2305,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'isCameraExposureSupported not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2800,7 +2314,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraExposureFactor not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2809,7 +2323,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'isCameraAutoExposureFaceModeSupported not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2818,7 +2332,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraAutoExposureFaceModeEnabled not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2829,21 +2343,21 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setDefaultAudioRouteToSpeakerphone not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setEnableSpeakerphone(speakerOn: boolean): CallApiReturnType { AgoraConsole.warn('setEnableSpeakerphone not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } isSpeakerphoneEnabled(): CallApiReturnType { AgoraConsole.warn('isSpeakerphoneEnabled not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2852,7 +2366,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setRouteInCommunicationMode not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2865,7 +2379,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getScreenCaptureSources not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2876,7 +2390,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setAudioSessionOperationRestriction not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2889,7 +2403,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startScreenCaptureByDisplayId not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2902,14 +2416,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startScreenCaptureByScreenRect not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getAudioDeviceInfo(deviceInfo: NATIVE_RTC.DeviceInfo): CallApiReturnType { AgoraConsole.warn('getAudioDeviceInfo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2922,7 +2436,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startScreenCaptureByWindowId not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2933,7 +2447,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setScreenCaptureContentHint not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2944,7 +2458,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'updateScreenCaptureRegion not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2955,7 +2469,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'updateScreenCaptureParameters not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -2964,57 +2478,37 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { captureParams: NATIVE_RTC.ScreenCaptureParameters2 ): CallApiReturnType { let process = async () => { - this._engine.globalVariables.screenCaptureParameters2 = captureParams; - - let audioType = captureParams.captureAudio - ? IrisAudioSourceType.kAudioSourceTypeScreenPrimary - : IrisAudioSourceType.kAudioSourceTypeUnknown; - let videoType = captureParams.captureVideo - ? NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY - : NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN; - let clientType = IrisClientType.kClientMain; - this._engine.globalVariables.isScreenSharing = true; - - let trackArray: [ILocalAudioTrack, ILocalVideoTrack] = [null, null]; + if (this._engine.irisClientManager.getScreenCaptureStatus()) { + AgoraConsole.error('you have already startScreenCapture'); + return this._engine.returnResult(false); + } + + if (!captureParams.captureVideo) { + AgoraConsole.log('captureVideo is false, do nothing'); + return this._engine.returnResult(); + } + + let videoType = NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; + try { - trackArray = await ImplHelper.getOrCreateAudioAndVideoTrackAsync( - this._engine, - audioType, - videoType, - clientType, - null + await this._engine.implHelper.createScreenTrack( + captureParams, + videoType ); AgoraConsole.log('ScreenShare track create success'); } catch (err) { err && AgoraConsole.error(err); - return this.returnResult(false); - } - - //设置屏幕共享特殊的事件 - let videoTrack: ILocalVideoTrack = trackArray[1] as ILocalVideoTrack; - if (videoTrack) { - let trackEventHandler: IrisTrackEventHandler = new IrisTrackEventHandler( - { - track: videoTrack, - videoSourceType: videoType, - trackType: 'ILocalTrack', - }, - this._engine - ); - this._engine.entitiesContainer.addMainClientTrackEventHandler( - trackEventHandler - ); + return this._engine.returnResult(false); } - - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(process); + return this._engine.execute(process); } updateScreenCapture( captureParams: NATIVE_RTC.ScreenCaptureParameters2 ): CallApiReturnType { AgoraConsole.warn('updateScreenCapture not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3023,7 +2517,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'queryScreenCaptureCapability not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3034,7 +2528,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setScreenCaptureScenario not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3048,64 +2542,52 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { stopScreenCapture2( sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE ): CallApiReturnType { + //需要处理 let processFunc = async (): Promise => { - if (!this._engine.globalVariables.isScreenSharing) { - AgoraConsole.log('screen share is not start'); + let irisClientManager = this._engine.irisClientManager; + if (!this._engine.irisClientManager.getScreenCaptureStatus()) { + AgoraConsole.warn('screenCapture is not start'); + return this._engine.returnResult(); } - let entitiesContainer = this._engine.entitiesContainer; - this._engine.globalVariables.screenCaptureParameters2 = null; - this._engine.globalVariables.isScreenSharing = false; - - let audioTrackPackage = entitiesContainer.getLocalAudioTrackByType( - IrisAudioSourceType.kAudioSourceTypeScreenPrimary + let videoPackages = irisClientManager.getLocalVideoTrackPackageBySourceType( + sourceType ); - if (audioTrackPackage) { - await entitiesContainer.processAudioTrackClose( - audioTrackPackage.track as ILocalAudioTrack - ); - this._engine.rtcEngineEventHandler.onLocalAudioStateChanged( - NATIVE_RTC.LOCAL_AUDIO_STREAM_STATE.LOCAL_AUDIO_STREAM_STATE_STOPPED, - 0 - ); + let audioPackages = irisClientManager.getLocalAudioTrackPackageBySourceType( + IrisAudioSourceType.kAudioSourceTypeScreenCapture + ); + if (videoPackages.length == 0) { + AgoraConsole.error(`sourceType:${sourceType} is not start`); + return this._engine.returnResult(false); } - let videoTrackPackage = entitiesContainer.getLocalVideoTrackByType( - sourceType + await this._engine.irisClientManager.irisClientObserver.notifyLocal( + NotifyType.UNPUBLISH_TRACK, + [...videoPackages, ...audioPackages] ); - if (entitiesContainer.getLocalVideoTrackByType(sourceType)) { - await entitiesContainer.processVideoTrackClose( - videoTrackPackage.track as ILocalVideoTrack - ); - this._engine.rtcEngineEventHandler.onLocalVideoStateChanged( - sourceType, - NATIVE_RTC.LOCAL_VIDEO_STREAM_STATE.LOCAL_VIDEO_STREAM_STATE_STOPPED, - 0 - ); - } - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } getCallId(callId: string): CallApiReturnType { AgoraConsole.warn('getCallId not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } rate(callId: string, rating: number, description: string): CallApiReturnType { AgoraConsole.warn('rate not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } complain(callId: string, description: string): CallApiReturnType { AgoraConsole.warn('complain not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3114,7 +2596,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startRtmpStreamWithoutTranscoding not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3126,7 +2608,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startRtmpStreamWithTranscoding not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3135,14 +2617,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { transcoding: NATIVE_RTC.LiveTranscoding ): CallApiReturnType { AgoraConsole.warn('updateRtmpTranscoding not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopRtmpStream(url: string): CallApiReturnType { AgoraConsole.warn('stopRtmpStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3153,7 +2635,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startLocalVideoTranscoder not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3164,7 +2646,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'updateLocalTranscoderConfiguration not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3173,7 +2655,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'stopLocalVideoTranscoder not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3183,7 +2665,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.CameraCapturerConfiguration ): CallApiReturnType { AgoraConsole.warn('startCameraCapture not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3192,7 +2674,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE ): CallApiReturnType { AgoraConsole.warn('stopCameraCapture not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3204,7 +2686,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setCameraDeviceOrientation not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3216,7 +2698,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setScreenCaptureOrientation not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3225,16 +2707,15 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { sourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE, config: NATIVE_RTC.ScreenCaptureConfiguration ): CallApiReturnType { - let processFunc = async (): Promise => { - //todo - return CallIrisApiResult.success(); - }; - - return this.execute(processFunc); + AgoraConsole.warn('startScreenCapture2 not supported in this platform!'); + return this._engine.returnResult( + false, + -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED + ); } getConnectionState(): CallApiReturnType { AgoraConsole.warn('getConnectionState not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3245,10 +2726,10 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { RTCENGINE_KEY, eventHandler ); - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } unregisterEventHandler(eventHandler: any): CallApiReturnType { let processFunc = async (): Promise => { @@ -3257,31 +2738,31 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { eventHandler ); - return this.returnResult(); + return this._engine.returnResult(); }; - return this.execute(processFunc); + return this._engine.execute(processFunc); } setRemoteUserPriority( uid: number, userPriority: NATIVE_RTC.PRIORITY_TYPE ): CallApiReturnType { AgoraConsole.warn('setRemoteUserPriority not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setEncryptionMode(encryptionMode: string): CallApiReturnType { AgoraConsole.warn('setEncryptionMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setEncryptionSecret(secret: string): CallApiReturnType { AgoraConsole.warn('setEncryptionSecret not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3291,7 +2772,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.EncryptionConfig ): CallApiReturnType { AgoraConsole.warn('enableEncryption not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3302,7 +2783,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { ordered: boolean ): CallApiReturnType { AgoraConsole.warn('createDataStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3312,7 +2793,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.DataStreamConfig ): CallApiReturnType { AgoraConsole.warn('createDataStream2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3323,14 +2804,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { length: number ): CallApiReturnType { AgoraConsole.warn('sendStreamMessage not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } addVideoWatermark(watermark: NATIVE_RTC.RtcImage): CallApiReturnType { AgoraConsole.warn('addVideoWatermark not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3340,28 +2821,28 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { options: NATIVE_RTC.WatermarkOptions ): CallApiReturnType { AgoraConsole.warn('addVideoWatermark2 not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } clearVideoWatermarks(): CallApiReturnType { AgoraConsole.warn('clearVideoWatermarks not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } pauseAudio(): CallApiReturnType { AgoraConsole.warn('pauseAudio not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } resumeAudio(): CallApiReturnType { AgoraConsole.warn('resumeAudio not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3370,7 +2851,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableWebSdkInteroperability not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3385,7 +2866,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'sendCustomReportMessage not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3397,7 +2878,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'registerMediaMetadataObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3409,7 +2890,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'unregisterMediaMetadataObserver not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3424,7 +2905,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { auto_upload: boolean ): CallApiReturnType { AgoraConsole.warn('startAudioFrameDump not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3435,7 +2916,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { location: string ): CallApiReturnType { AgoraConsole.warn('stopAudioFrameDump not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3445,7 +2926,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { mode: NATIVE_RTC.AUDIO_AINS_MODE ): CallApiReturnType { AgoraConsole.warn('setAINSMode not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3457,7 +2938,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'registerLocalUserAccount not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3470,7 +2951,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'joinChannelWithUserAccount not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3484,7 +2965,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'joinChannelWithUserAccount2 not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3498,7 +2979,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'joinChannelWithUserAccountEx not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3510,7 +2991,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getUserInfoByUserAccount not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3520,7 +3001,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { userInfo: NATIVE_RTC.UserInfo[] ): CallApiReturnType { AgoraConsole.warn('getUserInfoByUid not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3531,7 +3012,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startOrUpdateChannelMediaRelay not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3540,7 +3021,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { configuration: NATIVE_RTC.ChannelMediaRelayConfiguration ): CallApiReturnType { AgoraConsole.warn('startChannelMediaRelay not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3551,14 +3032,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'updateChannelMediaRelay not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopChannelMediaRelay(): CallApiReturnType { AgoraConsole.warn('stopChannelMediaRelay not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3567,7 +3048,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'pauseAllChannelMediaRelay not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3576,7 +3057,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'resumeAllChannelMediaRelay not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3587,7 +3068,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setDirectCdnStreamingAudioConfiguration not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3598,7 +3079,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setDirectCdnStreamingVideoConfiguration not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3611,14 +3092,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startDirectCdnStreaming not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopDirectCdnStreaming(): CallApiReturnType { AgoraConsole.warn('stopDirectCdnStreaming not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3629,7 +3110,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'updateDirectCdnStreamingMediaOptions not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3640,14 +3121,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.AgoraRhythmPlayerConfig ): CallApiReturnType { AgoraConsole.warn('startRhythmPlayer not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopRhythmPlayer(): CallApiReturnType { AgoraConsole.warn('stopRhythmPlayer not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3656,14 +3137,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.AgoraRhythmPlayerConfig ): CallApiReturnType { AgoraConsole.warn('configRhythmPlayer not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } takeSnapshot(uid: number, filePath: string): CallApiReturnType { AgoraConsole.warn('takeSnapshot not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3673,7 +3154,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.ContentInspectConfig ): CallApiReturnType { AgoraConsole.warn('enableContentInspect not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3685,7 +3166,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustCustomAudioPublishVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3697,14 +3178,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'adjustCustomAudioPlayoutVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setCloudProxy(proxyType: NATIVE_RTC.CLOUD_PROXY_TYPE): CallApiReturnType { AgoraConsole.warn('setCloudProxy not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3713,7 +3194,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { config: NATIVE_RTC.LocalAccessPointConfiguration ): CallApiReturnType { AgoraConsole.warn('setLocalAccessPoint not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3725,14 +3206,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'setAdvancedAudioOptions not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setAVSyncSource(channelId: string, uid: number): CallApiReturnType { AgoraConsole.warn('setAVSyncSource not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3742,7 +3223,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { options: NATIVE_RTC.ImageTrackOptions ): CallApiReturnType { AgoraConsole.warn('enableVideoImageSource not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3751,7 +3232,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'getCurrentMonotonicTimeInMs not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3760,21 +3241,21 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableWirelessAccelerate not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getNetworkType(): CallApiReturnType { AgoraConsole.warn('getNetworkType not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setParameters(parameters: string): CallApiReturnType { AgoraConsole.warn('setParameters not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3783,7 +3264,7 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'startMediaRenderingTracing not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3792,14 +3273,14 @@ export class IRtcEngineImpl implements IRtcEngineExtensions { AgoraConsole.warn( 'enableInstantMediaRendering not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } getNtpWallTimeInMs(): CallApiReturnType { AgoraConsole.warn('getNtpWallTimeInMs not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3813,85 +3294,70 @@ export class IVideoDeviceManagerImpl implements NATIVE_RTC.IVideoDeviceManager { this._engine = engine; } - private execute(task: AsyncTaskType): CallApiReturnType { - return this._engine.executor.execute(task); - } - - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - enumerateVideoDevices(): CallApiReturnType { let deviceList = []; let process = async () => { try { - deviceList = (await ImplHelper.enumerateDevices(this._engine)) + deviceList = (await this._engine.implHelper.enumerateDevices()) ?.videoDevices; } catch (e) { AgoraConsole.log(e); - return this.returnResult(false); + return this._engine.returnResult(false); } - return this.returnResult(true, 0, JSON.stringify({ result: deviceList })); + return this._engine.returnResult( + true, + 0, + JSON.stringify({ result: deviceList }) + ); }; - return this.execute(process); + return this._engine.execute(process); } setDevice(deviceIdUTF8: string): CallApiReturnType { let process = async () => { - this._engine.mainClientVariables.videoDeviceId = deviceIdUTF8; - try { - this._engine.entitiesContainer.walkAllILocalVideoTrack( - (trackPackage: VideoTrackPackage) => { - if ( - trackPackage.type == - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY || - trackPackage.type == - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY || - trackPackage.type == - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_THIRD || - trackPackage.type == - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_FOURTH - ) { - TrackHelper.setDevice( - trackPackage.track as ICameraVideoTrack, - deviceIdUTF8 - ); - } + this._engine.globalState.videoDeviceId = deviceIdUTF8; + + for (let videoTrackPackage of this._engine.irisClientManager + .localVideoTrackPackages) { + if (videoTrackPackage.track) { + if ( + videoTrackPackage.type == + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY || + videoTrackPackage.type == + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY || + videoTrackPackage.type == + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_THIRD || + videoTrackPackage.type == + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_FOURTH + ) { + await this._engine.trackHelper.setDevice( + videoTrackPackage.track as ICameraVideoTrack, + deviceIdUTF8 + ); } - ); - return this.returnResult(); - } catch (e) { - AgoraConsole.error(e); - return this.returnResult(false); + } } + + return this._engine.returnResult(); }; - return this.execute(process); + return this._engine.execute(process); } getDevice(): CallApiReturnType { let process = async () => { let list: MediaDeviceInfo[] = []; let deviceId = ''; - if (this._engine.mainClientVariables.videoDeviceId) { - deviceId = this._engine.mainClientVariables.videoDeviceId; - } else if (this._engine.globalVariables.deviceEnumerated) { - deviceId = this._engine.globalVariables.videoDevices[0]?.deviceId || ''; + if (this._engine.globalState.videoDeviceId) { + deviceId = this._engine.globalState.videoDeviceId; } else { try { - list = await this._engine.globalVariables.AgoraRTC.getCameras(); + list = await this._engine.globalState.AgoraRTC.getCameras(); } catch (e) { - return this.returnResult(false); + return this._engine.returnResult(false); } if (list && list.length > 0) { deviceId = list[0].deviceId; } } - return this.returnResult( + return this._engine.returnResult( true, 0, JSON.stringify({ @@ -3900,12 +3366,12 @@ export class IVideoDeviceManagerImpl implements NATIVE_RTC.IVideoDeviceManager { }) ); }; - return this.execute(process); + return this._engine.execute(process); } numberOfCapabilities(deviceIdUTF8: string): CallApiReturnType { AgoraConsole.warn('numberOfCapabilities not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3916,21 +3382,21 @@ export class IVideoDeviceManagerImpl implements NATIVE_RTC.IVideoDeviceManager { capability: NATIVE_RTC.VideoFormat ): CallApiReturnType { AgoraConsole.warn('getCapability not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } startDeviceTest(hwnd: number): CallApiReturnType { AgoraConsole.warn('startDeviceTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } stopDeviceTest(): CallApiReturnType { AgoraConsole.warn('stopDeviceTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -3938,12 +3404,11 @@ export class IVideoDeviceManagerImpl implements NATIVE_RTC.IVideoDeviceManager { release(): CallApiReturnType { let process = async () => { let engine = this._engine; - engine.globalVariables.playbackDevices = new Array(); - engine.globalVariables.recordingDevices = new Array(); - engine.globalVariables.videoDevices = new Array(); - engine.globalVariables.deviceEnumerated = false; - return this.returnResult(); + engine.globalState.playbackDevices = new Array(); + engine.globalState.recordingDevices = new Array(); + engine.globalState.videoDevices = new Array(); + return this._engine.returnResult(); }; - return this.execute(process); + return this._engine.execute(process); } } diff --git a/packages/rtc/src/impl/IAgoraSpatialAudioImpl.ts b/packages/rtc/src/impl/IAgoraSpatialAudioImpl.ts index 3000632..8392bbd 100644 --- a/packages/rtc/src/impl/IAgoraSpatialAudioImpl.ts +++ b/packages/rtc/src/impl/IAgoraSpatialAudioImpl.ts @@ -1,5 +1,5 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; +import { CallApiReturnType } from 'iris-web-core'; import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { AgoraConsole } from '../util/AgoraConsole'; @@ -12,20 +12,9 @@ export class ILocalSpatialAudioEngineImpl this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - initialize(): CallApiReturnType { AgoraConsole.warn('initialize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -38,7 +27,7 @@ export class ILocalSpatialAudioEngineImpl AgoraConsole.warn( 'setRemoteAudioAttenuation not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -46,21 +35,21 @@ export class ILocalSpatialAudioEngineImpl setMaxAudioRecvCount(maxCount: number): CallApiReturnType { AgoraConsole.warn('setMaxAudioRecvCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setAudioRecvRange(range: number): CallApiReturnType { AgoraConsole.warn('setAudioRecvRange not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setDistanceUnit(unit: number): CallApiReturnType { AgoraConsole.warn('setDistanceUnit not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -72,7 +61,7 @@ export class ILocalSpatialAudioEngineImpl axisUp: number[] ): CallApiReturnType { AgoraConsole.warn('updateSelfPosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -85,7 +74,7 @@ export class ILocalSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('updateSelfPositionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -97,21 +86,21 @@ export class ILocalSpatialAudioEngineImpl AgoraConsole.warn( 'updatePlayerPositionInfo not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setParameters(params: string): CallApiReturnType { AgoraConsole.warn('setParameters not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteLocalAudioStream(mute: boolean): CallApiReturnType { AgoraConsole.warn('muteLocalAudioStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -120,7 +109,7 @@ export class ILocalSpatialAudioEngineImpl AgoraConsole.warn( 'muteAllRemoteAudioStreams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -131,7 +120,7 @@ export class ILocalSpatialAudioEngineImpl posInfo: NATIVE_RTC.RemoteVoicePositionInfo ): CallApiReturnType { AgoraConsole.warn('updateRemotePosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -143,7 +132,7 @@ export class ILocalSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('updateRemotePositionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -151,7 +140,7 @@ export class ILocalSpatialAudioEngineImpl removeRemotePosition(uid: number): CallApiReturnType { AgoraConsole.warn('removeRemotePosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -162,7 +151,7 @@ export class ILocalSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('removeRemotePositionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -170,7 +159,7 @@ export class ILocalSpatialAudioEngineImpl clearRemotePositions(): CallApiReturnType { AgoraConsole.warn('clearRemotePositions not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -180,7 +169,7 @@ export class ILocalSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('clearRemotePositionsEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -195,20 +184,9 @@ export class IBaseSpatialAudioEngineImpl this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - release(): CallApiReturnType { AgoraConsole.warn('release not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -218,7 +196,7 @@ export class IBaseSpatialAudioEngineImpl zoneCount: number ): CallApiReturnType { AgoraConsole.warn('setZones not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -229,14 +207,14 @@ export class IBaseSpatialAudioEngineImpl forceSet: boolean ): CallApiReturnType { AgoraConsole.warn('setPlayerAttenuation not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteRemoteAudioStream(uid: number, mute: boolean): CallApiReturnType { AgoraConsole.warn('muteRemoteAudioStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -244,7 +222,7 @@ export class IBaseSpatialAudioEngineImpl initialize(): CallApiReturnType { AgoraConsole.warn('initialize not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -257,7 +235,7 @@ export class IBaseSpatialAudioEngineImpl AgoraConsole.warn( 'setRemoteAudioAttenuation not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -265,21 +243,21 @@ export class IBaseSpatialAudioEngineImpl setMaxAudioRecvCount(maxCount: number): CallApiReturnType { AgoraConsole.warn('setMaxAudioRecvCount not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setAudioRecvRange(range: number): CallApiReturnType { AgoraConsole.warn('setAudioRecvRange not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setDistanceUnit(unit: number): CallApiReturnType { AgoraConsole.warn('setDistanceUnit not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -291,7 +269,7 @@ export class IBaseSpatialAudioEngineImpl axisUp: number ): CallApiReturnType { AgoraConsole.warn('updateSelfPosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -304,7 +282,7 @@ export class IBaseSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('updateSelfPositionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -316,21 +294,21 @@ export class IBaseSpatialAudioEngineImpl AgoraConsole.warn( 'updatePlayerPositionInfo not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } setParameters(params: string): CallApiReturnType { AgoraConsole.warn('setParameters not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); } muteLocalAudioStream(mute: boolean): CallApiReturnType { AgoraConsole.warn('muteLocalAudioStream not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -339,7 +317,7 @@ export class IBaseSpatialAudioEngineImpl AgoraConsole.warn( 'muteAllRemoteAudioStreams not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -350,7 +328,7 @@ export class IBaseSpatialAudioEngineImpl posInfo: NATIVE_RTC.RemoteVoicePositionInfo ): CallApiReturnType { AgoraConsole.warn('updateRemotePosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -362,7 +340,7 @@ export class IBaseSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('updateRemotePositionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -370,7 +348,7 @@ export class IBaseSpatialAudioEngineImpl removeRemotePosition(uid: number): CallApiReturnType { AgoraConsole.warn('removeRemotePosition not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -381,7 +359,7 @@ export class IBaseSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('removeRemotePositionEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -389,7 +367,7 @@ export class IBaseSpatialAudioEngineImpl clearRemotePositions(): CallApiReturnType { AgoraConsole.warn('clearRemotePositions not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -399,7 +377,7 @@ export class IBaseSpatialAudioEngineImpl connection: NATIVE_RTC.RtcConnection ): CallApiReturnType { AgoraConsole.warn('clearRemotePositionsEx not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); diff --git a/packages/rtc/src/impl/IAudioDeviceManagerImpl.ts b/packages/rtc/src/impl/IAudioDeviceManagerImpl.ts index ef479e9..18e153c 100644 --- a/packages/rtc/src/impl/IAudioDeviceManagerImpl.ts +++ b/packages/rtc/src/impl/IAudioDeviceManagerImpl.ts @@ -1,5 +1,5 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { CallApiReturnType, CallIrisApiResult } from 'iris-web-core'; +import { CallApiReturnType } from 'iris-web-core'; import { IrisRtcEngine } from '../engine/IrisRtcEngine'; import { AgoraConsole } from '../util'; @@ -11,22 +11,11 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { this._engine = engine; } - private returnResult( - isSuccess: boolean = true, - code: number = NATIVE_RTC.ERROR_CODE_TYPE.ERR_OK, - data: string = '{"result": 0}' - ): Promise { - if (!isSuccess) { - code = -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED; - } - return Promise.resolve(new CallIrisApiResult(code, data)); - } - enumeratePlaybackDevices(): CallApiReturnType { AgoraConsole.warn( 'enumeratePlaybackDevices not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -36,7 +25,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'enumerateRecordingDevices not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -44,7 +33,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { setPlaybackDevice(deviceId: string[]): CallApiReturnType { AgoraConsole.warn('setPlaybackDevice not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -52,7 +41,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getPlaybackDevice(deviceId: string): CallApiReturnType { AgoraConsole.warn('getPlaybackDevice not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -60,7 +49,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getPlaybackDeviceInfo(): CallApiReturnType { AgoraConsole.warn('getPlaybackDeviceInfo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -70,7 +59,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'setPlaybackDeviceVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -80,7 +69,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'getPlaybackDeviceVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -88,7 +77,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { setRecordingDevice(deviceId: string[]): CallApiReturnType { AgoraConsole.warn('setRecordingDevice not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -96,7 +85,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getRecordingDevice(deviceId: string): CallApiReturnType { AgoraConsole.warn('getRecordingDevice not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -104,7 +93,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getRecordingDeviceInfo(): CallApiReturnType { AgoraConsole.warn('getRecordingDeviceInfo not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -114,7 +103,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'setRecordingDeviceVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -124,7 +113,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'getRecordingDeviceVolume not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -132,7 +121,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { setLoopbackDevice(deviceId: string[]): CallApiReturnType { AgoraConsole.warn('setLoopbackDevice not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -140,7 +129,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getLoopbackDevice(deviceId: string): CallApiReturnType { AgoraConsole.warn('getLoopbackDevice not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -148,7 +137,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { setPlaybackDeviceMute(mute: boolean): CallApiReturnType { AgoraConsole.warn('setPlaybackDeviceMute not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -156,7 +145,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getPlaybackDeviceMute(mute: boolean): CallApiReturnType { AgoraConsole.warn('getPlaybackDeviceMute not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -164,7 +153,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { setRecordingDeviceMute(mute: boolean): CallApiReturnType { AgoraConsole.warn('setRecordingDeviceMute not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -172,7 +161,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { getRecordingDeviceMute(mute: boolean): CallApiReturnType { AgoraConsole.warn('getRecordingDeviceMute not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -182,7 +171,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'startPlaybackDeviceTest not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -190,7 +179,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { stopPlaybackDeviceTest(): CallApiReturnType { AgoraConsole.warn('stopPlaybackDeviceTest not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -200,7 +189,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'startRecordingDeviceTest not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -210,7 +199,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'stopRecordingDeviceTest not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -220,7 +209,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'startAudioDeviceLoopbackTest not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -230,7 +219,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'stopAudioDeviceLoopbackTest not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -240,7 +229,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'followSystemPlaybackDevice not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -250,7 +239,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'followSystemRecordingDevice not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -260,7 +249,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { AgoraConsole.warn( 'followSystemLoopbackDevice not supported in this platform!' ); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); @@ -268,7 +257,7 @@ export class IAudioDeviceManagerImpl implements NATIVE_RTC.IAudioDeviceManager { release(): CallApiReturnType { AgoraConsole.warn('release not supported in this platform!'); - return this.returnResult( + return this._engine.returnResult( false, -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_SUPPORTED ); diff --git a/packages/rtc/src/impl/ImplHelper.ts b/packages/rtc/src/impl/ImplHelper.ts deleted file mode 100644 index 4a32896..0000000 --- a/packages/rtc/src/impl/ImplHelper.ts +++ /dev/null @@ -1,970 +0,0 @@ -import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { - AgoraRTCErrorCode, - BufferSourceAudioTrackInitConfig, - CameraVideoTrackInitConfig, - ClientConfig, - EncryptionMode, - IAgoraRTCClient, - IBufferSourceAudioTrack, - ICameraVideoTrack, - ILocalAudioTrack, - ILocalVideoTrack, - IMicrophoneAudioTrack, - MicrophoneAudioTrackInitConfig, - ScreenVideoTrackInitConfig, - VideoPlayerConfig, -} from 'agora-rtc-sdk-ng'; - -import { IrisAudioSourceType, IrisClientType } from '../base/BaseType'; -import { IrisRtcEngine } from '../engine/IrisRtcEngine'; -import { IrisGlobalVariables } from '../states/IrisGlobalVariables'; -import { AgoraConsole } from '../util/AgoraConsole'; -import { AgoraTranslate } from '../util/AgoraTranslate'; - -export class ImplHelper { - public static getAudioAndVideoTrack( - engine: IrisRtcEngine, - audioType: IrisAudioSourceType, - videoType: NATIVE_RTC.VIDEO_SOURCE_TYPE - ): [ILocalAudioTrack, ILocalVideoTrack] { - let trackArray: [ILocalAudioTrack, ILocalVideoTrack] = [null, null]; - if ( - audioType == IrisAudioSourceType.kAudioSourceTypeUnknown && - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN - ) { - AgoraConsole.warn('getAudioAndVideoTrack audio and video both unknown'); - } - - trackArray = [ - engine.entitiesContainer.getLocalAudioTrackByType(audioType) - ?.track as ILocalAudioTrack, - engine.entitiesContainer.getLocalVideoTrackByType(videoType) - ?.track as ILocalVideoTrack, - ]; - return trackArray; - } - - public static async createBufferSourceAudioTrackAsync( - engine: IrisRtcEngine, - soundId: number, - bufferSourceAudioTrackInitConfig: BufferSourceAudioTrackInitConfig, - clientType: IrisClientType - ): Promise { - let bufferSourceAudioTrack: IBufferSourceAudioTrack = null; - - let bufferSourceAudioTrackPackage = engine.entitiesContainer.getLocalBufferSourceAudioTrackBySoundId( - soundId - ); - if (bufferSourceAudioTrackPackage) { - throw `soundId:${bufferSourceAudioTrackPackage.soundId} already create`; - } - try { - bufferSourceAudioTrack = await engine.globalVariables.AgoraRTC.createBufferSourceAudioTrack( - bufferSourceAudioTrackInitConfig - ); - } catch (e) { - AgoraConsole.error('createBufferSourceAudioTrack failed'); - AgoraConsole.error(e); - } - if (bufferSourceAudioTrack) { - //audio 可能为null - // this.processAudioTrack(engine, bufferSourceAudioTrack, clientType); - engine.entitiesContainer.addLocalBufferSourceAudioTrack({ - soundId: soundId, - track: bufferSourceAudioTrack, - }); - } - - return bufferSourceAudioTrack; - } - - public static async getOrCreateCustomAudioAndVideoTrackAsync( - engine: IrisRtcEngine, - audioType: IrisAudioSourceType, - videoType: NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CUSTOM, - mediaStreamTrack: MediaStreamTrack, - clientType: IrisClientType, - connection: NATIVE_RTC.RtcConnection - ): Promise<[ILocalAudioTrack, ILocalVideoTrack]> { - let retAudioTrack: ILocalAudioTrack = null; - let retVideoTrack: ILocalVideoTrack = engine.entitiesContainer.getLocalVideoTrackByType( - videoType - )?.track as ILocalVideoTrack; - //video - if (!retVideoTrack) { - let videoTrack: ILocalVideoTrack = null; - try { - videoTrack = engine.globalVariables.AgoraRTC.createCustomVideoTrack({ - mediaStreamTrack, - }); - } catch (e) { - AgoraConsole.error('createCustomVideoTrack failed'); - AgoraConsole.error(e); - } - if (videoTrack) { - //video 可能为null - this.processVideoTrack( - engine, - videoTrack, - clientType, - videoType, - connection - ); - engine.entitiesContainer.addLocalVideoTrack({ - type: videoType, - track: videoTrack, - }); - } - retVideoTrack = videoTrack; - } - - //audio 暂时不实现 - - return [retAudioTrack, retVideoTrack]; - } - - public static async getOrCreateAudioAndVideoTrackAsync( - engine: IrisRtcEngine, - audioType: IrisAudioSourceType, - videoType: NATIVE_RTC.VIDEO_SOURCE_TYPE, - clientType: IrisClientType, - connection: NATIVE_RTC.RtcConnection - ): Promise<[ILocalAudioTrack, ILocalVideoTrack]> { - if ( - audioType == IrisAudioSourceType.kAudioSourceTypeUnknown && - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN - ) { - AgoraConsole.warn( - 'getOrCreateAudioAndVideoTrack audio and video both unknown ' - ); - return [null, null]; - } - - if ( - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY && - audioType == IrisAudioSourceType.kAudioSourceTypeScreenPrimary - ) { - //如果没有进行屏幕共享,则不create也不get - if (!engine.globalVariables.isScreenSharing) { - return [null, null]; - } - - let audioPackage = engine.entitiesContainer.getLocalAudioTrackByType( - audioType - ); - let videoPackage = engine.entitiesContainer.getLocalVideoTrackByType( - videoType - ); - if (audioPackage && videoPackage) { - return [ - audioPackage.track as ILocalAudioTrack, - videoPackage.track as ILocalVideoTrack, - ]; - } else { - //屏幕共享 audio 和 video 应该要同步创建和同步销毁 - if (audioPackage) { - await engine.entitiesContainer.processAudioTrackClose( - audioPackage.track as ILocalAudioTrack - ); - (audioPackage.track as ILocalAudioTrack).close(); - } - if (videoPackage) { - await engine.entitiesContainer.processVideoTrackClose( - videoPackage.track as ILocalVideoTrack - ); - (videoPackage.track as ILocalVideoTrack).close(); - } - - let trackArray: - | [ILocalVideoTrack, ILocalAudioTrack] - | ILocalVideoTrack - | null = null; - let audioTrack: ILocalAudioTrack = null; - let videoTrack: ILocalVideoTrack = null; - try { - let conf: ScreenVideoTrackInitConfig = this.generateScreenVideoTrackInitConfig( - engine - ); - //由于平台差异,有可能无法返回音频track,故做兼容 - let screenTrack = await engine.globalVariables.AgoraRTC.createScreenVideoTrack( - conf, - 'auto' - ); - if (Array.isArray(screenTrack)) { - trackArray = screenTrack; - } else { - trackArray = [screenTrack, null]; - } - } catch (e) { - if (e.code === AgoraRTCErrorCode.PERMISSION_DENIED) { - engine.rtcEngineEventHandler.onLocalVideoStateChanged( - videoType, - NATIVE_RTC.LOCAL_VIDEO_STREAM_STATE - .LOCAL_VIDEO_STREAM_STATE_FAILED, - NATIVE_RTC.LOCAL_VIDEO_STREAM_ERROR - .LOCAL_VIDEO_STREAM_ERROR_DEVICE_NO_PERMISSION - ); - } - throw e; - } - if (trackArray) { - //每一个track都可能是null - audioTrack = trackArray[1]; - if (audioTrack) { - this.processScreenShareAudioTrack(engine, audioTrack); - engine.entitiesContainer.addLocalAudioTrack({ - type: audioType, - track: audioTrack, - }); - } - - videoTrack = trackArray[0]; - if (videoTrack) { - this.processScreenShareVideoTrack(engine, videoTrack, videoType); - engine.entitiesContainer.addLocalVideoTrack({ - type: videoType, - track: videoTrack, - }); - } - } - return [audioTrack, videoTrack]; - } - } - - let retAudioTrack: ILocalAudioTrack = null; - let retVideoTrack: ILocalVideoTrack = null; - //video - if (engine.entitiesContainer.getLocalVideoTrackByType(videoType)) { - retVideoTrack = engine.entitiesContainer.getLocalVideoTrackByType( - videoType - ).track as ILocalVideoTrack; - } else if ( - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY || - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_SECONDARY - ) { - let videoTrack: ILocalVideoTrack = null; - try { - let conf: ScreenVideoTrackInitConfig = this.generateScreenVideoTrackInitConfig( - engine - ); - videoTrack = await engine.globalVariables.AgoraRTC.createScreenVideoTrack( - conf, - 'disable' - ); - } catch (e) { - throw e; - } - if (videoTrack) { - //这里的videoTrack有可能是null, 如果promise创建失败的话 - this.processScreenShareVideoTrack(engine, videoTrack, videoType); - engine.entitiesContainer.addLocalVideoTrack({ - type: videoType, - track: videoTrack, - }); - } - retVideoTrack = videoTrack; - } else if ( - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY || - videoType == NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY - ) { - let videoTrack: ICameraVideoTrack = null; - try { - let videoConfig: CameraVideoTrackInitConfig = this.generateCameraVideoTrackInitConfig( - engine - ); - videoTrack = await engine.globalVariables.AgoraRTC.createCameraVideoTrack( - videoConfig - ); - } catch (e) { - AgoraConsole.error('createCameraVideoTrack failed'); - AgoraConsole.error(e); - } - if (videoTrack) { - //video 可能为null - this.processVideoTrack( - engine, - videoTrack, - clientType, - videoType, - connection - ); - engine.entitiesContainer.addLocalVideoTrack({ - type: videoType, - track: videoTrack, - }); - } - retVideoTrack = videoTrack; - } - - //audio - if (engine.entitiesContainer.getLocalAudioTrackByType(audioType)) { - retAudioTrack = engine.entitiesContainer.getLocalAudioTrackByType( - audioType - ).track as ILocalAudioTrack; - } else if ( - audioType == IrisAudioSourceType.kAudioSourceTypeMicrophonePrimary - ) { - let audioTrack: IMicrophoneAudioTrack = null; - try { - let audioConfig: MicrophoneAudioTrackInitConfig = this.generateMicrophoneAudioTrackInitConfig( - engine - ); - audioTrack = await engine.globalVariables.AgoraRTC.createMicrophoneAudioTrack( - audioConfig - ); - } catch (e) { - AgoraConsole.error('createMicrophoneAudioTrack failed'); - throw e; - } - if (audioTrack) { - this.processAudioTrack(engine, audioTrack, clientType); - engine.entitiesContainer.addLocalAudioTrack({ - type: audioType, - track: audioTrack, - }); - } - retAudioTrack = audioTrack; - } - - return [retAudioTrack, retVideoTrack]; - } - - //当一个audioTrack被创建的时候,要拆解这些参数 - public static processScreenShareAudioTrack( - engine: IrisRtcEngine, - audioTrack: ILocalAudioTrack - ) { - let globalVariables = engine.globalVariables; - let mainClientVariables = engine.mainClientVariables; - - //audio - if (mainClientVariables.playbackDeviceId) { - audioTrack - .setPlaybackDevice(mainClientVariables.playbackDeviceId) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audiotrack setPlaybackDevice failed'); - reason && AgoraConsole.error(reason); - }) - .finally(() => {}); - } - if (globalVariables.enabledAudio) { - audioTrack.play(); - } - if (globalVariables.pausedAudio) { - audioTrack - .setEnabled(false) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audio track setEnabled failed'); - reason && AgoraConsole.error(reason); - }) - .finally(() => {}); - } - - if (globalVariables.mutedLocalAudioStream) { - audioTrack - .setMuted(true) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audio track setMuted failed'); - reason && AgoraConsole.error(reason); - }) - .finally(() => {}); - } - } - - public static processScreenShareVideoTrack( - engine: IrisRtcEngine, - videoTrack: ILocalVideoTrack, - videoSource: NATIVE_RTC.VIDEO_SOURCE_TYPE - ) { - let globalVariables = engine.globalVariables; - let mainClientVariables = engine.mainClientVariables; - - if (mainClientVariables.videoDeviceId) { - //屏幕共享视频没有设备id咯 - } - if (globalVariables.enabledVideo && videoTrack.enabled) { - videoTrack.play( - engine.generateVideoTrackLabelOrHtmlElement('0', 0, videoSource) - ); - } - - if (globalVariables.pausedVideo) { - videoTrack - .setEnabled(false) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('video track setEnabled failed'); - reason && AgoraConsole.error(reason); - }) - .finally(() => {}); - } - if (globalVariables.mutedLocalVideoStream) { - videoTrack - .setMuted(true) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('video track setMuted failed'); - reason && AgoraConsole.error(reason); - }) - .finally(() => {}); - } - } - - public static processAudioTrack( - engine: IrisRtcEngine, - audioTrack: IMicrophoneAudioTrack | IBufferSourceAudioTrack, - type: IrisClientType - ) { - let globalVariables = engine.globalVariables; - //这里play的话,自己会听到自己的声音, - // if (globalVariables.enabledAudio) { - // // audioTrack.play(); - // } - if (globalVariables.pausedAudio) { - audioTrack - .setEnabled(false) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audioTrack setEnable failed'); - reason && AgoraConsole.error(reason); - }); - } - if (globalVariables.mutedLocalAudioStream) { - audioTrack - .setMuted(true) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audioTrack setMuted failed'); - reason && AgoraConsole.error(reason); - }); - } - } - - public static processVideoTrack( - engine: IrisRtcEngine, - videoTrack: ICameraVideoTrack | ILocalVideoTrack, - type: IrisClientType, - videoSource: - | NATIVE_RTC.VIDEO_SOURCE_TYPE - | NATIVE_RTC.EXTERNAL_VIDEO_SOURCE_TYPE, - connection: NATIVE_RTC.RtcConnection - ) { - let globalVariables = engine.globalVariables; - if (globalVariables.enabledVideo) { - let config: VideoPlayerConfig = {}; - - let videoEncoderConfiguration: NATIVE_RTC.VideoEncoderConfiguration = null; - if (type == IrisClientType.kClientMain) { - videoEncoderConfiguration = - engine.mainClientVariables.videoEncoderConfiguration; - } else { - videoEncoderConfiguration = engine.subClientVariables.videoEncoderConfigurations.getT( - connection.channelId, - connection.localUid - ); - } - - if (videoEncoderConfiguration) { - config.mirror = AgoraTranslate.NATIVE_RTCVIDEO_MIRROR_MODE_TYPE2boolean( - videoEncoderConfiguration.mirrorMode - ); - } - - // videoTrack.play(engine.generateVideoTrackLabelOrHtmlElement("0", 0, videoSource), config); - } - - if (globalVariables.pausedVideo) { - videoTrack - .setEnabled(false) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audioTrack setMuted failed'); - reason && AgoraConsole.error(reason); - }); - } - if (globalVariables.mutedLocalVideoStream) { - videoTrack - .setMuted(true) - .then(() => {}) - .catch((reason) => { - AgoraConsole.error('audioTrack setMuted failed'); - reason && AgoraConsole.error(reason); - }); - } - } - - public static createMainClient(engine: IrisRtcEngine): IAgoraRTCClient { - let config: ClientConfig = this.generateMainClientConfig(engine); - let mainClient: IAgoraRTCClient = engine.globalVariables.AgoraRTC.createClient( - config - ); - - let mainClientVariables = engine.mainClientVariables; - //设置远端默认是 大流还是小流 - if (mainClientVariables.remoteDefaultVideoStreamType != null) { - mainClient - .setRemoteDefaultVideoStreamType( - AgoraTranslate.NATIVE_RTCVIDEO_STREAM_TYPE2RemoteStreamType( - mainClientVariables.remoteDefaultVideoStreamType - ) - ) - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - //设置指定的远端uid具体是大流还是小流 - for (let e of mainClientVariables.remoteVideoStreamTypes) { - mainClient - .setRemoteVideoStreamType( - e[0], - AgoraTranslate.NATIVE_RTCVIDEO_STREAM_TYPE2RemoteStreamType(e[1]) - ) - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - - // - let videoSourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE; - if (mainClientVariables.publishCameraTrack == true) { - videoSourceType = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; - } else if (mainClientVariables.publishSecondaryCameraTrack == true) { - videoSourceType = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY; - } else if (mainClientVariables.publishScreenCaptureVideo == true) { - videoSourceType = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; - } - - //如果当前轨道被特别指定了,那么就设置一下 - if (mainClientVariables.enabledDualStreamModes.has(videoSourceType)) { - let steamMode = mainClientVariables.enabledDualStreamModes.get( - videoSourceType - ); - if (steamMode.enabled) { - mainClient - .enableDualStream() - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - - if (steamMode.streamConfig != null) { - mainClient.setLowStreamParameter( - AgoraTranslate.NATIVE_RTCSimulcastStreamConfig2LowStreamParameter( - steamMode.streamConfig - ) - ); - } - } else { - mainClient - .disableDualStream() - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - } else { - if (mainClientVariables.enabledDualStreamMode) { - mainClient - .enableDualStream() - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - } - - //设置是否报告说话的人 - if (mainClientVariables.enabledAudioVolumeIndication) { - mainClient.enableAudioVolumeIndicator(); - mainClientVariables.enabledAudioVolumeIndication = null; - } - - //是否开启了加密 - if (mainClientVariables.encryptionConfig?.enabled) { - let config: NATIVE_RTC.EncryptionConfig = - mainClientVariables.encryptionConfig.config; - let encryptionMode: EncryptionMode = AgoraTranslate.NATIVE_RTCENCRYPTION_MODE2EncryptionMode( - config.encryptionMode - ); - let salt: Uint8Array = new Uint8Array(config.encryptionKdfSalt); - mainClient.setEncryptionConfig( - encryptionMode, - config.encryptionKey, - salt - ); - //加密只有一次生效 - mainClientVariables.encryptionConfig.enabled = false; - } - - //是否开启了鉴黄 - if (mainClientVariables.contentInspect != null) { - mainClient - .enableContentInspect( - AgoraTranslate.NATIVE_RTCContentInspectConfig2InspectConfiguration( - mainClientVariables.contentInspect - ) - ) - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - - let globalVariables: IrisGlobalVariables = engine.globalVariables; - - //是否开启了cloudProxy - if (globalVariables.cloudProxy != null) { - let proxyType = globalVariables.cloudProxy; - if (proxyType == NATIVE_RTC.CLOUD_PROXY_TYPE.UDP_PROXY) { - mainClient.startProxyServer(3); - } else if (proxyType == NATIVE_RTC.CLOUD_PROXY_TYPE.TCP_PROXY) { - mainClient.startProxyServer(5); - } - } - return mainClient; - } - - public static createSubClient( - engine: IrisRtcEngine, - connection: NATIVE_RTC.RtcConnection - ): IAgoraRTCClient { - let config: ClientConfig = this.generateSubClientConfig(engine, connection); - let subClient: IAgoraRTCClient = engine.globalVariables.AgoraRTC.createClient( - config - ); - let subClientVariables = engine.subClientVariables; - - //设置远端默认是 大流还是小流 - // if (subClientVariables.remoteDefaultVideoStreamType != null) { - // subClient.setRemoteDefaultVideoStreamType(AgoraTranslate.NATIVE_RTCVIDEO_STREAM_TYPE2RemoteStreamType(mainClientVariables.remoteDefaultVideoStreamType)) - // .then(() => { - - // }) - // .catch(() => { - - // }) - // .finally(() => { - - // }) - // } - //设置指定的远端uid具体是大流还是小流 - let remoteVideoStreamTypes = subClientVariables.remoteVideoStreamTypes.getT( - connection.channelId, - connection.localUid - ); - if (remoteVideoStreamTypes) - for (let e of remoteVideoStreamTypes) { - subClient - .setRemoteVideoStreamType( - e[0], - AgoraTranslate.NATIVE_RTCVIDEO_STREAM_TYPE2RemoteStreamType(e[1]) - ) - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - - // - let options = subClientVariables.channelMediaOptions.getT( - connection.channelId, - connection.localUid - ); - let videoSourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_UNKNOWN; - if (options) { - if (options.publishCameraTrack == true) { - videoSourceType = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY; - } else if (options.publishSecondaryCameraTrack == true) { - videoSourceType = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_SECONDARY; - } else if (options.publishScreenCaptureVideo == true) { - videoSourceType = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_SCREEN_PRIMARY; - } - } - - //如果当前轨道被特别指定了,那么就设置一下 - let enabledDualStreamModes = subClientVariables.enabledDualStreamModes.getT( - connection.channelId, - connection.localUid - ); - if (enabledDualStreamModes && enabledDualStreamModes.has(videoSourceType)) { - let steamMode = enabledDualStreamModes.get(videoSourceType); - if (steamMode.enabled) { - subClient - .enableDualStream() - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - - if (steamMode.streamConfig != null) { - subClient.setLowStreamParameter( - AgoraTranslate.NATIVE_RTCSimulcastStreamConfig2LowStreamParameter( - steamMode.streamConfig - ) - ); - } - } else { - subClient - .disableDualStream() - .then(() => {}) - .catch(() => {}) - .finally(() => {}); - } - } - - //设置是否报告说话的人 - let enabledAudioVolumeIndication = subClientVariables.enabledAudioVolumeIndications.getT( - connection.channelId, - connection.localUid - ); - if (enabledAudioVolumeIndication) { - subClient.enableAudioVolumeIndicator(); - subClientVariables.enabledAudioVolumeIndications.removeT( - connection.channelId, - connection.localUid - ); - } - - //是否开启了加密 - let encryptionConfig = subClientVariables.encryptionConfigs.getT( - connection.channelId, - connection.localUid - ); - if (encryptionConfig?.enabled) { - let config: NATIVE_RTC.EncryptionConfig = encryptionConfig.config; - let encryptionMode: EncryptionMode = AgoraTranslate.NATIVE_RTCENCRYPTION_MODE2EncryptionMode( - config.encryptionMode - ); - let salt: Uint8Array = new Uint8Array(config.encryptionKdfSalt); - subClient.setEncryptionConfig(encryptionMode, config.encryptionKey, salt); - //加密只有一次生效 - subClientVariables.encryptionConfigs.removeT( - connection.channelId, - connection.localUid - ); - } - - //是否开启了鉴黄 - // if (mainClientVariables.contentInspect != null) { - // subClient.enableContentInspect(AgoraTranslate.NATIVE_RTCContentInspectConfig2InspectConfiguration(mainClientVariables.contentInspect)) - // .then(() => { - - // }) - // .catch(() => { - - // }) - // .finally(() => { - - // }) - // } - - // let globalVariables: IrisGlobalVariables = engine.globalVariables; - - //是否开启了cloudProxy - // if (globalVariables.cloudProxy != null) { - // let proxyType = globalVariables.cloudProxy; - // if (proxyType == NATIVE_RTC.CLOUD_PROXY_TYPE.UDP_PROXY) { - // subClient.startProxyServer(3); - // } - // else if (proxyType == NATIVE_RTC.CLOUD_PROXY_TYPE.TCP_PROXY) { - // subClient.startProxyServer(5); - // } - // } - return subClient; - } - - public static generateMicrophoneAudioTrackInitConfig( - engine: IrisRtcEngine - ): MicrophoneAudioTrackInitConfig { - let audioConfig: MicrophoneAudioTrackInitConfig = {}; - if (engine.mainClientVariables.recordingDeviceId) { - audioConfig.microphoneId = engine.mainClientVariables.recordingDeviceId; - } - return audioConfig; - } - - public static generateCameraVideoTrackInitConfig( - engine: IrisRtcEngine - ): CameraVideoTrackInitConfig { - let videoConfig: CameraVideoTrackInitConfig = {}; - if (engine.mainClientVariables.videoDeviceId) { - videoConfig.cameraId = engine.mainClientVariables.videoDeviceId; - } - if (engine.globalVariables.videoEncoderConfiguration) { - videoConfig.encoderConfig = AgoraTranslate.NATIVE_RTCVideoEncoderConfiguration2VideoEncoderConfiguration( - engine.globalVariables.videoEncoderConfiguration - ); - } - if (engine.globalVariables.cameraDirection) { - videoConfig.facingMode = AgoraTranslate.NATIVE_RTCCAMERA_DIRECTION2string( - engine.globalVariables.cameraDirection - ); - } - - return videoConfig; - } - - public static generateScreenVideoTrackInitConfig( - engine: IrisRtcEngine - ): ScreenVideoTrackInitConfig { - let conf: ScreenVideoTrackInitConfig = {}; - let globalVariables: IrisGlobalVariables = engine.globalVariables; - if ( - globalVariables.screenCaptureContentHint != null && - globalVariables.screenCaptureContentHint != - NATIVE_RTC.VIDEO_CONTENT_HINT.CONTENT_HINT_NONE - ) { - conf.optimizationMode = AgoraTranslate.NATIVE_RTCVIDEO_CONTENT_HINT2string( - globalVariables.screenCaptureContentHint - ); - } - - if (globalVariables.screenCaptureParameters2 != null) { - conf.encoderConfig = AgoraTranslate.NATIVE_RTCScreenCaptureParameters2VideoEncoderConfiguration( - globalVariables.screenCaptureParameters2 - ); - } else if (globalVariables.videoEncoderConfiguration != null) { - conf.encoderConfig = AgoraTranslate.NATIVE_RTCVideoEncoderConfiguration2VideoEncoderConfiguration( - globalVariables.videoEncoderConfiguration - ); - } - return conf; - } - - //根据保存的中间状态,生成ClientConfig - public static generateMainClientConfig(engine: IrisRtcEngine): ClientConfig { - let mainClientVariables = engine.mainClientVariables; - let globalVariables = engine.globalVariables; - - let config: ClientConfig = { - codec: - mainClientVariables.videoEncoderConfiguration != null - ? AgoraTranslate.NATIVE_RTCVIDEO_CODEC_TYPE2SDK_CODEC( - mainClientVariables.videoEncoderConfiguration.codecType - ) - : 'vp8', - mode: mainClientVariables.channelProfile - ? AgoraTranslate.NATIVE_RTC_CHANNEL_PROFILE_TYPE2SDK_MODE( - mainClientVariables.channelProfile - ) - : 'live', - }; - if (mainClientVariables.clientRoleType != null) { - config.role = AgoraTranslate.NATIVE_RTC_CLIENT_ROLE_TYPE2ClientRole( - mainClientVariables.clientRoleType - ); - } - if (mainClientVariables.clientRoleOptions != null) { - config.clientRoleOptions = AgoraTranslate.NATIVE_RTCClientRoleOptions2ClientRoleOptions( - mainClientVariables.clientRoleOptions - ); - } - return config; - } - - public static generateSubClientConfig( - engine: IrisRtcEngine, - connection: NATIVE_RTC.RtcConnection - ): ClientConfig { - let subClientVariables = engine.subClientVariables; - let videoEncoderConfiguration = subClientVariables.videoEncoderConfigurations.getT( - connection.channelId, - connection.localUid - ); - let options = subClientVariables.channelMediaOptions.getT( - connection.channelId, - connection.localUid - ); - let channelProfile = options?.channelProfile; - let clientRoleType = options?.clientRoleType; - let config: ClientConfig = { - codec: - videoEncoderConfiguration != null - ? AgoraTranslate.NATIVE_RTCVIDEO_CODEC_TYPE2SDK_CODEC( - videoEncoderConfiguration.codecType - ) - : 'vp8', - mode: - channelProfile != null - ? AgoraTranslate.NATIVE_RTC_CHANNEL_PROFILE_TYPE2SDK_MODE( - channelProfile - ) - : 'live', - }; - if (clientRoleType != null) { - config.role = AgoraTranslate.NATIVE_RTC_CLIENT_ROLE_TYPE2ClientRole( - clientRoleType - ); - } - // if (mainClientVariables.clientRoleOptions != null) { - // config.clientRoleOptions = AgoraTranslate.NATIVE_RTCClientRoleOptions2ClientRoleOptions(mainClientVariables.clientRoleOptions); - // } - return config; - } - - public static pretreatmentChannelMediaRelayConfiguration( - engine: IrisRtcEngine, - conf: NATIVE_RTC.ChannelMediaRelayConfiguration - ) { - //在这里0表示自己 - let mainClientUid = engine.entitiesContainer.getMainClient()?.uid || 0; - - for (let e of conf.srcInfo) { - if (e.uid == 0) { - e.uid = mainClientUid as number; - } - } - - for (let e of conf.destInfos) { - if (e.uid == 0) { - e.uid = mainClientUid as number; - } - } - } - - public static async enumerateDevices( - engine: IrisRtcEngine - ): Promise<{ - playbackDevices: NATIVE_RTC.DeviceInfo[]; - recordingDevices: NATIVE_RTC.DeviceInfo[]; - videoDevices: NATIVE_RTC.DeviceInfo[]; - }> { - let info = await engine.globalVariables.AgoraRTC.getDevices(); - let playbackDevices: any[] = []; - let recordingDevices: any[] = []; - let videoDevices: any[] = []; - for (let e of info) { - if (e.kind == 'audiooutput') { - playbackDevices.push({ - deviceId: e.deviceId, - deviceName: e.label, - }); - } else if (e.kind == 'audioinput') { - recordingDevices.push({ - deviceId: e.deviceId, - deviceName: e.label, - }); - } else if (e.kind == 'videoinput') { - videoDevices.push({ - deviceId: e.deviceId, - deviceName: e.label, - }); - } - } - - engine.globalVariables.playbackDevices = playbackDevices; - engine.globalVariables.recordingDevices = recordingDevices; - engine.globalVariables.videoDevices = videoDevices; - engine.globalVariables.deviceEnumerated = true; - return { - playbackDevices: playbackDevices, - recordingDevices: recordingDevices, - videoDevices: videoDevices, - }; - } -} diff --git a/packages/rtc/src/state/IrisClientState.ts b/packages/rtc/src/state/IrisClientState.ts new file mode 100644 index 0000000..d87f530 --- /dev/null +++ b/packages/rtc/src/state/IrisClientState.ts @@ -0,0 +1,182 @@ +import * as NATIVE_RTC from '@iris/native-rtc-binding'; +import { UID } from 'agora-rtc-sdk-ng'; + +import { IrisGlobalState } from './IrisGlobalState'; + +//Record the intermediate status of the client +export class IrisClientState { + //public role: NATIVE_RTC.CLIENT_ROLE_TYPE = NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_AUDIENCE; + + _globalState: IrisGlobalState = null; + + //LeaveChannelOptions + stopAudioMixing?: boolean = true; + stopAllEffect?: boolean = true; + stopMicrophoneRecording?: boolean = true; + + //ChannelMediaOptions + publishCameraTrack?: boolean = true; + + publishSecondaryCameraTrack?: boolean = false; + + publishThirdCameraTrack?: boolean; + + publishFourthCameraTrack?: boolean; + + publishMicrophoneTrack?: boolean = true; + + publishScreenCaptureVideo?: boolean; + + publishScreenCaptureAudio?: boolean; + + publishScreenTrack?: boolean; + + publishSecondaryScreenTrack?: boolean; + + publishThirdScreenTrack?: boolean; + + publishFourthScreenTrack?: boolean; + + publishCustomAudioTrack?: boolean; + + publishCustomAudioTrackId?: number; + + publishCustomVideoTrack?: boolean; + + publishEncodedVideoTrack?: boolean; + + publishMediaPlayerAudioTrack?: boolean; + + publishMediaPlayerVideoTrack?: boolean; + + publishTranscodedVideoTrack?: boolean; + + autoSubscribeAudio?: boolean; + + autoSubscribeVideo?: boolean; + + enableAudioRecordingOrPlayout?: boolean; + + publishMediaPlayerId?: number; + + clientRoleType?: NATIVE_RTC.CLIENT_ROLE_TYPE = + NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_BROADCASTER; + + audienceLatencyLevel?: NATIVE_RTC.AUDIENCE_LATENCY_LEVEL_TYPE; + + defaultVideoStreamType?: NATIVE_RTC.VIDEO_STREAM_TYPE = + NATIVE_RTC.VIDEO_STREAM_TYPE.VIDEO_STREAM_HIGH; + + channelProfile?: NATIVE_RTC.CHANNEL_PROFILE_TYPE = + NATIVE_RTC.CHANNEL_PROFILE_TYPE.CHANNEL_PROFILE_COMMUNICATION; + + audioDelayMs?: number; + + mediaPlayerAudioDelayMs?: number; + + token?: string; + + enableBuiltInMediaEncryption?: boolean; + + publishRhythmPlayerTrack?: boolean; + + isInteractiveAudience?: boolean; + + customVideoTrackId?: number; + + isAudioFilterable?: boolean; + + //setClientOptions() + public clientRoleOptions?: NATIVE_RTC.ClientRoleOptions = null; + + //mute 远端的用户流 + mutedRemoteAudioStreams: Map = new Map(); + mutedRemoteVideoStreams: Map = new Map(); + + videoSourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE = + NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA; + + //SetVideoEncoderConfiguration + videoEncoderConfiguration: NATIVE_RTC.VideoEncoderConfiguration = null; + + //是否开启大小流 + enabledDualStreamMode: boolean = false; + enabledDualStreamModes: Map< + NATIVE_RTC.VIDEO_SOURCE_TYPE, + { enabled: boolean; streamConfig?: NATIVE_RTC.SimulcastStreamConfig } + > = new Map< + NATIVE_RTC.VIDEO_SOURCE_TYPE, + { enabled: boolean; streamConfig?: NATIVE_RTC.SimulcastStreamConfig } + >(); + + //远端的大小流 + remoteVideoStreamTypes: Map = new Map< + UID, + NATIVE_RTC.VIDEO_STREAM_TYPE + >(); + + //远端默认流 + remoteDefaultVideoStreamType: NATIVE_RTC.VIDEO_STREAM_TYPE = null; + + encryptionConfig: { + enabled: boolean; + config: NATIVE_RTC.EncryptionConfig; + } = { + enabled: false, + config: new NATIVE_RTC.EncryptionConfig(), + }; + + //C++ enabledAudioVolumeIndication() + enabledAudioVolumeIndication: { + interval: number; + smooth: number; + reportVad: boolean; + } = null; + + //setPlaybackDevice: audiDevice + playbackDeviceId: string = null; + //setRecordingDevice: recordingDevice + recordingDeviceId: string = null; + + //SetContentInspect + contentInspect: NATIVE_RTC.ContentInspectConfig = null; + + // startPreviewed 似乎没有用处 + // startPreviewed: boolean = false; + + //用来记录暂停或者恢复的 + currChannelMediaRelayconfiguration: NATIVE_RTC.ChannelMediaRelayConfiguration = null; + + constructor(globalState: IrisGlobalState) { + this._globalState = globalState; + if (globalState.rtcEngineContext?.channelProfile) { + this.channelProfile = globalState.rtcEngineContext.channelProfile; + } + if (globalState.autoSubscribeVideo) { + this.autoSubscribeVideo = globalState.autoSubscribeVideo; + } + } + + mergeChannelMediaOptions( + options: NATIVE_RTC.ChannelMediaOptions | NATIVE_RTC.LeaveChannelOptions + ) { + for (let key in options) { + this[key] = options[key]; + } + if ( + this.publishCustomVideoTrack && + this._globalState.pushVideoFrameEnabled + ) { + this.publishCameraTrack = false; + this.publishEncodedVideoTrack = false; + this.publishSecondaryCameraTrack = false; + this.publishThirdCameraTrack = false; + this.publishFourthCameraTrack = false; + this.publishScreenTrack = false; + this.publishSecondaryScreenTrack = false; + this.publishThirdScreenTrack = false; + this.publishFourthScreenTrack = false; + this.publishMediaPlayerVideoTrack = false; + } + } +} diff --git a/packages/rtc/src/states/IrisGlobalVariables.ts b/packages/rtc/src/state/IrisGlobalState.ts similarity index 82% rename from packages/rtc/src/states/IrisGlobalVariables.ts rename to packages/rtc/src/state/IrisGlobalState.ts index 53bfb6e..b01e6e9 100644 --- a/packages/rtc/src/states/IrisGlobalVariables.ts +++ b/packages/rtc/src/state/IrisGlobalState.ts @@ -1,14 +1,13 @@ import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import AgoraRTC, { IAgoraRTC, UID } from 'agora-rtc-sdk-ng'; +import AgoraRTC, { IAgoraRTC } from 'agora-rtc-sdk-ng'; export interface DeviceInfo { deviceName: string; deviceId: string; } -export class IrisGlobalVariables { +export class IrisGlobalState { public rtcEngineContext: NATIVE_RTC.RtcEngineContext; - isJoinChannel: boolean = false; //C++ SetAudioProfile() initialize() public audioProfile: NATIVE_RTC.AUDIO_PROFILE_TYPE; @@ -33,11 +32,6 @@ export class IrisGlobalVariables { public enabledVideo: boolean = false; public pausedVideo: boolean = false; - //远端用户的 playback signal volume, 总设置 - playbackSignalVolume: number = 100; - //每个远端用户的 playback signal volume 对应uid - playbackSignalVolumes: Map = new Map(); - // recording Signal Volume recordingSignalVolume: number = 100; @@ -58,25 +52,23 @@ export class IrisGlobalVariables { //setVideoEncoderConfiguration videoEncoderConfiguration: NATIVE_RTC.VideoEncoderConfiguration = null; - cameraDirection: NATIVE_RTC.CAMERA_DIRECTION = null; - fallbackOption: NATIVE_RTC.STREAM_FALLBACK_OPTIONS = null; screenCaptureContentHint: NATIVE_RTC.VIDEO_CONTENT_HINT = null; - isScreenSharing: boolean = false; - // screenCaptureParameters: NATIVE_RTC.ScreenCaptureParameters = null; screenCaptureParameters2: NATIVE_RTC.ScreenCaptureParameters2 = null; cloudProxy: NATIVE_RTC.CLOUD_PROXY_TYPE = null; //devicesInfo - deviceEnumerated: boolean = false; playbackDevices: DeviceInfo[] = new Array(); recordingDevices: DeviceInfo[] = new Array(); videoDevices: DeviceInfo[] = new Array(); + //setDevice() : videoDevice + videoDeviceId: string = null; + //enableAudioVolumeIndication enableAudioVolumeIndication: boolean = false; enableAudioVolumeIndicationConfig = { @@ -85,6 +77,15 @@ export class IrisGlobalVariables { reportVad: false, }; + public autoSubscribeVideo: boolean = false; + + reset() { + this.enabledAudio = true; + this.pausedAudio = false; + this.enabledLocalAudio = true; + this.mutedLocalAudioStream = false; + } + //fake AgoraRTC: IAgoraRTC = AgoraRTC; } diff --git a/packages/rtc/src/states/IrisMainClientVariables.ts b/packages/rtc/src/states/IrisMainClientVariables.ts deleted file mode 100644 index 6f3e30e..0000000 --- a/packages/rtc/src/states/IrisMainClientVariables.ts +++ /dev/null @@ -1,154 +0,0 @@ -import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { UID } from 'agora-rtc-sdk-ng'; - -//Record the intermediate status of the Main client -export class IrisMainClientVariables { - //public role: NATIVE_RTC.CLIENT_ROLE_TYPE = NATIVE_RTC.CLIENT_ROLE_TYPE.CLIENT_ROLE_AUDIENCE; - - //ClientRoleOptions - // audienceLatencyLevel?: NATIVE_RTC.AUDIENCE_LATENCY_LEVEL_TYPE; - // stopMicrophoneRecording?: boolean; - public stopPreview?: boolean; - - //ChannelMediaOptions - public publishCameraTrack?: boolean; - public publishSecondaryCameraTrack?: boolean; - public publishAudioTrack?: boolean; - public publishScreenCaptureVideo?: boolean; - public publishScreenCaptureAudio?: boolean; - public publishScreenTrack: boolean; - public publishSecondaryScreenTrack: boolean; - public publishCustomAudioTrack?: boolean; - public publishCustomAudioSourceId?: number; - public publishCustomAudioTrackEnableAec?: boolean; - public publishDirectCustomAudioTrack?: boolean; - public publishCustomAudioTrackAec?: boolean; - public publishCustomVideoTrack?: boolean; - public publishEncodedVideoTrack?: boolean; - public publishMediaPlayerAudioTrack?: boolean; - public publishMediaPlayerVideoTrack?: boolean; - public publishTrancodedVideoTrack?: boolean; - public autoSubscribeAudio?: boolean = true; - public autoSubscribeVideo?: boolean = true; - public startPreview?: boolean; - public enableAudioRecordingOrPlayout?: boolean; - public publishMediaPlayerId?: number; - public clientRoleType?: NATIVE_RTC.CLIENT_ROLE_TYPE; - public audienceLatencyLevel?: NATIVE_RTC.AUDIENCE_LATENCY_LEVEL_TYPE; - public defaultVideoStreamType?: NATIVE_RTC.VIDEO_STREAM_TYPE; - public channelProfile?: NATIVE_RTC.CHANNEL_PROFILE_TYPE; - public audioDelayMs?: number; - public mediaPlayerAudioDelayMs?: number; - public token?: string; - public enableBuiltInMediaEncryption?: boolean; - public publishRhythmPlayerTrack?: boolean; - // public audioOptionsExternal: AudioOptionsExternal; - - clearChannelMediaOptions() { - this.publishCameraTrack = null; - this.publishSecondaryCameraTrack = null; - this.publishAudioTrack = null; - this.publishScreenCaptureVideo = null; - this.publishScreenCaptureAudio = null; - this.publishScreenTrack = null; - this.publishSecondaryScreenTrack = null; - this.publishCustomAudioTrack = null; - this.publishCustomAudioSourceId = null; - this.publishCustomAudioTrackEnableAec = null; - this.publishDirectCustomAudioTrack = null; - this.publishCustomAudioTrackAec = null; - this.publishCustomVideoTrack = null; - this.publishEncodedVideoTrack = null; - this.publishMediaPlayerAudioTrack = null; - this.publishMediaPlayerVideoTrack = null; - this.publishTrancodedVideoTrack = null; - this.autoSubscribeAudio = null; - this.autoSubscribeVideo = null; - this.startPreview = null; - this.enableAudioRecordingOrPlayout = null; - this.publishMediaPlayerId = null; - this.clientRoleType = null; - this.audienceLatencyLevel = null; - this.defaultVideoStreamType = null; - this.audioDelayMs = null; - this.mediaPlayerAudioDelayMs = null; - this.token = null; - this.enableBuiltInMediaEncryption = null; - this.publishRhythmPlayerTrack = null; - } - - mergeChannelMediaOptions(options: NATIVE_RTC.ChannelMediaOptions) { - for (let key in options) { - this[key] = options[key]; - } - } - - //setClientOptions() - public clientRoleOptions?: NATIVE_RTC.ClientRoleOptions = null; - - //LeaveChannelOptions - public stopAudioMixing: boolean = true; - public stopAllEffect: boolean = true; - public stopMicrophoneRecording: boolean = true; - - //mute 远端的用户流 - mutedRemoteAudioStreams: Map = new Map(); - mutedRemoteVideoStreams: Map = new Map(); - - videoSourceType: NATIVE_RTC.VIDEO_SOURCE_TYPE = - NATIVE_RTC.VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA; - - //SetVideoEncoderConfiguration - videoEncoderConfiguration: NATIVE_RTC.VideoEncoderConfiguration = null; - - //是否开启大小流 - enabledDualStreamMode: boolean = false; - enabledDualStreamModes: Map< - NATIVE_RTC.VIDEO_SOURCE_TYPE, - { enabled: boolean; streamConfig?: NATIVE_RTC.SimulcastStreamConfig } - > = new Map< - NATIVE_RTC.VIDEO_SOURCE_TYPE, - { enabled: boolean; streamConfig?: NATIVE_RTC.SimulcastStreamConfig } - >(); - - //远端的大小流 - remoteVideoStreamTypes: Map = new Map< - UID, - NATIVE_RTC.VIDEO_STREAM_TYPE - >(); - - //远端默认流 - remoteDefaultVideoStreamType: NATIVE_RTC.VIDEO_STREAM_TYPE = null; - - encryptionConfig: { - enabled: boolean; - config: NATIVE_RTC.EncryptionConfig; - } = { - enabled: false, - config: new NATIVE_RTC.EncryptionConfig(), - }; - - //C++ enabledAudioVolumeIndication() - enabledAudioVolumeIndication: { - interval: number; - smooth: number; - reportVad: boolean; - } = null; - - //setDevice() : videoDevice - videoDeviceId: string = null; - - //setPlaybackDevice: audiDevice - playbackDeviceId: string = null; - //setRecordingDevice: recordingDevice - recordingDeviceId: string = null; - - //SetContentInspect - contentInspect: NATIVE_RTC.ContentInspectConfig = null; - - // startPreviewed 似乎没有用处 - // startPreviewed: boolean = false; - - //用来记录暂停或者恢复的 - currChannelMediaRelayconfiguration: NATIVE_RTC.ChannelMediaRelayConfiguration = null; -} diff --git a/packages/rtc/src/states/IrisSubClientVariables.ts b/packages/rtc/src/states/IrisSubClientVariables.ts deleted file mode 100644 index 22e9027..0000000 --- a/packages/rtc/src/states/IrisSubClientVariables.ts +++ /dev/null @@ -1,88 +0,0 @@ -import * as NATIVE_RTC from '@iris/native-rtc-binding'; -import { UID } from 'agora-rtc-sdk-ng'; - -import { Container } from '../util/Container'; -//Record the intermediate status of the Main client -export class IrisSubClientVariables { - //ChannelMediaOptions - channelMediaOptions: Container< - NATIVE_RTC.ChannelMediaOptions - > = new Container(); - - //返回值为合并后万好着呢个版本的ChannelMediaOptions - mergeChannelMediaOptions( - connection: NATIVE_RTC.RtcConnection, - options: NATIVE_RTC.ChannelMediaOptions - ): NATIVE_RTC.ChannelMediaOptions { - let channelMediaOptions: NATIVE_RTC.ChannelMediaOptions = this.channelMediaOptions.getT( - connection.channelId, - connection.localUid - ); - if (channelMediaOptions == null) { - channelMediaOptions = {}; - this.channelMediaOptions.addT( - connection.channelId, - connection.localUid, - channelMediaOptions - ); - } - - for (let key in options) { - channelMediaOptions[key] = options[key]; - } - - return channelMediaOptions; - } - - enabledAudioVolumeIndications: Container<{ - interval: number; - smooth: number; - reportVad: boolean; - }> = new Container<{ - interval: number; - smooth: number; - reportVad: boolean; - }>(); - //C++ AdjustUserPlaybackSignalVolume - //each user playback signal volume - playbackSignalVolumes: Map = new Map(); - - //mute 远端用户流 - mutedRemoteAudioStreams: Container> = new Container< - Map - >(); - mutedRemoteVideoStreams: Container> = new Container< - Map - >(); - - //SetVideoEncoderConfigurationEx - videoEncoderConfigurations: Container< - NATIVE_RTC.VideoEncoderConfiguration - > = new Container(); - - //子账户设置开启大小流 - enabledDualStreamModes: Container< - Map< - NATIVE_RTC.VIDEO_SOURCE_TYPE, - { enabled: boolean; streamConfig?: NATIVE_RTC.SimulcastStreamConfig } - > - > = new Container< - Map< - NATIVE_RTC.VIDEO_SOURCE_TYPE, - { enabled: boolean; streamConfig?: NATIVE_RTC.SimulcastStreamConfig } - > - >(); - //子账户设置接收大小流 - remoteVideoStreamTypes: Container< - Map - > = new Container>(); - - //加密 - encryptionConfigs: Container<{ - enabled: boolean; - config: NATIVE_RTC.EncryptionConfig; - }> = new Container<{ - enabled: boolean; - config: NATIVE_RTC.EncryptionConfig; - }>(); -} diff --git a/packages/rtc/src/util/AgoraConsole.ts b/packages/rtc/src/util/AgoraConsole.ts index 7ccb754..6481df9 100644 --- a/packages/rtc/src/util/AgoraConsole.ts +++ b/packages/rtc/src/util/AgoraConsole.ts @@ -1,7 +1,7 @@ import { LOG_LEVEL } from '@iris/native-rtc-binding'; export class AgoraConsole { - public static logLevel: LOG_LEVEL = LOG_LEVEL.LOG_LEVEL_ERROR; + public static logLevel: LOG_LEVEL = LOG_LEVEL.LOG_LEVEL_INFO; public static getDate(): string { const timestamp = new Date(); @@ -11,26 +11,35 @@ export class AgoraConsole { } public static debug(msg: any) { - if (AgoraConsole.logLevel > LOG_LEVEL.LOG_LEVEL_INFO) { - console.log(`\x1B[35m[${this.getDate()}][Iris debug]:\x1B[30m ${msg}`); + if (AgoraConsole.logLevel > LOG_LEVEL.LOG_LEVEL_NONE) { + console.log(`[${this.getDate()}][Iris debug]:${msg}`); } } public static log(msg: any) { - if (AgoraConsole.logLevel >= LOG_LEVEL.LOG_LEVEL_INFO) { - console.log(`\x1B[35m[${this.getDate()}][Iris log]:\x1B[30m ${msg}`); + if ( + AgoraConsole.logLevel > LOG_LEVEL.LOG_LEVEL_NONE && + AgoraConsole.logLevel <= LOG_LEVEL.LOG_LEVEL_INFO + ) { + console.log(`[${this.getDate()}][Iris log]:${msg}`); } } public static warn(msg: any) { - if (AgoraConsole.logLevel >= LOG_LEVEL.LOG_LEVEL_WARN) { - console.log(`\x1B[33m[${this.getDate()}][Iris warning]:\x1B[30m${msg}`); + if ( + AgoraConsole.logLevel > LOG_LEVEL.LOG_LEVEL_NONE && + AgoraConsole.logLevel <= LOG_LEVEL.LOG_LEVEL_WARN + ) { + console.log(`[${this.getDate()}][Iris warning]:${msg}`); } } public static error(msg: any) { - if (AgoraConsole.logLevel >= LOG_LEVEL.LOG_LEVEL_ERROR) { - console.error(`[${this.getDate()}] [Iris error]:${msg}`); + if ( + AgoraConsole.logLevel > LOG_LEVEL.LOG_LEVEL_NONE && + AgoraConsole.logLevel <= LOG_LEVEL.LOG_LEVEL_ERROR + ) { + console.error(`[${this.getDate()}][Iris error]:${msg}`); } } } diff --git a/packages/rtc/src/util/AgoraTranslate.ts b/packages/rtc/src/util/AgoraTranslate.ts index b4c3f24..ac831d6 100644 --- a/packages/rtc/src/util/AgoraTranslate.ts +++ b/packages/rtc/src/util/AgoraTranslate.ts @@ -253,7 +253,7 @@ export class AgoraTranslate { config: NATIVE_RTC.ChannelMediaRelayConfiguration, engine: IrisRtcEngine ): IChannelMediaRelayConfiguration { - let ret: IChannelMediaRelayConfiguration = engine.globalVariables.AgoraRTC.createChannelMediaRelayConfiguration(); + let ret: IChannelMediaRelayConfiguration = engine.globalState.AgoraRTC.createChannelMediaRelayConfiguration(); for (let i = 0; i < config.srcInfo.length; i++) { ret.addDestChannelInfo( AgoraTranslate.NATIVE_RTCChannelMediaInfo2ChannelMediaRelayInfo( diff --git a/packages/rtc/src/util/ErrorHandler.ts b/packages/rtc/src/util/ErrorHandler.ts new file mode 100644 index 0000000..e191837 --- /dev/null +++ b/packages/rtc/src/util/ErrorHandler.ts @@ -0,0 +1,29 @@ +import * as NATIVE_RTC from '@iris/native-rtc-binding'; + +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +import { AgoraConsole } from './AgoraConsole'; + +export default class IrisRtcErrorHandler { + _engine: IrisRtcEngine; + constructor(engine: IrisRtcEngine) { + this._engine = engine; + } + + public notInitialized() { + let message = 'not initialized'; + AgoraConsole.error(message); + return this._engine.returnResult( + false, + -NATIVE_RTC.ERROR_CODE_TYPE.ERR_NOT_INITIALIZED + ); + } + + public failed(msg: string) { + AgoraConsole.error(msg); + return this._engine.returnResult( + false, + -NATIVE_RTC.ERROR_CODE_TYPE.ERR_FAILED + ); + } +} diff --git a/packages/rtc/src/util/index.ts b/packages/rtc/src/util/index.ts index 5a2f71b..1756c76 100644 --- a/packages/rtc/src/util/index.ts +++ b/packages/rtc/src/util/index.ts @@ -2,4 +2,3 @@ export * from './AgoraActionQueue'; export * from './AgoraConsole'; export * from './AgoraTool'; export * from './AgoraTranslate'; -export * from './Container'; diff --git a/packages/rtc/test/binding/AgoraBaseDispatch.test.ts b/packages/rtc/test/binding/AgoraBaseDispatch.test.ts new file mode 100644 index 0000000..50b3a9e --- /dev/null +++ b/packages/rtc/test/binding/AgoraBaseDispatch.test.ts @@ -0,0 +1,79 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/AgoraBaseDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IAudioEncodedFrameObserver', () => { + test('onRecordAudioEncodedFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioEncodedFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRecordAudioEncodedFrame(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRecordAudioEncodedFrame'); + }); + test('onPlaybackAudioEncodedFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioEncodedFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlaybackAudioEncodedFrame(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlaybackAudioEncodedFrame'); + }); + test('onMixedAudioEncodedFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioEncodedFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMixedAudioEncodedFrame(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMixedAudioEncodedFrame'); + }); +}); diff --git a/packages/rtc/test/binding/AgoraMediaBaseDispatch.test.ts b/packages/rtc/test/binding/AgoraMediaBaseDispatch.test.ts new file mode 100644 index 0000000..3f0920f --- /dev/null +++ b/packages/rtc/test/binding/AgoraMediaBaseDispatch.test.ts @@ -0,0 +1,250 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/AgoraMediaBaseDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IAudioPcmFrameSink', () => { + test('onFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioPcmFrameSink(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFrame(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFrame'); + }); +}); +describe('IAudioFrameObserverBase', () => { + test('onRecordAudioFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioFrameObserverBase(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRecordAudioFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRecordAudioFrame'); + }); + test('onPlaybackAudioFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioFrameObserverBase(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlaybackAudioFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlaybackAudioFrame'); + }); + test('onMixedAudioFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioFrameObserverBase(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMixedAudioFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMixedAudioFrame'); + }); + test('onEarMonitoringAudioFrame impl call', async () => { + let eventHandler = new bindingAPI.IAudioFrameObserverBase(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onEarMonitoringAudioFrame(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onEarMonitoringAudioFrame'); + }); +}); +describe('IAudioFrameObserver', () => { + test('onPlaybackAudioFrameBeforeMixing impl call', async () => { + let eventHandler = new bindingAPI.IAudioFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlaybackAudioFrameBeforeMixing( + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onPlaybackAudioFrameBeforeMixing' + ); + }); +}); +describe('IAudioSpectrumObserver', () => { + test('onLocalAudioSpectrum impl call', async () => { + let eventHandler = new bindingAPI.IAudioSpectrumObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalAudioSpectrum(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalAudioSpectrum'); + }); + test('onRemoteAudioSpectrum impl call', async () => { + let eventHandler = new bindingAPI.IAudioSpectrumObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioSpectrum(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteAudioSpectrum'); + }); +}); +describe('IVideoEncodedFrameObserver', () => { + test('onEncodedVideoFrameReceived impl call', async () => { + let eventHandler = new bindingAPI.IVideoEncodedFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onEncodedVideoFrameReceived( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onEncodedVideoFrameReceived'); + }); +}); +describe('IVideoFrameObserver', () => { + test('onCaptureVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IVideoFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onCaptureVideoFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onCaptureVideoFrame'); + }); + test('onPreEncodeVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IVideoFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPreEncodeVideoFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPreEncodeVideoFrame'); + }); + test('onMediaPlayerVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IVideoFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMediaPlayerVideoFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMediaPlayerVideoFrame'); + }); + test('onRenderVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IVideoFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRenderVideoFrame(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRenderVideoFrame'); + }); + test('onTranscodedVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IVideoFrameObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onTranscodedVideoFrame(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onTranscodedVideoFrame'); + }); +}); +describe('IMediaRecorderObserver', () => { + test('onRecorderStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IMediaRecorderObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRecorderStateChanged( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRecorderStateChanged'); + }); + test('onRecorderInfoUpdated impl call', async () => { + let eventHandler = new bindingAPI.IMediaRecorderObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRecorderInfoUpdated(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRecorderInfoUpdated'); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraMediaEngineDispatch.test.ts b/packages/rtc/test/binding/IAgoraMediaEngineDispatch.test.ts index b2e8e2f..1473863 100644 --- a/packages/rtc/test/binding/IAgoraMediaEngineDispatch.test.ts +++ b/packages/rtc/test/binding/IAgoraMediaEngineDispatch.test.ts @@ -1,29 +1,800 @@ -import { CallIrisApiResult, EventParam, IrisApiEngine, IrisCore } from "iris-web-core"; -import { IrisApiType } from "../../src/base/IrisApiType"; -import { initIrisRtc } from "../../src/index"; +/// Generated by terra, DO NOT MODIFY BY HAND. +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; -let apiEnginePtr:IrisApiEngine; -beforeAll(() => { +const bindingAPI = require('../../src/binding/IAgoraMediaEngineDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { apiEnginePtr = IrisCore.createIrisApiEngine(); initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); }); afterAll(() => { IrisCore.disposeIrisApiEngine(apiEnginePtr); }); -IrisCore.createIrisApiEngine(); -describe("IAgoraMediaEngineImpl", () => { - test("setExternalVideoSource", async () => { - let nParam:string = "{}"; - let apiParam = new EventParam(IrisApiType.FUNC_MEDIAENGINE_SETEXTERNALVIDEOSOURCE, nParam, 0, '', [], [], 0); - try { - await IrisCore.callIrisApi(apiEnginePtr,apiParam); - }catch (e){ - expect(e).toEqual('enabled is undefined'); +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IMediaEngine', () => { + test('registerAudioFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_registerAudioFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerAudioFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'registerAudioFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_registerAudioFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .registerAudioFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .registerAudioFrameObserver + ).toBeCalledWith('test'); + }); + test('registerVideoFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_registerVideoFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerVideoFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'registerVideoFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_registerVideoFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .registerVideoFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .registerVideoFrameObserver + ).toBeCalledWith('test'); + }); + test('registerVideoEncodedFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_registerVideoEncodedFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerVideoEncodedFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'registerVideoEncodedFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_registerVideoEncodedFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .registerVideoEncodedFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .registerVideoEncodedFrameObserver + ).toBeCalledWith('test'); + }); + test('pushAudioFrame parameter', async () => { + let nParam = { + frame: undefined, + trackId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_pushAudioFrame', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('pushAudioFrame impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'pushAudioFrame' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + frame: 'test', + trackId: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_pushAudioFrame', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.pushAudioFrame + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.pushAudioFrame + ).toBeCalledWith('test', 'test'); + }); + test('pullAudioFrame parameter', async () => { + let nParam = { + frame: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_pullAudioFrame', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('pullAudioFrame impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'pullAudioFrame' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + frame: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_pullAudioFrame', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.pullAudioFrame + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.pullAudioFrame + ).toBeCalledWith('test'); + }); + test('setExternalVideoSource parameter', async () => { + let nParam = { + enabled: undefined, + useTexture: undefined, + sourceType: undefined, + encodedVideoOption: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_setExternalVideoSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; } + }); + + test('setExternalVideoSource impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'setExternalVideoSource' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + useTexture: 'test', + sourceType: 'test', + encodedVideoOption: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_setExternalVideoSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .setExternalVideoSource + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .setExternalVideoSource + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setExternalAudioSource parameter', async () => { + let nParam = { + enabled: undefined, + sampleRate: undefined, + channels: undefined, + localPlayback: undefined, + publish: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_setExternalAudioSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + test('setExternalAudioSource impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'setExternalAudioSource' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + sampleRate: 'test', + channels: 'test', + localPlayback: 'test', + publish: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_setExternalAudioSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .setExternalAudioSource + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .setExternalAudioSource + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); }); -}); \ No newline at end of file + test('createCustomAudioTrack parameter', async () => { + let nParam = { + trackType: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_createCustomAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createCustomAudioTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'createCustomAudioTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + trackType: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_createCustomAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .createCustomAudioTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .createCustomAudioTrack + ).toBeCalledWith('test', 'test'); + }); + test('destroyCustomAudioTrack parameter', async () => { + let nParam = { + trackId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_destroyCustomAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('destroyCustomAudioTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'destroyCustomAudioTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + trackId: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_destroyCustomAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .destroyCustomAudioTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .destroyCustomAudioTrack + ).toBeCalledWith('test'); + }); + test('setExternalAudioSink parameter', async () => { + let nParam = { + enabled: undefined, + sampleRate: undefined, + channels: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_setExternalAudioSink', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setExternalAudioSink impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'setExternalAudioSink' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + sampleRate: 'test', + channels: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_setExternalAudioSink', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .setExternalAudioSink + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .setExternalAudioSink + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableCustomAudioLocalPlayback parameter', async () => { + let nParam = { + trackId: undefined, + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_enableCustomAudioLocalPlayback', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableCustomAudioLocalPlayback impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'enableCustomAudioLocalPlayback' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + trackId: 'test', + enabled: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_enableCustomAudioLocalPlayback', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .enableCustomAudioLocalPlayback + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .enableCustomAudioLocalPlayback + ).toBeCalledWith('test', 'test'); + }); + test('pushVideoFrame parameter', async () => { + let nParam = { + frame: undefined, + videoTrackId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_pushVideoFrame', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('pushVideoFrame impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'pushVideoFrame' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + frame: 'test', + videoTrackId: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_pushVideoFrame', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.pushVideoFrame + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.pushVideoFrame + ).toBeCalledWith('test', 'test'); + }); + test('pushEncodedVideoImage parameter', async () => { + let nParam = { + imageBuffer: undefined, + length: undefined, + videoEncodedFrameInfo: undefined, + videoTrackId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaEngine_pushEncodedVideoImage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('pushEncodedVideoImage impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'pushEncodedVideoImage' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + imageBuffer: 'test', + length: 'test', + videoEncodedFrameInfo: 'test', + videoTrackId: 'test', + }; + let apiParam = new EventParam( + 'MediaEngine_pushEncodedVideoImage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .pushEncodedVideoImage + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl + .pushEncodedVideoImage + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + + test('release impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl, + 'release' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaEngine_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.release + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaEngine')._impl.release + ).toBeCalledWith(); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraMediaPlayerDispatch.test.ts b/packages/rtc/test/binding/IAgoraMediaPlayerDispatch.test.ts new file mode 100644 index 0000000..4a264b6 --- /dev/null +++ b/packages/rtc/test/binding/IAgoraMediaPlayerDispatch.test.ts @@ -0,0 +1,3165 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraMediaPlayerDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IMediaPlayer', () => { + test('getMediaPlayerId impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getMediaPlayerId' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_getMediaPlayerId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getMediaPlayerId + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getMediaPlayerId + ).toBeCalledWith(); + }); + test('open parameter', async () => { + let nParam = { + url: undefined, + startPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_open', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('open impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'open') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + startPos: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_open', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.open + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.open + ).toBeCalledWith('test', 'test'); + }); + test('openWithMediaSource parameter', async () => { + let nParam = { + source: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_openWithMediaSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('openWithMediaSource impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'openWithMediaSource' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + source: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_openWithMediaSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .openWithMediaSource + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .openWithMediaSource + ).toBeCalledWith('test'); + }); + + test('play impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'play') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_play', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.play + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.play + ).toBeCalledWith(); + }); + + test('pause impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'pause') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_pause', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.pause + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.pause + ).toBeCalledWith(); + }); + + test('stop impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'stop') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_stop', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.stop + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.stop + ).toBeCalledWith(); + }); + + test('resume impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'resume') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_resume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.resume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.resume + ).toBeCalledWith(); + }); + test('seek parameter', async () => { + let nParam = { + newPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_seek', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('seek impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'seek') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + newPos: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_seek', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.seek + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.seek + ).toBeCalledWith('test'); + }); + test('setAudioPitch parameter', async () => { + let nParam = { + pitch: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setAudioPitch', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioPitch impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setAudioPitch' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + pitch: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setAudioPitch', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setAudioPitch + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setAudioPitch + ).toBeCalledWith('test'); + }); + test('getDuration parameter', async () => { + let nParam = { + duration: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getDuration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getDuration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getDuration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + duration: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getDuration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getDuration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getDuration + ).toBeCalledWith('test'); + }); + test('getPlayPosition parameter', async () => { + let nParam = { + pos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getPlayPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getPlayPosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getPlayPosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + pos: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getPlayPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getPlayPosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getPlayPosition + ).toBeCalledWith('test'); + }); + test('getStreamCount parameter', async () => { + let nParam = { + count: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getStreamCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getStreamCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getStreamCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + count: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getStreamCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getStreamCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getStreamCount + ).toBeCalledWith('test'); + }); + test('getStreamInfo parameter', async () => { + let nParam = { + index: undefined, + info: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getStreamInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getStreamInfo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getStreamInfo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + info: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getStreamInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getStreamInfo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getStreamInfo + ).toBeCalledWith('test', 'test'); + }); + test('setLoopCount parameter', async () => { + let nParam = { + loopCount: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setLoopCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLoopCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setLoopCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + loopCount: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setLoopCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setLoopCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setLoopCount + ).toBeCalledWith('test'); + }); + test('setPlaybackSpeed parameter', async () => { + let nParam = { + speed: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setPlaybackSpeed', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlaybackSpeed impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setPlaybackSpeed' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + speed: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setPlaybackSpeed', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setPlaybackSpeed + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setPlaybackSpeed + ).toBeCalledWith('test'); + }); + test('selectAudioTrack parameter', async () => { + let nParam = { + index: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_selectAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('selectAudioTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'selectAudioTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_selectAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.selectAudioTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.selectAudioTrack + ).toBeCalledWith('test'); + }); + test('setPlayerOption parameter', async () => { + let nParam = { + key: undefined, + value: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setPlayerOption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlayerOption impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setPlayerOption' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + key: 'test', + value: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setPlayerOption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setPlayerOption + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setPlayerOption + ).toBeCalledWith('test', 'test'); + }); + test('setPlayerOption2 parameter', async () => { + let nParam = { + key: undefined, + value: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setPlayerOption2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlayerOption2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setPlayerOption2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + key: 'test', + value: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setPlayerOption2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setPlayerOption2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setPlayerOption2 + ).toBeCalledWith('test', 'test'); + }); + test('takeScreenshot parameter', async () => { + let nParam = { + filename: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_takeScreenshot', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('takeScreenshot impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'takeScreenshot' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filename: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_takeScreenshot', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.takeScreenshot + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.takeScreenshot + ).toBeCalledWith('test'); + }); + test('selectInternalSubtitle parameter', async () => { + let nParam = { + index: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_selectInternalSubtitle', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('selectInternalSubtitle impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'selectInternalSubtitle' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_selectInternalSubtitle', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .selectInternalSubtitle + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .selectInternalSubtitle + ).toBeCalledWith('test'); + }); + test('setExternalSubtitle parameter', async () => { + let nParam = { + url: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setExternalSubtitle', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setExternalSubtitle impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setExternalSubtitle' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setExternalSubtitle', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setExternalSubtitle + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setExternalSubtitle + ).toBeCalledWith('test'); + }); + + test('getState impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getState' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_getState', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getState + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getState + ).toBeCalledWith(); + }); + test('mute parameter', async () => { + let nParam = { + muted: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_mute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('mute impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, 'mute') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + muted: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_mute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.mute + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.mute + ).toBeCalledWith('test'); + }); + test('getMute parameter', async () => { + let nParam = { + muted: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getMute impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getMute' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + muted: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getMute + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getMute + ).toBeCalledWith('test'); + }); + test('adjustPlayoutVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_adjustPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustPlayoutVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'adjustPlayoutVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_adjustPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .adjustPlayoutVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .adjustPlayoutVolume + ).toBeCalledWith('test'); + }); + test('getPlayoutVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getPlayoutVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getPlayoutVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getPlayoutVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getPlayoutVolume + ).toBeCalledWith('test'); + }); + test('adjustPublishSignalVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_adjustPublishSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustPublishSignalVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'adjustPublishSignalVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_adjustPublishSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .adjustPublishSignalVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .adjustPublishSignalVolume + ).toBeCalledWith('test'); + }); + test('getPublishSignalVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_getPublishSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getPublishSignalVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getPublishSignalVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_getPublishSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getPublishSignalVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getPublishSignalVolume + ).toBeCalledWith('test'); + }); + test('setView parameter', async () => { + let nParam = { + view: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setView', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setView impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setView' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + view: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setView', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setView + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setView + ).toBeCalledWith('test'); + }); + test('setRenderMode parameter', async () => { + let nParam = { + renderMode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setRenderMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRenderMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setRenderMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + renderMode: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setRenderMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setRenderMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.setRenderMode + ).toBeCalledWith('test'); + }); + test('registerPlayerSourceObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_registerPlayerSourceObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerPlayerSourceObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'registerPlayerSourceObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_registerPlayerSourceObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerPlayerSourceObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerPlayerSourceObserver + ).toBeCalledWith('test'); + }); + test('unregisterPlayerSourceObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_unregisterPlayerSourceObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterPlayerSourceObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'unregisterPlayerSourceObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_unregisterPlayerSourceObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterPlayerSourceObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterPlayerSourceObserver + ).toBeCalledWith('test'); + }); + test('registerAudioFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_registerAudioFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerAudioFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'registerAudioFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_registerAudioFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerAudioFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerAudioFrameObserver + ).toBeCalledWith('test'); + }); + test('registerAudioFrameObserver2 parameter', async () => { + let nParam = { + observer: undefined, + mode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_registerAudioFrameObserver2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerAudioFrameObserver2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'registerAudioFrameObserver2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + mode: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_registerAudioFrameObserver2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerAudioFrameObserver2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerAudioFrameObserver2 + ).toBeCalledWith('test', 'test'); + }); + test('unregisterAudioFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_unregisterAudioFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterAudioFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'unregisterAudioFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_unregisterAudioFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterAudioFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterAudioFrameObserver + ).toBeCalledWith('test'); + }); + test('registerVideoFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_registerVideoFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerVideoFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'registerVideoFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_registerVideoFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerVideoFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerVideoFrameObserver + ).toBeCalledWith('test'); + }); + test('unregisterVideoFrameObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_unregisterVideoFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterVideoFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'unregisterVideoFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_unregisterVideoFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterVideoFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterVideoFrameObserver + ).toBeCalledWith('test'); + }); + test('registerMediaPlayerAudioSpectrumObserver parameter', async () => { + let nParam = { + observer: undefined, + intervalInMS: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_registerMediaPlayerAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerMediaPlayerAudioSpectrumObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'registerMediaPlayerAudioSpectrumObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + intervalInMS: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_registerMediaPlayerAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerMediaPlayerAudioSpectrumObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .registerMediaPlayerAudioSpectrumObserver + ).toBeCalledWith('test', 'test'); + }); + test('unregisterMediaPlayerAudioSpectrumObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_unregisterMediaPlayerAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterMediaPlayerAudioSpectrumObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'unregisterMediaPlayerAudioSpectrumObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_unregisterMediaPlayerAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterMediaPlayerAudioSpectrumObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .unregisterMediaPlayerAudioSpectrumObserver + ).toBeCalledWith('test'); + }); + test('setAudioDualMonoMode parameter', async () => { + let nParam = { + mode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setAudioDualMonoMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioDualMonoMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setAudioDualMonoMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mode: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setAudioDualMonoMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setAudioDualMonoMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setAudioDualMonoMode + ).toBeCalledWith('test'); + }); + + test('getPlayerSdkVersion impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getPlayerSdkVersion' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_getPlayerSdkVersion', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getPlayerSdkVersion + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getPlayerSdkVersion + ).toBeCalledWith(); + }); + + test('getPlaySrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getPlaySrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_getPlaySrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getPlaySrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.getPlaySrc + ).toBeCalledWith(); + }); + test('openWithAgoraCDNSrc parameter', async () => { + let nParam = { + src: undefined, + startPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_openWithAgoraCDNSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('openWithAgoraCDNSrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'openWithAgoraCDNSrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + src: 'test', + startPos: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_openWithAgoraCDNSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .openWithAgoraCDNSrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .openWithAgoraCDNSrc + ).toBeCalledWith('test', 'test'); + }); + + test('getAgoraCDNLineCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getAgoraCDNLineCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_getAgoraCDNLineCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getAgoraCDNLineCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getAgoraCDNLineCount + ).toBeCalledWith(); + }); + test('switchAgoraCDNLineByIndex parameter', async () => { + let nParam = { + index: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_switchAgoraCDNLineByIndex', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('switchAgoraCDNLineByIndex impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'switchAgoraCDNLineByIndex' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_switchAgoraCDNLineByIndex', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .switchAgoraCDNLineByIndex + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .switchAgoraCDNLineByIndex + ).toBeCalledWith('test'); + }); + + test('getCurrentAgoraCDNIndex impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'getCurrentAgoraCDNIndex' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayer_getCurrentAgoraCDNIndex', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getCurrentAgoraCDNIndex + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .getCurrentAgoraCDNIndex + ).toBeCalledWith(); + }); + test('enableAutoSwitchAgoraCDN parameter', async () => { + let nParam = { + enable: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_enableAutoSwitchAgoraCDN', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableAutoSwitchAgoraCDN impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'enableAutoSwitchAgoraCDN' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enable: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_enableAutoSwitchAgoraCDN', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .enableAutoSwitchAgoraCDN + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .enableAutoSwitchAgoraCDN + ).toBeCalledWith('test'); + }); + test('renewAgoraCDNSrcToken parameter', async () => { + let nParam = { + token: undefined, + ts: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_renewAgoraCDNSrcToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('renewAgoraCDNSrcToken impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'renewAgoraCDNSrcToken' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + ts: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_renewAgoraCDNSrcToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .renewAgoraCDNSrcToken + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .renewAgoraCDNSrcToken + ).toBeCalledWith('test', 'test'); + }); + test('switchAgoraCDNSrc parameter', async () => { + let nParam = { + src: undefined, + syncPts: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_switchAgoraCDNSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('switchAgoraCDNSrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'switchAgoraCDNSrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + src: 'test', + syncPts: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_switchAgoraCDNSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.switchAgoraCDNSrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.switchAgoraCDNSrc + ).toBeCalledWith('test', 'test'); + }); + test('switchSrc parameter', async () => { + let nParam = { + src: undefined, + syncPts: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_switchSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('switchSrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'switchSrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + src: 'test', + syncPts: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_switchSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.switchSrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.switchSrc + ).toBeCalledWith('test', 'test'); + }); + test('preloadSrc parameter', async () => { + let nParam = { + src: undefined, + startPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_preloadSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('preloadSrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'preloadSrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + src: 'test', + startPos: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_preloadSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.preloadSrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.preloadSrc + ).toBeCalledWith('test', 'test'); + }); + test('playPreloadedSrc parameter', async () => { + let nParam = { + src: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_playPreloadedSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('playPreloadedSrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'playPreloadedSrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + src: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_playPreloadedSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.playPreloadedSrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.playPreloadedSrc + ).toBeCalledWith('test'); + }); + test('unloadSrc parameter', async () => { + let nParam = { + src: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_unloadSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unloadSrc impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'unloadSrc' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + src: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_unloadSrc', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.unloadSrc + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl.unloadSrc + ).toBeCalledWith('test'); + }); + test('setSpatialAudioParams parameter', async () => { + let nParam = { + params: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setSpatialAudioParams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSpatialAudioParams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setSpatialAudioParams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + params: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setSpatialAudioParams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setSpatialAudioParams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setSpatialAudioParams + ).toBeCalledWith('test'); + }); + test('setSoundPositionParams parameter', async () => { + let nParam = { + pan: undefined, + gain: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayer_setSoundPositionParams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSoundPositionParams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl, + 'setSoundPositionParams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + pan: 'test', + gain: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayer_setSoundPositionParams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setSoundPositionParams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayer')._impl + .setSoundPositionParams + ).toBeCalledWith('test', 'test'); + }); +}); +describe('IMediaPlayerCacheManager', () => { + test('removeAllCaches impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'removeAllCaches' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_removeAllCaches', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .removeAllCaches + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .removeAllCaches + ).toBeCalledWith(); + }); + + test('removeOldCache impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'removeOldCache' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_removeOldCache', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .removeOldCache + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .removeOldCache + ).toBeCalledWith(); + }); + test('removeCacheByUri parameter', async () => { + let nParam = { + uri: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayerCacheManager_removeCacheByUri', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('removeCacheByUri impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'removeCacheByUri' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uri: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_removeCacheByUri', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .removeCacheByUri + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .removeCacheByUri + ).toBeCalledWith('test'); + }); + test('setCacheDir parameter', async () => { + let nParam = { + path: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayerCacheManager_setCacheDir', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCacheDir impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'setCacheDir' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + path: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_setCacheDir', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .setCacheDir + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .setCacheDir + ).toBeCalledWith('test'); + }); + test('setMaxCacheFileCount parameter', async () => { + let nParam = { + count: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayerCacheManager_setMaxCacheFileCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setMaxCacheFileCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'setMaxCacheFileCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + count: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_setMaxCacheFileCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .setMaxCacheFileCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .setMaxCacheFileCount + ).toBeCalledWith('test'); + }); + test('setMaxCacheFileSize parameter', async () => { + let nParam = { + cacheSize: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayerCacheManager_setMaxCacheFileSize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setMaxCacheFileSize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'setMaxCacheFileSize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + cacheSize: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_setMaxCacheFileSize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .setMaxCacheFileSize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .setMaxCacheFileSize + ).toBeCalledWith('test'); + }); + test('enableAutoRemoveCache parameter', async () => { + let nParam = { + enable: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayerCacheManager_enableAutoRemoveCache', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableAutoRemoveCache impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'enableAutoRemoveCache' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enable: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_enableAutoRemoveCache', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .enableAutoRemoveCache + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .enableAutoRemoveCache + ).toBeCalledWith('test'); + }); + test('getCacheDir parameter', async () => { + let nParam = { + path: undefined, + length: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaPlayerCacheManager_getCacheDir', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getCacheDir impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'getCacheDir' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + path: 'test', + length: 'test', + }; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_getCacheDir', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getCacheDir + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getCacheDir + ).toBeCalledWith('test', 'test'); + }); + + test('getMaxCacheFileCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'getMaxCacheFileCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_getMaxCacheFileCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getMaxCacheFileCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getMaxCacheFileCount + ).toBeCalledWith(); + }); + + test('getMaxCacheFileSize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'getMaxCacheFileSize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_getMaxCacheFileSize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getMaxCacheFileSize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getMaxCacheFileSize + ).toBeCalledWith(); + }); + + test('getCacheFileCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl, + 'getCacheFileCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaPlayerCacheManager_getCacheFileCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getCacheFileCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaPlayerCacheManager')._impl + .getCacheFileCount + ).toBeCalledWith(); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraMediaPlayerSourceDispatch.test.ts b/packages/rtc/test/binding/IAgoraMediaPlayerSourceDispatch.test.ts new file mode 100644 index 0000000..a0801e7 --- /dev/null +++ b/packages/rtc/test/binding/IAgoraMediaPlayerSourceDispatch.test.ts @@ -0,0 +1,167 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraMediaPlayerSourceDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IMediaPlayerSourceObserver', () => { + test('onPlayerSourceStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlayerSourceStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlayerSourceStateChanged'); + }); + test('onPositionChanged impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPositionChanged(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPositionChanged'); + }); + test('onPlayerEvent impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlayerEvent(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlayerEvent'); + }); + test('onMetaData impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMetaData(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMetaData'); + }); + test('onPlayBufferUpdated impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlayBufferUpdated(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlayBufferUpdated'); + }); + test('onPreloadEvent impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPreloadEvent(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPreloadEvent'); + }); + test('onCompleted impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onCompleted(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onCompleted'); + }); + test('onAgoraCDNTokenWillExpire impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAgoraCDNTokenWillExpire(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAgoraCDNTokenWillExpire'); + }); + test('onPlayerSrcInfoChanged impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlayerSrcInfoChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlayerSrcInfoChanged'); + }); + test('onPlayerInfoUpdated impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPlayerInfoUpdated(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPlayerInfoUpdated'); + }); + test('onAudioVolumeIndication impl call', async () => { + let eventHandler = new bindingAPI.IMediaPlayerSourceObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioVolumeIndication(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioVolumeIndication'); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraMediaRecorderDispatch.test.ts b/packages/rtc/test/binding/IAgoraMediaRecorderDispatch.test.ts new file mode 100644 index 0000000..62d3417 --- /dev/null +++ b/packages/rtc/test/binding/IAgoraMediaRecorderDispatch.test.ts @@ -0,0 +1,178 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraMediaRecorderDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IMediaRecorder', () => { + test('setMediaRecorderObserver parameter', async () => { + let nParam = { + callback: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaRecorder_setMediaRecorderObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setMediaRecorderObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl, + 'setMediaRecorderObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + callback: 'test', + }; + let apiParam = new EventParam( + 'MediaRecorder_setMediaRecorderObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl + .setMediaRecorderObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl + .setMediaRecorderObserver + ).toBeCalledWith('test'); + }); + test('startRecording parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MediaRecorder_startRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRecording impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl, + 'startRecording' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'MediaRecorder_startRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl.startRecording + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl.startRecording + ).toBeCalledWith('test'); + }); + + test('stopRecording impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl, + 'stopRecording' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MediaRecorder_stopRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl.stopRecording + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MediaRecorder')._impl.stopRecording + ).toBeCalledWith(); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraMusicContentCenterDispatch.test.ts b/packages/rtc/test/binding/IAgoraMusicContentCenterDispatch.test.ts new file mode 100644 index 0000000..2c40bc3 --- /dev/null +++ b/packages/rtc/test/binding/IAgoraMusicContentCenterDispatch.test.ts @@ -0,0 +1,1220 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraMusicContentCenterDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('MusicChartCollection', () => { + test('getCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicChartCollection')._impl, + 'getCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicChartCollection_getCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicChartCollection')._impl.getCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicChartCollection')._impl.getCount + ).toBeCalledWith(); + }); + test('get parameter', async () => { + let nParam = { + index: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicChartCollection_get', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('get impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicChartCollection')._impl, + 'get' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + }; + let apiParam = new EventParam( + 'MusicChartCollection_get', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicChartCollection')._impl.get + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicChartCollection')._impl.get + ).toBeCalledWith('test'); + }); +}); +describe('MusicCollection', () => { + test('getCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl, + 'getCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicCollection_getCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getCount + ).toBeCalledWith(); + }); + + test('getTotal impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl, + 'getTotal' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicCollection_getTotal', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getTotal + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getTotal + ).toBeCalledWith(); + }); + + test('getPage impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl, + 'getPage' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicCollection_getPage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getPage + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getPage + ).toBeCalledWith(); + }); + + test('getPageSize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl, + 'getPageSize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicCollection_getPageSize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getPageSize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getPageSize + ).toBeCalledWith(); + }); + test('getMusic parameter', async () => { + let nParam = { + index: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicCollection_getMusic', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getMusic impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl, + 'getMusic' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + }; + let apiParam = new EventParam( + 'MusicCollection_getMusic', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getMusic + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicCollection')._impl.getMusic + ).toBeCalledWith('test'); + }); +}); +describe('IMusicContentCenterEventHandler', () => { + test('onMusicChartsResult impl call', async () => { + let eventHandler = new bindingAPI.IMusicContentCenterEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMusicChartsResult(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMusicChartsResult'); + }); + test('onMusicCollectionResult impl call', async () => { + let eventHandler = new bindingAPI.IMusicContentCenterEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMusicCollectionResult(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMusicCollectionResult'); + }); + test('onLyricResult impl call', async () => { + let eventHandler = new bindingAPI.IMusicContentCenterEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLyricResult(undefined, undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLyricResult'); + }); + test('onSongSimpleInfoResult impl call', async () => { + let eventHandler = new bindingAPI.IMusicContentCenterEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onSongSimpleInfoResult( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onSongSimpleInfoResult'); + }); + test('onPreLoadEvent impl call', async () => { + let eventHandler = new bindingAPI.IMusicContentCenterEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPreLoadEvent( + undefined, + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPreLoadEvent'); + }); +}); +describe('IMusicPlayer', () => {}); +describe('IMusicContentCenter', () => { + test('initialize parameter', async () => { + let nParam = { + configuration: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('initialize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'initialize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.initialize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.initialize + ).toBeCalledWith('test'); + }); + test('renewToken parameter', async () => { + let nParam = { + token: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_renewToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('renewToken impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'renewToken' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_renewToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.renewToken + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.renewToken + ).toBeCalledWith('test'); + }); + + test('release impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'release' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicContentCenter_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.release + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.release + ).toBeCalledWith(); + }); + test('registerEventHandler parameter', async () => { + let nParam = { + eventHandler: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_registerEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerEventHandler impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'registerEventHandler' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + eventHandler: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_registerEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .registerEventHandler + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .registerEventHandler + ).toBeCalledWith('test'); + }); + + test('unregisterEventHandler impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'unregisterEventHandler' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicContentCenter_unregisterEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .unregisterEventHandler + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .unregisterEventHandler + ).toBeCalledWith(); + }); + + test('createMusicPlayer impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'createMusicPlayer' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'MusicContentCenter_createMusicPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .createMusicPlayer + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .createMusicPlayer + ).toBeCalledWith(); + }); + test('getMusicCharts parameter', async () => { + let nParam = { + requestId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_getMusicCharts', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getMusicCharts impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'getMusicCharts' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_getMusicCharts', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getMusicCharts + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getMusicCharts + ).toBeCalledWith('test'); + }); + test('getMusicCollectionByMusicChartId parameter', async () => { + let nParam = { + requestId: undefined, + musicChartId: undefined, + page: undefined, + pageSize: undefined, + jsonOption: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_getMusicCollectionByMusicChartId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getMusicCollectionByMusicChartId impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'getMusicCollectionByMusicChartId' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + musicChartId: 'test', + page: 'test', + pageSize: 'test', + jsonOption: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_getMusicCollectionByMusicChartId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getMusicCollectionByMusicChartId + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getMusicCollectionByMusicChartId + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('searchMusic parameter', async () => { + let nParam = { + requestId: undefined, + keyWord: undefined, + page: undefined, + pageSize: undefined, + jsonOption: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_searchMusic', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('searchMusic impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'searchMusic' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + keyWord: 'test', + page: 'test', + pageSize: 'test', + jsonOption: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_searchMusic', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .searchMusic + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .searchMusic + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('preload parameter', async () => { + let nParam = { + songCode: undefined, + jsonOption: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_preload', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('preload impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'preload' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + songCode: 'test', + jsonOption: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_preload', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.preload + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.preload + ).toBeCalledWith('test', 'test'); + }); + test('preload2 parameter', async () => { + let nParam = { + requestId: undefined, + songCode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_preload2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('preload2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'preload2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + songCode: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_preload2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.preload2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.preload2 + ).toBeCalledWith('test', 'test'); + }); + test('removeCache parameter', async () => { + let nParam = { + songCode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_removeCache', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('removeCache impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'removeCache' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + songCode: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_removeCache', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .removeCache + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .removeCache + ).toBeCalledWith('test'); + }); + test('getCaches parameter', async () => { + let nParam = { + cacheInfo: undefined, + cacheInfoSize: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_getCaches', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getCaches impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'getCaches' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + cacheInfo: 'test', + cacheInfoSize: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_getCaches', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.getCaches + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.getCaches + ).toBeCalledWith('test', 'test'); + }); + test('isPreloaded parameter', async () => { + let nParam = { + songCode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_isPreloaded', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('isPreloaded impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'isPreloaded' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + songCode: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_isPreloaded', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .isPreloaded + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .isPreloaded + ).toBeCalledWith('test'); + }); + test('getLyric parameter', async () => { + let nParam = { + requestId: undefined, + songCode: undefined, + LyricType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_getLyric', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getLyric impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'getLyric' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + songCode: 'test', + LyricType: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_getLyric', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.getLyric + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl.getLyric + ).toBeCalledWith('test', 'test', 'test'); + }); + test('getSongSimpleInfo parameter', async () => { + let nParam = { + requestId: undefined, + songCode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_getSongSimpleInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getSongSimpleInfo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'getSongSimpleInfo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + songCode: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_getSongSimpleInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getSongSimpleInfo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getSongSimpleInfo + ).toBeCalledWith('test', 'test'); + }); + test('getInternalSongCode parameter', async () => { + let nParam = { + songCode: undefined, + jsonOption: undefined, + internalSongCode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'MusicContentCenter_getInternalSongCode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getInternalSongCode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl, + 'getInternalSongCode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + songCode: 'test', + jsonOption: 'test', + internalSongCode: 'test', + }; + let apiParam = new EventParam( + 'MusicContentCenter_getInternalSongCode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getInternalSongCode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('MusicContentCenter')._impl + .getInternalSongCode + ).toBeCalledWith('test', 'test', 'test'); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts b/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts new file mode 100644 index 0000000..06e25dd --- /dev/null +++ b/packages/rtc/test/binding/IAgoraRtcEngineDispatch.test.ts @@ -0,0 +1,15441 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraRtcEngineDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IRtcEngineEventHandler', () => { + test('onJoinChannelSuccess impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onJoinChannelSuccess(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onJoinChannelSuccess'); + }); + test('onRejoinChannelSuccess impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRejoinChannelSuccess(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRejoinChannelSuccess'); + }); + test('onProxyConnected impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onProxyConnected( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onProxyConnected'); + }); + test('onError impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onError(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onError'); + }); + test('onAudioQuality impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioQuality(undefined, undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioQuality'); + }); + test('onLastmileProbeResult impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLastmileProbeResult(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLastmileProbeResult'); + }); + test('onAudioVolumeIndication impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioVolumeIndication(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioVolumeIndication'); + }); + test('onLeaveChannel impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLeaveChannel(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLeaveChannel'); + }); + test('onRtcStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRtcStats(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRtcStats'); + }); + test('onAudioDeviceStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioDeviceStateChanged(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioDeviceStateChanged'); + }); + test('onAudioMixingPositionChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioMixingPositionChanged(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onAudioMixingPositionChanged' + ); + }); + test('onAudioMixingFinished impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioMixingFinished(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioMixingFinished'); + }); + test('onAudioEffectFinished impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioEffectFinished(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioEffectFinished'); + }); + test('onVideoDeviceStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoDeviceStateChanged(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onVideoDeviceStateChanged'); + }); + test('onNetworkQuality impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onNetworkQuality(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onNetworkQuality'); + }); + test('onIntraRequestReceived impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onIntraRequestReceived(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onIntraRequestReceived'); + }); + test('onUplinkNetworkInfoUpdated impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUplinkNetworkInfoUpdated(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUplinkNetworkInfoUpdated'); + }); + test('onDownlinkNetworkInfoUpdated impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onDownlinkNetworkInfoUpdated(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onDownlinkNetworkInfoUpdated' + ); + }); + test('onLastmileQuality impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLastmileQuality(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLastmileQuality'); + }); + test('onFirstLocalVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstLocalVideoFrame( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstLocalVideoFrame'); + }); + test('onFirstLocalVideoFramePublished impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstLocalVideoFramePublished(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onFirstLocalVideoFramePublished' + ); + }); + test('onFirstRemoteVideoDecoded impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteVideoDecoded( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteVideoDecoded'); + }); + test('onVideoSizeChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoSizeChanged( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onVideoSizeChanged'); + }); + test('onLocalVideoStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalVideoStateChanged(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalVideoStateChanged'); + }); + test('onRemoteVideoStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteVideoStateChanged( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteVideoStateChanged'); + }); + test('onFirstRemoteVideoFrame impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteVideoFrame( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteVideoFrame'); + }); + test('onUserJoined impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserJoined(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserJoined'); + }); + test('onUserOffline impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserOffline(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserOffline'); + }); + test('onUserMuteAudio impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserMuteAudio(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserMuteAudio'); + }); + test('onUserMuteVideo impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserMuteVideo(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserMuteVideo'); + }); + test('onUserEnableVideo impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserEnableVideo(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserEnableVideo'); + }); + test('onUserStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserStateChanged'); + }); + test('onUserEnableLocalVideo impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserEnableLocalVideo(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserEnableLocalVideo'); + }); + test('onLocalAudioStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalAudioStats(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalAudioStats'); + }); + test('onRemoteAudioStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioStats(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteAudioStats'); + }); + test('onLocalVideoStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalVideoStats(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalVideoStats'); + }); + test('onRemoteVideoStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteVideoStats(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteVideoStats'); + }); + test('onCameraReady impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onCameraReady(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onCameraReady'); + }); + test('onCameraFocusAreaChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onCameraFocusAreaChanged( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onCameraFocusAreaChanged'); + }); + test('onCameraExposureAreaChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onCameraExposureAreaChanged( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onCameraExposureAreaChanged'); + }); + test('onFacePositionChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFacePositionChanged( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFacePositionChanged'); + }); + test('onVideoStopped impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoStopped(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onVideoStopped'); + }); + test('onAudioMixingStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioMixingStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioMixingStateChanged'); + }); + test('onRhythmPlayerStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRhythmPlayerStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRhythmPlayerStateChanged'); + }); + test('onConnectionLost impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionLost(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionLost'); + }); + test('onConnectionInterrupted impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionInterrupted(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionInterrupted'); + }); + test('onConnectionBanned impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionBanned(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionBanned'); + }); + test('onStreamMessage impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onStreamMessage( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onStreamMessage'); + }); + test('onStreamMessageError impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onStreamMessageError( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onStreamMessageError'); + }); + test('onRequestToken impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRequestToken(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRequestToken'); + }); + test('onTokenPrivilegeWillExpire impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onTokenPrivilegeWillExpire(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onTokenPrivilegeWillExpire'); + }); + test('onLicenseValidationFailure impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLicenseValidationFailure(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLicenseValidationFailure'); + }); + test('onFirstLocalAudioFramePublished impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstLocalAudioFramePublished(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onFirstLocalAudioFramePublished' + ); + }); + test('onFirstRemoteAudioFrame impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteAudioFrame(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteAudioFrame'); + }); + test('onFirstRemoteAudioDecoded impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteAudioDecoded(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteAudioDecoded'); + }); + test('onLocalAudioStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalAudioStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalAudioStateChanged'); + }); + test('onRemoteAudioStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioStateChanged( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteAudioStateChanged'); + }); + test('onActiveSpeaker impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onActiveSpeaker(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onActiveSpeaker'); + }); + test('onContentInspectResult impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onContentInspectResult(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onContentInspectResult'); + }); + test('onSnapshotTaken impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onSnapshotTaken( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onSnapshotTaken'); + }); + test('onClientRoleChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onClientRoleChanged(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onClientRoleChanged'); + }); + test('onClientRoleChangeFailed impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onClientRoleChangeFailed(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onClientRoleChangeFailed'); + }); + test('onAudioDeviceVolumeChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioDeviceVolumeChanged(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioDeviceVolumeChanged'); + }); + test('onRtmpStreamingStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRtmpStreamingStateChanged(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRtmpStreamingStateChanged'); + }); + test('onRtmpStreamingEvent impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRtmpStreamingEvent(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRtmpStreamingEvent'); + }); + test('onTranscodingUpdated impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onTranscodingUpdated(); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onTranscodingUpdated'); + }); + test('onAudioRoutingChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioRoutingChanged(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioRoutingChanged'); + }); + test('onChannelMediaRelayStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onChannelMediaRelayStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onChannelMediaRelayStateChanged' + ); + }); + test('onChannelMediaRelayEvent impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onChannelMediaRelayEvent(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onChannelMediaRelayEvent'); + }); + test('onLocalPublishFallbackToAudioOnly impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalPublishFallbackToAudioOnly(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onLocalPublishFallbackToAudioOnly' + ); + }); + test('onRemoteSubscribeFallbackToAudioOnly impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteSubscribeFallbackToAudioOnly(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onRemoteSubscribeFallbackToAudioOnly' + ); + }); + test('onRemoteAudioTransportStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioTransportStats( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteAudioTransportStats'); + }); + test('onRemoteVideoTransportStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteVideoTransportStats( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteVideoTransportStats'); + }); + test('onConnectionStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionStateChanged(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionStateChanged'); + }); + test('onWlAccMessage impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onWlAccMessage(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onWlAccMessage'); + }); + test('onWlAccStats impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onWlAccStats(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onWlAccStats'); + }); + test('onNetworkTypeChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onNetworkTypeChanged(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onNetworkTypeChanged'); + }); + test('onEncryptionError impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onEncryptionError(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onEncryptionError'); + }); + test('onPermissionError impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onPermissionError(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onPermissionError'); + }); + test('onLocalUserRegistered impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalUserRegistered(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalUserRegistered'); + }); + test('onUserInfoUpdated impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserInfoUpdated(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserInfoUpdated'); + }); + test('onUploadLogResult impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUploadLogResult(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUploadLogResult'); + }); + test('onAudioSubscribeStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioSubscribeStateChanged( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onAudioSubscribeStateChanged' + ); + }); + test('onVideoSubscribeStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoSubscribeStateChanged( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onVideoSubscribeStateChanged' + ); + }); + test('onAudioPublishStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioPublishStateChanged( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioPublishStateChanged'); + }); + test('onVideoPublishStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoPublishStateChanged( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onVideoPublishStateChanged'); + }); + test('onExtensionEvent impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onExtensionEvent(undefined, undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onExtensionEvent'); + }); + test('onExtensionStarted impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onExtensionStarted(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onExtensionStarted'); + }); + test('onExtensionStopped impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onExtensionStopped(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onExtensionStopped'); + }); + test('onExtensionError impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onExtensionError(undefined, undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onExtensionError'); + }); + test('onUserAccountUpdated impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserAccountUpdated(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserAccountUpdated'); + }); + test('onLocalVideoTranscoderError impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalVideoTranscoderError(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalVideoTranscoderError'); + }); + test('onVideoRenderingTracingResult impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandler(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoRenderingTracingResult(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onVideoRenderingTracingResult' + ); + }); +}); +describe('IVideoDeviceManager', () => { + test('enumerateVideoDevices impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'enumerateVideoDevices' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'VideoDeviceManager_enumerateVideoDevices', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .enumerateVideoDevices + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .enumerateVideoDevices + ).toBeCalledWith(); + }); + test('setDevice parameter', async () => { + let nParam = { + deviceIdUTF8: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'VideoDeviceManager_setDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'setDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceIdUTF8: 'test', + }; + let apiParam = new EventParam( + 'VideoDeviceManager_setDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl.setDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl.setDevice + ).toBeCalledWith('test'); + }); + + test('getDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'getDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'VideoDeviceManager_getDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl.getDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl.getDevice + ).toBeCalledWith(); + }); + test('numberOfCapabilities parameter', async () => { + let nParam = { + deviceIdUTF8: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'VideoDeviceManager_numberOfCapabilities', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('numberOfCapabilities impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'numberOfCapabilities' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceIdUTF8: 'test', + }; + let apiParam = new EventParam( + 'VideoDeviceManager_numberOfCapabilities', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .numberOfCapabilities + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .numberOfCapabilities + ).toBeCalledWith('test'); + }); + test('getCapability parameter', async () => { + let nParam = { + deviceIdUTF8: undefined, + deviceCapabilityNumber: undefined, + capability: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'VideoDeviceManager_getCapability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getCapability impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'getCapability' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceIdUTF8: 'test', + deviceCapabilityNumber: 'test', + capability: 'test', + }; + let apiParam = new EventParam( + 'VideoDeviceManager_getCapability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .getCapability + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .getCapability + ).toBeCalledWith('test', 'test', 'test'); + }); + test('startDeviceTest parameter', async () => { + let nParam = { + hwnd: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'VideoDeviceManager_startDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startDeviceTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'startDeviceTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + hwnd: 'test', + }; + let apiParam = new EventParam( + 'VideoDeviceManager_startDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .startDeviceTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .startDeviceTest + ).toBeCalledWith('test'); + }); + + test('stopDeviceTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'stopDeviceTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'VideoDeviceManager_stopDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .stopDeviceTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl + .stopDeviceTest + ).toBeCalledWith(); + }); + + test('release impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl, + 'release' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'VideoDeviceManager_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl.release + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('VideoDeviceManager')._impl.release + ).toBeCalledWith(); + }); +}); +describe('IMetadataObserver', () => { + test('onMetadataReceived impl call', async () => { + let eventHandler = new bindingAPI.IMetadataObserver(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onMetadataReceived(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onMetadataReceived'); + }); +}); +describe('IDirectCdnStreamingEventHandler', () => { + test('onDirectCdnStreamingStateChanged impl call', async () => { + let eventHandler = new bindingAPI.IDirectCdnStreamingEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onDirectCdnStreamingStateChanged( + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onDirectCdnStreamingStateChanged' + ); + }); + test('onDirectCdnStreamingStats impl call', async () => { + let eventHandler = new bindingAPI.IDirectCdnStreamingEventHandler( + irisRtcEngine + ); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onDirectCdnStreamingStats(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onDirectCdnStreamingStats'); + }); +}); +describe('IRtcEngine', () => { + test('release parameter', async () => { + let nParam = { + sync: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('release impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, 'release') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sync: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.release + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.release + ).toBeCalledWith('test'); + }); + test('initialize parameter', async () => { + let nParam = { + context: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('initialize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'initialize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.initialize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.initialize + ).toBeCalledWith('test'); + }); + + test('getVersion impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getVersion' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getVersion', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getVersion + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getVersion + ).toBeCalledWith(); + }); + test('getErrorDescription parameter', async () => { + let nParam = { + code: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getErrorDescription', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getErrorDescription impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getErrorDescription' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + code: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getErrorDescription', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getErrorDescription + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getErrorDescription + ).toBeCalledWith('test'); + }); + test('queryCodecCapability parameter', async () => { + let nParam = { + codecInfo: undefined, + size: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_queryCodecCapability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('queryCodecCapability impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'queryCodecCapability' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + codecInfo: 'test', + size: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_queryCodecCapability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .queryCodecCapability + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .queryCodecCapability + ).toBeCalledWith('test', 'test'); + }); + test('preloadChannel parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + uid: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_preloadChannel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('preloadChannel impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'preloadChannel' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + uid: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_preloadChannel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.preloadChannel + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.preloadChannel + ).toBeCalledWith('test', 'test', 'test'); + }); + test('preloadChannel2 parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + userAccount: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_preloadChannel2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('preloadChannel2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'preloadChannel2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + userAccount: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_preloadChannel2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.preloadChannel2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.preloadChannel2 + ).toBeCalledWith('test', 'test', 'test'); + }); + test('updatePreloadChannelToken parameter', async () => { + let nParam = { + token: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updatePreloadChannelToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updatePreloadChannelToken impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updatePreloadChannelToken' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updatePreloadChannelToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updatePreloadChannelToken + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updatePreloadChannelToken + ).toBeCalledWith('test'); + }); + test('joinChannel parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + info: undefined, + uid: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_joinChannel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('joinChannel impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'joinChannel' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + info: 'test', + uid: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_joinChannel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.joinChannel + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.joinChannel + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('joinChannel2 parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + uid: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_joinChannel2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('joinChannel2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'joinChannel2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + uid: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_joinChannel2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.joinChannel2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.joinChannel2 + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('updateChannelMediaOptions parameter', async () => { + let nParam = { + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateChannelMediaOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateChannelMediaOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateChannelMediaOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateChannelMediaOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateChannelMediaOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateChannelMediaOptions + ).toBeCalledWith('test'); + }); + + test('leaveChannel impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'leaveChannel' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_leaveChannel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.leaveChannel + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.leaveChannel + ).toBeCalledWith(); + }); + test('leaveChannel2 parameter', async () => { + let nParam = { + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_leaveChannel2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('leaveChannel2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'leaveChannel2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_leaveChannel2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.leaveChannel2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.leaveChannel2 + ).toBeCalledWith('test'); + }); + test('renewToken parameter', async () => { + let nParam = { + token: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_renewToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('renewToken impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'renewToken' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_renewToken', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.renewToken + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.renewToken + ).toBeCalledWith('test'); + }); + test('setChannelProfile parameter', async () => { + let nParam = { + profile: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setChannelProfile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setChannelProfile impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setChannelProfile' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + profile: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setChannelProfile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setChannelProfile + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setChannelProfile + ).toBeCalledWith('test'); + }); + test('setClientRole parameter', async () => { + let nParam = { + role: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setClientRole', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setClientRole impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setClientRole' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + role: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setClientRole', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setClientRole + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setClientRole + ).toBeCalledWith('test'); + }); + test('setClientRole2 parameter', async () => { + let nParam = { + role: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setClientRole2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setClientRole2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setClientRole2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + role: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setClientRole2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setClientRole2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setClientRole2 + ).toBeCalledWith('test', 'test'); + }); + + test('startEchoTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startEchoTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_startEchoTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startEchoTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startEchoTest + ).toBeCalledWith(); + }); + test('startEchoTest2 parameter', async () => { + let nParam = { + intervalInSeconds: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startEchoTest2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startEchoTest2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startEchoTest2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + intervalInSeconds: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startEchoTest2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startEchoTest2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startEchoTest2 + ).toBeCalledWith('test'); + }); + test('startEchoTest3 parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startEchoTest3', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startEchoTest3 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startEchoTest3' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startEchoTest3', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startEchoTest3 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startEchoTest3 + ).toBeCalledWith('test'); + }); + + test('stopEchoTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopEchoTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopEchoTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopEchoTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopEchoTest + ).toBeCalledWith(); + }); + test('enableMultiCamera parameter', async () => { + let nParam = { + enabled: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableMultiCamera', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableMultiCamera impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableMultiCamera' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableMultiCamera', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableMultiCamera + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableMultiCamera + ).toBeCalledWith('test', 'test'); + }); + + test('enableVideo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableVideo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_enableVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableVideo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableVideo + ).toBeCalledWith(); + }); + + test('disableVideo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'disableVideo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_disableVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.disableVideo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.disableVideo + ).toBeCalledWith(); + }); + + test('startPreview impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startPreview' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_startPreview', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startPreview + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startPreview + ).toBeCalledWith(); + }); + test('startPreview2 parameter', async () => { + let nParam = { + sourceType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startPreview2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startPreview2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startPreview2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sourceType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startPreview2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startPreview2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startPreview2 + ).toBeCalledWith('test'); + }); + + test('stopPreview impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopPreview' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopPreview', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopPreview + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopPreview + ).toBeCalledWith(); + }); + test('stopPreview2 parameter', async () => { + let nParam = { + sourceType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_stopPreview2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopPreview2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopPreview2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sourceType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_stopPreview2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopPreview2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopPreview2 + ).toBeCalledWith('test'); + }); + test('startLastmileProbeTest parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startLastmileProbeTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startLastmileProbeTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startLastmileProbeTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startLastmileProbeTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startLastmileProbeTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startLastmileProbeTest + ).toBeCalledWith('test'); + }); + + test('stopLastmileProbeTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopLastmileProbeTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopLastmileProbeTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopLastmileProbeTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopLastmileProbeTest + ).toBeCalledWith(); + }); + test('setVideoEncoderConfiguration parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVideoEncoderConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVideoEncoderConfiguration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVideoEncoderConfiguration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVideoEncoderConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVideoEncoderConfiguration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVideoEncoderConfiguration + ).toBeCalledWith('test'); + }); + test('setBeautyEffectOptions parameter', async () => { + let nParam = { + enabled: undefined, + options: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setBeautyEffectOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setBeautyEffectOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setBeautyEffectOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + options: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setBeautyEffectOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setBeautyEffectOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setBeautyEffectOptions + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setLowlightEnhanceOptions parameter', async () => { + let nParam = { + enabled: undefined, + options: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLowlightEnhanceOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLowlightEnhanceOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLowlightEnhanceOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + options: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLowlightEnhanceOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLowlightEnhanceOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLowlightEnhanceOptions + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setVideoDenoiserOptions parameter', async () => { + let nParam = { + enabled: undefined, + options: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVideoDenoiserOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVideoDenoiserOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVideoDenoiserOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + options: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVideoDenoiserOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVideoDenoiserOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVideoDenoiserOptions + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setColorEnhanceOptions parameter', async () => { + let nParam = { + enabled: undefined, + options: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setColorEnhanceOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setColorEnhanceOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setColorEnhanceOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + options: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setColorEnhanceOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setColorEnhanceOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setColorEnhanceOptions + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableVirtualBackground parameter', async () => { + let nParam = { + enabled: undefined, + backgroundSource: undefined, + segproperty: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableVirtualBackground', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableVirtualBackground impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableVirtualBackground' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + backgroundSource: 'test', + segproperty: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableVirtualBackground', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableVirtualBackground + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableVirtualBackground + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setupRemoteVideo parameter', async () => { + let nParam = { + canvas: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setupRemoteVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setupRemoteVideo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setupRemoteVideo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + canvas: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setupRemoteVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setupRemoteVideo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setupRemoteVideo + ).toBeCalledWith('test'); + }); + test('setupLocalVideo parameter', async () => { + let nParam = { + canvas: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setupLocalVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setupLocalVideo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setupLocalVideo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + canvas: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setupLocalVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setupLocalVideo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setupLocalVideo + ).toBeCalledWith('test'); + }); + test('setVideoScenario parameter', async () => { + let nParam = { + scenarioType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVideoScenario', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVideoScenario impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVideoScenario' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + scenarioType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVideoScenario', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setVideoScenario + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setVideoScenario + ).toBeCalledWith('test'); + }); + + test('enableAudio impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableAudio' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_enableAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableAudio + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableAudio + ).toBeCalledWith(); + }); + + test('disableAudio impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'disableAudio' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_disableAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.disableAudio + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.disableAudio + ).toBeCalledWith(); + }); + test('setAudioProfile parameter', async () => { + let nParam = { + profile: undefined, + scenario: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioProfile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioProfile impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioProfile' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + profile: 'test', + scenario: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioProfile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioProfile + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioProfile + ).toBeCalledWith('test', 'test'); + }); + test('setAudioProfile2 parameter', async () => { + let nParam = { + profile: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioProfile2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioProfile2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioProfile2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + profile: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioProfile2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioProfile2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioProfile2 + ).toBeCalledWith('test'); + }); + test('setAudioScenario parameter', async () => { + let nParam = { + scenario: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioScenario', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioScenario impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioScenario' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + scenario: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioScenario', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioScenario + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioScenario + ).toBeCalledWith('test'); + }); + test('enableLocalAudio parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableLocalAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableLocalAudio impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableLocalAudio' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableLocalAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableLocalAudio + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableLocalAudio + ).toBeCalledWith('test'); + }); + test('muteLocalAudioStream parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteLocalAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteLocalAudioStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteLocalAudioStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteLocalAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteLocalAudioStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteLocalAudioStream + ).toBeCalledWith('test'); + }); + test('muteAllRemoteAudioStreams parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteAllRemoteAudioStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteAllRemoteAudioStreams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteAllRemoteAudioStreams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteAllRemoteAudioStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteAllRemoteAudioStreams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteAllRemoteAudioStreams + ).toBeCalledWith('test'); + }); + test('setDefaultMuteAllRemoteAudioStreams parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDefaultMuteAllRemoteAudioStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDefaultMuteAllRemoteAudioStreams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDefaultMuteAllRemoteAudioStreams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDefaultMuteAllRemoteAudioStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDefaultMuteAllRemoteAudioStreams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDefaultMuteAllRemoteAudioStreams + ).toBeCalledWith('test'); + }); + test('muteRemoteAudioStream parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteRemoteAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRemoteAudioStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteRemoteAudioStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteRemoteAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteRemoteAudioStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteRemoteAudioStream + ).toBeCalledWith('test', 'test'); + }); + test('muteLocalVideoStream parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteLocalVideoStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteLocalVideoStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteLocalVideoStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteLocalVideoStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteLocalVideoStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteLocalVideoStream + ).toBeCalledWith('test'); + }); + test('enableLocalVideo parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableLocalVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableLocalVideo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableLocalVideo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableLocalVideo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableLocalVideo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableLocalVideo + ).toBeCalledWith('test'); + }); + test('muteAllRemoteVideoStreams parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteAllRemoteVideoStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteAllRemoteVideoStreams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteAllRemoteVideoStreams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteAllRemoteVideoStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteAllRemoteVideoStreams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteAllRemoteVideoStreams + ).toBeCalledWith('test'); + }); + test('setDefaultMuteAllRemoteVideoStreams parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDefaultMuteAllRemoteVideoStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDefaultMuteAllRemoteVideoStreams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDefaultMuteAllRemoteVideoStreams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDefaultMuteAllRemoteVideoStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDefaultMuteAllRemoteVideoStreams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDefaultMuteAllRemoteVideoStreams + ).toBeCalledWith('test'); + }); + test('muteRemoteVideoStream parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteRemoteVideoStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRemoteVideoStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteRemoteVideoStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteRemoteVideoStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteRemoteVideoStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .muteRemoteVideoStream + ).toBeCalledWith('test', 'test'); + }); + test('setRemoteVideoStreamType parameter', async () => { + let nParam = { + uid: undefined, + streamType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteVideoStreamType', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteVideoStreamType impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteVideoStreamType' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + streamType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteVideoStreamType', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteVideoStreamType + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteVideoStreamType + ).toBeCalledWith('test', 'test'); + }); + test('setRemoteVideoSubscriptionOptions parameter', async () => { + let nParam = { + uid: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteVideoSubscriptionOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteVideoSubscriptionOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteVideoSubscriptionOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteVideoSubscriptionOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteVideoSubscriptionOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteVideoSubscriptionOptions + ).toBeCalledWith('test', 'test'); + }); + test('setRemoteDefaultVideoStreamType parameter', async () => { + let nParam = { + streamType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteDefaultVideoStreamType', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteDefaultVideoStreamType impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteDefaultVideoStreamType' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteDefaultVideoStreamType', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteDefaultVideoStreamType + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteDefaultVideoStreamType + ).toBeCalledWith('test'); + }); + test('setSubscribeAudioBlocklist parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setSubscribeAudioBlocklist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeAudioBlocklist impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setSubscribeAudioBlocklist' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setSubscribeAudioBlocklist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeAudioBlocklist + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeAudioBlocklist + ).toBeCalledWith('test', 'test'); + }); + test('setSubscribeAudioAllowlist parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setSubscribeAudioAllowlist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeAudioAllowlist impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setSubscribeAudioAllowlist' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setSubscribeAudioAllowlist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeAudioAllowlist + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeAudioAllowlist + ).toBeCalledWith('test', 'test'); + }); + test('setSubscribeVideoBlocklist parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setSubscribeVideoBlocklist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeVideoBlocklist impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setSubscribeVideoBlocklist' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setSubscribeVideoBlocklist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeVideoBlocklist + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeVideoBlocklist + ).toBeCalledWith('test', 'test'); + }); + test('setSubscribeVideoAllowlist parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setSubscribeVideoAllowlist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeVideoAllowlist impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setSubscribeVideoAllowlist' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setSubscribeVideoAllowlist', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeVideoAllowlist + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setSubscribeVideoAllowlist + ).toBeCalledWith('test', 'test'); + }); + test('enableAudioVolumeIndication parameter', async () => { + let nParam = { + interval: undefined, + smooth: undefined, + reportVad: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableAudioVolumeIndication', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableAudioVolumeIndication impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableAudioVolumeIndication' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + interval: 'test', + smooth: 'test', + reportVad: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableAudioVolumeIndication', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableAudioVolumeIndication + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableAudioVolumeIndication + ).toBeCalledWith('test', 'test', 'test'); + }); + test('startAudioRecording parameter', async () => { + let nParam = { + filePath: undefined, + quality: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startAudioRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioRecording impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startAudioRecording' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filePath: 'test', + quality: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startAudioRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioRecording + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioRecording + ).toBeCalledWith('test', 'test'); + }); + test('startAudioRecording2 parameter', async () => { + let nParam = { + filePath: undefined, + sampleRate: undefined, + quality: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startAudioRecording2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioRecording2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startAudioRecording2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filePath: 'test', + sampleRate: 'test', + quality: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startAudioRecording2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startAudioRecording2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startAudioRecording2 + ).toBeCalledWith('test', 'test', 'test'); + }); + test('startAudioRecording3 parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startAudioRecording3', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioRecording3 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startAudioRecording3' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startAudioRecording3', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startAudioRecording3 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startAudioRecording3 + ).toBeCalledWith('test'); + }); + test('registerAudioEncodedFrameObserver parameter', async () => { + let nParam = { + config: undefined, + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_registerAudioEncodedFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerAudioEncodedFrameObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'registerAudioEncodedFrameObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + observer: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_registerAudioEncodedFrameObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerAudioEncodedFrameObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerAudioEncodedFrameObserver + ).toBeCalledWith('test', 'test'); + }); + + test('stopAudioRecording impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopAudioRecording' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopAudioRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAudioRecording + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAudioRecording + ).toBeCalledWith(); + }); + + test('createMediaPlayer impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'createMediaPlayer' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_createMediaPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createMediaPlayer + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createMediaPlayer + ).toBeCalledWith(); + }); + test('destroyMediaPlayer parameter', async () => { + let nParam = { + media_player: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_destroyMediaPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('destroyMediaPlayer impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'destroyMediaPlayer' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + media_player: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_destroyMediaPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.destroyMediaPlayer + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.destroyMediaPlayer + ).toBeCalledWith('test'); + }); + test('createMediaRecorder parameter', async () => { + let nParam = { + info: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_createMediaRecorder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createMediaRecorder impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'createMediaRecorder' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + info: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_createMediaRecorder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createMediaRecorder + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createMediaRecorder + ).toBeCalledWith('test'); + }); + test('destroyMediaRecorder parameter', async () => { + let nParam = { + mediaRecorder: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_destroyMediaRecorder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('destroyMediaRecorder impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'destroyMediaRecorder' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mediaRecorder: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_destroyMediaRecorder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .destroyMediaRecorder + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .destroyMediaRecorder + ).toBeCalledWith('test'); + }); + test('startAudioMixing parameter', async () => { + let nParam = { + filePath: undefined, + loopback: undefined, + cycle: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startAudioMixing', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioMixing impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startAudioMixing' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filePath: 'test', + loopback: 'test', + cycle: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startAudioMixing', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioMixing + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioMixing + ).toBeCalledWith('test', 'test', 'test'); + }); + test('startAudioMixing2 parameter', async () => { + let nParam = { + filePath: undefined, + loopback: undefined, + cycle: undefined, + startPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startAudioMixing2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioMixing2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startAudioMixing2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filePath: 'test', + loopback: 'test', + cycle: 'test', + startPos: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startAudioMixing2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioMixing2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioMixing2 + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + + test('stopAudioMixing impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopAudioMixing' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopAudioMixing', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAudioMixing + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAudioMixing + ).toBeCalledWith(); + }); + + test('pauseAudioMixing impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'pauseAudioMixing' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_pauseAudioMixing', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseAudioMixing + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseAudioMixing + ).toBeCalledWith(); + }); + + test('resumeAudioMixing impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'resumeAudioMixing' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_resumeAudioMixing', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeAudioMixing + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeAudioMixing + ).toBeCalledWith(); + }); + test('selectAudioTrack parameter', async () => { + let nParam = { + index: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_selectAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('selectAudioTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'selectAudioTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + index: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_selectAudioTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.selectAudioTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.selectAudioTrack + ).toBeCalledWith('test'); + }); + + test('getAudioTrackCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getAudioTrackCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getAudioTrackCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getAudioTrackCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getAudioTrackCount + ).toBeCalledWith(); + }); + test('adjustAudioMixingVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustAudioMixingVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustAudioMixingVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustAudioMixingVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustAudioMixingVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustAudioMixingVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustAudioMixingVolume + ).toBeCalledWith('test'); + }); + test('adjustAudioMixingPublishVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustAudioMixingPublishVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustAudioMixingPublishVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustAudioMixingPublishVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustAudioMixingPublishVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustAudioMixingPublishVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustAudioMixingPublishVolume + ).toBeCalledWith('test'); + }); + + test('getAudioMixingPublishVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getAudioMixingPublishVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getAudioMixingPublishVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingPublishVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingPublishVolume + ).toBeCalledWith(); + }); + test('adjustAudioMixingPlayoutVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustAudioMixingPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustAudioMixingPlayoutVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustAudioMixingPlayoutVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustAudioMixingPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustAudioMixingPlayoutVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustAudioMixingPlayoutVolume + ).toBeCalledWith('test'); + }); + + test('getAudioMixingPlayoutVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getAudioMixingPlayoutVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getAudioMixingPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingPlayoutVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingPlayoutVolume + ).toBeCalledWith(); + }); + + test('getAudioMixingDuration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getAudioMixingDuration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getAudioMixingDuration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingDuration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingDuration + ).toBeCalledWith(); + }); + + test('getAudioMixingCurrentPosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getAudioMixingCurrentPosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getAudioMixingCurrentPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingCurrentPosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getAudioMixingCurrentPosition + ).toBeCalledWith(); + }); + test('setAudioMixingPosition parameter', async () => { + let nParam = { + pos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioMixingPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioMixingPosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioMixingPosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + pos: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioMixingPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioMixingPosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioMixingPosition + ).toBeCalledWith('test'); + }); + test('setAudioMixingDualMonoMode parameter', async () => { + let nParam = { + mode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioMixingDualMonoMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioMixingDualMonoMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioMixingDualMonoMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioMixingDualMonoMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioMixingDualMonoMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioMixingDualMonoMode + ).toBeCalledWith('test'); + }); + test('setAudioMixingPitch parameter', async () => { + let nParam = { + pitch: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioMixingPitch', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioMixingPitch impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioMixingPitch' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + pitch: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioMixingPitch', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioMixingPitch + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAudioMixingPitch + ).toBeCalledWith('test'); + }); + + test('getEffectsVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getEffectsVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getEffectsVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getEffectsVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getEffectsVolume + ).toBeCalledWith(); + }); + test('setEffectsVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setEffectsVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setEffectsVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setEffectsVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setEffectsVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEffectsVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEffectsVolume + ).toBeCalledWith('test'); + }); + test('preloadEffect parameter', async () => { + let nParam = { + soundId: undefined, + filePath: undefined, + startPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_preloadEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('preloadEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'preloadEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + filePath: 'test', + startPos: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_preloadEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.preloadEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.preloadEffect + ).toBeCalledWith('test', 'test', 'test'); + }); + test('playEffect parameter', async () => { + let nParam = { + soundId: undefined, + filePath: undefined, + loopCount: undefined, + pitch: undefined, + pan: undefined, + gain: undefined, + publish: undefined, + startPos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_playEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('playEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'playEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + filePath: 'test', + loopCount: 'test', + pitch: 'test', + pan: 'test', + gain: 'test', + publish: 'test', + startPos: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_playEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.playEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.playEffect + ).toBeCalledWith( + 'test', + 'test', + 'test', + 'test', + 'test', + 'test', + 'test', + 'test' + ); + }); + test('playAllEffects parameter', async () => { + let nParam = { + loopCount: undefined, + pitch: undefined, + pan: undefined, + gain: undefined, + publish: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_playAllEffects', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('playAllEffects impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'playAllEffects' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + loopCount: 'test', + pitch: 'test', + pan: 'test', + gain: 'test', + publish: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_playAllEffects', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.playAllEffects + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.playAllEffects + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('getVolumeOfEffect parameter', async () => { + let nParam = { + soundId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getVolumeOfEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getVolumeOfEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getVolumeOfEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getVolumeOfEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getVolumeOfEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getVolumeOfEffect + ).toBeCalledWith('test'); + }); + test('setVolumeOfEffect parameter', async () => { + let nParam = { + soundId: undefined, + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVolumeOfEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVolumeOfEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVolumeOfEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVolumeOfEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setVolumeOfEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setVolumeOfEffect + ).toBeCalledWith('test', 'test'); + }); + test('pauseEffect parameter', async () => { + let nParam = { + soundId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_pauseEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('pauseEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'pauseEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_pauseEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseEffect + ).toBeCalledWith('test'); + }); + + test('pauseAllEffects impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'pauseAllEffects' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_pauseAllEffects', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseAllEffects + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseAllEffects + ).toBeCalledWith(); + }); + test('resumeEffect parameter', async () => { + let nParam = { + soundId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_resumeEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('resumeEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'resumeEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_resumeEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeEffect + ).toBeCalledWith('test'); + }); + + test('resumeAllEffects impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'resumeAllEffects' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_resumeAllEffects', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeAllEffects + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeAllEffects + ).toBeCalledWith(); + }); + test('stopEffect parameter', async () => { + let nParam = { + soundId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_stopEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_stopEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopEffect + ).toBeCalledWith('test'); + }); + + test('stopAllEffects impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopAllEffects' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopAllEffects', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAllEffects + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAllEffects + ).toBeCalledWith(); + }); + test('unloadEffect parameter', async () => { + let nParam = { + soundId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_unloadEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unloadEffect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'unloadEffect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_unloadEffect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.unloadEffect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.unloadEffect + ).toBeCalledWith('test'); + }); + + test('unloadAllEffects impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'unloadAllEffects' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_unloadAllEffects', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.unloadAllEffects + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.unloadAllEffects + ).toBeCalledWith(); + }); + test('getEffectDuration parameter', async () => { + let nParam = { + filePath: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getEffectDuration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getEffectDuration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getEffectDuration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filePath: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getEffectDuration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getEffectDuration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getEffectDuration + ).toBeCalledWith('test'); + }); + test('setEffectPosition parameter', async () => { + let nParam = { + soundId: undefined, + pos: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setEffectPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setEffectPosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setEffectPosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + pos: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setEffectPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEffectPosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEffectPosition + ).toBeCalledWith('test', 'test'); + }); + test('getEffectCurrentPosition parameter', async () => { + let nParam = { + soundId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getEffectCurrentPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getEffectCurrentPosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getEffectCurrentPosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + soundId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getEffectCurrentPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getEffectCurrentPosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getEffectCurrentPosition + ).toBeCalledWith('test'); + }); + test('enableSoundPositionIndication parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableSoundPositionIndication', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableSoundPositionIndication impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableSoundPositionIndication' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableSoundPositionIndication', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableSoundPositionIndication + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableSoundPositionIndication + ).toBeCalledWith('test'); + }); + test('setRemoteVoicePosition parameter', async () => { + let nParam = { + uid: undefined, + pan: undefined, + gain: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteVoicePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteVoicePosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteVoicePosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + pan: 'test', + gain: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteVoicePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteVoicePosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteVoicePosition + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableSpatialAudio parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableSpatialAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableSpatialAudio impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableSpatialAudio' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableSpatialAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableSpatialAudio + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableSpatialAudio + ).toBeCalledWith('test'); + }); + test('setRemoteUserSpatialAudioParams parameter', async () => { + let nParam = { + uid: undefined, + params: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteUserSpatialAudioParams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteUserSpatialAudioParams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteUserSpatialAudioParams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + params: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteUserSpatialAudioParams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteUserSpatialAudioParams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteUserSpatialAudioParams + ).toBeCalledWith('test', 'test'); + }); + test('setVoiceBeautifierPreset parameter', async () => { + let nParam = { + preset: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVoiceBeautifierPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVoiceBeautifierPreset impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVoiceBeautifierPreset' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVoiceBeautifierPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceBeautifierPreset + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceBeautifierPreset + ).toBeCalledWith('test'); + }); + test('setAudioEffectPreset parameter', async () => { + let nParam = { + preset: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioEffectPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioEffectPreset impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioEffectPreset' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioEffectPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioEffectPreset + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioEffectPreset + ).toBeCalledWith('test'); + }); + test('setVoiceConversionPreset parameter', async () => { + let nParam = { + preset: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVoiceConversionPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVoiceConversionPreset impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVoiceConversionPreset' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVoiceConversionPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceConversionPreset + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceConversionPreset + ).toBeCalledWith('test'); + }); + test('setAudioEffectParameters parameter', async () => { + let nParam = { + preset: undefined, + param1: undefined, + param2: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioEffectParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioEffectParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioEffectParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + param1: 'test', + param2: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioEffectParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioEffectParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioEffectParameters + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setVoiceBeautifierParameters parameter', async () => { + let nParam = { + preset: undefined, + param1: undefined, + param2: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVoiceBeautifierParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVoiceBeautifierParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVoiceBeautifierParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + param1: 'test', + param2: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVoiceBeautifierParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceBeautifierParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceBeautifierParameters + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setVoiceConversionParameters parameter', async () => { + let nParam = { + preset: undefined, + param1: undefined, + param2: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setVoiceConversionParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVoiceConversionParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setVoiceConversionParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + param1: 'test', + param2: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setVoiceConversionParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceConversionParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setVoiceConversionParameters + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setLocalVoicePitch parameter', async () => { + let nParam = { + pitch: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalVoicePitch', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalVoicePitch impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalVoicePitch' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + pitch: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalVoicePitch', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalVoicePitch + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalVoicePitch + ).toBeCalledWith('test'); + }); + test('setLocalVoiceFormant parameter', async () => { + let nParam = { + formantRatio: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalVoiceFormant', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalVoiceFormant impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalVoiceFormant' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + formantRatio: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalVoiceFormant', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalVoiceFormant + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalVoiceFormant + ).toBeCalledWith('test'); + }); + test('setLocalVoiceEqualization parameter', async () => { + let nParam = { + bandFrequency: undefined, + bandGain: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalVoiceEqualization', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalVoiceEqualization impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalVoiceEqualization' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + bandFrequency: 'test', + bandGain: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalVoiceEqualization', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalVoiceEqualization + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalVoiceEqualization + ).toBeCalledWith('test', 'test'); + }); + test('setLocalVoiceReverb parameter', async () => { + let nParam = { + reverbKey: undefined, + value: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalVoiceReverb', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalVoiceReverb impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalVoiceReverb' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + reverbKey: 'test', + value: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalVoiceReverb', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalVoiceReverb + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalVoiceReverb + ).toBeCalledWith('test', 'test'); + }); + test('setHeadphoneEQPreset parameter', async () => { + let nParam = { + preset: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setHeadphoneEQPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setHeadphoneEQPreset impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setHeadphoneEQPreset' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + preset: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setHeadphoneEQPreset', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setHeadphoneEQPreset + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setHeadphoneEQPreset + ).toBeCalledWith('test'); + }); + test('setHeadphoneEQParameters parameter', async () => { + let nParam = { + lowGain: undefined, + highGain: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setHeadphoneEQParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setHeadphoneEQParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setHeadphoneEQParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + lowGain: 'test', + highGain: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setHeadphoneEQParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setHeadphoneEQParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setHeadphoneEQParameters + ).toBeCalledWith('test', 'test'); + }); + test('setLogFile parameter', async () => { + let nParam = { + filePath: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLogFile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLogFile impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLogFile' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filePath: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLogFile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogFile + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogFile + ).toBeCalledWith('test'); + }); + test('setLogFilter parameter', async () => { + let nParam = { + filter: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLogFilter', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLogFilter impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLogFilter' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + filter: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLogFilter', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogFilter + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogFilter + ).toBeCalledWith('test'); + }); + test('setLogLevel parameter', async () => { + let nParam = { + level: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLogLevel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLogLevel impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLogLevel' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + level: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLogLevel', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogLevel + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogLevel + ).toBeCalledWith('test'); + }); + test('setLogFileSize parameter', async () => { + let nParam = { + fileSizeInKBytes: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLogFileSize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLogFileSize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLogFileSize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + fileSizeInKBytes: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLogFileSize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogFileSize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLogFileSize + ).toBeCalledWith('test'); + }); + test('uploadLogFile parameter', async () => { + let nParam = { + requestId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_uploadLogFile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('uploadLogFile impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'uploadLogFile' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + requestId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_uploadLogFile', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.uploadLogFile + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.uploadLogFile + ).toBeCalledWith('test'); + }); + test('setLocalRenderMode parameter', async () => { + let nParam = { + renderMode: undefined, + mirrorMode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalRenderMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalRenderMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalRenderMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + renderMode: 'test', + mirrorMode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalRenderMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalRenderMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalRenderMode + ).toBeCalledWith('test', 'test'); + }); + test('setRemoteRenderMode parameter', async () => { + let nParam = { + uid: undefined, + renderMode: undefined, + mirrorMode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteRenderMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteRenderMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteRenderMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + renderMode: 'test', + mirrorMode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteRenderMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setRemoteRenderMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setRemoteRenderMode + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setLocalRenderMode2 parameter', async () => { + let nParam = { + renderMode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalRenderMode2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalRenderMode2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalRenderMode2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + renderMode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalRenderMode2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalRenderMode2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalRenderMode2 + ).toBeCalledWith('test'); + }); + test('setLocalVideoMirrorMode parameter', async () => { + let nParam = { + mirrorMode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalVideoMirrorMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalVideoMirrorMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalVideoMirrorMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mirrorMode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalVideoMirrorMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalVideoMirrorMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalVideoMirrorMode + ).toBeCalledWith('test'); + }); + test('enableDualStreamMode parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableDualStreamMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableDualStreamMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableDualStreamMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableDualStreamMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableDualStreamMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableDualStreamMode + ).toBeCalledWith('test'); + }); + test('enableDualStreamMode2 parameter', async () => { + let nParam = { + enabled: undefined, + streamConfig: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableDualStreamMode2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableDualStreamMode2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableDualStreamMode2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + streamConfig: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableDualStreamMode2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableDualStreamMode2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableDualStreamMode2 + ).toBeCalledWith('test', 'test'); + }); + test('setDualStreamMode parameter', async () => { + let nParam = { + mode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDualStreamMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDualStreamMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDualStreamMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDualStreamMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setDualStreamMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setDualStreamMode + ).toBeCalledWith('test'); + }); + test('setDualStreamMode2 parameter', async () => { + let nParam = { + mode: undefined, + streamConfig: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDualStreamMode2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDualStreamMode2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDualStreamMode2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mode: 'test', + streamConfig: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDualStreamMode2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setDualStreamMode2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setDualStreamMode2 + ).toBeCalledWith('test', 'test'); + }); + test('enableCustomAudioLocalPlayback parameter', async () => { + let nParam = { + trackId: undefined, + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableCustomAudioLocalPlayback', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableCustomAudioLocalPlayback impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableCustomAudioLocalPlayback' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + trackId: 'test', + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableCustomAudioLocalPlayback', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableCustomAudioLocalPlayback + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableCustomAudioLocalPlayback + ).toBeCalledWith('test', 'test'); + }); + test('setRecordingAudioFrameParameters parameter', async () => { + let nParam = { + sampleRate: undefined, + channel: undefined, + mode: undefined, + samplesPerCall: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRecordingAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRecordingAudioFrameParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRecordingAudioFrameParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sampleRate: 'test', + channel: 'test', + mode: 'test', + samplesPerCall: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRecordingAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRecordingAudioFrameParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRecordingAudioFrameParameters + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setPlaybackAudioFrameParameters parameter', async () => { + let nParam = { + sampleRate: undefined, + channel: undefined, + mode: undefined, + samplesPerCall: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setPlaybackAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlaybackAudioFrameParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setPlaybackAudioFrameParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sampleRate: 'test', + channel: 'test', + mode: 'test', + samplesPerCall: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setPlaybackAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setPlaybackAudioFrameParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setPlaybackAudioFrameParameters + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setMixedAudioFrameParameters parameter', async () => { + let nParam = { + sampleRate: undefined, + channel: undefined, + samplesPerCall: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setMixedAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setMixedAudioFrameParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setMixedAudioFrameParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sampleRate: 'test', + channel: 'test', + samplesPerCall: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setMixedAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setMixedAudioFrameParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setMixedAudioFrameParameters + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setEarMonitoringAudioFrameParameters parameter', async () => { + let nParam = { + sampleRate: undefined, + channel: undefined, + mode: undefined, + samplesPerCall: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setEarMonitoringAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setEarMonitoringAudioFrameParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setEarMonitoringAudioFrameParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sampleRate: 'test', + channel: 'test', + mode: 'test', + samplesPerCall: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setEarMonitoringAudioFrameParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setEarMonitoringAudioFrameParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setEarMonitoringAudioFrameParameters + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setPlaybackAudioFrameBeforeMixingParameters parameter', async () => { + let nParam = { + sampleRate: undefined, + channel: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setPlaybackAudioFrameBeforeMixingParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlaybackAudioFrameBeforeMixingParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setPlaybackAudioFrameBeforeMixingParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sampleRate: 'test', + channel: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setPlaybackAudioFrameBeforeMixingParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setPlaybackAudioFrameBeforeMixingParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setPlaybackAudioFrameBeforeMixingParameters + ).toBeCalledWith('test', 'test'); + }); + test('enableAudioSpectrumMonitor parameter', async () => { + let nParam = { + intervalInMS: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableAudioSpectrumMonitor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableAudioSpectrumMonitor impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableAudioSpectrumMonitor' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + intervalInMS: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableAudioSpectrumMonitor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableAudioSpectrumMonitor + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableAudioSpectrumMonitor + ).toBeCalledWith('test'); + }); + + test('disableAudioSpectrumMonitor impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'disableAudioSpectrumMonitor' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_disableAudioSpectrumMonitor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .disableAudioSpectrumMonitor + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .disableAudioSpectrumMonitor + ).toBeCalledWith(); + }); + test('registerAudioSpectrumObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_registerAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerAudioSpectrumObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'registerAudioSpectrumObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_registerAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerAudioSpectrumObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerAudioSpectrumObserver + ).toBeCalledWith('test'); + }); + test('unregisterAudioSpectrumObserver parameter', async () => { + let nParam = { + observer: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_unregisterAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterAudioSpectrumObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'unregisterAudioSpectrumObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_unregisterAudioSpectrumObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .unregisterAudioSpectrumObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .unregisterAudioSpectrumObserver + ).toBeCalledWith('test'); + }); + test('adjustRecordingSignalVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustRecordingSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustRecordingSignalVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustRecordingSignalVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustRecordingSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustRecordingSignalVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustRecordingSignalVolume + ).toBeCalledWith('test'); + }); + test('muteRecordingSignal parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_muteRecordingSignal', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRecordingSignal impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'muteRecordingSignal' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_muteRecordingSignal', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.muteRecordingSignal + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.muteRecordingSignal + ).toBeCalledWith('test'); + }); + test('adjustPlaybackSignalVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustPlaybackSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustPlaybackSignalVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustPlaybackSignalVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustPlaybackSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustPlaybackSignalVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustPlaybackSignalVolume + ).toBeCalledWith('test'); + }); + test('adjustUserPlaybackSignalVolume parameter', async () => { + let nParam = { + uid: undefined, + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustUserPlaybackSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustUserPlaybackSignalVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustUserPlaybackSignalVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustUserPlaybackSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustUserPlaybackSignalVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustUserPlaybackSignalVolume + ).toBeCalledWith('test', 'test'); + }); + test('setLocalPublishFallbackOption parameter', async () => { + let nParam = { + option: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalPublishFallbackOption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalPublishFallbackOption impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalPublishFallbackOption' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + option: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalPublishFallbackOption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalPublishFallbackOption + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setLocalPublishFallbackOption + ).toBeCalledWith('test'); + }); + test('setRemoteSubscribeFallbackOption parameter', async () => { + let nParam = { + option: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteSubscribeFallbackOption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteSubscribeFallbackOption impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteSubscribeFallbackOption' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + option: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteSubscribeFallbackOption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteSubscribeFallbackOption + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteSubscribeFallbackOption + ).toBeCalledWith('test'); + }); + test('setHighPriorityUserList parameter', async () => { + let nParam = { + uidList: undefined, + uidNum: undefined, + option: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setHighPriorityUserList', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setHighPriorityUserList impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setHighPriorityUserList' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNum: 'test', + option: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setHighPriorityUserList', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setHighPriorityUserList + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setHighPriorityUserList + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableLoopbackRecording parameter', async () => { + let nParam = { + enabled: undefined, + deviceName: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableLoopbackRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableLoopbackRecording impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableLoopbackRecording' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + deviceName: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableLoopbackRecording', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableLoopbackRecording + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableLoopbackRecording + ).toBeCalledWith('test', 'test'); + }); + test('adjustLoopbackSignalVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustLoopbackSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustLoopbackSignalVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustLoopbackSignalVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustLoopbackSignalVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustLoopbackSignalVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustLoopbackSignalVolume + ).toBeCalledWith('test'); + }); + + test('getLoopbackRecordingVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getLoopbackRecordingVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getLoopbackRecordingVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getLoopbackRecordingVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getLoopbackRecordingVolume + ).toBeCalledWith(); + }); + test('enableInEarMonitoring parameter', async () => { + let nParam = { + enabled: undefined, + includeAudioFilters: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableInEarMonitoring', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableInEarMonitoring impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableInEarMonitoring' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + includeAudioFilters: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableInEarMonitoring', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableInEarMonitoring + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableInEarMonitoring + ).toBeCalledWith('test', 'test'); + }); + test('setInEarMonitoringVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setInEarMonitoringVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setInEarMonitoringVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setInEarMonitoringVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setInEarMonitoringVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setInEarMonitoringVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setInEarMonitoringVolume + ).toBeCalledWith('test'); + }); + test('loadExtensionProvider parameter', async () => { + let nParam = { + path: undefined, + unload_after_use: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_loadExtensionProvider', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('loadExtensionProvider impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'loadExtensionProvider' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + path: 'test', + unload_after_use: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_loadExtensionProvider', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .loadExtensionProvider + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .loadExtensionProvider + ).toBeCalledWith('test', 'test'); + }); + test('setExtensionProviderProperty parameter', async () => { + let nParam = { + provider: undefined, + key: undefined, + value: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setExtensionProviderProperty', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setExtensionProviderProperty impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setExtensionProviderProperty' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + key: 'test', + value: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setExtensionProviderProperty', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setExtensionProviderProperty + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setExtensionProviderProperty + ).toBeCalledWith('test', 'test', 'test'); + }); + test('registerExtension parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_registerExtension', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerExtension impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'registerExtension' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_registerExtension', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.registerExtension + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.registerExtension + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableExtension parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + enable: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableExtension', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableExtension impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableExtension' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + enable: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableExtension', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableExtension + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableExtension + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('enableExtension2 parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + extensionInfo: undefined, + enable: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableExtension2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableExtension2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableExtension2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + extensionInfo: 'test', + enable: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableExtension2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableExtension2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableExtension2 + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setExtensionProperty parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + key: undefined, + value: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setExtensionProperty', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setExtensionProperty impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setExtensionProperty' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + key: 'test', + value: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setExtensionProperty', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setExtensionProperty + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setExtensionProperty + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('getExtensionProperty parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + key: undefined, + value: undefined, + buf_len: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getExtensionProperty', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getExtensionProperty impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getExtensionProperty' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + key: 'test', + value: 'test', + buf_len: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getExtensionProperty', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getExtensionProperty + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getExtensionProperty + ).toBeCalledWith('test', 'test', 'test', 'test', 'test', 'test'); + }); + test('setExtensionProperty2 parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + extensionInfo: undefined, + key: undefined, + value: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setExtensionProperty2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setExtensionProperty2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setExtensionProperty2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + extensionInfo: 'test', + key: 'test', + value: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setExtensionProperty2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setExtensionProperty2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setExtensionProperty2 + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('getExtensionProperty2 parameter', async () => { + let nParam = { + provider: undefined, + extension: undefined, + extensionInfo: undefined, + key: undefined, + value: undefined, + buf_len: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getExtensionProperty2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getExtensionProperty2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getExtensionProperty2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + provider: 'test', + extension: 'test', + extensionInfo: 'test', + key: 'test', + value: 'test', + buf_len: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getExtensionProperty2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getExtensionProperty2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getExtensionProperty2 + ).toBeCalledWith('test', 'test', 'test', 'test', 'test', 'test'); + }); + test('setCameraCapturerConfiguration parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraCapturerConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraCapturerConfiguration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraCapturerConfiguration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraCapturerConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraCapturerConfiguration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraCapturerConfiguration + ).toBeCalledWith('test'); + }); + + test('createCustomVideoTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'createCustomVideoTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_createCustomVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .createCustomVideoTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .createCustomVideoTrack + ).toBeCalledWith(); + }); + test('createCustomEncodedVideoTrack parameter', async () => { + let nParam = { + sender_option: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_createCustomEncodedVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createCustomEncodedVideoTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'createCustomEncodedVideoTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sender_option: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_createCustomEncodedVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .createCustomEncodedVideoTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .createCustomEncodedVideoTrack + ).toBeCalledWith('test'); + }); + test('destroyCustomVideoTrack parameter', async () => { + let nParam = { + video_track_id: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_destroyCustomVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('destroyCustomVideoTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'destroyCustomVideoTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + video_track_id: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_destroyCustomVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .destroyCustomVideoTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .destroyCustomVideoTrack + ).toBeCalledWith('test'); + }); + test('destroyCustomEncodedVideoTrack parameter', async () => { + let nParam = { + video_track_id: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_destroyCustomEncodedVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('destroyCustomEncodedVideoTrack impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'destroyCustomEncodedVideoTrack' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + video_track_id: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_destroyCustomEncodedVideoTrack', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .destroyCustomEncodedVideoTrack + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .destroyCustomEncodedVideoTrack + ).toBeCalledWith('test'); + }); + + test('switchCamera impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'switchCamera' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_switchCamera', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.switchCamera + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.switchCamera + ).toBeCalledWith(); + }); + + test('isCameraZoomSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraZoomSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraZoomSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraZoomSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraZoomSupported + ).toBeCalledWith(); + }); + + test('isCameraFaceDetectSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraFaceDetectSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraFaceDetectSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraFaceDetectSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraFaceDetectSupported + ).toBeCalledWith(); + }); + + test('isCameraTorchSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraTorchSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraTorchSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraTorchSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraTorchSupported + ).toBeCalledWith(); + }); + + test('isCameraFocusSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraFocusSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraFocusSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraFocusSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraFocusSupported + ).toBeCalledWith(); + }); + + test('isCameraAutoFocusFaceModeSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraAutoFocusFaceModeSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraAutoFocusFaceModeSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraAutoFocusFaceModeSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraAutoFocusFaceModeSupported + ).toBeCalledWith(); + }); + test('setCameraZoomFactor parameter', async () => { + let nParam = { + factor: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraZoomFactor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraZoomFactor impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraZoomFactor' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + factor: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraZoomFactor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setCameraZoomFactor + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setCameraZoomFactor + ).toBeCalledWith('test'); + }); + test('enableFaceDetection parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableFaceDetection', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableFaceDetection impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableFaceDetection' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableFaceDetection', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableFaceDetection + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableFaceDetection + ).toBeCalledWith('test'); + }); + + test('getCameraMaxZoomFactor impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getCameraMaxZoomFactor' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getCameraMaxZoomFactor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getCameraMaxZoomFactor + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getCameraMaxZoomFactor + ).toBeCalledWith(); + }); + test('setCameraFocusPositionInPreview parameter', async () => { + let nParam = { + positionX: undefined, + positionY: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraFocusPositionInPreview', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraFocusPositionInPreview impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraFocusPositionInPreview' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + positionX: 'test', + positionY: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraFocusPositionInPreview', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraFocusPositionInPreview + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraFocusPositionInPreview + ).toBeCalledWith('test', 'test'); + }); + test('setCameraTorchOn parameter', async () => { + let nParam = { + isOn: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraTorchOn', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraTorchOn impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraTorchOn' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + isOn: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraTorchOn', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setCameraTorchOn + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setCameraTorchOn + ).toBeCalledWith('test'); + }); + test('setCameraAutoFocusFaceModeEnabled parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraAutoFocusFaceModeEnabled', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraAutoFocusFaceModeEnabled impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraAutoFocusFaceModeEnabled' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraAutoFocusFaceModeEnabled', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraAutoFocusFaceModeEnabled + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraAutoFocusFaceModeEnabled + ).toBeCalledWith('test'); + }); + + test('isCameraExposurePositionSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraExposurePositionSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraExposurePositionSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraExposurePositionSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraExposurePositionSupported + ).toBeCalledWith(); + }); + test('setCameraExposurePosition parameter', async () => { + let nParam = { + positionXinView: undefined, + positionYinView: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraExposurePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraExposurePosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraExposurePosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + positionXinView: 'test', + positionYinView: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraExposurePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraExposurePosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraExposurePosition + ).toBeCalledWith('test', 'test'); + }); + + test('isCameraExposureSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraExposureSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraExposureSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraExposureSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraExposureSupported + ).toBeCalledWith(); + }); + test('setCameraExposureFactor parameter', async () => { + let nParam = { + factor: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraExposureFactor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraExposureFactor impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraExposureFactor' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + factor: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraExposureFactor', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraExposureFactor + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraExposureFactor + ).toBeCalledWith('test'); + }); + + test('isCameraAutoExposureFaceModeSupported impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isCameraAutoExposureFaceModeSupported' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isCameraAutoExposureFaceModeSupported', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraAutoExposureFaceModeSupported + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isCameraAutoExposureFaceModeSupported + ).toBeCalledWith(); + }); + test('setCameraAutoExposureFaceModeEnabled parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraAutoExposureFaceModeEnabled', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraAutoExposureFaceModeEnabled impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraAutoExposureFaceModeEnabled' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraAutoExposureFaceModeEnabled', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraAutoExposureFaceModeEnabled + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraAutoExposureFaceModeEnabled + ).toBeCalledWith('test'); + }); + test('setDefaultAudioRouteToSpeakerphone parameter', async () => { + let nParam = { + defaultToSpeaker: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDefaultAudioRouteToSpeakerphone', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDefaultAudioRouteToSpeakerphone impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDefaultAudioRouteToSpeakerphone' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + defaultToSpeaker: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDefaultAudioRouteToSpeakerphone', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDefaultAudioRouteToSpeakerphone + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDefaultAudioRouteToSpeakerphone + ).toBeCalledWith('test'); + }); + test('setEnableSpeakerphone parameter', async () => { + let nParam = { + speakerOn: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setEnableSpeakerphone', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setEnableSpeakerphone impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setEnableSpeakerphone' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + speakerOn: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setEnableSpeakerphone', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setEnableSpeakerphone + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setEnableSpeakerphone + ).toBeCalledWith('test'); + }); + + test('isSpeakerphoneEnabled impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isSpeakerphoneEnabled' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_isSpeakerphoneEnabled', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isSpeakerphoneEnabled + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isSpeakerphoneEnabled + ).toBeCalledWith(); + }); + test('setRouteInCommunicationMode parameter', async () => { + let nParam = { + route: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRouteInCommunicationMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRouteInCommunicationMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRouteInCommunicationMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + route: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRouteInCommunicationMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRouteInCommunicationMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRouteInCommunicationMode + ).toBeCalledWith('test'); + }); + test('getScreenCaptureSources parameter', async () => { + let nParam = { + thumbSize: undefined, + iconSize: undefined, + includeScreen: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getScreenCaptureSources', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getScreenCaptureSources impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getScreenCaptureSources' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + thumbSize: 'test', + iconSize: 'test', + includeScreen: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getScreenCaptureSources', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getScreenCaptureSources + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getScreenCaptureSources + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setAudioSessionOperationRestriction parameter', async () => { + let nParam = { + restriction: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAudioSessionOperationRestriction', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioSessionOperationRestriction impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAudioSessionOperationRestriction' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + restriction: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAudioSessionOperationRestriction', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioSessionOperationRestriction + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAudioSessionOperationRestriction + ).toBeCalledWith('test'); + }); + test('startScreenCaptureByDisplayId parameter', async () => { + let nParam = { + displayId: undefined, + regionRect: undefined, + captureParams: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startScreenCaptureByDisplayId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startScreenCaptureByDisplayId impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startScreenCaptureByDisplayId' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + displayId: 'test', + regionRect: 'test', + captureParams: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startScreenCaptureByDisplayId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startScreenCaptureByDisplayId + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startScreenCaptureByDisplayId + ).toBeCalledWith('test', 'test', 'test'); + }); + test('startScreenCaptureByScreenRect parameter', async () => { + let nParam = { + screenRect: undefined, + regionRect: undefined, + captureParams: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startScreenCaptureByScreenRect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startScreenCaptureByScreenRect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startScreenCaptureByScreenRect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + screenRect: 'test', + regionRect: 'test', + captureParams: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startScreenCaptureByScreenRect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startScreenCaptureByScreenRect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startScreenCaptureByScreenRect + ).toBeCalledWith('test', 'test', 'test'); + }); + test('getAudioDeviceInfo parameter', async () => { + let nParam = { + deviceInfo: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getAudioDeviceInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getAudioDeviceInfo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getAudioDeviceInfo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceInfo: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getAudioDeviceInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getAudioDeviceInfo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getAudioDeviceInfo + ).toBeCalledWith('test'); + }); + test('startScreenCaptureByWindowId parameter', async () => { + let nParam = { + windowId: undefined, + regionRect: undefined, + captureParams: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startScreenCaptureByWindowId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startScreenCaptureByWindowId impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startScreenCaptureByWindowId' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + windowId: 'test', + regionRect: 'test', + captureParams: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startScreenCaptureByWindowId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startScreenCaptureByWindowId + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startScreenCaptureByWindowId + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setScreenCaptureContentHint parameter', async () => { + let nParam = { + contentHint: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setScreenCaptureContentHint', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setScreenCaptureContentHint impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setScreenCaptureContentHint' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + contentHint: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setScreenCaptureContentHint', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setScreenCaptureContentHint + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setScreenCaptureContentHint + ).toBeCalledWith('test'); + }); + test('updateScreenCaptureRegion parameter', async () => { + let nParam = { + regionRect: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateScreenCaptureRegion', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateScreenCaptureRegion impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateScreenCaptureRegion' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + regionRect: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateScreenCaptureRegion', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateScreenCaptureRegion + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateScreenCaptureRegion + ).toBeCalledWith('test'); + }); + test('updateScreenCaptureParameters parameter', async () => { + let nParam = { + captureParams: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateScreenCaptureParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateScreenCaptureParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateScreenCaptureParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + captureParams: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateScreenCaptureParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateScreenCaptureParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateScreenCaptureParameters + ).toBeCalledWith('test'); + }); + test('startScreenCapture parameter', async () => { + let nParam = { + captureParams: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startScreenCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startScreenCapture impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startScreenCapture' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + captureParams: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startScreenCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startScreenCapture + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startScreenCapture + ).toBeCalledWith('test'); + }); + test('updateScreenCapture parameter', async () => { + let nParam = { + captureParams: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateScreenCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateScreenCapture impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateScreenCapture' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + captureParams: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateScreenCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.updateScreenCapture + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.updateScreenCapture + ).toBeCalledWith('test'); + }); + + test('queryScreenCaptureCapability impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'queryScreenCaptureCapability' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_queryScreenCaptureCapability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .queryScreenCaptureCapability + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .queryScreenCaptureCapability + ).toBeCalledWith(); + }); + test('setScreenCaptureScenario parameter', async () => { + let nParam = { + screenScenario: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setScreenCaptureScenario', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setScreenCaptureScenario impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setScreenCaptureScenario' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + screenScenario: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setScreenCaptureScenario', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setScreenCaptureScenario + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setScreenCaptureScenario + ).toBeCalledWith('test'); + }); + + test('stopScreenCapture impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopScreenCapture' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopScreenCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopScreenCapture + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopScreenCapture + ).toBeCalledWith(); + }); + test('getCallId parameter', async () => { + let nParam = { + callId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getCallId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getCallId impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getCallId' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + callId: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getCallId', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getCallId + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getCallId + ).toBeCalledWith('test'); + }); + test('rate parameter', async () => { + let nParam = { + callId: undefined, + rating: undefined, + description: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_rate', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('rate impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, 'rate') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + callId: 'test', + rating: 'test', + description: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_rate', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.rate + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.rate + ).toBeCalledWith('test', 'test', 'test'); + }); + test('complain parameter', async () => { + let nParam = { + callId: undefined, + description: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_complain', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('complain impl call', async () => { + jest + .spyOn(irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, 'complain') + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + callId: 'test', + description: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_complain', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.complain + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.complain + ).toBeCalledWith('test', 'test'); + }); + test('startRtmpStreamWithoutTranscoding parameter', async () => { + let nParam = { + url: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startRtmpStreamWithoutTranscoding', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRtmpStreamWithoutTranscoding impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startRtmpStreamWithoutTranscoding' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startRtmpStreamWithoutTranscoding', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startRtmpStreamWithoutTranscoding + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startRtmpStreamWithoutTranscoding + ).toBeCalledWith('test'); + }); + test('startRtmpStreamWithTranscoding parameter', async () => { + let nParam = { + url: undefined, + transcoding: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startRtmpStreamWithTranscoding', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRtmpStreamWithTranscoding impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startRtmpStreamWithTranscoding' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + transcoding: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startRtmpStreamWithTranscoding', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startRtmpStreamWithTranscoding + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startRtmpStreamWithTranscoding + ).toBeCalledWith('test', 'test'); + }); + test('updateRtmpTranscoding parameter', async () => { + let nParam = { + transcoding: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateRtmpTranscoding', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateRtmpTranscoding impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateRtmpTranscoding' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + transcoding: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateRtmpTranscoding', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateRtmpTranscoding + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateRtmpTranscoding + ).toBeCalledWith('test'); + }); + test('stopRtmpStream parameter', async () => { + let nParam = { + url: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_stopRtmpStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopRtmpStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopRtmpStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_stopRtmpStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopRtmpStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopRtmpStream + ).toBeCalledWith('test'); + }); + test('startLocalVideoTranscoder parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startLocalVideoTranscoder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startLocalVideoTranscoder impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startLocalVideoTranscoder' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startLocalVideoTranscoder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startLocalVideoTranscoder + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startLocalVideoTranscoder + ).toBeCalledWith('test'); + }); + test('updateLocalTranscoderConfiguration parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateLocalTranscoderConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateLocalTranscoderConfiguration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateLocalTranscoderConfiguration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateLocalTranscoderConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateLocalTranscoderConfiguration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateLocalTranscoderConfiguration + ).toBeCalledWith('test'); + }); + + test('stopLocalVideoTranscoder impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopLocalVideoTranscoder' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopLocalVideoTranscoder', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopLocalVideoTranscoder + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopLocalVideoTranscoder + ).toBeCalledWith(); + }); + test('startCameraCapture parameter', async () => { + let nParam = { + sourceType: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startCameraCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startCameraCapture impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startCameraCapture' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sourceType: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startCameraCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startCameraCapture + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startCameraCapture + ).toBeCalledWith('test', 'test'); + }); + test('stopCameraCapture parameter', async () => { + let nParam = { + sourceType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_stopCameraCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopCameraCapture impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopCameraCapture' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sourceType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_stopCameraCapture', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopCameraCapture + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopCameraCapture + ).toBeCalledWith('test'); + }); + test('setCameraDeviceOrientation parameter', async () => { + let nParam = { + type: undefined, + orientation: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCameraDeviceOrientation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCameraDeviceOrientation impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCameraDeviceOrientation' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + type: 'test', + orientation: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCameraDeviceOrientation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraDeviceOrientation + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setCameraDeviceOrientation + ).toBeCalledWith('test', 'test'); + }); + test('setScreenCaptureOrientation parameter', async () => { + let nParam = { + type: undefined, + orientation: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setScreenCaptureOrientation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setScreenCaptureOrientation impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setScreenCaptureOrientation' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + type: 'test', + orientation: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setScreenCaptureOrientation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setScreenCaptureOrientation + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setScreenCaptureOrientation + ).toBeCalledWith('test', 'test'); + }); + test('startScreenCapture2 parameter', async () => { + let nParam = { + sourceType: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startScreenCapture2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startScreenCapture2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startScreenCapture2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sourceType: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startScreenCapture2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startScreenCapture2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startScreenCapture2 + ).toBeCalledWith('test', 'test'); + }); + test('stopScreenCapture2 parameter', async () => { + let nParam = { + sourceType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_stopScreenCapture2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopScreenCapture2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopScreenCapture2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sourceType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_stopScreenCapture2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopScreenCapture2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopScreenCapture2 + ).toBeCalledWith('test'); + }); + + test('getConnectionState impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getConnectionState' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getConnectionState', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getConnectionState + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getConnectionState + ).toBeCalledWith(); + }); + test('registerEventHandler parameter', async () => { + let nParam = { + eventHandler: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_registerEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerEventHandler impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'registerEventHandler' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + eventHandler: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_registerEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerEventHandler + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerEventHandler + ).toBeCalledWith('test'); + }); + test('unregisterEventHandler parameter', async () => { + let nParam = { + eventHandler: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_unregisterEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterEventHandler impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'unregisterEventHandler' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + eventHandler: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_unregisterEventHandler', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .unregisterEventHandler + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .unregisterEventHandler + ).toBeCalledWith('test'); + }); + test('setRemoteUserPriority parameter', async () => { + let nParam = { + uid: undefined, + userPriority: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setRemoteUserPriority', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteUserPriority impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setRemoteUserPriority' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + userPriority: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setRemoteUserPriority', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteUserPriority + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setRemoteUserPriority + ).toBeCalledWith('test', 'test'); + }); + test('setEncryptionMode parameter', async () => { + let nParam = { + encryptionMode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setEncryptionMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setEncryptionMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setEncryptionMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + encryptionMode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setEncryptionMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEncryptionMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEncryptionMode + ).toBeCalledWith('test'); + }); + test('setEncryptionSecret parameter', async () => { + let nParam = { + secret: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setEncryptionSecret', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setEncryptionSecret impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setEncryptionSecret' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + secret: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setEncryptionSecret', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEncryptionSecret + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setEncryptionSecret + ).toBeCalledWith('test'); + }); + test('enableEncryption parameter', async () => { + let nParam = { + enabled: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableEncryption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableEncryption impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableEncryption' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableEncryption', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableEncryption + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.enableEncryption + ).toBeCalledWith('test', 'test'); + }); + test('createDataStream parameter', async () => { + let nParam = { + streamId: undefined, + reliable: undefined, + ordered: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_createDataStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createDataStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'createDataStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamId: 'test', + reliable: 'test', + ordered: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_createDataStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createDataStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createDataStream + ).toBeCalledWith('test', 'test', 'test'); + }); + test('createDataStream2 parameter', async () => { + let nParam = { + streamId: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_createDataStream2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createDataStream2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'createDataStream2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamId: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_createDataStream2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createDataStream2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.createDataStream2 + ).toBeCalledWith('test', 'test'); + }); + test('sendStreamMessage parameter', async () => { + let nParam = { + streamId: undefined, + data: undefined, + length: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_sendStreamMessage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('sendStreamMessage impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'sendStreamMessage' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamId: 'test', + data: 'test', + length: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_sendStreamMessage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.sendStreamMessage + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.sendStreamMessage + ).toBeCalledWith('test', 'test', 'test'); + }); + test('addVideoWatermark parameter', async () => { + let nParam = { + watermark: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_addVideoWatermark', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('addVideoWatermark impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'addVideoWatermark' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + watermark: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_addVideoWatermark', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.addVideoWatermark + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.addVideoWatermark + ).toBeCalledWith('test'); + }); + test('addVideoWatermark2 parameter', async () => { + let nParam = { + watermarkUrl: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_addVideoWatermark2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('addVideoWatermark2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'addVideoWatermark2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + watermarkUrl: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_addVideoWatermark2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.addVideoWatermark2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.addVideoWatermark2 + ).toBeCalledWith('test', 'test'); + }); + + test('clearVideoWatermarks impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'clearVideoWatermarks' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_clearVideoWatermarks', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .clearVideoWatermarks + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .clearVideoWatermarks + ).toBeCalledWith(); + }); + + test('pauseAudio impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'pauseAudio' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_pauseAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseAudio + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.pauseAudio + ).toBeCalledWith(); + }); + + test('resumeAudio impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'resumeAudio' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_resumeAudio', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeAudio + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.resumeAudio + ).toBeCalledWith(); + }); + test('enableWebSdkInteroperability parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableWebSdkInteroperability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableWebSdkInteroperability impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableWebSdkInteroperability' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableWebSdkInteroperability', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableWebSdkInteroperability + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableWebSdkInteroperability + ).toBeCalledWith('test'); + }); + test('sendCustomReportMessage parameter', async () => { + let nParam = { + id: undefined, + category: undefined, + event: undefined, + label: undefined, + value: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_sendCustomReportMessage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('sendCustomReportMessage impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'sendCustomReportMessage' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + id: 'test', + category: 'test', + event: 'test', + label: 'test', + value: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_sendCustomReportMessage', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .sendCustomReportMessage + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .sendCustomReportMessage + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('registerMediaMetadataObserver parameter', async () => { + let nParam = { + observer: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_registerMediaMetadataObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerMediaMetadataObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'registerMediaMetadataObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_registerMediaMetadataObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerMediaMetadataObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerMediaMetadataObserver + ).toBeCalledWith('test', 'test'); + }); + test('unregisterMediaMetadataObserver parameter', async () => { + let nParam = { + observer: undefined, + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_unregisterMediaMetadataObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('unregisterMediaMetadataObserver impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'unregisterMediaMetadataObserver' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + observer: 'test', + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_unregisterMediaMetadataObserver', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .unregisterMediaMetadataObserver + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .unregisterMediaMetadataObserver + ).toBeCalledWith('test', 'test'); + }); + test('startAudioFrameDump parameter', async () => { + let nParam = { + channel_id: undefined, + user_id: undefined, + location: undefined, + uuid: undefined, + passwd: undefined, + duration_ms: undefined, + auto_upload: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startAudioFrameDump', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioFrameDump impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startAudioFrameDump' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + channel_id: 'test', + user_id: 'test', + location: 'test', + uuid: 'test', + passwd: 'test', + duration_ms: 'test', + auto_upload: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startAudioFrameDump', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioFrameDump + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startAudioFrameDump + ).toBeCalledWith('test', 'test', 'test', 'test', 'test', 'test', 'test'); + }); + test('stopAudioFrameDump parameter', async () => { + let nParam = { + channel_id: undefined, + user_id: undefined, + location: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_stopAudioFrameDump', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopAudioFrameDump impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopAudioFrameDump' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + channel_id: 'test', + user_id: 'test', + location: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_stopAudioFrameDump', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAudioFrameDump + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopAudioFrameDump + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setAINSMode parameter', async () => { + let nParam = { + enabled: undefined, + mode: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAINSMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAINSMode impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAINSMode' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + mode: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAINSMode', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAINSMode + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAINSMode + ).toBeCalledWith('test', 'test'); + }); + test('registerLocalUserAccount parameter', async () => { + let nParam = { + appId: undefined, + userAccount: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_registerLocalUserAccount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('registerLocalUserAccount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'registerLocalUserAccount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + appId: 'test', + userAccount: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_registerLocalUserAccount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerLocalUserAccount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .registerLocalUserAccount + ).toBeCalledWith('test', 'test'); + }); + test('joinChannelWithUserAccount parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + userAccount: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_joinChannelWithUserAccount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('joinChannelWithUserAccount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'joinChannelWithUserAccount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + userAccount: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_joinChannelWithUserAccount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .joinChannelWithUserAccount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .joinChannelWithUserAccount + ).toBeCalledWith('test', 'test', 'test'); + }); + test('joinChannelWithUserAccount2 parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + userAccount: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_joinChannelWithUserAccount2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('joinChannelWithUserAccount2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'joinChannelWithUserAccount2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + userAccount: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_joinChannelWithUserAccount2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .joinChannelWithUserAccount2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .joinChannelWithUserAccount2 + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('joinChannelWithUserAccountEx parameter', async () => { + let nParam = { + token: undefined, + channelId: undefined, + userAccount: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_joinChannelWithUserAccountEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('joinChannelWithUserAccountEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'joinChannelWithUserAccountEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + channelId: 'test', + userAccount: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_joinChannelWithUserAccountEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .joinChannelWithUserAccountEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .joinChannelWithUserAccountEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('getUserInfoByUserAccount parameter', async () => { + let nParam = { + userAccount: undefined, + userInfo: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getUserInfoByUserAccount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getUserInfoByUserAccount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getUserInfoByUserAccount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + userAccount: 'test', + userInfo: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getUserInfoByUserAccount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getUserInfoByUserAccount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getUserInfoByUserAccount + ).toBeCalledWith('test', 'test'); + }); + test('getUserInfoByUid parameter', async () => { + let nParam = { + uid: undefined, + userInfo: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_getUserInfoByUid', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getUserInfoByUid impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getUserInfoByUid' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + userInfo: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_getUserInfoByUid', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getUserInfoByUid + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getUserInfoByUid + ).toBeCalledWith('test', 'test'); + }); + test('startOrUpdateChannelMediaRelay parameter', async () => { + let nParam = { + configuration: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startOrUpdateChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startOrUpdateChannelMediaRelay impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startOrUpdateChannelMediaRelay' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startOrUpdateChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startOrUpdateChannelMediaRelay + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startOrUpdateChannelMediaRelay + ).toBeCalledWith('test'); + }); + test('startChannelMediaRelay parameter', async () => { + let nParam = { + configuration: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startChannelMediaRelay impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startChannelMediaRelay' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startChannelMediaRelay + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startChannelMediaRelay + ).toBeCalledWith('test'); + }); + test('updateChannelMediaRelay parameter', async () => { + let nParam = { + configuration: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateChannelMediaRelay impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateChannelMediaRelay' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateChannelMediaRelay + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateChannelMediaRelay + ).toBeCalledWith('test'); + }); + + test('stopChannelMediaRelay impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopChannelMediaRelay' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopChannelMediaRelay + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopChannelMediaRelay + ).toBeCalledWith(); + }); + + test('pauseAllChannelMediaRelay impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'pauseAllChannelMediaRelay' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_pauseAllChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .pauseAllChannelMediaRelay + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .pauseAllChannelMediaRelay + ).toBeCalledWith(); + }); + + test('resumeAllChannelMediaRelay impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'resumeAllChannelMediaRelay' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_resumeAllChannelMediaRelay', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .resumeAllChannelMediaRelay + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .resumeAllChannelMediaRelay + ).toBeCalledWith(); + }); + test('setDirectCdnStreamingAudioConfiguration parameter', async () => { + let nParam = { + profile: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDirectCdnStreamingAudioConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDirectCdnStreamingAudioConfiguration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDirectCdnStreamingAudioConfiguration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + profile: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDirectCdnStreamingAudioConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDirectCdnStreamingAudioConfiguration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDirectCdnStreamingAudioConfiguration + ).toBeCalledWith('test'); + }); + test('setDirectCdnStreamingVideoConfiguration parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setDirectCdnStreamingVideoConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDirectCdnStreamingVideoConfiguration impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setDirectCdnStreamingVideoConfiguration' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setDirectCdnStreamingVideoConfiguration', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDirectCdnStreamingVideoConfiguration + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setDirectCdnStreamingVideoConfiguration + ).toBeCalledWith('test'); + }); + test('startDirectCdnStreaming parameter', async () => { + let nParam = { + eventHandler: undefined, + publishUrl: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startDirectCdnStreaming', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startDirectCdnStreaming impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startDirectCdnStreaming' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + eventHandler: 'test', + publishUrl: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startDirectCdnStreaming', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startDirectCdnStreaming + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startDirectCdnStreaming + ).toBeCalledWith('test', 'test', 'test'); + }); + + test('stopDirectCdnStreaming impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopDirectCdnStreaming' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopDirectCdnStreaming', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopDirectCdnStreaming + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .stopDirectCdnStreaming + ).toBeCalledWith(); + }); + test('updateDirectCdnStreamingMediaOptions parameter', async () => { + let nParam = { + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_updateDirectCdnStreamingMediaOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateDirectCdnStreamingMediaOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'updateDirectCdnStreamingMediaOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_updateDirectCdnStreamingMediaOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateDirectCdnStreamingMediaOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .updateDirectCdnStreamingMediaOptions + ).toBeCalledWith('test'); + }); + test('startRhythmPlayer parameter', async () => { + let nParam = { + sound1: undefined, + sound2: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_startRhythmPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRhythmPlayer impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startRhythmPlayer' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + sound1: 'test', + sound2: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_startRhythmPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startRhythmPlayer + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.startRhythmPlayer + ).toBeCalledWith('test', 'test', 'test'); + }); + + test('stopRhythmPlayer impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'stopRhythmPlayer' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_stopRhythmPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopRhythmPlayer + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.stopRhythmPlayer + ).toBeCalledWith(); + }); + test('configRhythmPlayer parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_configRhythmPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('configRhythmPlayer impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'configRhythmPlayer' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_configRhythmPlayer', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.configRhythmPlayer + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.configRhythmPlayer + ).toBeCalledWith('test'); + }); + test('takeSnapshot parameter', async () => { + let nParam = { + uid: undefined, + filePath: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_takeSnapshot', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('takeSnapshot impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'takeSnapshot' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + filePath: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_takeSnapshot', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.takeSnapshot + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.takeSnapshot + ).toBeCalledWith('test', 'test'); + }); + test('enableContentInspect parameter', async () => { + let nParam = { + enabled: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableContentInspect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableContentInspect impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableContentInspect' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableContentInspect', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableContentInspect + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableContentInspect + ).toBeCalledWith('test', 'test'); + }); + test('adjustCustomAudioPublishVolume parameter', async () => { + let nParam = { + trackId: undefined, + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustCustomAudioPublishVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustCustomAudioPublishVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustCustomAudioPublishVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + trackId: 'test', + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustCustomAudioPublishVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustCustomAudioPublishVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustCustomAudioPublishVolume + ).toBeCalledWith('test', 'test'); + }); + test('adjustCustomAudioPlayoutVolume parameter', async () => { + let nParam = { + trackId: undefined, + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_adjustCustomAudioPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustCustomAudioPlayoutVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'adjustCustomAudioPlayoutVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + trackId: 'test', + volume: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_adjustCustomAudioPlayoutVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustCustomAudioPlayoutVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .adjustCustomAudioPlayoutVolume + ).toBeCalledWith('test', 'test'); + }); + test('setCloudProxy parameter', async () => { + let nParam = { + proxyType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setCloudProxy', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setCloudProxy impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setCloudProxy' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + proxyType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setCloudProxy', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setCloudProxy + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setCloudProxy + ).toBeCalledWith('test'); + }); + test('setLocalAccessPoint parameter', async () => { + let nParam = { + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setLocalAccessPoint', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLocalAccessPoint impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setLocalAccessPoint' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setLocalAccessPoint', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalAccessPoint + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setLocalAccessPoint + ).toBeCalledWith('test'); + }); + test('setAdvancedAudioOptions parameter', async () => { + let nParam = { + options: undefined, + sourceType: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAdvancedAudioOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAdvancedAudioOptions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAdvancedAudioOptions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + options: 'test', + sourceType: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAdvancedAudioOptions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAdvancedAudioOptions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .setAdvancedAudioOptions + ).toBeCalledWith('test', 'test'); + }); + test('setAVSyncSource parameter', async () => { + let nParam = { + channelId: undefined, + uid: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setAVSyncSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAVSyncSource impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setAVSyncSource' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + channelId: 'test', + uid: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setAVSyncSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAVSyncSource + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setAVSyncSource + ).toBeCalledWith('test', 'test'); + }); + test('enableVideoImageSource parameter', async () => { + let nParam = { + enable: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableVideoImageSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableVideoImageSource impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableVideoImageSource' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enable: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableVideoImageSource', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableVideoImageSource + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableVideoImageSource + ).toBeCalledWith('test', 'test'); + }); + + test('getCurrentMonotonicTimeInMs impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getCurrentMonotonicTimeInMs' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getCurrentMonotonicTimeInMs', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getCurrentMonotonicTimeInMs + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .getCurrentMonotonicTimeInMs + ).toBeCalledWith(); + }); + test('enableWirelessAccelerate parameter', async () => { + let nParam = { + enabled: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_enableWirelessAccelerate', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableWirelessAccelerate impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableWirelessAccelerate' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_enableWirelessAccelerate', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableWirelessAccelerate + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableWirelessAccelerate + ).toBeCalledWith('test'); + }); + + test('getNetworkType impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getNetworkType' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getNetworkType', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getNetworkType + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getNetworkType + ).toBeCalledWith(); + }); + test('setParameters parameter', async () => { + let nParam = { + parameters: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_setParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'setParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + parameters: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_setParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.setParameters + ).toBeCalledWith('test'); + }); + + test('startMediaRenderingTracing impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'startMediaRenderingTracing' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_startMediaRenderingTracing', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startMediaRenderingTracing + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .startMediaRenderingTracing + ).toBeCalledWith(); + }); + + test('enableInstantMediaRendering impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'enableInstantMediaRendering' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_enableInstantMediaRendering', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableInstantMediaRendering + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .enableInstantMediaRendering + ).toBeCalledWith(); + }); + + test('getNtpWallTimeInMs impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'getNtpWallTimeInMs' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'RtcEngine_getNtpWallTimeInMs', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getNtpWallTimeInMs + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl.getNtpWallTimeInMs + ).toBeCalledWith(); + }); + test('isFeatureAvailableOnDevice parameter', async () => { + let nParam = { + type: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngine_isFeatureAvailableOnDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('isFeatureAvailableOnDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl, + 'isFeatureAvailableOnDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + type: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_isFeatureAvailableOnDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isFeatureAvailableOnDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngine')._impl + .isFeatureAvailableOnDevice + ).toBeCalledWith('test'); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts b/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts new file mode 100644 index 0000000..413a2b1 --- /dev/null +++ b/packages/rtc/test/binding/IAgoraRtcEngineExDispatch.test.ts @@ -0,0 +1,3653 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraRtcEngineExDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IRtcEngineEventHandlerEx', () => { + test('onJoinChannelSuccessEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onJoinChannelSuccessEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onJoinChannelSuccessEx'); + }); + test('onRejoinChannelSuccessEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRejoinChannelSuccessEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRejoinChannelSuccessEx'); + }); + test('onAudioQualityEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioQualityEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioQualityEx'); + }); + test('onAudioVolumeIndicationEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onAudioVolumeIndicationEx( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onAudioVolumeIndicationEx'); + }); + test('onLeaveChannelEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLeaveChannelEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLeaveChannelEx'); + }); + test('onRtcStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRtcStatsEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRtcStatsEx'); + }); + test('onNetworkQualityEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onNetworkQualityEx(undefined, undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onNetworkQualityEx'); + }); + test('onIntraRequestReceivedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onIntraRequestReceivedEx(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onIntraRequestReceivedEx'); + }); + test('onFirstRemoteVideoDecodedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteVideoDecodedEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteVideoDecodedEx'); + }); + test('onVideoSizeChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoSizeChangedEx( + undefined, + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onVideoSizeChangedEx'); + }); + test('onRemoteVideoStateChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteVideoStateChangedEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteVideoStateChangedEx'); + }); + test('onFirstRemoteVideoFrameEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteVideoFrameEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteVideoFrameEx'); + }); + test('onUserJoinedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserJoinedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserJoinedEx'); + }); + test('onUserOfflineEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserOfflineEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserOfflineEx'); + }); + test('onUserMuteAudioEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserMuteAudioEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserMuteAudioEx'); + }); + test('onUserMuteVideoEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserMuteVideoEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserMuteVideoEx'); + }); + test('onUserEnableVideoEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserEnableVideoEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserEnableVideoEx'); + }); + test('onUserEnableLocalVideoEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserEnableLocalVideoEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserEnableLocalVideoEx'); + }); + test('onUserStateChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserStateChangedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserStateChangedEx'); + }); + test('onLocalAudioStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalAudioStatsEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalAudioStatsEx'); + }); + test('onRemoteAudioStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioStatsEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteAudioStatsEx'); + }); + test('onRemoteVideoStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteVideoStatsEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteVideoStatsEx'); + }); + test('onConnectionLostEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionLostEx(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionLostEx'); + }); + test('onConnectionInterruptedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionInterruptedEx(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionInterruptedEx'); + }); + test('onConnectionBannedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionBannedEx(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionBannedEx'); + }); + test('onStreamMessageEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onStreamMessageEx( + undefined, + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onStreamMessageEx'); + }); + test('onStreamMessageErrorEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onStreamMessageErrorEx( + undefined, + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onStreamMessageErrorEx'); + }); + test('onRequestTokenEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRequestTokenEx(undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRequestTokenEx'); + }); + test('onLicenseValidationFailureEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLicenseValidationFailureEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onLicenseValidationFailureEx' + ); + }); + test('onTokenPrivilegeWillExpireEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onTokenPrivilegeWillExpireEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onTokenPrivilegeWillExpireEx' + ); + }); + test('onFirstLocalAudioFramePublishedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstLocalAudioFramePublishedEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onFirstLocalAudioFramePublishedEx' + ); + }); + test('onFirstRemoteAudioFrameEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteAudioFrameEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteAudioFrameEx'); + }); + test('onFirstRemoteAudioDecodedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onFirstRemoteAudioDecodedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onFirstRemoteAudioDecodedEx'); + }); + test('onLocalAudioStateChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onLocalAudioStateChangedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onLocalAudioStateChangedEx'); + }); + test('onRemoteAudioStateChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioStateChangedEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onRemoteAudioStateChangedEx'); + }); + test('onActiveSpeakerEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onActiveSpeakerEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onActiveSpeakerEx'); + }); + test('onClientRoleChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onClientRoleChangedEx( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onClientRoleChangedEx'); + }); + test('onClientRoleChangeFailedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onClientRoleChangeFailedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onClientRoleChangeFailedEx'); + }); + test('onRemoteAudioTransportStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteAudioTransportStatsEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onRemoteAudioTransportStatsEx' + ); + }); + test('onRemoteVideoTransportStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onRemoteVideoTransportStatsEx( + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onRemoteVideoTransportStatsEx' + ); + }); + test('onConnectionStateChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onConnectionStateChangedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onConnectionStateChangedEx'); + }); + test('onWlAccMessageEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onWlAccMessageEx(undefined, undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onWlAccMessageEx'); + }); + test('onWlAccStatsEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onWlAccStatsEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onWlAccStatsEx'); + }); + test('onNetworkTypeChangedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onNetworkTypeChangedEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onNetworkTypeChangedEx'); + }); + test('onEncryptionErrorEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onEncryptionErrorEx(undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onEncryptionErrorEx'); + }); + test('onUploadLogResultEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUploadLogResultEx( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUploadLogResultEx'); + }); + test('onUserAccountUpdatedEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onUserAccountUpdatedEx(undefined, undefined, undefined); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onUserAccountUpdatedEx'); + }); + test('onSnapshotTakenEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onSnapshotTakenEx( + undefined, + undefined, + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('onSnapshotTakenEx'); + }); + test('onVideoRenderingTracingResultEx impl call', async () => { + let eventHandler = new bindingAPI.IRtcEngineEventHandlerEx(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.onVideoRenderingTracingResultEx( + undefined, + undefined, + undefined, + undefined + ); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith( + 'onVideoRenderingTracingResultEx' + ); + }); +}); +describe('IRtcEngineEx', () => { + test('joinChannelEx parameter', async () => { + let nParam = { + token: undefined, + connection: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_joinChannelEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('joinChannelEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'joinChannelEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + token: 'test', + connection: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_joinChannelEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.joinChannelEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.joinChannelEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('leaveChannelEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_leaveChannelEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('leaveChannelEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'leaveChannelEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_leaveChannelEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.leaveChannelEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.leaveChannelEx + ).toBeCalledWith('test'); + }); + test('leaveChannelEx2 parameter', async () => { + let nParam = { + connection: undefined, + options: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_leaveChannelEx2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('leaveChannelEx2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'leaveChannelEx2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + options: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_leaveChannelEx2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.leaveChannelEx2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.leaveChannelEx2 + ).toBeCalledWith('test', 'test'); + }); + test('updateChannelMediaOptionsEx parameter', async () => { + let nParam = { + options: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_updateChannelMediaOptionsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateChannelMediaOptionsEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'updateChannelMediaOptionsEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + options: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_updateChannelMediaOptionsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .updateChannelMediaOptionsEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .updateChannelMediaOptionsEx + ).toBeCalledWith('test', 'test'); + }); + test('setVideoEncoderConfigurationEx parameter', async () => { + let nParam = { + config: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setVideoEncoderConfigurationEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setVideoEncoderConfigurationEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setVideoEncoderConfigurationEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + config: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setVideoEncoderConfigurationEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setVideoEncoderConfigurationEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setVideoEncoderConfigurationEx + ).toBeCalledWith('test', 'test'); + }); + test('setupRemoteVideoEx parameter', async () => { + let nParam = { + canvas: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setupRemoteVideoEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setupRemoteVideoEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setupRemoteVideoEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + canvas: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setupRemoteVideoEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setupRemoteVideoEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setupRemoteVideoEx + ).toBeCalledWith('test', 'test'); + }); + test('muteRemoteAudioStreamEx parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteRemoteAudioStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRemoteAudioStreamEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteRemoteAudioStreamEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteRemoteAudioStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRemoteAudioStreamEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRemoteAudioStreamEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('muteRemoteVideoStreamEx parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteRemoteVideoStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRemoteVideoStreamEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteRemoteVideoStreamEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteRemoteVideoStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRemoteVideoStreamEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRemoteVideoStreamEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setRemoteVideoStreamTypeEx parameter', async () => { + let nParam = { + uid: undefined, + streamType: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setRemoteVideoStreamTypeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteVideoStreamTypeEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setRemoteVideoStreamTypeEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + streamType: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setRemoteVideoStreamTypeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteVideoStreamTypeEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteVideoStreamTypeEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('muteLocalAudioStreamEx parameter', async () => { + let nParam = { + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteLocalAudioStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteLocalAudioStreamEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteLocalAudioStreamEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteLocalAudioStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteLocalAudioStreamEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteLocalAudioStreamEx + ).toBeCalledWith('test', 'test'); + }); + test('muteLocalVideoStreamEx parameter', async () => { + let nParam = { + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteLocalVideoStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteLocalVideoStreamEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteLocalVideoStreamEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteLocalVideoStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteLocalVideoStreamEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteLocalVideoStreamEx + ).toBeCalledWith('test', 'test'); + }); + test('muteAllRemoteAudioStreamsEx parameter', async () => { + let nParam = { + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteAllRemoteAudioStreamsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteAllRemoteAudioStreamsEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteAllRemoteAudioStreamsEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteAllRemoteAudioStreamsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteAllRemoteAudioStreamsEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteAllRemoteAudioStreamsEx + ).toBeCalledWith('test', 'test'); + }); + test('muteAllRemoteVideoStreamsEx parameter', async () => { + let nParam = { + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteAllRemoteVideoStreamsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteAllRemoteVideoStreamsEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteAllRemoteVideoStreamsEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteAllRemoteVideoStreamsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteAllRemoteVideoStreamsEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteAllRemoteVideoStreamsEx + ).toBeCalledWith('test', 'test'); + }); + test('setSubscribeAudioBlocklistEx parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setSubscribeAudioBlocklistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeAudioBlocklistEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setSubscribeAudioBlocklistEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setSubscribeAudioBlocklistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeAudioBlocklistEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeAudioBlocklistEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setSubscribeAudioAllowlistEx parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setSubscribeAudioAllowlistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeAudioAllowlistEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setSubscribeAudioAllowlistEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setSubscribeAudioAllowlistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeAudioAllowlistEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeAudioAllowlistEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setSubscribeVideoBlocklistEx parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setSubscribeVideoBlocklistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeVideoBlocklistEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setSubscribeVideoBlocklistEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setSubscribeVideoBlocklistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeVideoBlocklistEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeVideoBlocklistEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setSubscribeVideoAllowlistEx parameter', async () => { + let nParam = { + uidList: undefined, + uidNumber: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setSubscribeVideoAllowlistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setSubscribeVideoAllowlistEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setSubscribeVideoAllowlistEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNumber: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setSubscribeVideoAllowlistEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeVideoAllowlistEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setSubscribeVideoAllowlistEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setRemoteVideoSubscriptionOptionsEx parameter', async () => { + let nParam = { + uid: undefined, + options: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setRemoteVideoSubscriptionOptionsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteVideoSubscriptionOptionsEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setRemoteVideoSubscriptionOptionsEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + options: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setRemoteVideoSubscriptionOptionsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteVideoSubscriptionOptionsEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteVideoSubscriptionOptionsEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setRemoteVoicePositionEx parameter', async () => { + let nParam = { + uid: undefined, + pan: undefined, + gain: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setRemoteVoicePositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteVoicePositionEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setRemoteVoicePositionEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + pan: 'test', + gain: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setRemoteVoicePositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteVoicePositionEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteVoicePositionEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('setRemoteUserSpatialAudioParamsEx parameter', async () => { + let nParam = { + uid: undefined, + params: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setRemoteUserSpatialAudioParamsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteUserSpatialAudioParamsEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setRemoteUserSpatialAudioParamsEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + params: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setRemoteUserSpatialAudioParamsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteUserSpatialAudioParamsEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteUserSpatialAudioParamsEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setRemoteRenderModeEx parameter', async () => { + let nParam = { + uid: undefined, + renderMode: undefined, + mirrorMode: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setRemoteRenderModeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteRenderModeEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setRemoteRenderModeEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + renderMode: 'test', + mirrorMode: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setRemoteRenderModeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteRenderModeEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setRemoteRenderModeEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('enableLoopbackRecordingEx parameter', async () => { + let nParam = { + connection: undefined, + enabled: undefined, + deviceName: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_enableLoopbackRecordingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableLoopbackRecordingEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'enableLoopbackRecordingEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + enabled: 'test', + deviceName: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_enableLoopbackRecordingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableLoopbackRecordingEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableLoopbackRecordingEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('adjustRecordingSignalVolumeEx parameter', async () => { + let nParam = { + volume: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_adjustRecordingSignalVolumeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustRecordingSignalVolumeEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'adjustRecordingSignalVolumeEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_adjustRecordingSignalVolumeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .adjustRecordingSignalVolumeEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .adjustRecordingSignalVolumeEx + ).toBeCalledWith('test', 'test'); + }); + test('muteRecordingSignalEx parameter', async () => { + let nParam = { + mute: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_muteRecordingSignalEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRecordingSignalEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'muteRecordingSignalEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_muteRecordingSignalEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRecordingSignalEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .muteRecordingSignalEx + ).toBeCalledWith('test', 'test'); + }); + test('adjustUserPlaybackSignalVolumeEx parameter', async () => { + let nParam = { + uid: undefined, + volume: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_adjustUserPlaybackSignalVolumeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('adjustUserPlaybackSignalVolumeEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'adjustUserPlaybackSignalVolumeEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + volume: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_adjustUserPlaybackSignalVolumeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .adjustUserPlaybackSignalVolumeEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .adjustUserPlaybackSignalVolumeEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('getConnectionStateEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_getConnectionStateEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getConnectionStateEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'getConnectionStateEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_getConnectionStateEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .getConnectionStateEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .getConnectionStateEx + ).toBeCalledWith('test'); + }); + test('enableEncryptionEx parameter', async () => { + let nParam = { + connection: undefined, + enabled: undefined, + config: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_enableEncryptionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableEncryptionEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'enableEncryptionEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + enabled: 'test', + config: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_enableEncryptionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableEncryptionEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableEncryptionEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('createDataStreamEx parameter', async () => { + let nParam = { + streamId: undefined, + reliable: undefined, + ordered: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_createDataStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createDataStreamEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'createDataStreamEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamId: 'test', + reliable: 'test', + ordered: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_createDataStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .createDataStreamEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .createDataStreamEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('createDataStreamEx2 parameter', async () => { + let nParam = { + streamId: undefined, + config: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_createDataStreamEx2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('createDataStreamEx2 impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'createDataStreamEx2' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamId: 'test', + config: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_createDataStreamEx2', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .createDataStreamEx2 + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .createDataStreamEx2 + ).toBeCalledWith('test', 'test', 'test'); + }); + test('sendStreamMessageEx parameter', async () => { + let nParam = { + streamId: undefined, + data: undefined, + length: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_sendStreamMessageEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('sendStreamMessageEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'sendStreamMessageEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + streamId: 'test', + data: 'test', + length: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_sendStreamMessageEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .sendStreamMessageEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .sendStreamMessageEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('addVideoWatermarkEx parameter', async () => { + let nParam = { + watermarkUrl: undefined, + options: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_addVideoWatermarkEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('addVideoWatermarkEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'addVideoWatermarkEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + watermarkUrl: 'test', + options: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_addVideoWatermarkEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .addVideoWatermarkEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .addVideoWatermarkEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('clearVideoWatermarkEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_clearVideoWatermarkEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('clearVideoWatermarkEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'clearVideoWatermarkEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_clearVideoWatermarkEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .clearVideoWatermarkEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .clearVideoWatermarkEx + ).toBeCalledWith('test'); + }); + test('sendCustomReportMessageEx parameter', async () => { + let nParam = { + id: undefined, + category: undefined, + event: undefined, + label: undefined, + value: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_sendCustomReportMessageEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('sendCustomReportMessageEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'sendCustomReportMessageEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + id: 'test', + category: 'test', + event: 'test', + label: 'test', + value: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_sendCustomReportMessageEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .sendCustomReportMessageEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .sendCustomReportMessageEx + ).toBeCalledWith('test', 'test', 'test', 'test', 'test', 'test'); + }); + test('enableAudioVolumeIndicationEx parameter', async () => { + let nParam = { + interval: undefined, + smooth: undefined, + reportVad: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_enableAudioVolumeIndicationEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableAudioVolumeIndicationEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'enableAudioVolumeIndicationEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + interval: 'test', + smooth: 'test', + reportVad: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_enableAudioVolumeIndicationEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableAudioVolumeIndicationEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableAudioVolumeIndicationEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('startRtmpStreamWithoutTranscodingEx parameter', async () => { + let nParam = { + url: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_startRtmpStreamWithoutTranscodingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRtmpStreamWithoutTranscodingEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'startRtmpStreamWithoutTranscodingEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_startRtmpStreamWithoutTranscodingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startRtmpStreamWithoutTranscodingEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startRtmpStreamWithoutTranscodingEx + ).toBeCalledWith('test', 'test'); + }); + test('startRtmpStreamWithTranscodingEx parameter', async () => { + let nParam = { + url: undefined, + transcoding: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_startRtmpStreamWithTranscodingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRtmpStreamWithTranscodingEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'startRtmpStreamWithTranscodingEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + transcoding: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_startRtmpStreamWithTranscodingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startRtmpStreamWithTranscodingEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startRtmpStreamWithTranscodingEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('updateRtmpTranscodingEx parameter', async () => { + let nParam = { + transcoding: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_updateRtmpTranscodingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateRtmpTranscodingEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'updateRtmpTranscodingEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + transcoding: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_updateRtmpTranscodingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .updateRtmpTranscodingEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .updateRtmpTranscodingEx + ).toBeCalledWith('test', 'test'); + }); + test('stopRtmpStreamEx parameter', async () => { + let nParam = { + url: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_stopRtmpStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopRtmpStreamEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'stopRtmpStreamEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + url: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_stopRtmpStreamEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.stopRtmpStreamEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.stopRtmpStreamEx + ).toBeCalledWith('test', 'test'); + }); + test('startOrUpdateChannelMediaRelayEx parameter', async () => { + let nParam = { + configuration: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_startOrUpdateChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startOrUpdateChannelMediaRelayEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'startOrUpdateChannelMediaRelayEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_startOrUpdateChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startOrUpdateChannelMediaRelayEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startOrUpdateChannelMediaRelayEx + ).toBeCalledWith('test', 'test'); + }); + test('startChannelMediaRelayEx parameter', async () => { + let nParam = { + configuration: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_startChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startChannelMediaRelayEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'startChannelMediaRelayEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_startChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startChannelMediaRelayEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startChannelMediaRelayEx + ).toBeCalledWith('test', 'test'); + }); + test('updateChannelMediaRelayEx parameter', async () => { + let nParam = { + configuration: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_updateChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateChannelMediaRelayEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'updateChannelMediaRelayEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + configuration: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_updateChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .updateChannelMediaRelayEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .updateChannelMediaRelayEx + ).toBeCalledWith('test', 'test'); + }); + test('stopChannelMediaRelayEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_stopChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('stopChannelMediaRelayEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'stopChannelMediaRelayEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_stopChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .stopChannelMediaRelayEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .stopChannelMediaRelayEx + ).toBeCalledWith('test'); + }); + test('pauseAllChannelMediaRelayEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_pauseAllChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('pauseAllChannelMediaRelayEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'pauseAllChannelMediaRelayEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_pauseAllChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .pauseAllChannelMediaRelayEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .pauseAllChannelMediaRelayEx + ).toBeCalledWith('test'); + }); + test('resumeAllChannelMediaRelayEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_resumeAllChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('resumeAllChannelMediaRelayEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'resumeAllChannelMediaRelayEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_resumeAllChannelMediaRelayEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .resumeAllChannelMediaRelayEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .resumeAllChannelMediaRelayEx + ).toBeCalledWith('test'); + }); + test('getUserInfoByUserAccountEx parameter', async () => { + let nParam = { + userAccount: undefined, + userInfo: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_getUserInfoByUserAccountEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getUserInfoByUserAccountEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'getUserInfoByUserAccountEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + userAccount: 'test', + userInfo: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_getUserInfoByUserAccountEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .getUserInfoByUserAccountEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .getUserInfoByUserAccountEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('getUserInfoByUidEx parameter', async () => { + let nParam = { + uid: undefined, + userInfo: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_getUserInfoByUidEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getUserInfoByUidEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'getUserInfoByUidEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + userInfo: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_getUserInfoByUidEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .getUserInfoByUidEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .getUserInfoByUidEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableDualStreamModeEx parameter', async () => { + let nParam = { + enabled: undefined, + streamConfig: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_enableDualStreamModeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableDualStreamModeEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'enableDualStreamModeEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + streamConfig: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_enableDualStreamModeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableDualStreamModeEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableDualStreamModeEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setDualStreamModeEx parameter', async () => { + let nParam = { + mode: undefined, + streamConfig: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setDualStreamModeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDualStreamModeEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setDualStreamModeEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mode: 'test', + streamConfig: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setDualStreamModeEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setDualStreamModeEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setDualStreamModeEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('setHighPriorityUserListEx parameter', async () => { + let nParam = { + uidList: undefined, + uidNum: undefined, + option: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_setHighPriorityUserListEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setHighPriorityUserListEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'setHighPriorityUserListEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uidList: 'test', + uidNum: 'test', + option: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_setHighPriorityUserListEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setHighPriorityUserListEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .setHighPriorityUserListEx + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('takeSnapshotEx parameter', async () => { + let nParam = { + connection: undefined, + uid: undefined, + filePath: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_takeSnapshotEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('takeSnapshotEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'takeSnapshotEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + uid: 'test', + filePath: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_takeSnapshotEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.takeSnapshotEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl.takeSnapshotEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('enableContentInspectEx parameter', async () => { + let nParam = { + enabled: undefined, + config: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_enableContentInspectEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('enableContentInspectEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'enableContentInspectEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enabled: 'test', + config: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_enableContentInspectEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableContentInspectEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .enableContentInspectEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('startMediaRenderingTracingEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'RtcEngineEx_startMediaRenderingTracingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startMediaRenderingTracingEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl, + 'startMediaRenderingTracingEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'RtcEngineEx_startMediaRenderingTracingEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startMediaRenderingTracingEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('RtcEngineEx')._impl + .startMediaRenderingTracingEx + ).toBeCalledWith('test'); + }); +}); diff --git a/packages/rtc/test/binding/IAgoraSpatialAudioDispatch.test.ts b/packages/rtc/test/binding/IAgoraSpatialAudioDispatch.test.ts new file mode 100644 index 0000000..6dab0b9 --- /dev/null +++ b/packages/rtc/test/binding/IAgoraSpatialAudioDispatch.test.ts @@ -0,0 +1,1138 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAgoraSpatialAudioDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IBaseSpatialAudioEngine', () => { + test('release impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'release' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .release + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .release + ).toBeCalledWith(); + }); + test('setMaxAudioRecvCount parameter', async () => { + let nParam = { + maxCount: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_setMaxAudioRecvCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setMaxAudioRecvCount impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'setMaxAudioRecvCount' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + maxCount: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_setMaxAudioRecvCount', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setMaxAudioRecvCount + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setMaxAudioRecvCount + ).toBeCalledWith('test'); + }); + test('setAudioRecvRange parameter', async () => { + let nParam = { + range: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_setAudioRecvRange', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setAudioRecvRange impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'setAudioRecvRange' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + range: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_setAudioRecvRange', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setAudioRecvRange + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setAudioRecvRange + ).toBeCalledWith('test'); + }); + test('setDistanceUnit parameter', async () => { + let nParam = { + unit: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_setDistanceUnit', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setDistanceUnit impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'setDistanceUnit' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + unit: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_setDistanceUnit', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setDistanceUnit + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setDistanceUnit + ).toBeCalledWith('test'); + }); + test('updateSelfPosition parameter', async () => { + let nParam = { + position: undefined, + axisForward: undefined, + axisRight: undefined, + axisUp: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_updateSelfPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateSelfPosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'updateSelfPosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + position: 'test', + axisForward: 'test', + axisRight: 'test', + axisUp: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_updateSelfPosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .updateSelfPosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .updateSelfPosition + ).toBeCalledWith('test', 'test', 'test', 'test'); + }); + test('updateSelfPositionEx parameter', async () => { + let nParam = { + position: undefined, + axisForward: undefined, + axisRight: undefined, + axisUp: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_updateSelfPositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateSelfPositionEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'updateSelfPositionEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + position: 'test', + axisForward: 'test', + axisRight: 'test', + axisUp: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_updateSelfPositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .updateSelfPositionEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .updateSelfPositionEx + ).toBeCalledWith('test', 'test', 'test', 'test', 'test'); + }); + test('updatePlayerPositionInfo parameter', async () => { + let nParam = { + playerId: undefined, + positionInfo: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_updatePlayerPositionInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updatePlayerPositionInfo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'updatePlayerPositionInfo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + playerId: 'test', + positionInfo: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_updatePlayerPositionInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .updatePlayerPositionInfo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .updatePlayerPositionInfo + ).toBeCalledWith('test', 'test'); + }); + test('setParameters parameter', async () => { + let nParam = { + params: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_setParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setParameters impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'setParameters' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + params: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_setParameters', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setParameters + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setParameters + ).toBeCalledWith('test'); + }); + test('muteLocalAudioStream parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_muteLocalAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteLocalAudioStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'muteLocalAudioStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_muteLocalAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .muteLocalAudioStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .muteLocalAudioStream + ).toBeCalledWith('test'); + }); + test('muteAllRemoteAudioStreams parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_muteAllRemoteAudioStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteAllRemoteAudioStreams impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'muteAllRemoteAudioStreams' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_muteAllRemoteAudioStreams', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .muteAllRemoteAudioStreams + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .muteAllRemoteAudioStreams + ).toBeCalledWith('test'); + }); + test('setZones parameter', async () => { + let nParam = { + zones: undefined, + zoneCount: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_setZones', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setZones impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'setZones' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + zones: 'test', + zoneCount: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_setZones', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setZones + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setZones + ).toBeCalledWith('test', 'test'); + }); + test('setPlayerAttenuation parameter', async () => { + let nParam = { + playerId: undefined, + attenuation: undefined, + forceSet: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_setPlayerAttenuation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlayerAttenuation impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'setPlayerAttenuation' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + playerId: 'test', + attenuation: 'test', + forceSet: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_setPlayerAttenuation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setPlayerAttenuation + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .setPlayerAttenuation + ).toBeCalledWith('test', 'test', 'test'); + }); + test('muteRemoteAudioStream parameter', async () => { + let nParam = { + uid: undefined, + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'BaseSpatialAudioEngine_muteRemoteAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('muteRemoteAudioStream impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl, + 'muteRemoteAudioStream' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + mute: 'test', + }; + let apiParam = new EventParam( + 'BaseSpatialAudioEngine_muteRemoteAudioStream', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .muteRemoteAudioStream + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('BaseSpatialAudioEngine')._impl + .muteRemoteAudioStream + ).toBeCalledWith('test', 'test'); + }); +}); +describe('ILocalSpatialAudioEngine', () => { + test('initialize impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'initialize' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .initialize + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .initialize + ).toBeCalledWith(); + }); + test('updateRemotePosition parameter', async () => { + let nParam = { + uid: undefined, + posInfo: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'LocalSpatialAudioEngine_updateRemotePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateRemotePosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'updateRemotePosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + posInfo: 'test', + }; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_updateRemotePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .updateRemotePosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .updateRemotePosition + ).toBeCalledWith('test', 'test'); + }); + test('updateRemotePositionEx parameter', async () => { + let nParam = { + uid: undefined, + posInfo: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'LocalSpatialAudioEngine_updateRemotePositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('updateRemotePositionEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'updateRemotePositionEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + posInfo: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_updateRemotePositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .updateRemotePositionEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .updateRemotePositionEx + ).toBeCalledWith('test', 'test', 'test'); + }); + test('removeRemotePosition parameter', async () => { + let nParam = { + uid: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'LocalSpatialAudioEngine_removeRemotePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('removeRemotePosition impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'removeRemotePosition' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + }; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_removeRemotePosition', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .removeRemotePosition + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .removeRemotePosition + ).toBeCalledWith('test'); + }); + test('removeRemotePositionEx parameter', async () => { + let nParam = { + uid: undefined, + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'LocalSpatialAudioEngine_removeRemotePositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('removeRemotePositionEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'removeRemotePositionEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + connection: 'test', + }; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_removeRemotePositionEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .removeRemotePositionEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .removeRemotePositionEx + ).toBeCalledWith('test', 'test'); + }); + + test('clearRemotePositions impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'clearRemotePositions' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_clearRemotePositions', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .clearRemotePositions + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .clearRemotePositions + ).toBeCalledWith(); + }); + test('clearRemotePositionsEx parameter', async () => { + let nParam = { + connection: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'LocalSpatialAudioEngine_clearRemotePositionsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('clearRemotePositionsEx impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'clearRemotePositionsEx' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + connection: 'test', + }; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_clearRemotePositionsEx', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .clearRemotePositionsEx + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .clearRemotePositionsEx + ).toBeCalledWith('test'); + }); + test('setRemoteAudioAttenuation parameter', async () => { + let nParam = { + uid: undefined, + attenuation: undefined, + forceSet: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'LocalSpatialAudioEngine_setRemoteAudioAttenuation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRemoteAudioAttenuation impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl, + 'setRemoteAudioAttenuation' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + uid: 'test', + attenuation: 'test', + forceSet: 'test', + }; + let apiParam = new EventParam( + 'LocalSpatialAudioEngine_setRemoteAudioAttenuation', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .setRemoteAudioAttenuation + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('LocalSpatialAudioEngine')._impl + .setRemoteAudioAttenuation + ).toBeCalledWith('test', 'test', 'test'); + }); +}); diff --git a/packages/rtc/test/binding/IAudioDeviceManagerDispatch.test.ts b/packages/rtc/test/binding/IAudioDeviceManagerDispatch.test.ts new file mode 100644 index 0000000..fc530bf --- /dev/null +++ b/packages/rtc/test/binding/IAudioDeviceManagerDispatch.test.ts @@ -0,0 +1,1347 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +const bindingAPI = require('../../src/binding/IAudioDeviceManagerDispatch'); + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +describe('IAudioDeviceManager', () => { + test('enumeratePlaybackDevices impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'enumeratePlaybackDevices' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_enumeratePlaybackDevices', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .enumeratePlaybackDevices + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .enumeratePlaybackDevices + ).toBeCalledWith(); + }); + + test('enumerateRecordingDevices impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'enumerateRecordingDevices' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_enumerateRecordingDevices', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .enumerateRecordingDevices + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .enumerateRecordingDevices + ).toBeCalledWith(); + }); + test('setPlaybackDevice parameter', async () => { + let nParam = { + deviceId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setPlaybackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlaybackDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setPlaybackDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceId: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setPlaybackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setPlaybackDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setPlaybackDevice + ).toBeCalledWith('test'); + }); + test('getPlaybackDevice parameter', async () => { + let nParam = { + deviceId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getPlaybackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getPlaybackDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getPlaybackDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceId: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getPlaybackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDevice + ).toBeCalledWith('test'); + }); + + test('getPlaybackDeviceInfo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getPlaybackDeviceInfo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_getPlaybackDeviceInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDeviceInfo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDeviceInfo + ).toBeCalledWith(); + }); + test('setPlaybackDeviceVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setPlaybackDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlaybackDeviceVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setPlaybackDeviceVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setPlaybackDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setPlaybackDeviceVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setPlaybackDeviceVolume + ).toBeCalledWith('test'); + }); + test('getPlaybackDeviceVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getPlaybackDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getPlaybackDeviceVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getPlaybackDeviceVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getPlaybackDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDeviceVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDeviceVolume + ).toBeCalledWith('test'); + }); + test('setRecordingDevice parameter', async () => { + let nParam = { + deviceId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setRecordingDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRecordingDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setRecordingDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceId: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setRecordingDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setRecordingDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setRecordingDevice + ).toBeCalledWith('test'); + }); + test('getRecordingDevice parameter', async () => { + let nParam = { + deviceId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getRecordingDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getRecordingDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getRecordingDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceId: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getRecordingDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDevice + ).toBeCalledWith('test'); + }); + + test('getRecordingDeviceInfo impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getRecordingDeviceInfo' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_getRecordingDeviceInfo', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDeviceInfo + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDeviceInfo + ).toBeCalledWith(); + }); + test('setRecordingDeviceVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setRecordingDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRecordingDeviceVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setRecordingDeviceVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setRecordingDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setRecordingDeviceVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setRecordingDeviceVolume + ).toBeCalledWith('test'); + }); + test('getRecordingDeviceVolume parameter', async () => { + let nParam = { + volume: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getRecordingDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getRecordingDeviceVolume impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getRecordingDeviceVolume' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + volume: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getRecordingDeviceVolume', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDeviceVolume + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDeviceVolume + ).toBeCalledWith('test'); + }); + test('setLoopbackDevice parameter', async () => { + let nParam = { + deviceId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setLoopbackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setLoopbackDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setLoopbackDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceId: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setLoopbackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setLoopbackDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setLoopbackDevice + ).toBeCalledWith('test'); + }); + test('getLoopbackDevice parameter', async () => { + let nParam = { + deviceId: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getLoopbackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getLoopbackDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getLoopbackDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + deviceId: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getLoopbackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getLoopbackDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getLoopbackDevice + ).toBeCalledWith('test'); + }); + test('setPlaybackDeviceMute parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setPlaybackDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setPlaybackDeviceMute impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setPlaybackDeviceMute' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setPlaybackDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setPlaybackDeviceMute + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setPlaybackDeviceMute + ).toBeCalledWith('test'); + }); + test('getPlaybackDeviceMute parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getPlaybackDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getPlaybackDeviceMute impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getPlaybackDeviceMute' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getPlaybackDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDeviceMute + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getPlaybackDeviceMute + ).toBeCalledWith('test'); + }); + test('setRecordingDeviceMute parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_setRecordingDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('setRecordingDeviceMute impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'setRecordingDeviceMute' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_setRecordingDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setRecordingDeviceMute + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .setRecordingDeviceMute + ).toBeCalledWith('test'); + }); + test('getRecordingDeviceMute parameter', async () => { + let nParam = { + mute: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_getRecordingDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('getRecordingDeviceMute impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'getRecordingDeviceMute' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + mute: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_getRecordingDeviceMute', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDeviceMute + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .getRecordingDeviceMute + ).toBeCalledWith('test'); + }); + test('startPlaybackDeviceTest parameter', async () => { + let nParam = { + testAudioFilePath: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_startPlaybackDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startPlaybackDeviceTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'startPlaybackDeviceTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + testAudioFilePath: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_startPlaybackDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .startPlaybackDeviceTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .startPlaybackDeviceTest + ).toBeCalledWith('test'); + }); + + test('stopPlaybackDeviceTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'stopPlaybackDeviceTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_stopPlaybackDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .stopPlaybackDeviceTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .stopPlaybackDeviceTest + ).toBeCalledWith(); + }); + test('startRecordingDeviceTest parameter', async () => { + let nParam = { + indicationInterval: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_startRecordingDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startRecordingDeviceTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'startRecordingDeviceTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + indicationInterval: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_startRecordingDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .startRecordingDeviceTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .startRecordingDeviceTest + ).toBeCalledWith('test'); + }); + + test('stopRecordingDeviceTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'stopRecordingDeviceTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_stopRecordingDeviceTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .stopRecordingDeviceTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .stopRecordingDeviceTest + ).toBeCalledWith(); + }); + test('startAudioDeviceLoopbackTest parameter', async () => { + let nParam = { + indicationInterval: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_startAudioDeviceLoopbackTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('startAudioDeviceLoopbackTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'startAudioDeviceLoopbackTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + indicationInterval: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_startAudioDeviceLoopbackTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .startAudioDeviceLoopbackTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .startAudioDeviceLoopbackTest + ).toBeCalledWith('test'); + }); + + test('stopAudioDeviceLoopbackTest impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'stopAudioDeviceLoopbackTest' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_stopAudioDeviceLoopbackTest', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .stopAudioDeviceLoopbackTest + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .stopAudioDeviceLoopbackTest + ).toBeCalledWith(); + }); + test('followSystemPlaybackDevice parameter', async () => { + let nParam = { + enable: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_followSystemPlaybackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('followSystemPlaybackDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'followSystemPlaybackDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enable: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_followSystemPlaybackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .followSystemPlaybackDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .followSystemPlaybackDevice + ).toBeCalledWith('test'); + }); + test('followSystemRecordingDevice parameter', async () => { + let nParam = { + enable: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_followSystemRecordingDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('followSystemRecordingDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'followSystemRecordingDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enable: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_followSystemRecordingDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .followSystemRecordingDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .followSystemRecordingDevice + ).toBeCalledWith('test'); + }); + test('followSystemLoopbackDevice parameter', async () => { + let nParam = { + enable: undefined, + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + 'AudioDeviceManager_followSystemLoopbackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + + test('followSystemLoopbackDevice impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'followSystemLoopbackDevice' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + enable: 'test', + }; + let apiParam = new EventParam( + 'AudioDeviceManager_followSystemLoopbackDevice', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .followSystemLoopbackDevice + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl + .followSystemLoopbackDevice + ).toBeCalledWith('test'); + }); + + test('release impl call', async () => { + jest + .spyOn( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl, + 'release' + ) + .mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = {}; + let apiParam = new EventParam( + 'AudioDeviceManager_release', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl.release + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('AudioDeviceManager')._impl.release + ).toBeCalledWith(); + }); +}); diff --git a/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts b/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts index 8d7d786..66cf7a5 100644 --- a/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts +++ b/packages/rtc/test/impl/IAgoraRtcEngineImpl.test.ts @@ -1,23 +1,27 @@ -import { IrisApiEngine, IrisCore } from "iris-web-core"; -import { initIrisRtc } from "../../src/index"; +import { IrisApiEngine, IrisCore } from 'iris-web-core'; +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; -let apiEnginePtr:IrisApiEngine; +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; beforeAll(() => { apiEnginePtr = IrisCore.createIrisApiEngine(); initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; }); afterAll(() => { IrisCore.disposeIrisApiEngine(apiEnginePtr); }); +afterEach(() => { + jest.clearAllMocks(); +}); -// AgoraWrapper.initIrisRtc(); -IrisCore.createIrisApiEngine(); -describe("support list", () => { - test("joinChannel", () => { - console.log('joinChannel') -//call create engine +describe('support list', () => { + test('joinChannel', () => { + console.log('joinChannel'); + //call create engine }); -}); \ No newline at end of file +}); diff --git a/packages/rtc/test/setup.ts b/packages/rtc/test/setup.ts index 0c187a4..32bc28c 100644 --- a/packages/rtc/test/setup.ts +++ b/packages/rtc/test/setup.ts @@ -1,5 +1,4 @@ -import "@testing-library/jest-dom"; - +import '@testing-library/jest-dom'; /** * started agora-rtc-sdk-ng@17.0.0, need mock RTCPeerConnection. @@ -19,15 +18,13 @@ HTMLMediaElement.prototype.pause = jest.fn().mockReturnValue(Promise.resolve()); * */ const mockPromise = jest.fn(async () => { - return new Promise(resolve => { + return new Promise((resolve) => { resolve(); }); }); -Object.defineProperty(global.navigator, "mediaDevices", { +Object.defineProperty(global.navigator, 'mediaDevices', { value: { getUserMedia: mockPromise, enumerateDevices: mockPromise, }, }); - - diff --git a/packages/rtc/webpack.config.js b/packages/rtc/webpack.config.js index e1e2152..e8c2352 100644 --- a/packages/rtc/webpack.config.js +++ b/packages/rtc/webpack.config.js @@ -3,34 +3,19 @@ const path = require('path'); const { CleanWebpackPlugin } = require('clean-webpack-plugin'); const TerserPlugin = require('terser-webpack-plugin'); -module.exports = { +const environment = process.env.NODE_ENV; + +config = { entry: './src/index.ts', output: { path: path.resolve(__dirname, 'dist'), libraryTarget: 'this', - // library: "", filename: 'iris-web-rtc.js', environment: { arrowFunction: false, }, }, - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - parallel: true, - terserOptions: { - toplevel: true, - ie8: true, - safari10: true, - }, - }), - ], - }, - - // devtool: 'inline-source-map', - resolve: { extensions: ['.ts', '.js'], }, @@ -58,3 +43,23 @@ module.exports = { }, }, }; +if (environment !== 'production') { + config.devtool = 'inline-source-map'; +} else { + config.optimization = { + minimize: true, + minimizer: [ + new TerserPlugin({ + parallel: true, + extractComments: false, + terserOptions: { + toplevel: true, + ie8: false, + safari10: true, + }, + }), + ], + }; +} + +module.exports = config; diff --git a/scripts/terra/binding.ts b/scripts/terra/binding.ts index a97639d..14085b5 100644 --- a/scripts/terra/binding.ts +++ b/scripts/terra/binding.ts @@ -25,6 +25,7 @@ interface TerraNodeUserData { isCallback: boolean; classPrefix: string; hasBaseClazzs: boolean; + prefix_name: string; } interface ClazzMethodUserData { @@ -34,11 +35,7 @@ interface ClazzMethodUserData { bindingExtensionList: []; } -export default function ( - terraContext: TerraContext, - args: any, - parseResult: ParseResult -) { +export function binding(parseResult: ParseResult) { let cxxfiles = parseResult.nodes as CXXFile[]; //移除不需要的文件 let view = filterFile(cxxfiles).map((cxxfile: CXXFile) => { @@ -84,6 +81,7 @@ export default function ( isStruct: node.__TYPE === CXXTYPE.Struct, isEnumz: node.__TYPE === CXXTYPE.Enumz, isClazz: node.__TYPE === CXXTYPE.Clazz, + prefix_name: node.name.replace(new RegExp('^I(.*)'), '$1'), classPrefix: node.name === 'IRtcEngineEventHandlerEx' ? 'RtcEngineEventHandler_' @@ -109,6 +107,15 @@ export default function ( }).length > 0 ); }); + return view; +} + +export default function ( + terraContext: TerraContext, + args: any, + parseResult: ParseResult +) { + let view = binding(parseResult); return renderWithConfiguration({ fileNameTemplatePath: path.join( __dirname, diff --git a/scripts/terra/binding_test.ts b/scripts/terra/binding_test.ts new file mode 100644 index 0000000..f52e07e --- /dev/null +++ b/scripts/terra/binding_test.ts @@ -0,0 +1,31 @@ +import * as path from 'path'; + +import { ParseResult, TerraContext } from '@agoraio-extensions/terra-core'; +import { renderWithConfiguration } from '@agoraio-extensions/terra_shared_configs'; + +import { binding } from './binding'; + +export default function ( + terraContext: TerraContext, + args: any, + parseResult: ParseResult +) { + let view = binding(parseResult); + return renderWithConfiguration({ + fileNameTemplatePath: path.join( + __dirname, + 'templates', + 'binding', + 'test', + 'file_name.mustache' + ), + fileContentTemplatePath: path.join( + __dirname, + 'templates', + 'binding', + 'test', + 'file_content.mustache' + ), + view, + }); +} diff --git a/scripts/terra/config/binding_configs.yaml b/scripts/terra/config/binding_configs.yaml index 9a8fe21..f8edca9 100644 --- a/scripts/terra/config/binding_configs.yaml +++ b/scripts/terra/config/binding_configs.yaml @@ -37,3 +37,4 @@ parsers: renderers: - path: ../binding.ts + - path: ../binding_test.ts diff --git a/scripts/terra/index.ts b/scripts/terra/index.ts index 14790fe..ddb2fb5 100644 --- a/scripts/terra/index.ts +++ b/scripts/terra/index.ts @@ -51,7 +51,7 @@ export default function ( let isCallback = isMatch(node.name, 'isCallback'); if (node.name === 'VIDEO_SOURCE_TYPE') { - debugger; + // debugger; } if (node.__TYPE === CXXTYPE.Clazz) { @@ -101,11 +101,13 @@ export default function ( fileNameTemplatePath: path.join( __dirname, 'templates', + 'impl', 'file_name.mustache' ), fileContentTemplatePath: path.join( __dirname, 'templates', + 'impl', 'file_content.mustache' ), view, diff --git a/scripts/terra/templates/binding/file_content.mustache b/scripts/terra/templates/binding/file_content.mustache index 10a2259..68df523 100644 --- a/scripts/terra/templates/binding/file_content.mustache +++ b/scripts/terra/templates/binding/file_content.mustache @@ -57,7 +57,6 @@ export class {{name}}Dispatch{ {{#user_data.isRegisterMethod}} let eventHandler = apiParam.buffer[0]; //obj.eventHandler; if (eventHandler === undefined) throw 'eventHandler is undefined'; - return this._impl.registerEventHandler(eventHandler); {{/user_data.isRegisterMethod}} {{^user_data.isRegisterMethod}} {{#user_data.hasParameters}} @@ -71,8 +70,8 @@ export class {{name}}Dispatch{ if ({{name}} === undefined) throw "{{name}} is undefined"; {{/parameters}} - return this._impl.{{name}}({{#parameters}}{{name}},{{/parameters}}); {{/user_data.isRegisterMethod}} + return this._impl.{{name}}({{#parameters}}{{name}},{{/parameters}}); } {{/methods}} diff --git a/scripts/terra/templates/binding/file_name.mustache b/scripts/terra/templates/binding/file_name.mustache index 5a6a376..15a358c 100644 --- a/scripts/terra/templates/binding/file_name.mustache +++ b/scripts/terra/templates/binding/file_name.mustache @@ -1 +1 @@ -{{&user_data.fileName}}Dispatch.ts \ No newline at end of file +/src/binding/{{&user_data.fileName}}Dispatch.ts \ No newline at end of file diff --git a/scripts/terra/templates/binding/test/file_content.mustache b/scripts/terra/templates/binding/test/file_content.mustache new file mode 100644 index 0000000..c9fccf3 --- /dev/null +++ b/scripts/terra/templates/binding/test/file_content.mustache @@ -0,0 +1,125 @@ +/// Generated by terra, DO NOT MODIFY BY HAND. + +import { + CallIrisApiResult, + EventParam, + IrisApiEngine, + IrisCore, +} from 'iris-web-core'; + +const bindingAPI = require('../../src/binding/{{&user_data.fileName}}Dispatch'); + +import { initIrisRtc } from '../../src/index'; +import { IrisRtcEngine } from '../engine/IrisRtcEngine'; + +let apiEnginePtr: IrisApiEngine; +let irisRtcEngine: IrisRtcEngine; +beforeAll(async () => { + apiEnginePtr = IrisCore.createIrisApiEngine(); + initIrisRtc(apiEnginePtr); + irisRtcEngine = apiEnginePtr['apiInterceptors'][0]; + irisRtcEngine.implHelper.createAudioTrack = jest.fn(); + let nParam = { + context: 'test', + }; + let apiParam = new EventParam( + 'RtcEngine_initialize', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); +}); + +afterAll(() => { + IrisCore.disposeIrisApiEngine(apiEnginePtr); +}); + +afterEach(() => { + jest.clearAllMocks(); +}); + +{{#nodes}} +describe('{{name}}', () => { +{{#user_data.isCallback}} + {{#methods}} + test('{{name}}{{user_data._prefix}} impl call', async () => { + let eventHandler = new bindingAPI.{{parent.name}}(irisRtcEngine); + jest.spyOn(eventHandler._engine.irisEventHandlerManager, 'notifyEvent'); + jest.spyOn(eventHandler, 'eventKey'); + eventHandler.{{name}}{{user_data._prefix}}({{#parameters}}undefined,{{/parameters}}); + expect( + eventHandler._engine.irisEventHandlerManager.notifyEvent + ).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledTimes(1); + expect(eventHandler.eventKey).toBeCalledWith('{{name}}{{user_data._prefix}}'); + }); + {{/methods}} +{{/user_data.isCallback}} +{{^user_data.isCallback}} + {{#methods}} + {{#user_data.hasParameters}} + test('{{name}} parameter', async () => { + let nParam = { + {{#parameters}} + {{name}}: undefined, + {{/parameters}} + }; + for (let i in nParam) { + try { + await IrisCore.callIrisApi( + apiEnginePtr, + new EventParam( + '{{user_data.prefix_name}}_{{name}}', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ) + ); + } catch (e) { + expect(e).toEqual(i + ' is undefined'); + } + nParam[i] = 'test'; + } + }); + {{/user_data.hasParameters}} + + test('{{name}} impl call', async () => { + jest.spyOn( + irisRtcEngine.implDispatchesMap.get('{{user_data.prefix_name}}')._impl, + '{{name}}' + ).mockResolvedValue(new CallIrisApiResult(0, '')); + let nParam = { + {{#parameters}} + {{name}}: 'test', + {{/parameters}} + }; + let apiParam = new EventParam( + '{{user_data.prefix_name}}_{{name}}', + JSON.stringify(nParam), + 0, + '', + ['test'], + [], + 1 + ); + await IrisCore.callIrisApi(apiEnginePtr, apiParam); + expect( + irisRtcEngine.implDispatchesMap.get('{{user_data.prefix_name}}')._impl + .{{name}} + ).toBeCalledTimes(1); + expect( + irisRtcEngine.implDispatchesMap.get('{{user_data.prefix_name}}')._impl + .{{name}} + ).toBeCalledWith({{#parameters}}'test',{{/parameters}}); + }); + {{/methods}} +{{/user_data.isCallback}} +}); +{{/nodes}} diff --git a/scripts/terra/templates/binding/test/file_name.mustache b/scripts/terra/templates/binding/test/file_name.mustache new file mode 100644 index 0000000..b592173 --- /dev/null +++ b/scripts/terra/templates/binding/test/file_name.mustache @@ -0,0 +1 @@ +/test/binding/{{&user_data.fileName}}Dispatch.test.ts \ No newline at end of file diff --git a/scripts/terra/templates/clazz.mustache b/scripts/terra/templates/impl/clazz.mustache similarity index 100% rename from scripts/terra/templates/clazz.mustache rename to scripts/terra/templates/impl/clazz.mustache diff --git a/scripts/terra/templates/enum.mustache b/scripts/terra/templates/impl/enum.mustache similarity index 100% rename from scripts/terra/templates/enum.mustache rename to scripts/terra/templates/impl/enum.mustache diff --git a/scripts/terra/templates/file_content.mustache b/scripts/terra/templates/impl/file_content.mustache similarity index 100% rename from scripts/terra/templates/file_content.mustache rename to scripts/terra/templates/impl/file_content.mustache diff --git a/scripts/terra/templates/file_name.mustache b/scripts/terra/templates/impl/file_name.mustache similarity index 100% rename from scripts/terra/templates/file_name.mustache rename to scripts/terra/templates/impl/file_name.mustache diff --git a/scripts/terra/templates/struct.mustache b/scripts/terra/templates/impl/struct.mustache similarity index 100% rename from scripts/terra/templates/struct.mustache rename to scripts/terra/templates/impl/struct.mustache diff --git a/scripts/terra/terra-binding.sh b/scripts/terra/terra-binding.sh index 4f0d8b7..16c76c6 100644 --- a/scripts/terra/terra-binding.sh +++ b/scripts/terra/terra-binding.sh @@ -3,18 +3,18 @@ set -e set -x MY_PATH=$(realpath $(dirname "$0")) -OUTPUT_DIR=$(realpath ${MY_PATH}/../../packages/rtc/src/binding) +OUTPUT_DIR=$(realpath ${MY_PATH}/../../packages/rtc) -find ${OUTPUT_DIR} -type f -delete +find ${OUTPUT_DIR}/src/binding -type f -delete +find ${OUTPUT_DIR}/test/binding -type f -delete -# packages/rtc/src/binding npm run build -- run \ --config ${MY_PATH}/config/binding_configs.yaml \ --output-dir=${OUTPUT_DIR} \ --cache \ -cd ${OUTPUT_DIR}/.. +cd ${OUTPUT_DIR} -npm run lint:fix +npm run lint:fix \ No newline at end of file