From 1fa6c2d13205f4c899465dafbcf2a736b9b79aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Sun, 16 Aug 2020 23:28:46 +0800 Subject: [PATCH 1/9] Update documentation comments --- src/src/Classes.ts | 663 +++++++++++---- src/src/Enums.ts | 994 +++++++++++----------- src/src/RtcEngine.native.ts | 1540 +++++++++++++++++++++-------------- src/src/RtcEvents.ts | 963 +++++++++++++++++++--- 4 files changed, 2791 insertions(+), 1369 deletions(-) diff --git a/src/src/Classes.ts b/src/src/Classes.ts index d5f8a7c3f..2b47a632f 100644 --- a/src/src/Classes.ts +++ b/src/src/Classes.ts @@ -19,21 +19,29 @@ import { /** * The user information, including the user ID and user account. - * @property uid: int | The user ID of a user. - * @property userAccount: string | The user account of a user. */ export interface UserInfo { + /** + * The user ID of a user. + */ uid: number + /** + * The user account of a user. + */ userAccount: string } /** * The video resolution. - * @property width: int | The video resolution on the horizontal axis. - * @property height: int | The video resolution on the vertical axis. */ export class VideoDimensions { + /** + * The video resolution on the horizontal axis. + */ width: number + /** + * The video resolution on the vertical axis. + */ height: number constructor(width: number, height: number) { @@ -44,23 +52,44 @@ export class VideoDimensions { /** * Definition of VideoEncoderConfiguration. - * @property dimensions: object | The video frame dimensions (px), which is used to specify the video quality and measured by the total number of pixels along a frame's width and height. The default value is 640 × 360. - * @property frameRate: int | The video frame rate (fps). The default value is 15. Users can either set the frame rate manually or choose from the following options. We do not recommend setting this to a value greater than 30. - * @property minFrameRate: int | The minimum video encoder frame rate (fps). The default value is Min(-1) (the SDK uses the lowest encoder frame rate). - * @property bitrate: int | Bitrate of the video (Kbps). Refer to the table below and set your bitrate. If you set a bitrate beyond the proper range, the SDK automatically adjusts it to a value within the range. - * @property minBitrate: int | The minimum encoding bitrate (Kbps). The Agora SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, Agora does not recommend changing this value. - * @property orientationMode: int | The orientation mode. - * @property degradationPrefer: int | The video encoding degradation preference under limited bandwidth. - * @property mirrorMode: int | Sets the mirror mode of the published local video stream. + * */ export class VideoEncoderConfiguration { + /** + * The video frame dimensions (px), which is used to specify the video quality and measured by the total number of pixels along a + * frame's width and height. The default value is 640 × 360. + */ dimensions?: VideoDimensions + /** + * The video frame rate (fps). The default value is 15. Users can either set the frame rate manually or choose from the following options. + * We do not recommend setting this to a value greater than 30. + */ frameRate?: VideoFrameRate + /** + * The minimum video encoder frame rate (fps). The default value is Min(-1) (the SDK uses the lowest encoder frame rate). + */ minFrameRate?: VideoFrameRate + /** + * Bitrate of the video (Kbps). Refer to the table below and set your bitrate. If you set a bitrate beyond the proper range, + * the SDK automatically adjusts it to a value within the range. + */ bitrate?: number + /** + * The minimum encoding bitrate (Kbps). The Agora SDK automatically adjusts the encoding bitrate to adapt to the network conditions. Using a value greater than the default value forces the video encoder to output high-quality images but may cause more packet loss and hence sacrifice the smoothness of the video transmission. That said, unless you have special requirements for image quality, + * Agora does not recommend changing this value. + */ minBitrate?: number + /** + * The orientation mode. + */ orientationMode?: VideoOutputOrientationMode + /** + * The video encoding degradation preference under limited bandwidth. + */ degradationPrefer?: DegradationPreference + /** + * Sets the mirror mode of the published local video stream. + */ mirrorMode?: VideoMirrorMode constructor({dimensions, frameRate, minFrameRate, bitrate, minBitrate, orientationMode, degradationPrefer, mirrorMode}: { dimensions?: VideoDimensions, frameRate?: VideoFrameRate, minFrameRate?: VideoFrameRate, bitrate?: number, minBitrate?: number, orientationMode?: VideoOutputOrientationMode, degradationPrefer?: DegradationPreference, mirrorMode?: VideoMirrorMode }) { @@ -77,15 +106,25 @@ export class VideoEncoderConfiguration { /** * Sets the image enhancement options. - * @property lighteningContrastLevel: int | The lightening contrast level. - * @property lighteningLevel: float | The brightness level. The value ranges between 0.0 (original) and 1.0. The default value is 0.7. - * @property smoothnessLevel: float | The sharpness level. The value ranges between 0.0 (original) and 1.0. The default value is 0.5. This parameter is usually used to remove blemishes. - * @property rednessLevel: float | The redness level. The value ranges between 0.0 (original) and 1.0. The default value is 0.1. This parameter adjusts the red saturation level. */ export class BeautyOptions { + /** + * The lightening contrast level. + */ lighteningContrastLevel?: LighteningContrastLevel + /** + * The brightness level. The value ranges between 0.0 (original) and 1.0. The default value is 0.7. + */ lighteningLevel?: number + /** + * The sharpness level. The value ranges between 0.0 (original) and 1.0. + * The default value is 0.5. This parameter is usually used to remove blemishes. + */ smoothnessLevel?: number + /** + * The redness level. The value ranges between 0.0 (original) and 1.0. + * The default value is 0.1. This parameter adjusts the red saturation level. + */ rednessLevel?: number constructor({lighteningContrastLevel, lighteningLevel, smoothnessLevel, rednessLevel}: { lighteningContrastLevel?: LighteningContrastLevel, lighteningLevel?: number, smoothnessLevel?: number, rednessLevel?: number }) { @@ -98,17 +137,27 @@ export class BeautyOptions { /** * Agora image properties. A class for setting the properties of the watermark and background images. - * @property url: string | HTTP/HTTPS URL address of the image on the broadcasting video. The maximum length of this parameter is 1024 bytes. - * @property x: int | Position of the image on the upper left of the broadcasting video on the horizontal axis. - * @property y: int | Position of the image on the upper left of the broadcasting video on the vertical axis. - * @property width: int | Width of the image on the broadcasting video. - * @property height: int | Height of the image on the broadcasting video. */ export class AgoraImage { + /** + * HTTP/HTTPS URL address of the image on the broadcasting video. The maximum length of this parameter is 1024 bytes. + */ url: string + /** + * Position of the image on the upper left of the broadcasting video on the horizontal axis. + */ x: number + /** + * Position of the image on the upper left of the broadcasting video on the vertical axis. + */ y: number + /** + * Width of the image on the broadcasting video. + */ width: number + /** + * Height of the image on the broadcasting video. + */ height: number constructor(url: string, x: number, y: number, width: number, height: number) { @@ -122,23 +171,39 @@ export class AgoraImage { /** * The transcodingUser class, which defines the audio and video properties in the CDN live. Agora supports a maximum of 17 transcoding users in a CDN live streaming channel. - * @property uid: int | ID of the user in the CDN live streaming. - * @property x: int | Horizontal position of the video frame of the user from the top left corner of the CDN live streaming. - * @property y: int | Vertical position of the video frame of the user from the top left corner of the CDN live streaming. - * @property width: int | Width of the video frame of the user on the CDN live streaming. The default value is 360. - * @property height: int | Height of the video frame of the user on the CDN live streaming. The default value is 640. - * @property zOrder: int | Layer position of video frame of the user on the CDN live streaming. The value ranges between 0 and 100. From v2.3.0, Agora SDK supports setting zOrder as 0. The smallest value is 0 (default value), which means that the video frame is at the bottom layer. The biggest value is 100, which means that the video frame is at the top layer. - * @property alpha: float | The transparency of the video frame of the user in the CDN live stream that ranges between 0.0 and 1.0. 0.0 means that the video frame is completely transparent and 1.0 means opaque. The default value is 1.0. - * @property audioChannel: int | The audio channel ranging between 0 and 5. The default value is 0. */ export class TranscodingUser { + /** + * ID of the user in the CDN live streaming. + */ uid: number + /** + * Horizontal position of the video frame of the user from the top left corner of the CDN live streaming. + */ x: number + /** + * Vertical position of the video frame of the user from the top left corner of the CDN live streaming. + */ y: number + /** + * Width of the video frame of the user on the CDN live streaming. The default value is 360. + */ width?: number + /** + * Height of the video frame of the user on the CDN live streaming. The default value is 640. + */ height?: number + /** + * Layer position of video frame of the user on the CDN live streaming. The value ranges between 0 and 100. From v2.3.0, Agora SDK supports setting zOrder as 0. The smallest value is 0 (default value), which means that the video frame is at the bottom layer. The biggest value is 100, which means that the video frame is at the top layer. + */ zOrder?: number + /** + * The transparency of the video frame of the user in the CDN live stream that ranges between 0.0 and 1.0. 0.0 means that the video frame is completely transparent and 1.0 means opaque. The default value is 1.0. + */ alpha?: number + /** + * The audio channel ranging between 0 and 5. The default value is 0. + */ audioChannel?: AudioChannel constructor(uid: number, x: number, y: number, {width, height, zOrder, alpha, audioChannel}: { width?: number, height?: number, zOrder?: number, alpha?: number, audioChannel?: AudioChannel }) { @@ -155,13 +220,20 @@ export class TranscodingUser { /** * Color. - * @property red: int | Red. - * @property green: int | Green. - * @property blue: int | Blue. + * */ export class Color { + /** + * Red. + */ red: number + /** + * Green. + */ green: number + /** + * Blue. + */ blue: number constructor(red: number, green: number, blue: number) { @@ -173,40 +245,80 @@ export class Color { /** * A class for managing user-specific CDN live audio/video transcoding settings. - * @property width: int | Width (pixel) of the video. The default value is 360. If you push video streams to the CDN, set the value of width × height to at least 64 × 64, or the SDK adjusts it to 64 x 64. If you push audio streams to the CDN, set the value of width × height to 0 × 0. - * @property height: int | Height (pixel) of the video. The default value is 640. If you push video streams to the CDN, set the value of width × height to at least 64 × 64, or the SDK adjusts it to 64 x 64. If you push audio streams to the CDN, set the value of width × height to 0 × 0. - * @property videoBitrate: int | Bitrate (Kbps) of the CDN live output video stream. The default value is 400. Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range. - * @property videoFramerate: int | Frame rate (fps) of the CDN live output video stream. The value range is [0, 30]. The default value is 15. Agora adjusts all values over 30 to 30. - * @property lowLatency: boolean | true: Low latency with unassured quality. false: (Default) High latency with assured quality. - * @property videoGop: int | Gop of the video frames in the CDN live stream. The default value is 30 fps. - * @property watermark: object | The watermark image added to the CDN live publishing stream. Ensure that the format of the image is PNG. Once a watermark image is added, the audience of the CDN live publishing stream can see it. - * @property backgroundImage: object | The background image added to the CDN live publishing stream. Once a background image is added, the audience of the CDN live publishing stream can see it. - * @property audioSampleRate: int | Self-defined audio-sample rate: AudioSampleRateType. - * @property audioBitrate: int | Bitrate (Kbps) of the CDN live audio output stream. The default value is 48 and the highest value is 128. - * @property audioChannels: int | Agora’s self-defined audio channel type. We recommend choosing 1 or 2. Special players are required if you choose 3, 4 or 5. - * @property audioCodecProfile: int | Audio codec profile type: AudioCodecProfileType. Set it as LC-AAC or HE-AAC. The default value is LC-AAC. - * @property videoCodecProfile: int | Video codec profile type: VideoCodecProfileType. Set it as BASELINE, MAIN, or HIGH (default). If you set this parameter to other values, Agora adjusts it to the default value HIGH. - * @property backgroundColor: int | Sets the background color. - * @property userConfigExtraInfo: string | Reserved property. Extra user-defined information to send the Supplemental Enhancement Information (SEI) for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes. - * @property transcodingUsers: array | An TranscodingUser object managing the user layout configuration in the CDN live stream. Agora supports a maximum of 17 transcoding users in a CDN live stream channel. + * */ export class LiveTranscoding { + /** + * Width (pixel) of the video. The default value is 360. If you push video streams to the CDN, set the value of width × height to at least 64 × 64, or the SDK adjusts it to 64 x 64. + * If you push audio streams to the CDN, set the value of width × height to 0 × 0. + */ width?: number + /** + * Height (pixel) of the video. The default value is 640. If you push video streams to the CDN, set the value of width × height to at least 64 × 64, or the SDK adjusts it to 64 x 64. + * If you push audio streams to the CDN, set the value of width × height to 0 × 0. + */ height?: number + /** + * Bitrate (Kbps) of the CDN live output video stream. The default value is 400. Set this parameter according to the Video Bitrate Table. If you set a bitrate beyond the proper range, + * the SDK automatically adapts it to a value within the range. + */ videoBitrate?: number + /** + * Frame rate (fps) of the CDN live output video stream. + * The value range is [0,30]. The default value is 15. Agora adjusts all values over 30 to 30. + */ videoFramerate?: VideoFrameRate - /** @deprecated */ + /** + * **Deprecated** + * - true: Low latency with unassured quality. + * - false: (Default) High latency with assured quality. + */ lowLatency?: boolean + /** + * Gop of the video frames in the CDN live stream. The default value is 30 fps. + */ videoGop?: number + /** + * The watermark image added to the CDN live publishing stream. Ensure that the format of the image is PNG. Once a watermark image is added, + * the audience of the CDN live publishing stream can see it. + */ watermark?: AgoraImage + /** + * The background image added to the CDN live publishing stream. Once a background image is added, + * the audience of the CDN live publishing stream can see it. + */ backgroundImage?: AgoraImage + /** + * Self-defined audio-sample rate: AudioSampleRateType. + */ audioSampleRate?: AudioSampleRateType + /** + * Bitrate (Kbps) of the CDN live audio output stream. The default value is 48 and the highest value is 128. + */ audioBitrate?: number + /** + * Agora self-defined audio channel type. We recommend choosing `1` or `2`. Special players are required if you choose `3`, `4` or `5`. + */ audioChannels?: AudioChannel + /** + * Audio codec profile type: AudioCodecProfileType. Set it as LC-AAC or HE-AAC. The default value is LC-AAC. + */ audioCodecProfile?: AudioCodecProfileType + /** + * Video codec profile type: VideoCodecProfileType. Set it as BASELINE, MAIN, or HIGH (default). If you set this parameter to other values, Agora adjusts it to the default value HIGH. + */ videoCodecProfile?: VideoCodecProfileType + /** + * Sets the background color. + */ backgroundColor?: Color + /** + * Reserved property. Extra user-defined information to send the Supplemental Enhancement Information (SEI) for the H.264/H.265 video stream to the CDN live client. Maximum length: 4096 Bytes. + */ userConfigExtraInfo?: string + /** + * An TranscodingUser object managing the user layout configuration in the CDN live stream. Agora supports a maximum of 17 transcoding users in a CDN live stream channel. + */ transcodingUsers: TranscodingUser[] constructor(transcodingUsers: TranscodingUser[], {width, height, videoBitrate, videoFramerate, lowLatency, videoGop, watermark, backgroundImage, audioSampleRate, audioBitrate, audioChannels, audioCodecProfile, videoCodecProfile, backgroundColor, userConfigExtraInfo}: { width?: number, height?: number, videoBitrate?: number, videoFramerate?: VideoFrameRate, lowLatency?: boolean, videoGop?: number, watermark?: AgoraImage, backgroundImage?: AgoraImage, audioSampleRate?: AudioSampleRateType, audioBitrate?: number, audioChannels?: AudioChannel, audioCodecProfile?: AudioCodecProfileType, videoCodecProfile?: VideoCodecProfileType, backgroundColor?: Color, userConfigExtraInfo?: string, }) { @@ -231,13 +343,19 @@ export class LiveTranscoding { /** * The ChannelMediaInfo class. - * @property channelName: string | The channel name. - * @property token: string | The token that enables the user to join the channel. - * @property uid: int | The user ID. */ export class ChannelMediaInfo { + /** + * The channel name. + */ channelName?: string + /** + * The token that enables the user to join the channel. + */ token?: string + /** + * The user ID. + */ uid: number constructor(uid: number, {channelName, token}: { channelName?: string, token?: string }) { @@ -249,11 +367,15 @@ export class ChannelMediaInfo { /** * The ChannelMediaRelayConfiguration class. - * @property srcInfo: object | Sets the information of the source channel. - * @property destInfos: array | Sets the information of the destination channel. */ export class ChannelMediaRelayConfiguration { + /** + * Sets the information of the source channel. + */ srcInfo: ChannelMediaInfo + /** + * Sets the information of the destination channel. + */ destInfos: ChannelMediaInfo[] constructor(srcInfo: ChannelMediaInfo, destInfos: ChannelMediaInfo[]) { @@ -264,15 +386,23 @@ export class ChannelMediaRelayConfiguration { /** * Lastmile probe configuration. - * @property probeUplink: boolean | Whether to probe uplink of lastmile. i.e., audience don't need probe uplink bandwidth. - * @property probeDownlink: boolean | Whether to probe downlink of lastmile. - * @property expectedUplinkBitrate: int | The expected maximum sending bitrate in bps in range of [100000, 5000000]. It is recommended to set this value according to the required bitrate of selected video profile. - * @property expectedDownlinkBitrate: int | The expected maximum receive bitrate in bps in range of [100000, 5000000]. */ export class LastmileProbeConfig { + /** + * Whether to probe uplink of lastmile. i.e., audience don't need probe uplink bandwidth. + */ probeUplink: boolean + /** + * Whether to probe downlink of lastmile. + */ probeDownlink: boolean + /** + * The expected maximum sending bitrate in bps in range of [100000,5000000]. It is recommended to set this value according to the required bitrate of selected video profile. + */ expectedUplinkBitrate: number + /** + * The expected maximum receive bitrate in bps in range of [100000,5000000]. + */ expectedDownlinkBitrate: number constructor(probeUplink: boolean, probeDownlink: boolean, expectedUplinkBitrate: number, expectedDownlinkBitrate: number) { @@ -285,15 +415,23 @@ export class LastmileProbeConfig { /** * The position and size of the watermark image. - * @property x: int | The horizontal offset from the top-left corner. - * @property y: int | The vertical offset from the top-left corner. - * @property width: int | The width (pixels) of the watermark image. - * @property height: int | The height (pixels) of the watermark image. */ export class Rectangle { + /** + * The horizontal offset from the top-left corner. + */ x: number + /** + * The vertical offset from the top-left corner. + */ y: number + /** + * The width (pixels) of the watermark image. + */ width: number + /** + * The height (pixels) of the watermark image. + */ height: number constructor(x: number, y: number, width: number, height: number) { @@ -306,13 +444,21 @@ export class Rectangle { /** * Agora watermark options. A class for setting the properties of watermark. - * @property visibleInPreview: boolean | Sets whether or not the watermark image is visible in the local video preview: true: (Default) The watermark image is visible in preview. false: The watermark image is not visible in preview. - * @property positionInLandscapeMode: object | The watermark position in the landscape mode. - * @property positionInPortraitMode: object | The watermark position in the portrait mode. */ export class WatermarkOptions { + /** + * Sets whether or not the watermark image is visible in the local video preview: + * - true: (Default) The watermark image is visible in preview. + * - false: The watermark image is not visible in preview. + */ visibleInPreview?: boolean + /** + * The watermark position in the landscape mode. + */ positionInLandscapeMode: Rectangle + /** + * The watermark position in the portrait mode. + */ positionInPortraitMode: Rectangle constructor(positionInLandscapeMode: Rectangle, positionInPortraitMode: Rectangle, visibleInPreview?: boolean) { @@ -324,23 +470,39 @@ export class WatermarkOptions { /** * Configuration of the imported live broadcast voice or video stream. - * @property width: int | Width of the added stream to the broadcast. The default value is 0, which is the same width as the original stream. - * @property height: int | Height of the added stream to the broadcast. The default value is 0, which is the same height as the original stream. - * @property videoGop: int | Video GOP of the added stream to the broadcast. The default value is 30 frames. - * @property videoFramerate: int | Video frame rate of the added stream to the broadcast. The default value is 15 fps. - * @property videoBitrate: int | Video bitrate of the added stream to the broadcast. The default value is 400 Kbps. - * @property audioSampleRate: int | Audio sample rate of the added stream to the broadcast: AudioSampleRateType. The default value is 44100 Hz. - * @property audioBitrate: int | Audio bitrate of the added stream to the broadcast. The default value is 48. - * @property audioChannels: int | Audio channels to add into the broadcast. The value ranges between 1 and 2. The default value is 1. */ export class LiveInjectStreamConfig { + /** + * Width of the added stream to the live interactive streaming. The default value is 0, which is the same width as the original stream. + */ width?: number + /** + * Height of the added stream to the live interactive streaming. The default value is 0, which is the same height as the original stream. + */ height?: number + /** + * Video GOP of the added stream to the live interactive streaming. The default value is 30 frames. + */ videoGop?: number + /** + * Video frame rate of the added stream to the live interactive streaming. The default value is 15 fps. + */ videoFramerate?: VideoFrameRate + /** + * Video bitrate of the added stream to the live interactive streaming. The default value is 400 Kbps. + */ videoBitrate?: number + /** + * Audio sample rate of the added stream to the live interactive streaming: AudioSampleRateType. The default value is 44100 Hz. + */ audioSampleRate?: AudioSampleRateType + /** + * Audio bitrate of the added stream to the live interactive streaming. The default value is 48. + */ audioBitrate?: number + /** + * Audio channels to add into the live interactive streaming. The value ranges between `1` and `2`. The default value is `1`. + */ audioChannels?: AudioChannel constructor({width, height, videoGop, videoFramerate, videoBitrate, audioSampleRate, audioBitrate, audioChannels}: { width?: number, height?: number, videoGop?: number, videoFramerate?: VideoFrameRate, videoBitrate?: number, audioSampleRate?: AudioSampleRateType, audioBitrate?: number, audioChannels?: AudioChannel }) { @@ -357,11 +519,15 @@ export class LiveInjectStreamConfig { /** * The definition of CameraCapturerConfiguration. - * @property preference: int | The camera capturer configuration. - * @property cameraDirection: int | The camera direction. */ export class CameraCapturerConfiguration { + /** + * The camera capturer configuration. + */ preference: CameraCaptureOutputPreference + /** + * The camera direction. + */ cameraDirection: CameraDirection constructor(preference: CameraCaptureOutputPreference, cameraDirection: CameraDirection) { @@ -372,11 +538,15 @@ export class CameraCapturerConfiguration { /** * The channel media options. - * @property autoSubscribeAudio: boolean | Determines whether to subscribe to audio streams when the user joins the channel. - * @property autoSubscribeVideo: boolean | Determines whether to subscribe to video streams when the user joins the channel. */ export class ChannelMediaOptions { + /** + * Determines whether to subscribe to audio streams when the user joins the channel. + */ autoSubscribeAudio: boolean + /** + * Determines whether to subscribe to video streams when the user joins the channel. + */ autoSubscribeVideo: boolean constructor(autoSubscribeAudio: boolean, autoSubscribeVideo: boolean) { @@ -387,225 +557,398 @@ export class ChannelMediaOptions { /** * Statistics of RTCEngine. - * @property totalDuration: int | Call duration in seconds, represented by an aggregate value. - * @property txBytes: int | Total number of bytes transmitted, represented by an aggregate value. - * @property rxBytes: int | Total number of bytes received, represented by an aggregate value. - * @property txAudioBytes: int | Total number of audio bytes sent (bytes), represented by an aggregate value. - * @property txVideoBytes: int | Total number of video bytes sent (bytes), represented by an aggregate value. - * @property rxAudioBytes: int | Total number of audio bytes received (bytes), represented by an aggregate value. - * @property rxVideoBytes: int | Total number of video bytes received (bytes), represented by an aggregate value. - * @property txKBitRate: int | Transmission bitrate in Kbps, represented by an instantaneous value. - * @property rxKBitRate: int | Receive bitrate (Kbps), represented by an instantaneous value. - * @property txAudioKBitRate: int | The transmission bitrate of the audio packet (Kbps), represented by an instantaneous value. - * @property rxAudioKBitRate: int | Audio receive bitrate (Kbps), represented by an instantaneous value. - * @property txVideoKBitRate: int | Video transmission bitrate (Kbps), represented by an instantaneous value. - * @property rxVideoKBitRate: int | Video receive bitrate (Kbps), represented by an instantaneous value. - * @property users: int | The number of users in the channel. - * @property lastmileDelay: int | Client-server latency. - * @property txPacketLossRate: int | The packet loss rate (%) from the local client to Agora's edge server, before network countermeasures. - * @property rxPacketLossRate: int | The packet loss rate (%) from Agora's edge server to the local client, before network countermeasures. - * @property cpuTotalUsage: float | System CPU usage (%). - * @property cpuAppUsage: float | Application CPU usage (%). - * @property gatewayRtt: int | The round-trip time delay from the client to the local router. - * @property memoryAppUsageRatio: float | The memory usage ratio of the app (%). - * @property memoryTotalUsageRatio: float | The memory usage ratio of the system (%). - * @property memoryAppUsageInKbytes: int | The memory usage of the app (KB). + * */ export interface RtcStats { + /** + * Call duration in seconds, represented by an aggregate value. + */ totalDuration: number + /** + * Total number of bytes transmitted, represented by an aggregate value. + */ txBytes: number + /** + * Total number of bytes received, represented by an aggregate value. + */ rxBytes: number + /** + * Total number of audio bytes sent (bytes), represented by an aggregate value. + */ txAudioBytes: number + /** + * Total number of video bytes sent (bytes), represented by an aggregate value. + */ txVideoBytes: number + /** + * Total number of audio bytes received (bytes), represented by an aggregate value. + */ rxAudioBytes: number + /** + * Total number of video bytes received (bytes), represented by an aggregate value. + */ rxVideoBytes: number + /** + * Transmission bitrate in Kbps, represented by an instantaneous value. + */ txKBitRate: number + /** + * Receive bitrate (Kbps), represented by an instantaneous value. + */ rxKBitRate: number + /** + * The transmission bitrate of the audio packet (Kbps), represented by an instantaneous value. + */ txAudioKBitRate: number + /** + * Audio receive bitrate (Kbps), represented by an instantaneous value. + */ rxAudioKBitRate: number + /** + * Video transmission bitrate (Kbps), represented by an instantaneous value. + */ txVideoKBitRate: number + /** + * Video receive bitrate (Kbps), represented by an instantaneous value. + */ rxVideoKBitRate: number + /** + * The number of users in the channel. + */ users: number + /** + * Client-server latency. + */ lastmileDelay: number + /** + * The packet loss rate (%) from the local client to Agora's edge server, before network countermeasures. + */ txPacketLossRate: number + /** + * The packet loss rate (%) from Agora's edge server to the local client, before network countermeasures. + */ rxPacketLossRate: number + /** + * System CPU usage (%). + */ cpuTotalUsage: number + /** + * Application CPU usage (%). + */ cpuAppUsage: number + /** + * The round-trip time delay from the client to the local router. + */ gatewayRtt: number + /** + * The memory usage ratio of the app (%). + */ memoryAppUsageRatio: number + /** + * The memory usage ratio of the system (%). + */ memoryTotalUsageRatio: number + /** + * The memory usage of the app (KB). + */ memoryAppUsageInKbytes: number } /** * Properties of the audio volume information. An array containing the user ID and volume information for each speaker. - * @property uid: int | The user ID of the speaker. The uid of the local user is 0. - * @property volume: int | The sum of the voice volume and audio-mixing volume of the speaker. The value ranges between 0 (lowest volume) and 255 (highest volume). - * @property vad: int | Voice activity status of the local user. - * @property channelId: string | The channel ID, which indicates which channel the speaker is in. + * */ export interface AudioVolumeInfo { + /** + * The user ID of the speaker. The uid of the local user is 0. + */ uid: number + /** + * The sum of the voice volume and audio-mixing volume of the speaker. The value ranges between 0 (lowest volume) and 255 (highest volume). + */ volume: number + /** + * Voice activity status of the local user. + */ vad: number + /** + * The channel ID, which indicates which channel the speaker is in. + */ channelId: string } /** * Rect. - * @property left: int | Left. - * @property top: int | Top. - * @property right: int | Right. - * @property bottom: int | Bottom. + * */ export interface Rect { + /** + * Left. + */ left: number + /** + * Top. + */ top: number + /** + * Right. + */ right: number + /** + * Bottom. + */ bottom: number } /** * The one-way last-mile probe result. - * @property packetLossRate: int | The packet loss rate (%). - * @property jitter: int | The network jitter (ms). - * @property availableBandwidth: int | The estimated available bandwidth (bps). + * */ export interface LastmileProbeOneWayResult { + /** + * The packet loss rate (%). + */ packetLossRate: number + /** + * The network jitter (ms). + */ jitter: number + /** + * The estimated available bandwidth (bps). + */ availableBandwidth: number } /** * Statistics of the lastmile probe. - * @property state: int | The state of the probe test. - * @property rtt: int | The round-trip delay time (ms). - * @property uplinkReport: object | The uplink last-mile network report. - * @property downlinkReport: object | The downlink last-mile network report. + * */ export interface LastmileProbeResult { + /** + * The state of the probe test. + */ state: LastmileProbeResultState + /** + * The round-trip delay time (ms). + */ rtt: number + /** + * The uplink last-mile network report. + */ uplinkReport: LastmileProbeOneWayResult + /** + * The downlink last-mile network report. + */ downlinkReport: LastmileProbeOneWayResult } /** * Statistics of the local audio stream. - * @property numChannels: int | The number of channels. - * @property sentSampleRate: int | The sample rate (Hz). - * @property sentBitrate: int | The average sending bitrate (Kbps). + * */ export interface LocalAudioStats { + /** + * The number of channels. + */ numChannels: number + /** + * The sample rate (Hz). + */ sentSampleRate: number + /** + * The average sending bitrate (Kbps). + */ sentBitrate: number } /** * Statistics of the local video. - * @property sentBitrate: int | Bitrate (Kbps) sent in the reported interval, which does not include the bitrate of the re-transmission video after the packet loss. - * @property sentFrameRate: int | Frame rate (fps) sent in the reported interval, which does not include the frame rate of the re-transmission video after the packet loss. - * @property encoderOutputFrameRate: int | The encoder output frame rate (fps) of the local video. - * @property rendererOutputFrameRate: int | The renderer output frame rate (fps) of the local video. - * @property targetBitrate: int | The target bitrate (Kbps) of the current encoder. This value is estimated by the SDK based on the current network conditions. - * @property targetFrameRate: int | The target frame rate (fps) of the current encoder. - * @property qualityAdaptIndication: int | Quality change of the local video in terms of target frame rate and target bit rate since last count. - * @property encodedBitrate: int | The encoding bitrate (Kbps), which does not include the bitrate of the re-transmission video after packet loss. - * @property encodedFrameWidth: int | The width of the encoding frame (px). - * @property encodedFrameHeight: int | The height of the encoding frame (px). - * @property encodedFrameCount: int | The value of the sent frame rate, represented by an aggregate value. - * @property codecType: int | The codec type of the local video. + * */ export interface LocalVideoStats { + /** + * Bitrate (Kbps) sent in the reported interval, which does not include the bitrate of the re-transmission video after the packet loss. + */ sentBitrate: number + /** + * Frame rate (fps) sent in the reported interval, which does not include the frame rate of the re-transmission video after the packet loss. + */ sentFrameRate: number + /** + * The encoder output frame rate (fps) of the local video. + */ encoderOutputFrameRate: number + /** + * The renderer output frame rate (fps) of the local video. + */ rendererOutputFrameRate: number + /** + * The target bitrate (Kbps) of the current encoder. This value is estimated by the SDK based on the current network conditions. + */ targetBitrate: number + /** + * The target frame rate (fps) of the current encoder. + */ targetFrameRate: number + /** + * Quality change of the local video in terms of target frame rate and target bit rate since last count. + */ qualityAdaptIndication: VideoQualityAdaptIndication + /** + * The encoding bitrate (Kbps), which does not include the bitrate of the re-transmission video after packet loss. + */ encodedBitrate: number + /** + * The width of the encoding frame (px). + */ encodedFrameWidth: number + /** + * The height of the encoding frame (px). + */ encodedFrameHeight: number + /** + * The value of the sent frame rate, represented by an aggregate value. + */ encodedFrameCount: number + /** + * The codec type of the local video. + */ codecType: VideoCodecType } /** * Statistics of the remote audio. - * @property uid: int | User ID of the user sending the audio streams. - * @property quality: int | Audio quality received by the user. - * @property networkTransportDelay: int | Network delay (ms) from the sender to the receiver. - * @property jitterBufferDelay: int | Network delay (ms) from the receiver to the jitter buffer. - * @property audioLossRate: int | Packet loss rate in the reported interval. - * @property numChannels: int | The number of channels. - * @property receivedSampleRate: int | The sample rate (Hz) of the received audio stream in the reported interval. - * @property receivedBitrate: int | The average bitrate (Kbps) of the received audio stream in the reported interval. - * @property totalFrozenTime: int | The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In the reported interval, audio freeze occurs when the audio frame loss rate reaches 4%. totalFrozenTime = The audio freeze time × 2 × 1000 (ms). - * @property frozenRate: int | The total audio freeze time as a percentage (%) of the total time when the audio is available. - * @property totalActiveTime: int | The total time (ms) when the remote user in the Communication profile or the remote broadcaster in the Live-broadcast profile neither stops sending the audio stream nor disables the audio module after joining the channel. + * */ export interface RemoteAudioStats { + /** + * User ID of the user sending the audio streams. + */ uid: number + /** + * Audio quality received by the user. + */ quality: NetworkQuality + /** + * Network delay (ms) from the sender to the receiver. + */ networkTransportDelay: number + /** + * Network delay (ms) from the receiver to the jitter buffer. + */ jitterBufferDelay: number + /** + * Packet loss rate in the reported interval. + */ audioLossRate: number + /** + * The number of channels. + */ numChannels: number + /** + * The sample rate (Hz) of the received audio stream in the reported interval. + */ receivedSampleRate: number + /** + * The average bitrate (Kbps) of the received audio stream in the reported interval. + */ receivedBitrate: number + /** + * The total freeze time (ms) of the remote audio stream after the remote user joins the channel. In the reported interval, audio freeze occurs when the audio frame loss rate reaches 4%. totalFrozenTime = The audio freeze time × 2 × 1000 (ms). + */ totalFrozenTime: number + /** + * The total audio freeze time as a percentage (%) of the total time when the audio is available. + */ frozenRate: number + /** + * The total time (ms) when the remote user in the `Communication` profile or the remote broadcaster in the `LiveBroadcasting` profile neither stops sending the audio stream nor disables the audio module after joining the channel. + */ totalActiveTime: number } /** * Statistics of the remote video. - * @property uid: int | User ID of the user sending the video streams. - * @property delay: int | Time delay (ms). In scenarios where audio and video is synchronized, you can use the value of networkTransportDelay and jitterBufferDelay in RemoteAudioStats to know the delay statistics of the remote video. - * @property width: int | Width (pixels) of the remote video. - * @property height: int | Height (pixels) of the remote video. - * @property receivedBitrate: int | Bitrate (Kbps) received in the reported interval. - * @property decoderOutputFrameRate: int | The decoder output frame rate (fps) of the remote video. - * @property rendererOutputFrameRate: int | The renderer output frame rate (fps) of the remote video. - * @property packetLossRate: int | Packet loss rate (%) of the remote video stream after network countermeasures. - * @property rxStreamType: int | Video stream type (high-stream or low-stream). - * @property totalFrozenTime: int | The total freeze time (ms) of the remote video stream after the remote user joins the channel. - * @property frozenRate: int | The total video freeze time as a percentage (%) of the total time when the video is available. - * @property totalActiveTime: int | The total time (ms) when the remote user in the Communication profile or the remote broadcaster in the Live-broadcast profile neither stops sending the video stream nor disables the video module after joining the channel. + * */ export interface RemoteVideoStats { - uid: number + /** - * @deprecated + * User ID of the user sending the video streams. + */uid: number + /** + * **Deprecated** + * Time delay (ms). In scenarios where audio and video is synchronized, you can use the value of networkTransportDelay and jitterBufferDelay + * in RemoteAudioStats to know the delay statistics of the remote video. */ delay: number + /** + * Width (pixels) of the remote video. + */ width: number + /** + * Height (pixels) of the remote video. + */ height: number + /** + * Bitrate (Kbps) received in the reported interval. + */ receivedBitrate: number + /** + * The decoder output frame rate (fps) of the remote video. + */ decoderOutputFrameRate: number + /** + * The renderer output frame rate (fps) of the remote video. + */ rendererOutputFrameRate: number + /** + * Packet loss rate (%) of the remote video stream after network countermeasures. + */ packetLossRate: number + /** + * Video stream type (high-stream or low-stream). + */ rxStreamType: VideoStreamType + /** + * The total freeze time (ms) of the remote video stream after the remote user joins the channel. + */ totalFrozenTime: number + /** + * The total video freeze time as a percentage (%) of the total time when the video is available. + */ frozenRate: number + /** + * The total time (ms) when the remote user in the Communication profile or the remote broadcaster in the Live-broadcast profile neither stops sending the video stream nor disables the video module after joining the channel. + */ totalActiveTime: number } /** * The information of the detected human face. - * @property x: int | The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin. - * @property y: int | The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin. - * @property width: int | The width (px) of the human face in the captured video. - * @property height: int | The height (px) of the human face in the captured video. - * @property distance: int | The distance (cm) between the human face and the screen. + * */ export interface FacePositionInfo { + /** + * The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, + * the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin. + */ x: number + /** + * The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, + * the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin. + */ y: number + /** + * The width (px) of the human face in the captured video. + */ width: number + /** + * The height (px) of the human face in the captured video. + */ height: number + /** + * The distance (cm) between the human face and the screen. + */ distance: number } diff --git a/src/src/Enums.ts b/src/src/Enums.ts index 8ce401738..fc15e44ab 100644 --- a/src/src/Enums.ts +++ b/src/src/Enums.ts @@ -12,7 +12,7 @@ export enum IPAreaCode { */ AREA_NA = 1 << 1, /** - * AREA_EUR + * Europe */ AREA_EUR = 1 << 2, /** @@ -31,11 +31,11 @@ export enum IPAreaCode { */ export enum AudioCodecProfileType { /** - * (Default) LC-AAC, the low-complexity audio codec profile. + * 0: (Default) LC-AAC, which is the low-complexity audio codec profile. */ LCAAC = 0, /** - * HE-AAC, the high-efficiency audio codec profile. + * 1: HE-AAC, which is the high-efficiency audio codec profile. */ HEAAC = 1, } @@ -46,43 +46,43 @@ export enum AudioCodecProfileType { */ export enum AudioEqualizationBandFrequency { /** - * 31 Hz. + * 0: 31 Hz. */ Band31 = 0, /** - * 62 Hz. + * 1: 62 Hz. */ Band62 = 1, /** - * 125 Hz. + * 2: 125 Hz. */ Band125 = 2, /** - * 250 Hz. + * 3: 250 Hz. */ Band250 = 3, /** - * 500 Hz. + * 4: 500 Hz. */ Band500 = 4, /** - * 1 kHz. + * 5: 1 kHz. */ Band1K = 5, /** - * 2 kHz. + * 6: 2 kHz. */ Band2K = 6, /** - * 4 kHz. + * 7: 4 kHz. */ Band4K = 7, /** - * 8 kHz. + * 8: 8 kHz. */ Band8K = 8, /** - * 16 kHz. + * 9: 16 kHz. */ Band16K = 9, } @@ -93,27 +93,27 @@ export enum AudioEqualizationBandFrequency { */ export enum AudioLocalError { /** - * The local audio is normal. + * 0: The local audio is normal. */ Ok = 0, /** - * No specified reason for the local audio failure. + * 1: No specified reason for the local audio failure. */ Failure = 1, /** - * No permission to use the local audio device. + * 2: No permission to use the local audio device. */ DeviceNoPermission = 2, /** - * The microphone is in use. + * 3: The microphone is in use. */ DeviceBusy = 3, /** - * The local audio recording fails. Check whether the recording device is working properly. + * 4: The local audio recording fails. Check whether the recording device is working properly. */ RecordFailure = 4, /** - * The local audio encoding fails. + * 5: The local audio encoding fails. */ EncodeFailure = 5, } @@ -124,19 +124,19 @@ export enum AudioLocalError { */ export enum AudioLocalState { /** - * The local audio is in the initial state. + * 0: The local audio is in the initial state. */ Stopped = 0, /** - * The recording device starts successfully. + * 1: The recording device starts successfully. */ Recording = 1, /** - * The first audio frame encodes successfully. + * 2: The first audio frame encodes successfully. */ Encoding = 2, /** - * The local audio fails to start. + * 3: The local audio fails to start. */ Failed = 3, } @@ -147,19 +147,19 @@ export enum AudioLocalState { */ export enum AudioMixingErrorCode { /** - * The SDK cannot open the audio mixing file. + * 701: The SDK cannot open the audio mixing file. */ CanNotOpen = 701, /** - * The SDK opens the audio mixing file too frequently. + * 702: The SDK opens the audio mixing file too frequently. */ TooFrequentCall = 702, /** - * The opening of the audio mixing file is interrupted. + * 703: The opening of the audio mixing file is interrupted. */ InterruptedEOF = 703, /** - * No error. + * 0: No error. */ OK = 0, } @@ -170,19 +170,19 @@ export enum AudioMixingErrorCode { */ export enum AudioMixingStateCode { /** - * The audio mixing file is playing. + * 710: The audio mixing file is playing. */ Playing = 710, /** - * The audio mixing file pauses playing. + * 711: The audio mixing file pauses playing. */ Paused = 711, /** - * The audio mixing file stops playing. + * 713: The audio mixing file stops playing. */ Stopped = 713, /** - * An exception occurs when playing the audio mixing file. + * 714: An exception occurs when playing the audio mixing file. */ Failed = 714, } @@ -193,31 +193,31 @@ export enum AudioMixingStateCode { */ export enum AudioOutputRouting { /** - * Default. + * -1: Default. */ Default = -1, /** - * Headset. + * 0: Headset. */ Headset = 0, /** - * Earpiece. + * 1: Earpiece. */ Earpiece = 1, /** - * Headset with no microphone. + * 2: Headset with no microphone. */ HeadsetNoMic = 2, /** - * Speakerphone. + * 3: Speakerphone. */ Speakerphone = 3, /** - * Loudspeaker. + * 4: Loudspeaker. */ Loudspeaker = 4, /** - * Bluetooth headset. + * 5: Bluetooth headset. */ HeadsetBluetooth = 5, } @@ -228,29 +228,29 @@ export enum AudioOutputRouting { */ export enum AudioProfile { /** - * Default audio profile. + * 0: Default audio profile. * - In the Communication profile: A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps. * - In the Live-broadcast profile: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 52 Kbps. */ Default = 0, /** - * A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps. + * 1: A sample rate of 32 KHz, audio encoding, mono, and a bitrate of up to 18 Kbps. */ SpeechStandard = 1, /** - * A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 48 Kbps. + * 2: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 48 Kbps. */ MusicStandard = 2, /** - * A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 56 Kbps. + * 3: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 56 Kbps. */ MusicStandardStereo = 3, /** - * A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 128 Kbps. + * 4: A sample rate of 48 KHz, music encoding, mono, and a bitrate of up to 128 Kbps. */ MusicHighQuality = 4, /** - * A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 192 Kbps. + * 5: A sample rate of 48 KHz, music encoding, stereo, and a bitrate of up to 192 Kbps. */ MusicHighQualityStereo = 5, } @@ -262,15 +262,15 @@ export enum AudioProfile { */ export enum AudioRawFrameOperationMode { /** - * Users only read the AudioFrame data without modifying anything. For example, when users acquire data with the Agora SDK then push the RTMP streams. + * 0: Users only read the AudioFrame data without modifying anything. For example, when users acquire data with the Agora SDK then push the RTMP streams. */ ReadOnly = 0, /** - * Users replace the AudioFrame data with their own data and pass them to the SDK for encoding. For example, when users acquire data. + * 1: Users replace the AudioFrame data with their own data and pass them to the SDK for encoding. For example, when users acquire data. */ WriteOnly = 1, /** - * Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing such as a voice change. + * 2: Users read the data from AudioFrame, modify it, and then play it. For example, when users have their own sound-effect processing module and perform some voice pre-processing such as a voice change. */ ReadWrite = 2, } @@ -280,15 +280,15 @@ export enum AudioRawFrameOperationMode { */ export enum AudioRecordingQuality { /** - * The sample rate is 32 KHz, and the file size is around 1.2 MB after 10 minutes of recording. + * 0: The sample rate is 32 KHz, and the file size is around 1.2 MB after 10 minutes of recording. */ Low = 0, /** - * The sample rate is 32 KHz, and the file size is around 2 MB after 10 minutes of recording. + * 1: The sample rate is 32 KHz, and the file size is around 2 MB after 10 minutes of recording. */ Medium = 1, /** - * The sample rate is 32 KHz, and the file size is around 3.75 MB after 10 minutes of recording. + * 2: The sample rate is 32 KHz, and the file size is around 3.75 MB after 10 minutes of recording. */ High = 2, } @@ -299,31 +299,31 @@ export enum AudioRecordingQuality { */ export enum AudioRemoteState { /** - * The remote audio is in the default state, probably due to: - * @see AudioRemoteStateReason.LocalMuted - * @see AudioRemoteStateReason.RemoteMuted - * @see AudioRemoteStateReason.RemoteOffline + * 0: The remote audio is in the default state, probably due to: + * - [`LocalMuted`]{@link AudioRemoteStateReason.LocalMuted} + * - [`RemoteMuted`]{@link AudioRemoteStateReason.RemoteMuted} + * - [`RemoteOffline`]{@link AudioRemoteStateReason.RemoteOffline} */ Stopped = 0, /** - * The first remote audio packet is received. + * 1: The first remote audio packet is received. */ Starting = 1, /** - * The remote audio stream is decoded and plays normally, probably due to: - * @see AudioRemoteStateReason.NetworkRecovery - * @see AudioRemoteStateReason.LocalUnmuted - * @see AudioRemoteStateReason.RemoteUnmuted + * 2: The remote audio stream is decoded and plays normally, probably due to: + * - [`NetworkRecovery`]{@link AudioRemoteStateReason.NetworkRecovery} + * - [`LocalUnmuted`]{@link AudioRemoteStateReason.LocalUnmuted} + * - [`RemoteUnmuted`]{@link AudioRemoteStateReason.RemoteUnmuted} */ Decoding = 2, /** - * The remote audio is frozen, probably due to: - * @see AudioRemoteStateReason.NetworkCongestion + * 3: The remote audio is frozen, probably due to: + * [`NetworkCongestion`]{@link AudioRemoteStateReason.NetworkCongestion} */ Frozen = 3, /** - * The remote audio fails to start, probably due to: - * @see AudioRemoteStateReason.Internal + * 4: The remote audio fails to start, probably due to: + * [`Internal`]{@link AudioRemoteStateReason.Internal} */ Failed = 4, } @@ -334,35 +334,35 @@ export enum AudioRemoteState { */ export enum AudioRemoteStateReason { /** - * Internal reasons. + * 0: Internal reasons. */ Internal = 0, /** - * Network congestion. + * 1: Network congestion. */ NetworkCongestion = 1, /** - * Network recovery. + * 2: Network recovery. */ NetworkRecovery = 2, /** - * The local user stops receiving the remote audio stream or disables the audio module. + * 3: The local user stops receiving the remote audio stream or disables the audio module. */ LocalMuted = 3, /** - * The local user resumes receiving the remote audio stream or enables the audio module. + * 4: The local user resumes receiving the remote audio stream or enables the audio module. */ LocalUnmuted = 4, /** - * The remote user stops sending the audio stream or disables the audio module. + * 5: The remote user stops sending the audio stream or disables the audio module. */ RemoteMuted = 5, /** - * The remote user resumes sending the audio stream or enables the audio module. + * 6: The remote user resumes sending the audio stream or enables the audio module. */ RemoteUnmuted = 6, /** - * The remote user leaves the channel. + * 7: The remote user leaves the channel. */ RemoteOffline = 7, } @@ -377,31 +377,31 @@ export enum AudioReverbPreset { */ Off = 0x00000000, /** - * Pop music + * Pop music. */ Popular = 0x00000001, /** - * R&B + * R&B. */ RnB = 0x00000002, /** - * Rock music + * Rock music. */ Rock = 0x00000003, /** - * Hip-hop music + * Hip-hop music. */ HipHop = 0x00000004, /** - * Pop concert + * Pop concert. */ VocalConcert = 0x00000005, /** - * Karaoke + * Karaoke. */ KTV = 0x00000006, /** - * Recording studio + * Recording studio. */ Studio = 0x00000007, /** @@ -450,23 +450,23 @@ export enum AudioReverbPreset { */ export enum AudioReverbType { /** - * The level of the dry signal (dB). The value ranges between -20 and 10. + * 0: The level of the dry signal (dB). The value ranges between -20 and 10. */ DryLevel = 0, /** - * The level of the early reflection signal (wet signal) in dB. The value ranges between -20 and 10. + * 1: The level of the early reflection signal (wet signal) in dB. The value ranges between -20 and 10. */ WetLevel = 1, /** - * The room size of the reverberation. A larger room size means a stronger reverberation. The value ranges between 0 and 100. + * 2: The room size of the reverberation. A larger room size means a stronger reverberation. The value ranges between 0 and 100. */ RoomSize = 2, /** - * The length of the initial delay of the wet signal (ms). The value ranges between 0 and 200. + * 3: The length of the initial delay of the wet signal (ms). The value ranges between 0 and 200. */ WetDelay = 3, /** - * The reverberation strength. The value ranges between 0 and 100. + * 4: The reverberation strength. The value ranges between 0 and 100. */ Strength = 4, } @@ -477,15 +477,15 @@ export enum AudioReverbType { */ export enum AudioSampleRateType { /** - * 32 kHz. + * 32000: 32 kHz. */ Type32000 = 32000, /** - * 44.1 kHz. + * 44100: 44.1 kHz. */ Type44100 = 44100, /** - * 48 kHz. + * 48000: 48 kHz. */ Type48000 = 48000, } @@ -496,27 +496,27 @@ export enum AudioSampleRateType { */ export enum AudioScenario { /** - * Default. + * 0: Default. */ Default = 0, /** - * Entertainment scenario, supporting voice during gameplay. + * 1: Entertainment scenario, supporting voice during gameplay. */ ChatRoomEntertainment = 1, /** - * Education scenario, prioritizing fluency and stability. + * 2: Education scenario, prioritizing fluency and stability. */ Education = 2, /** - * Live gaming scenario, enabling the gaming audio effects in the speaker mode in a live broadcast scenario. Choose this scenario for high-fidelity music playback. + * 3: Live gaming scenario, enabling the gaming audio effects in the speaker mode in a live broadcast scenario. Choose this scenario for high-fidelity music playback. */ GameStreaming = 3, /** - * Showroom scenario, optimizing the audio quality with external professional equipment. + * 4: Showroom scenario, optimizing the audio quality with external professional equipment. */ ShowRoom = 4, /** - * Gaming scenario. + * 5: Gaming scenario. */ ChatRoomGaming = 5, } @@ -528,23 +528,23 @@ export enum AudioScenario { */ export enum AudioSessionOperationRestriction { /** - * No restriction, the SDK has full control of the audio session operations. + * 0: No restriction, the SDK has full control of the audio session operations. */ None = 0, /** - * The SDK does not change the audio session category. + * 1: The SDK does not change the audio session category. */ SetCategory = 1, /** - * The SDK does not change any setting of the audio session (category, mode, categoryOptions). + * 1 << 1: The SDK does not change any setting of the audio session (category, mode, categoryOptions). */ ConfigureSession = 1 << 1, /** - * The SDK keeps the audio session active when leaving a channel. + * 1 << 2: The SDK keeps the audio session active when leaving a channel. */ DeactivateSession = 1 << 2, /** - * The SDK does not configure the audio session anymore. + * 1 << 7: The SDK does not configure the audio session anymore. */ All = 1 << 7, } @@ -571,7 +571,7 @@ export enum AudioVoiceChanger { */ BabyGirl = 0x00000003, /** - * TBD + * The voice of a growling bear. */ ZhuBaJie = 0x00000004, /** @@ -638,20 +638,20 @@ export enum AudioVoiceChanger { */ export enum CameraCaptureOutputPreference { /** - * (default) Self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality. + * 0: (default) Self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality. */ Auto = 0, /** - * Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration. - * @see RtcEngine.setVideoEncoderConfiguration + * 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration. + * [`setVideoEncoderConfiguration`]{@link RtcEngine.setVideoEncoderConfiguration} */ Performance = 1, /** - * Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing. + * 2: Prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing. */ Preview = 2, /** - * Internal use only + * 3: Internal use only */ Unkown = 3, } @@ -662,11 +662,11 @@ export enum CameraCaptureOutputPreference { */ export enum CameraDirection { /** - * The rear camera. + * 0: The rear camera. */ Rear = 0, /** - * The front camera. + * 1: The front camera. */ Front = 1, } @@ -677,53 +677,53 @@ export enum CameraDirection { */ export enum ChannelMediaRelayError { /** - * The state is normal. + * 0: The state is normal. */ None = 0, /** - * An error occurs in the server response. + * 1: An error occurs in the server response. */ ServerErrorResponse = 1, /** - * No server response. You can call the leaveChannel method to leave the channel. - * @see RtcEngine.leaveChannel + * 2: No server response. You can call the leaveChannel method to leave the channel. + * [`leaveChannel`]{@link RtcEngine.leaveChannel} */ ServerNoResponse = 2, /** - * The SDK fails to access the service, probably due to limited resources of the server. + * 3: The SDK fails to access the service, probably due to limited resources of the server. */ NoResourceAvailable = 3, /** - * Fails to send the relay request. + * 4: Fails to send the relay request. */ FailedJoinSourceChannel = 4, /** - * Fails to accept the relay request. + * 5: Fails to accept the relay request. */ FailedJoinDestinationChannel = 5, /** - * The server fails to receive the media stream. + * 6: The server fails to receive the media stream. */ FailedPacketReceivedFromSource = 6, /** - * The server fails to send the media stream. + * 7: The server fails to send the media stream. */ FailedPacketSentToDestination = 7, /** - * The SDK disconnects from the server due to poor network connections. You can call the leaveChannel method to leave the channel. - * @see RtcEngine.leaveChannel + * 8: The SDK disconnects from the server due to poor network connections. You can call [`leaveChannel`]{@link RtcEngine.leaveChannel} to leave the channel. + * */ ServerConnectionLost = 8, /** - * An internal error occurs in the server. + * 9: An internal error occurs in the server. */ InternalError = 9, /** - * The token of the source channel has expired. + * 10: The token of the source channel has expired. */ SourceTokenExpired = 10, /** - * The token of the destination channel has expired. + * 11: The token of the destination channel has expired. */ DestinationTokenExpired = 11, } @@ -734,51 +734,51 @@ export enum ChannelMediaRelayError { */ export enum ChannelMediaRelayEvent { /** - * The user disconnects from the server due to poor network connections. + * 0: The user disconnects from the server due to poor network connections. */ Disconnect = 0, /** - * The network reconnects. + * 1: The network reconnects. */ Connected = 1, /** - * The user joins the source channel. + * 2: The user joins the source channel. */ JoinedSourceChannel = 2, /** - * The user joins the destination channel. + * 3: The user joins the destination channel. */ JoinedDestinationChannel = 3, /** - * The SDK starts relaying the media stream to the destination channel. + * 4: The SDK starts relaying the media stream to the destination channel. */ SentToDestinationChannel = 4, /** - * The server receives the video stream from the source channel. + * 5: The server receives the video stream from the source channel. */ ReceivedVideoPacketFromSource = 5, /** - * The server receives the audio stream from the source channel. + * 6: The server receives the audio stream from the source channel. */ ReceivedAudioPacketFromSource = 6, /** - * The destination channel is updated. + * 7: The destination channel is updated. */ UpdateDestinationChannel = 7, /** - * The destination channel update fails due to internal reasons. + * 8: The destination channel update fails due to internal reasons. */ UpdateDestinationChannelRefused = 8, /** - * The destination channel does not change, which means that the destination channel fails to be updated. + * 9: The destination channel does not change, which means that the destination channel fails to be updated. */ UpdateDestinationChannelNotChange = 9, /** - * The destination channel name is NULL. + * 10: The destination channel name is NULL. */ UpdateDestinationChannelIsNil = 10, /** - * The video profile is sent to the server. + * 11: The video profile is sent to the server. */ VideoProfileUpdate = 11, } @@ -789,19 +789,19 @@ export enum ChannelMediaRelayEvent { */ export enum ChannelMediaRelayState { /** - * The SDK is initializing. + * 0: The SDK is initializing. */ Idle = 0, /** - * The SDK tries to relay the media stream to the destination channel. + * 1: The SDK tries to relay the media stream to the destination channel. */ Connecting = 1, /** - * The SDK successfully relays the media stream to the destination channel. + * 2: The SDK successfully relays the media stream to the destination channel. */ Running = 2, /** - * A failure occurs. See the details in error. + * 3: A failure occurs. See the details in error. */ Failure = 3, } @@ -812,33 +812,33 @@ export enum ChannelMediaRelayState { */ export enum ChannelProfile { /** - * (Default) The Communication profile. + * 0: (Default) The Communication profile. * Use this profile in one-on-one calls or group calls, where all users can talk freely. */ Communication = 0, /** - * The Live-Broadcast profile. - * Users in a live-broadcast channel have a role as either broadcaster or audience. A broadcaster can both send and receive streams; an audience can only receive streams. + * 1: The Live-Broadcast profile. + * Users in a live-broadcast channel have a role as either host or audience. A host can both send and receive streams; an audience can only receive streams. */ LiveBroadcasting = 1, /** - * The Gaming profile. + * 2: The Gaming profile. * This profile uses a codec with a lower bitrate and consumes less power. Applies to the gaming scenario, where all game players can talk freely. */ Game = 2, } /** - * Client role in a live broadcast. + * Client role in the `LiveBroadcasting` profile. * @enum {number} */ export enum ClientRole { /** - * A broadcaster can both send and receive streams. + * 1: A host can both send and receive streams. */ Broadcaster = 1, /** - * The default role. An audience can only receive streams. + * 2: The default role. An audience can only receive streams. */ Audience = 2, } @@ -849,67 +849,67 @@ export enum ClientRole { */ export enum ConnectionChangedReason { /** - * The SDK is connecting to Agora’s edge server. + * 0: The SDK is connecting to Agora’s edge server. */ Connecting = 0, /** - * The SDK has joined the channel successfully. + * 1: The SDK has joined the channel successfully. */ JoinSuccess = 1, /** - * The connection between the SDK and Agora’s edge server is interrupted. + * 2: The connection between the SDK and Agora’s edge server is interrupted. */ Interrupted = 2, /** - * The connection between the SDK and Agora’s edge server is banned by Agora’s edge server. + * 3: The connection between the SDK and Agora’s edge server is banned by Agora’s edge server. */ BannedByServer = 3, /** - * The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. + * 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. */ JoinFailed = 4, /** - * The SDK has left the channel. + * 5: The SDK has left the channel. */ LeaveChannel = 5, /** - * The specified App ID is invalid. Try to rejoin the channel with a valid App ID. + * 6: The specified App ID is invalid. Try to rejoin the channel with a valid App ID. */ InvalidAppId = 6, /** - * The specified channel name is invalid. Try to rejoin the channel with a valid channel name. + * 7: The specified channel name is invalid. Try to rejoin the channel with a valid channel name. */ InvalidChannelName = 7, /** - * The generated token is invalid probably due to the following reasons: + * 8: The generated token is invalid probably due to the following reasons: * - The App Certificate for the project is enabled in Console, but you do not use Token when joining the channel. If you enable the App Certificate, you must use a token to join the channel. - * - The uid that you specify in the joinChannel method is different from the uid that you pass for generating the token. - * @see RtcEngine.joinChannel + * - The uid that you specify in the [`joinChannel`]{@link RtcEngine.joinChannel} method is different from the uid that you pass for generating the token. + * */ InvalidToken = 8, /** - * The token has expired. Generate a new token from your server. + * 9: The token has expired. Generate a new token from your server. */ TokenExpired = 9, /** - * The user is banned by the server. + * 10: The user is banned by the server. */ RejectedByServer = 10, /** - * The SDK tries to reconnect after setting a proxy server. + * 11: The SDK tries to reconnect after setting a proxy server. */ SettingProxyServer = 11, /** - * The token renews. + * 12: The token renews. */ RenewToken = 12, /** - * The client IP address has changed, probably due to a change of the network type, IP address, or network port. + * 13: The client IP address has changed, probably due to a change of the network type, IP address, or network port. */ ClientIpAddressChanged = 13, /** - * Timeout for the keep-alive of the connection between the SDK and Agora’s edge server. The connection state changes to: - * @see ConnectionStateType.Reconnecting + * 14: Timeout for the keep-alive of the connection between the SDK and Agora’s edge server. The connection state changes to: + * [`Reconnecting`]{@link ConnectionStateType.Reconnecting} */ KeepAliveTimeout = 14, } @@ -920,45 +920,38 @@ export enum ConnectionChangedReason { */ export enum ConnectionStateType { /** - * The SDK is disconnected from Agora's edge server. - * - This is the initial state before joinChannel. - * @see RtcEngine.joinChannel - * - The SDK also enters this state when the app calls leaveChannel. - * @see RtcEngine.leaveChannel + * 1: The SDK is disconnected from Agora's edge server. + * - This is the initial state before [`joinChannel`]{@link RtcEngine.joinChannel}. + * - The SDK also enters this state when the app calls [`leaveChannel`]{@link RtcEngine.leaveChannel}. + * */ Disconnected = 1, /** - * The SDK is connecting to Agora's edge server. - * - When the app calls joinChannel, the SDK starts to establish a connection to the specified channel, triggers the onConnectionStateChanged callback, and switches to the Connecting state. - * @see RtcEngine.joinChannel - * @see RtcEngineEvents.onConnectionStateChanged - * @see ConnectionStateType.Connecting - * - When the SDK successfully joins the channel, the SDK triggers the onConnectionStateChanged callback and switches to the Connected state. - * @see RtcEngineEvents.onConnectionStateChanged - * @see ConnectionStateType.Connected - * - After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the onJoinChannelSuccess callback. - * @see RtcEngineEvents.onJoinChannelSuccess + * 2: The SDK is connecting to Agora's edge server. + * - When the app calls [`joinChannel`]{@link RtcEngine.joinChannel}, the SDK starts to establish a connection to the specified channel, triggers the [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback, and switches to the [`Connecting`]{@link ConnectionStateType.Connecting} state. + * - When the SDK successfully joins the channel, the SDK triggers the [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback and switches to the [`Connected`]{@link ConnectionStateType.Connected} state. + * - After the SDK joins the channel and when it finishes initializing the media engine, the SDK triggers the [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callback. + * */ Connecting = 2, /** - * The SDK is connected to Agora's edge server and joins a channel. You can now publish or subscribe to a media stream in the channel. + * 3: The SDK is connected to Agora's edge server and joins a channel. You can now publish or subscribe to a media stream in the channel. * If the connection to the channel is lost because, for example, the network is down or switched, the SDK automatically tries to reconnect and triggers: - * - The onConnectionStateChanged callback, and switches to the Reconnecting state. - * @see RtcEngineEvents.onConnectionStateChanged - * @see ConnectionStateType.Reconnecting + * - The [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback, and switches to the [`Reconnecting`]{@link ConnectionStateType.Reconnecting} state. + * */ Connected = 3, /** - * The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. - * - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora’s edge server, the SDK triggers the onConnectionLost callback, stays in the Reconnecting state, and keeps rejoining the channel. - * @see RtcEngineEvents.onConnectionLost - * - If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora’s edge server, the SDK triggers the onConnectionStateChanged callback, switches to the Failed state, and stops rejoining the channel. - * @see RtcEngineEvents.onConnectionStateChanged - * @see ConnectionStateType.Failed + * 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. + * - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora’s edge server, the SDK triggers the [`ConnectionLost`]{@link RtcEngineEvents.ConnectionLost} callback, stays in the [`Reconnecting`]{@link ConnectionStateType.Reconnecting} state, and keeps rejoining the channel. + * + * - If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora’s edge server, the SDK triggers the [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback, switches to the Failed state, and stops rejoining the channel. + * [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} + * @see [`Failed`]{@link ConnectionStateType.Failed} */ Reconnecting = 4, /** - * The SDK fails to connect to Agora's edge server or join the channel. + * 5: The SDK fails to connect to Agora's edge server or join the channel. * You must call leaveChannel to leave this state, and call joinChannel again to rejoin the channel. * @see RtcEngine.leaveChannel * @see RtcEngine.joinChannel @@ -974,15 +967,15 @@ export enum ConnectionStateType { */ export enum DegradationPreference { /** - * (Default) Degrades the frame rate to guarantee the video quality. + * 0: (Default) Degrades the frame rate to guarantee the video quality. */ MaintainQuality = 0, /** - * Degrades the video quality to guarantee the frame rate. + * 1: Degrades the video quality to guarantee the frame rate. */ MaintainFramerate = 1, /** - * Reserved for future use. + * 2: Reserved for future use. */ Balanced = 2, } @@ -1012,19 +1005,19 @@ export enum EncryptionMode { */ export enum ErrorCode { /** - * No error occurs. + * 0: No error occurs. */ NoError = 0, /** - * A general error occurs (no specified reason). + * 1: A general error occurs (no specified reason). */ Failed = 1, /** - * An invalid parameter is used. For example, the specific channel name includes illegal characters. + * 2: An invalid parameter is used. For example, the specific channel name includes illegal characters. */ InvalidArgument = 2, /** - * The SDK module is not ready. + * 3: The SDK module is not ready. * Possible solutions: * - Check the audio device. * - Check the completeness of the app. @@ -1032,324 +1025,316 @@ export enum ErrorCode { */ NotReady = 3, /** - * The current state of the SDK does not support this function. + * 4: The current state of the SDK does not support this function. */ NotSupported = 4, /** - * The request is rejected. This is for internal SDK use only, and is not returned to the app through any method or callback. + * 5: The request is rejected. This is for internal SDK use only, and is not returned to the app through any method or callback. */ Refused = 5, /** - * The buffer size is not big enough to store the returned data. + * 6: The buffer size is not big enough to store the returned data. */ BufferTooSmall = 6, /** - * The SDK is not initialized before calling this method. + * 7: The SDK is not initialized before calling this method. */ NotInitialized = 7, /** - * No permission exists. Check if the user has granted access to the audio or video device. + * 9: No permission exists. Check if the user has granted access to the audio or video device. */ NoPermission = 9, /** - * An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (over 10 seconds) for the SDK to process. + * 10: An API method timeout occurs. Some API methods require the SDK to return the execution result, and this error occurs if the request takes too long (over 10 seconds) for the SDK to process. */ TimedOut = 10, /** - * The request is canceled. This is for internal SDK use only, and is not returned to the app through any method or callback. + * 11: The request is canceled. This is for internal SDK use only, and is not returned to the app through any method or callback. */ Canceled = 11, /** - * The method is called too often. This is for internal SDK use only, and is not returned to the app through any method or callback. + * 12: The method is called too often. This is for internal SDK use only, and is not returned to the app through any method or callback. */ TooOften = 12, /** - * The SDK fails to bind to the network socket. This is for internal SDK use only, and is not returned to the app through any method or callback. + * 13: The SDK fails to bind to the network socket. This is for internal SDK use only, and is not returned to the app through any method or callback. */ BindSocket = 13, /** - * The network is unavailable. This is for internal SDK use only, and is not returned to the app through any method or callback. + * 14: The network is unavailable. This is for internal SDK use only, and is not returned to the app through any method or callback. */ NetDown = 14, /** - * No network buffers are available. This is for internal SDK use only, and is not returned to the app through any method or callback. + * 15: No network buffers are available. This is for internal SDK use only, and is not returned to the app through any method or callback. */ NoBufs = 15, /** - * The request to join the channel is rejected. + * 17: The request to join the channel is rejected. * Possible reasons are: - * - The user is already in the channel, and still calls the API method to join the channel, for example, joinChannel - * @see RtcEngine.joinChannel + * - The user is already in the channel, and still calls the API method to join the channel, for example, [`joinChannel`]{@link RtcEngine.joinChannel} * - The user tries joining the channel during the echo test. Please join the channel after the echo test ends. */ JoinChannelRejected = 17, /** - * The request to leave the channel is rejected. + * 18: The request to leave the channel is rejected. * Possible reasons are: - * - The user left the channel and still calls the API method to leave the channel, for example, leaveChannel. - * @see RtcEngine.leaveChannel + * - The user left the channel and still calls the API method to leave the channel, for example, [`leaveChannel`]{@link RtcEngine.leaveChannel}. * - The user has not joined the channel and calls the API method to leave the channel. */ LeaveChannelRejected = 18, /** - * The resources are occupied and cannot be used. + * 19: The resources are occupied and cannot be used. */ AlreadyInUse = 19, /** - * The SDK gave up the request due to too many requests. + * 20: The SDK gave up the request due to too many requests. */ Abort = 20, /** - * In Windows, specific firewall settings cause the SDK to fail to initialize and crash. + * 21: In Windows, specific firewall settings cause the SDK to fail to initialize and crash. */ InitNetEngine = 21, /** - * The app uses too much of the system resources and the SDK fails to allocate the resources. + * 22: The app uses too much of the system resources and the SDK fails to allocate the resources. */ ResourceLimited = 22, /** - * The specified App ID is invalid. Please try to rejoin the channel with a valid App ID. + * 101: The specified App ID is invalid. Please try to rejoin the channel with a valid App ID. */ InvalidAppId = 101, /** - * The specified channel name is invalid. Please try to rejoin the channel with a valid channel name. + * 102: The specified channel name is invalid. Please try to rejoin the channel with a valid channel name. */ InvalidChannelId = 102, /** - * The token expired. DEPRECATED as of v2.4.1. Use TokenExpired(9) in the reason parameter of onConnectionStateChanged. - * @see ConnectionChangedReason.TokenExpired - * @see RtcEngineEvents.onConnectionStateChanged + * 109: The token expired. + * **DEPRECATED** as of v2.4.1. Use [`TokenExpired`]{@link ConnectionChangedReason.TokenExpired} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. + * * Possible reasons are: * - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the token to access the Agora service within five minutes after the token is generated. If the user does not access the Agora service after five minutes, this token is no longer valid. * - Call Expiration Timestamp expired: The timestamp is the exact time when a user can no longer use the Agora service (for example, when a user is forced to leave an ongoing call). When a value is set for the Call Expiration Timestamp, it does not mean that the token will expire, but that the user will be banned from the channel. - * @deprecated + * */ TokenExpired = 109, /** - * The token is invalid. DEPRECATED as of v2.4.1. Use InvalidToken(8) in the reason parameter of onConnectionStateChanged. - * @see ConnectionChangedReason.InvalidToken - * @see RtcEngineEvents.onConnectionStateChanged + * 110: The token is invalid. + * **DEPRECATED** as of v2.4.1. Use [`InvalidToken`]{@link ConnectionChangedReason.InvalidToken} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. + * * Possible reasons are: * - The App Certificate for the project is enabled in Console, but the user is using the App ID. Once the App Certificate is enabled, the user must use a token. - * - The uid is mandatory, and users must set the same uid as the one set in the joinChannel method. - * @see RtcEngine.joinChannel - * @deprecated + * - The uid is mandatory, and users must set the same uid as the one set in the [`joinChannel`]{@link RtcEngine.joinChannel} method. + * */ InvalidToken = 110, /** - * The Internet connection is interrupted. This applies to the Agora Web SDK only. + * 111: The Internet connection is interrupted. This applies to the Agora Web SDK only. */ ConnectionInterrupted = 111, /** - * The Internet connection is lost. This applies to the Agora Web SDK only. + * 112: The Internet connection is lost. This applies to the Agora Web SDK only. */ ConnectionLost = 112, /** - * The user is not in the channel when calling the sendStreamMessage or getUserInfoByUserAccount method. - * @see RtcEngine.sendStreamMessage - * @see RtcEngine.getUserInfoByUserAccount + * 113: The user is not in the channel when calling the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} or [`getUserInfoByUserAccount`]{@link RtcEngine.getUserInfoByUserAccount} method. */ NotInChannel = 113, /** - * The size of the sent data is over 1024 bytes when the user calls the sendStreamMessage method. - * @see RtcEngine.sendStreamMessage + * 114: The size of the sent data is over 1024 bytes when the user calls the sendStreamMessage method. + * @see [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} */ SizeTooLarge = 114, /** - * The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the sendStreamMessage method. - * @see RtcEngine.sendStreamMessage + * 115: The bitrate of the sent data exceeds the limit of 6 Kbps when the user calls the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} method. */ BitrateLimit = 115, /** - * Too many data streams (over five streams) are created when the user calls the createDataStream method. - * @see RtcEngine.createDataStream + * 116: Too many data streams (over five streams) are created when the user calls the [`createDataStream`]{@link RtcEngine.createDataStream} method. */ TooManyDataStreams = 116, /** - * Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel. + * 120: Decryption fails. The user may have used a different encryption password to join the channel. Check your settings or try rejoining the channel. */ DecryptionFailed = 120, /** - * The client is banned by the server. + * 123: The client is banned by the server. */ ClientIsBannedByServer = 123, /** - * Incorrect watermark file parameter. + * 124: Incorrect watermark file parameter. */ WatermarkParam = 124, /** - * Incorrect watermark file path. + * 125: Incorrect watermark file path. */ WatermarkPath = 125, /** - * Incorrect watermark file format. + * 126: Incorrect watermark file format. */ WatermarkPng = 126, /** - * Incorrect watermark file information. + * 127: Incorrect watermark file information. */ WatermarkInfo = 127, /** - * Incorrect watermark file data format. + * 128: Incorrect watermark file data format. */ WatermarkAGRB = 128, /** - * An error occurs in reading the watermark file. + * 129: An error occurs in reading the watermark file. */ WatermarkRead = 129, /** - * The encrypted stream is not allowed to publish. + * 130: The encrypted stream is not allowed to publish. */ EncryptedStreamNotAllowedPublish = 130, /** - * The user account is invalid. + * 134: The user account is invalid. */ InvalidUserAccount = 134, /** - * CDN related errors. Remove the original URL address and add a new one by calling the removePublishStreamUrl and addPublishStreamUrl methods. - * @see RtcEngine.removePublishStreamUrl - * @see RtcEngine.addPublishStreamUrl + * 151: CDN related errors. Remove the original URL address and add a new one by calling the [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl} and [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} methods. */ PublishStreamCDNError = 151, /** - * The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. + * 152: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */ PublishStreamNumReachLimit = 152, /** - * The host manipulates other hosts' URLs. Check your app logic. + * 153: The host manipulates other hosts' URLs. Check your app logic. */ PublishStreamNotAuthorized = 153, /** - * An error occurs in Agora’s streaming server. Call the addPublishStreamUrl method to publish the stream again. - * @see RtcEngine.addPublishStreamUrl + * 154: An error occurs in Agora’s streaming server. Call the [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} method to publish the stream again. */ PublishStreamInternalServerError = 154, /** - * The server fails to find the stream. + * 155: The server fails to find the stream. */ PublishStreamNotFound = 155, /** - * The format of the RTMP stream URL is not supported. Check whether the URL format is correct. + * 156: The format of the RTMP stream URL is not supported. Check whether the URL format is correct. */ PublishStreamFormatNotSuppported = 156, /** - * Fails to load the media engine. + * 1001: Fails to load the media engine. */ LoadMediaEngine = 1001, /** - * Fails to start the call after enabling the media engine. + * 1002: Fails to start the call after enabling the media engine. */ StartCall = 1002, /** - * Fails to start the camera. DEPRECATED as of v2.4.1. Use CaptureFailure(4) in the error parameter of onLocalVideoStateChanged. - * @see LocalVideoStreamError.CaptureFailure - * @see RtcEngineEvents.onLocalVideoStateChanged - * @deprecated + * 1003: Fails to start the camera. + * + * **DEPRECATED** as of v2.4.1. Use [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure} in the error parameter of [`LocalVideoStateChanged`]{@link RtcEngineEvents.LocalVideoStateChanged}. + * */ StartCamera = 1003, /** - * Fails to start the video rendering module. + * 1004: Fails to start the video rendering module. */ StartVideoRender = 1004, /** - * Audio Device Module: A general error occurs in the Audio Device Module (the reason is not classified specifically). Check if the audio device is used by another app, or try rejoining the channel. + * 1005: Audio Device Module: A general error occurs in the Audio Device Module (the reason is not classified specifically). Check if the audio device is used by another app, or try rejoining the channel. */ AdmGeneralError = 1005, /** - * Audio Device Module: An error occurs in using the Java resources. + * 1006: Audio Device Module: An error occurs in using the Java resources. */ AdmJavaResource = 1006, /** - * Audio Device Module: An error occurs in setting the sampling frequency. + * 1007: Audio Device Module: An error occurs in setting the sampling frequency. */ AdmSampleRate = 1007, /** - * Audio Device Module: An error occurs in initializing the playback device. + * 1008: Audio Device Module: An error occurs in initializing the playback device. */ AdmInitPlayout = 1008, /** - * Audio Device Module: An error occurs in starting the playback device. + * 1009: Audio Device Module: An error occurs in starting the playback device. */ AdmStartPlayout = 1009, /** - * Audio Device Module: An error occurs in stopping the playback device. + * 1010: Audio Device Module: An error occurs in stopping the playback device. */ AdmStopPlayout = 1010, /** - * Audio Device Module: An error occurs in initializing the recording device. + * 1011: Audio Device Module: An error occurs in initializing the recording device. */ AdmInitRecording = 1011, /** - * Audio Device Module: An error occurs in starting the recording device. + * 1012: Audio Device Module: An error occurs in starting the recording device. */ AdmStartRecording = 1012, /** - * Audio Device Module: An error occurs in stopping the recording device. + * 1013: Audio Device Module: An error occurs in stopping the recording device. */ AdmStopRecording = 1013, /** - * Audio Device Module: A playback error occurs. Check your playback device, or try rejoining the channel. + * 1015: Audio Device Module: A playback error occurs. Check your playback device, or try rejoining the channel. */ AdmRuntimePlayoutError = 1015, /** - * Audio Device Module: A recording error occurs. + * 1017: Audio Device Module: A recording error occurs. */ AdmRuntimeRecordingError = 1017, /** - * Audio Device Module: Fails to record. + * 1018: Audio Device Module: Fails to record. */ AdmRecordAudioFailed = 1018, /** - * Audio Device Module: Abnormal audio playback frequency. + * 1020: Audio Device Module: Abnormal audio playback frequency. */ AdmPlayAbnormalFrequency = 1020, /** - * Audio Device Module: Abnormal audio recording frequency. + * 1021: Audio Device Module: Abnormal audio recording frequency. */ AdmRecordAbnormalFrequency = 1021, /** - * Audio Device Module: An error occurs in initializing the loopback device. + * 1022: Audio Device Module: An error occurs in initializing the loopback device. */ AdmInitLoopback = 1022, /** - * Audio Device Module: An error occurs in starting the loopback device. + * 1023: Audio Device Module: An error occurs in starting the loopback device. */ AdmStartLoopback = 1023, /** - * Audio Device Module: An error occurs in no recording Permission. + * 1027: Audio Device Module: An error occurs in no recording Permission. */ AdmNoPermission = 1027, /** - * Audio Routing: Fails to route the audio to the connected Bluetooth device. The default route is used. + * 1030: Audio Routing: Fails to route the audio to the connected Bluetooth device. The default route is used. */ AudioBtScoFailed = 1030, /** - * Audio Device Module: No recording device exists. + * 1359: Audio Device Module: No recording device exists. */ AdmNoRecordingDevice = 1359, /** - * No playback device exists. + * 1360: No playback device exists. */ AdmNoPlayoutDevice = 1360, /** - * Video Device Module: The camera is unauthorized. + * 1501: Video Device Module: The camera is unauthorized. */ VdmCameraNotAuthorized = 1501, /** - * Video Device Module: An unknown error occurs. + * 1600: Video Device Module: An unknown error occurs. */ VcmUnknownError = 1600, /** - * Video Device Module: An error occurs in initializing the video encoder. + * 1601: Video Device Module: An error occurs in initializing the video encoder. */ VcmEncoderInitError = 1601, /** - * Video Device Module: An error occurs in video encoding. + * 1602: Video Device Module: An error occurs in video encoding. */ VcmEncoderEncodeError = 1602, /** - * Video Device Module: An error occurs in setting the video encoder. - * @deprecated + * 1603: Video Device Module: An error occurs in setting the video encoder. + * + * **DEPRECATED** + * This error code is deprecated. */ VcmEncoderSetError = 1603, } @@ -1360,47 +1345,47 @@ export enum ErrorCode { */ export enum InjectStreamStatus { /** - * The external video stream imported successfully. + * 0: The external video stream imported successfully. */ StartSuccess = 0, /** - * The external video stream already exists. + * 1: The external video stream already exists. */ StartAlreadyExists = 1, /** - * The external video stream import is unauthorized. + * 2: The external video stream import is unauthorized. */ StartUnauthorized = 2, /** - * Import external video stream timeout. + * 3: Import external video stream timeout. */ StartTimedout = 3, /** - * The external video stream failed to import. + * 4: The external video stream failed to import. */ StartFailed = 4, /** - * The external video stream imports successfully. + * 5: The external video stream imports successfully. */ StopSuccess = 5, /** - * No external video stream is found. + * 6: No external video stream is found. */ StopNotFound = 6, /** - * The external video stream is stopped from being unauthorized. + * 7: The external video stream is stopped from being unauthorized. */ StopUnauthorized = 7, /** - * Importing the external video stream timeout. + * 8: Importing the external video stream timeout. */ StopTimedout = 8, /** - * Importing the external video stream failed. + * 9: Importing the external video stream failed. */ StopFailed = 9, /** - * The external video stream import is interrupted. + * 10: The external video stream import is interrupted. */ Broken = 10, } @@ -1411,15 +1396,15 @@ export enum InjectStreamStatus { */ export enum LastmileProbeResultState { /** - * the last-mile network probe test is complete. + * 1: the last-mile network probe test is complete. */ Complete = 1, /** - * the last-mile network probe test is incomplete and the bandwidth estimation is not available, probably due to limited test resources. + * 2: the last-mile network probe test is incomplete and the bandwidth estimation is not available, probably due to limited test resources. */ IncompleteNoBwe = 2, /** - * the last-mile network probe test is not carried out, probably due to poor network conditions. + * 3: the last-mile network probe test is not carried out, probably due to poor network conditions. */ Unavailable = 3, } @@ -1430,15 +1415,15 @@ export enum LastmileProbeResultState { */ export enum LighteningContrastLevel { /** - * Low contrast level. + * 0: Low contrast level. */ Low = 0, /** - * (Default) Normal contrast level. + * 1: (Default) Normal contrast level. */ Normal = 1, /** - * High contrast level. + * 2: High contrast level. */ High = 2, } @@ -1449,27 +1434,27 @@ export enum LighteningContrastLevel { */ export enum LocalVideoStreamError { /** - * The local video is normal. + * 0: The local video is normal. */ OK = 0, /** - * No specified reason for the local video failure. + * 1: No specified reason for the local video failure. */ Failure = 1, /** - * No permission to use the local video device. + * 2: No permission to use the local video device. */ DeviceNoPermission = 2, /** - * The local video capturer is in use. + * 3: The local video capturer is in use. */ DeviceBusy = 3, /** - * The local video capture fails. Check whether the capturer is working properly. + * 4: The local video capture fails. Check whether the capturer is working properly. */ CaptureFailure = 4, /** - * The local video encoding fails. + * 5: The local video encoding fails. */ EncodeFailure = 5, } @@ -1480,19 +1465,19 @@ export enum LocalVideoStreamError { */ export enum LocalVideoStreamState { /** - * The local video is in the initial state. + * 0: The local video is in the initial state. */ Stopped = 0, /** - * The local video capturer starts successfully. + * 1: The local video capturer starts successfully. */ Capturing = 1, /** - * The first local video frame encodes successfully. + * 2: The first local video frame encodes successfully. */ Encoding = 2, /** - * The local video fails to start. + * 3: The local video fails to start. */ Failed = 3, } @@ -1503,27 +1488,27 @@ export enum LocalVideoStreamState { */ export enum LogFilter { /** - * Do not output any log information. + * 0: Do not output any log information. */ Off = 0, /** - * Output all log information. Set your log filter as debug if you want to get the most complete log file. + * 0x080f: Output all log information. Set your log filter as debug if you want to get the most complete log file. */ Debug = 0x080f, /** - * Output CRITICAL, ERROR, WARNING, and INFO level log information. We recommend setting your log filter as this level. + * 0x000f: Output CRITICAL, ERROR, WARNING, and INFO level log information. We recommend setting your log filter as this level. */ Info = 0x000f, /** - * Outputs CRITICAL, ERROR, and WARNING level log information. + * 0x000e: Outputs CRITICAL, ERROR, and WARNING level log information. */ Warning = 0x000e, /** - * Outputs CRITICAL and ERROR level log information. + * 0x000c: Outputs CRITICAL and ERROR level log information. */ Error = 0x000c, /** - * Outputs CRITICAL level log information. + * 0x0008: Outputs CRITICAL level log information. */ Critical = 0x0008, } @@ -1535,23 +1520,23 @@ export enum LogFilter { */ export enum MediaDeviceType { /** - * Unknown device. + * -1: Unknown device. */ AudioUnknown = -1, /** - * Audio playback device. + * 0: Audio playback device. */ AudioPlayout = 0, /** - * Audio recording device. + * 1: Audio recording device. */ AudioRecording = 1, /** - * Video render device. + * 2: Video render device. */ VideoRender = 2, /** - * Video capture device. + * 3: Video capture device. */ VideoCapture = 3, } @@ -1563,19 +1548,19 @@ export enum MediaDeviceType { */ export enum MediaType { /** - * No audio and video. + * 0: No audio and video. */ None = 0, /** - * Audio only. + * 1: Audio only. */ AudioOnly = 1, /** - * Video only. + * 2: Video only. */ VideoOnly = 2, /** - * Audio and video. + * 3: Audio and video. */ AudioAndVideo = 3, } @@ -1587,11 +1572,11 @@ export enum MediaType { */ export enum MetadataType { /** - * the metadata type is unknown. + * -1: the metadata type is unknown. */ Unknown = -1, /** - * the metadata type is video. + * 0: the metadata type is video. */ Video = 0, } @@ -1602,39 +1587,39 @@ export enum MetadataType { */ export enum NetworkQuality { /** - * The network quality is unknown. + * 0: The network quality is unknown. */ Unknown = 0, /** - * The network quality is excellent. + * 1: The network quality is excellent. */ Excellent = 1, /** - * The network quality is quite good, but the bitrate may be slightly lower than excellent. + * 2: The network quality is quite good, but the bitrate may be slightly lower than excellent. */ Good = 2, /** - * Users can feel the communication slightly impaired. + * 3: Users can feel the communication slightly impaired. */ Poor = 3, /** - * Users can communicate only not very smoothly. + * 4: Users can communicate only not very smoothly. */ Bad = 4, /** - * The network quality is so bad that users can hardly communicate. + * 5: The network quality is so bad that users can hardly communicate. */ VBad = 5, /** - * The network is disconnected and users cannot communicate at all. + * 6: The network is disconnected and users cannot communicate at all. */ Down = 6, /** - * Users cannot detect the network quality. (Not in use.) + * 7: Users cannot detect the network quality. (Not in use.) */ Unsupported = 7, /** - * Detecting the network quality. + * 8: Detecting the network quality. */ Detecting = 8, } @@ -1645,31 +1630,31 @@ export enum NetworkQuality { */ export enum NetworkType { /** - * The network type is unknown. + * -1: The network type is unknown. */ Unknown = -1, /** - * The SDK disconnects from the network. + * 0: The SDK disconnects from the network. */ Disconnected = 0, /** - * The network type is LAN. + * 1: The network type is LAN. */ LAN = 1, /** - * The network type is Wi-Fi (including hotspots). + * 2: The network type is Wi-Fi (including hotspots). */ WIFI = 2, /** - * The network type is mobile 2G. + * 3: The network type is mobile 2G. */ Mobile2G = 3, /** - * The network type is mobile 3G. + * 4: The network type is mobile 3G. */ Mobile3G = 4, /** - * The network type is mobile 4G. + * 5: The network type is mobile 4G. */ Mobile4G = 5, } @@ -1681,11 +1666,11 @@ export enum NetworkType { */ export enum RtcDefaultCameraPosition { /** - * Front camera + * 0: Front camera */ Front = 0, /** - * Rear camera + * 1: Rear camera */ Back = 1, } @@ -1697,11 +1682,11 @@ export enum RtcDefaultCameraPosition { */ export enum RtmpStreamLifeCycle { /** - * Bound to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds. + * 1: Bound to the channel lifecycle. If all hosts leave the channel, the CDN live streaming stops after 30 seconds. */ BindToChannel = 1, /** - * Bound to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately. + * 2: Bound to the owner of the RTMP stream. If the owner leaves the channel, the CDN live streaming stops immediately. */ BindToOwnner = 2, } @@ -1712,51 +1697,49 @@ export enum RtmpStreamLifeCycle { */ export enum RtmpStreamingErrorCode { /** - * The RTMP streaming publishes successfully. + * 0: The RTMP streaming publishes successfully. */ OK = 0, /** - * Invalid argument used. If, for example, you do not call the setLiveTranscoding method to configure the LiveTranscoding parameters before calling the addPublishStreamUrl method, the SDK returns this error. Check whether you set the parameters in the setLiveTranscoding method properly. - * @see RtcEngine.setLiveTranscoding - * @see RtcEngine.addPublishStreamUrl + * 1: Invalid argument used. If, for example, you do not call the [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} method to configure + * the `LiveTranscoding` parameters before calling the [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} method, the SDK returns this error. + * Check whether you set the parameters in the [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} method properly. */ InvalidParameters = 1, /** - * The RTMP streaming is encrypted and cannot be published. + * 2: The RTMP streaming is encrypted and cannot be published. */ EncryptedStreamNotAllowed = 2, /** - * Timeout for the RTMP streaming. Call the addPublishStreamUrl method to publish the streaming again. - * @see RtcEngine.addPublishStreamUrl + * 3: Timeout for the RTMP streaming. Call the [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} method to publish the streaming again. */ ConnectionTimeout = 3, /** - * An error occurs in Agora’s streaming server. Call the addPublishStreamUrl method to publish the streaming again. - * @see RtcEngine.addPublishStreamUrl + * 4: An error occurs in Agora’s streaming server. Call the [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} method to publish the streaming again. */ InternalServerError = 4, /** - * An error occurs in the RTMP server. + * 5: An error occurs in the RTMP server. */ RtmpServerError = 5, /** - * The RTMP streaming publishes too frequently. + * 6: The RTMP streaming publishes too frequently. */ TooOften = 6, /** - * The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. + * 7: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. */ ReachLimit = 7, /** - * The host manipulates other hosts' URLs. Check your app logic. + * 8: The host manipulates other hosts' URLs. Check your app logic. */ NotAuthorized = 8, /** - * Agora’s server fails to find the RTMP streaming. + * 9: Agora’s server fails to find the RTMP streaming. */ StreamNotFound = 9, /** - * The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. + * 10: The format of the RTMP streaming URL is not supported. Check whether the URL format is correct. */ FormatNotSupported = 10, } @@ -1767,32 +1750,37 @@ export enum RtmpStreamingErrorCode { */ export enum RtmpStreamingState { /** - * The RTMP streaming has not started or has ended. This state is also triggered after you remove an RTMP address from the CDN by calling removePublishStreamUrl. - * @see RtcEngine.removePublishStreamUrl + * 0: The RTMP streaming has not started or has ended. This state is also triggered after you + * remove an RTMP address from the CDN by calling [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl}. + * */ Idle = 0, /** - * The SDK is connecting to Agora’s streaming server and the RTMP server. This state is triggered after you call the addPublishStreamUrl method. - * @see RtcEngine.addPublishStreamUrl + * 1: The SDK is connecting to Agora’s streaming server and the RTMP server. + * This state is triggered after you call the [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} method. + * */ Connecting = 1, /** - * The RTMP streaming is being published. The SDK successfully publishes the RTMP streaming and returns this state. + * 2: The RTMP streaming is being published. The SDK successfully publishes the RTMP streaming and returns this state. */ Running = 2, /** - * The RTMP streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK attempts to resume RTMP streaming and returns this state. - * - If the SDK successfully resumes the streaming, Running(2) returns. - * @see RtmpStreamingState.Running - * - If the streaming does not resume within 60 seconds or server errors occur, Failure(4) returns. You can also reconnect to the server by calling the removePublishStreamUrl and addPublishStreamUrl methods. - * @see RtmpStreamingState.Failure - * @see RtcEngine.removePublishStreamUrl - * @see RtcEngine.addPublishStreamUrl + * 3: The RTMP streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, + * the SDK attempts to resume RTMP streaming and returns this state. + * + * - If the SDK successfully resumes the streaming, [`Running`]{@link RtmpStreamingState.Running} returns. + * - If the streaming does not resume within 60 seconds or server errors occur, + * [`Failure`]{@link RtmpStreamingState.Failure} returns. + * + * You can also reconnect to the server by calling the [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl} and [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} methods. + * */ Recovering = 3, /** - * The RTMP streaming fails. See the errorCode parameter for the detailed error information. You can also call the addPublishStreamUrl method to publish the RTMP streaming again. - * @see RtcEngine.addPublishStreamUrl + * 4: The RTMP streaming fails. See the errorCode parameter for the detailed error information. + * You can also call the [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} method to publish the RTMP streaming again. + * */ Failure = 4, } @@ -1803,17 +1791,19 @@ export enum RtmpStreamingState { */ export enum StreamFallbackOptions { /** - * No fallback behavior for the local/remote video stream when the uplink/downlink network condition is unreliable. The quality of the stream is not guaranteed. + * 0: No fallback behavior for the local/remote video stream when the uplink/downlink network condition is unreliable. The quality of the stream is not guaranteed. */ Disabled = 0, /** - * Under unreliable downlink network conditions, the remote video stream falls back to the low-stream (low resolution and low bitrate) video. You can only set this option in the setRemoteSubscribeFallbackOption method. Nothing happens when you set this in the setLocalPublishFallbackOption method. - * @see RtcEngine.setRemoteSubscribeFallbackOption - * @see RtcEngine.setLocalPublishFallbackOption + * 1: Under unreliable downlink network conditions, the remote video stream falls back to the + * low-stream (low resolution and low bitrate) video. You can only set this option + * in the [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} method. + * Nothing happens when you set this in the [`setLocalPublishFallbackOption`]{@link RtcEngine.setLocalPublishFallbackOption} method. + * */ VideoStreamLow = 1, /** - * Under unreliable uplink network conditions, the published video stream falls back to audio only. Under unreliable downlink network conditions, the remote video stream first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network condition deteriorates. + * 2: Under unreliable uplink network conditions, the published video stream falls back to audio only. Under unreliable downlink network conditions, the remote video stream first falls back to the low-stream (low resolution and low bitrate) video; and then to an audio-only stream if the network condition deteriorates. */ AudioOnly = 2, } @@ -1824,15 +1814,15 @@ export enum StreamFallbackOptions { */ export enum UserOfflineReason { /** - * The user left the current channel. + * 0: The user left the current channel. */ Quit = 0, /** - * The SDK timed out and the user dropped offline because no data packet is received within a certain period of time. If a user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. + * 1: The SDK timed out and the user dropped offline because no data packet is received within a certain period of time. If a user quits the call and the message is not passed to the SDK (due to an unreliable channel), the SDK assumes the user dropped offline. */ Dropped = 1, /** - * (Live broadcast only.) The client role switched from the host to the audience. + * 2: (Live broadcast only.) The client role switched from the host to the audience. */ BecomeAudience = 2, } @@ -1843,11 +1833,11 @@ export enum UserOfflineReason { */ export enum UserPriority { /** - * The user’s priority is high. + * 50: The user’s priority is high. */ High = 50, /** - * (Default) The user’s priority is normal. + * 100: (Default) The user’s priority is normal. */ Normal = 100, } @@ -1856,14 +1846,15 @@ export enum UserPriority { * Video buffer type * @enum {number} * TODO iOS AgoraVideoSourceProtocol AgoraVideoSinkProtocol + * //TODO ? */ export enum VideoBufferType { /** - * Use a pixel buffer to transmit the video data. + * 1: Use a pixel buffer to transmit the video data. */ PixelBuffer = 1, /** - * Use raw data to transmit the video data. + * 2: Use raw data to transmit the video data. */ RawData = 2, } @@ -1874,15 +1865,15 @@ export enum VideoBufferType { */ export enum VideoCodecProfileType { /** - * Baseline video codec profile. Generally used in video calls on mobile phones. + * 66: Baseline video codec profile. Generally used in video calls on mobile phones. */ BaseLine = 66, /** - * Main video codec profile. Generally used in mainstream electronics, such as MP4 players, portable video players, PSP, and iPads. + * 77: Main video codec profile. Generally used in mainstream electronics, such as MP4 players, portable video players, PSP, and iPads. */ Main = 77, /** - * (Default) High video codec profile. Generally used in high-resolution broadcasts or television. + * 100: (Default) High video codec profile. Generally used in high-resolution broadcasts or television. */ High = 100, } @@ -1891,18 +1882,19 @@ export enum VideoCodecProfileType { * The content hint for screen sharing. * @enum {number} * TODO MacOS setScreenCaptureContentHint + * //TODO ? */ export enum VideoContentHint { /** - * (Default) No content hint. + * 0: (Default) No content hint. */ None = 0, /** - * Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game. + * 1: Motion-intensive content. Choose this option if you prefer smoothness or when you are sharing a video clip, movie, or video game. */ Motion = 1, /** - * Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slide, or text. + * 2: Motionless content. Choose this option if you prefer sharpness or when you are sharing a picture, PowerPoint slide, or text. */ Details = 2, } @@ -1914,31 +1906,31 @@ export enum VideoContentHint { export enum VideoFrameRate { Min = -1, /** - * 1 fps. + * -1: 1 fps. */ Fps1 = 1, /** - * 7 fps. + * 7: 7 fps. */ Fps7 = 7, /** - * 10 fps. + * 10: 10 fps. */ Fps10 = 10, /** - * 15 fps. + * 15: 15 fps. */ Fps15 = 15, /** - * 24 fps. + * 24: 24 fps. */ Fps24 = 24, /** - * 30 fps. + * 30: 30 fps. */ Fps30 = 30, /** - * 60 fps (macOS only). + * 60: 60 fps (macOS only). */ Fps60 = 60, } @@ -1949,13 +1941,13 @@ export enum VideoFrameRate { */ export enum BitRate { /** - * (recommended) the standard bitrate mode. In this mode, the bitrates differ between the Live-broadcast and Communication profiles: + * 0: (Recommended) the standard bitrate mode. In this mode, the bitrates differ between the Live-broadcast and Communication profiles: * - Communication profile: the video bitrate is the same as the base bitrate. * - Live-broadcast profile: the video bitrate is twice the base bitrate. */ Standard = 0, /** - * the compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. In the Live-broadcast profile, if you choose this mode, the video frame rate may be lower than the set value. + * -1: The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. In the Live-broadcast profile, if you choose this mode, the video frame rate may be lower than the set value. */ Compatible = -1, } @@ -1966,15 +1958,15 @@ export enum BitRate { */ export enum VideoMirrorMode { /** - * (Default) The SDK determines the mirror mode. + * 0: (Default) The SDK determines the mirror mode. */ Auto = 0, /** - * Enables mirror mode. + * 1: Enables mirror mode. */ Enabled = 1, /** - * Disables mirror mode. + * 2: Disables mirror mode. */ Disabled = 2, } @@ -1985,19 +1977,22 @@ export enum VideoMirrorMode { */ export enum VideoOutputOrientationMode { /** - * Adaptive mode (Default). + * 0: Adaptive mode (Default). + * * The video encoder adapts to the orientation mode of the video input device. When you use a custom video source, the output video from the encoder inherits the orientation of the original video. * - If the width of the captured video from the SDK is greater than the height, the encoder sends the video in landscape mode. The encoder also sends the rotational information of the video, and the receiver uses the rotational information to rotate the received video. * - If the original video is in portrait mode, the output video from the encoder is also in portrait mode. The encoder also sends the rotational information of the video to the receiver. */ Adaptative = 0, /** - * Landscape mode. + * 1: Landscape mode. + * * The video encoder always sends the video in landscape mode. The video encoder rotates the original video before sending it and the rotational information is 0. This mode applies to scenarios involving CDN live streaming. */ FixedLandscape = 1, /** - * Portrait mode. + * 2: Portrait mode. + * * The video encoder always sends the video in portrait mode. The video encoder rotates the original video before sending it and the rotational information is 0. This mode applies to scenarios involving CDN live streaming. */ FixedPortrait = 2, @@ -2007,18 +2002,19 @@ export enum VideoOutputOrientationMode { * Video pixel format. * @enum {number} * TODO iOS AgoraVideoSinkProtocol + * //TODO ? */ export enum VideoPixelFormat { /** - * I420 + * 1: I420 */ I420 = 1, /** - * BGRA + * 2: BGRA */ BGRA = 2, /** - * NV12 + * 8: NV12 */ NV12 = 8, } @@ -2029,15 +2025,15 @@ export enum VideoPixelFormat { */ export enum VideoQualityAdaptIndication { /** - * The quality of the local video stays the same. + * 0: The quality of the local video stays the same. */ AdaptNone = 0, /** - * The quality improves because the network bandwidth increases. + * 1: The quality improves because the network bandwidth increases. */ AdaptUpBandwidth = 1, /** - * The quality worsens because the network bandwidth decreases. + * 2: The quality worsens because the network bandwidth decreases. */ AdaptDownBandwidth = 2, } @@ -2048,33 +2044,32 @@ export enum VideoQualityAdaptIndication { */ export enum VideoRemoteState { /** - * The remote video is in the default state, probably due to: - * @see VideoRemoteStateReason.LocalMuted - * @see VideoRemoteStateReason.RemoteMuted - * @see VideoRemoteStateReason.RemoteOffline + * 0: The remote video is in the default state, probably due to: + * - [`LocalMuted`]{@link VideoRemoteStateReason.LocalMuted} + * - [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted} + * - [`RemoteOffline`]{@link VideoRemoteStateReason.RemoteOffline} */ Stopped = 0, /** - * The first remote video packet is received. + * 1: The first remote video packet is received. */ Starting = 1, /** - * The remote video stream is decoded and plays normally, probably due to: - * @see VideoRemoteStateReason.NetworkRecovery - * @see VideoRemoteStateReason.LocalUnmuted - * @see VideoRemoteStateReason.RemoteUnmuted - * @see VideoRemoteStateReason.AudioFallbackRecovery + * 2: The remote video stream is decoded and plays normally, probably due to: + * - [`NetworkRecovery`]{@link VideoRemoteStateReason.NetworkRecovery} + * - [`LocalUnmuted`]{@link VideoRemoteStateReason.LocalUnmuted} + * - [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted} + * - [`AudioFallbackRecovery`]{@link VideoRemoteStateReason.AudioFallbackRecovery} */ Decoding = 2, /** - * The remote video is frozen, probably due to: - * @see VideoRemoteStateReason.NetworkCongestion - * @see VideoRemoteStateReason.AudioFallback + * 3: The remote video is frozen, probably due to: + * - [`NetworkCongestion`]{@link VideoRemoteStateReason.NetworkCongestion} + * - [`AudioFallback`]{@link VideoRemoteStateReason.AudioFallback} */ Frozen = 3, /** - * The remote video fails to start, probably due to: - * @see VideoRemoteStateReason.Internal + * 4: The remote video fails to start, probably due to: [`Internal`]{@link VideoRemoteStateReason.Internal} */ Failed = 4, } @@ -2085,43 +2080,43 @@ export enum VideoRemoteState { */ export enum VideoRemoteStateReason { /** - * Internal reasons. + * 0: Internal reasons. */ Internal = 0, /** - * Network congestion. + * 1: Network congestion. */ NetworkCongestion = 1, /** - * Network recovery. + * 2: Network recovery. */ NetworkRecovery = 2, /** - * The local user stops receiving the remote video stream or disables the video module. + * 3: The local user stops receiving the remote video stream or disables the video module. */ LocalMuted = 3, /** - * The local user stops receiving the remote video stream or disables the video module. + * 4: The local user stops receiving the remote video stream or disables the video module. */ LocalUnmuted = 4, /** - * The remote user stops sending the video stream or disables the video module. + * 5: The remote user stops sending the video stream or disables the video module. */ RemoteMuted = 5, /** - * The remote user resumes sending the video stream or enables the video module. + * 6: The remote user resumes sending the video stream or enables the video module. */ RemoteUnmuted = 6, /** - * The remote user leaves the channel. + * 7: The remote user leaves the channel. */ RemoteOffline = 7, /** - * The remote media stream falls back to the audio-only stream due to poor network conditions. + * 8: The remote media stream falls back to the audio-only stream due to poor network conditions. */ AudioFallback = 8, /** - * The remote media stream switches back to the video stream after the network conditions improve. + * 9: The remote media stream switches back to the video stream after the network conditions improve. */ AudioFallbackRecovery = 9, } @@ -2132,20 +2127,21 @@ export enum VideoRemoteStateReason { */ export enum VideoRenderMode { /** - * Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. + * 1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. */ Hidden = 1, /** - * Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black. + * 2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black. */ Fit = 2, /** - * This mode is deprecated. - * @deprecated + * **DEPRECATED** + * 3: This mode is deprecated. + * */ Adaptive = 3, /** - * The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window. + * 4: The fill mode. In this mode, the SDK stretches or zooms the video to fill the display window. */ FILL = 4, } @@ -2157,19 +2153,19 @@ export enum VideoRenderMode { */ export enum VideoRotation { /** - * No rotation + * 0: No rotation */ RotationNone = 0, /** - * 90 degrees + * 1: 90 degrees */ Rotation90 = 1, /** - * 180 degrees + * 2: 180 degrees */ Rotation180 = 2, /** - * 270 degrees + * 3: 270 degrees */ Rotation270 = 3, } @@ -2180,126 +2176,128 @@ export enum VideoRotation { */ export enum VideoStreamType { /** - * High-bitrate, high-resolution video stream. + * 0: High-bitrate, high-resolution video stream. */ High = 0, /** - * Low-bitrate, low-resolution video stream. + * 1: Low-bitrate, low-resolution video stream. */ Low = 1, } /** - * Warning codes occur when the SDK encounters an error that may be recovered automatically. These are only notifications, and can generally be ignored. For example, when the SDK loses connection to the server, the SDK reports the OpenChannelTimeout(106) warning and tries to reconnect automatically. - * @see WarningCode.OpenChannelTimeout + * Warning codes occur when the SDK encounters an error that may be recovered automatically. + * These are only notifications, and can generally be ignored. For example, when the SDK loses connection to the server, + * the SDK reports the [`OpenChannelTimeout(106)`]{@link WarningCode.OpenChannelTimeout} warning and tries to reconnect automatically. * @enum {number} */ export enum WarningCode { /** - * The specified view is invalid. Specify a view when using the video call function. + * 8: The specified view is invalid. Specify a view when using the video call function. */ InvalidView = 8, /** - * Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected. + * 16: Failed to initialize the video function, possibly caused by a lack of resources. The users cannot see the video while the voice communication is not affected. */ InitVideo = 16, /** - * The request is pending, usually due to some module not being ready, and the SDK postpones processing the request. + * 20: The request is pending, usually due to some module not being ready, and the SDK postpones processing the request. */ Pending = 20, /** - * No channel resources are available. Maybe because the server cannot allocate any channel resource. + * 103: No channel resources are available. Maybe because the server cannot allocate any channel resource. */ NoAvailableChannel = 103, /** - * A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. The warning usually occurs when the network condition is too poor for the SDK to connect to the server. + * 104: A timeout occurs when looking up the channel. When joining a channel, the SDK looks up the specified channel. The warning usually occurs when the network condition is too poor for the SDK to connect to the server. */ LookupChannelTimeout = 104, /** - * The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. DEPRECATED as of v2.4.1. Use RejectedByServer(10) in the reason parameter of onConnectionStateChanged. - * @see ConnectionChangedReason.RejectedByServer - * @see RtcEngineEvents.onConnectionStateChanged - * @deprecated + * 105: The server rejects the request to look up the channel. + * The server cannot process this request or the request is illegal. + * **DEPRECATED** as of v2.4.1. Use [`RejectedByServer(10)`]{@link ConnectionChangedReason.RejectedByServer} in the reason parameter + * of [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged}. + * */ LookupChannelRejected = 105, /** - * The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. + * 106: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. */ OpenChannelTimeout = 106, /** - * The server rejects the request to open the channel. The server cannot process this request or the request is illegal. + * 107: The server rejects the request to open the channel. The server cannot process this request or the request is illegal. */ OpenChannelRejected = 107, /** - * A timeout occurs when switching to the live video. + * 111: A timeout occurs when switching to the live video. */ SwitchLiveVideoTimeout = 111, /** - * A timeout occurs when setting the client role in the live broadcast profile. + * 118: A timeout occurs when setting the client role in the live broadcast profile. */ SetClientRoleTimeout = 118, /** - * The client role is unauthorized. + * 119: The client role is unauthorized. */ SetClientRoleNotAuthorized = 119, /** - * The ticket to open the channel is invalid. + * 121: The ticket to open the channel is invalid. */ OpenChannelInvalidTicket = 121, /** - * Try connecting to another server. + * 122: Try connecting to another server. */ OpenChannelTryNextVos = 122, /** - * An error occurs in opening the audio mixing file. + * 701: An error occurs in opening the audio mixing file. */ AudioMixingOpenError = 701, /** - * Audio Device Module: a warning occurs in the playback device. + * 1014: Audio Device Module: a warning occurs in the playback device. */ AdmRuntimePlayoutWarning = 1014, /** - * Audio Device Module: a warning occurs in the recording device. + * 1016: Audio Device Module: a warning occurs in the recording device. */ AdmRuntimeRecordingWarning = 1016, /** - * Audio Device Module: no valid audio data is collected. + * 1019: Audio Device Module: no valid audio data is collected. */ AdmRecordAudioSilence = 1019, /** - * Audio Device Module: a playback device fails. + * 1020: Audio Device Module: a playback device fails. */ AdmPlaybackMalfunction = 1020, /** - * Audio Device Module: a recording device fails. + * 1021: Audio Device Module: a recording device fails. */ AdmRecordMalfunction = 1021, /** - * Audio Device Module: call is interrupted by system events such as phone call or siri etc. + * 1025: Audio Device Module: call is interrupted by system events such as phone call or siri etc. */ AdmInterruption = 1025, /** - * Audio Device Module: the recorded audio is too low. + * 1031: Audio Device Module: the recorded audio is too low. */ AdmRecordAudioLowlevel = 1031, /** - * Audio Device Module: the playback audio is too low. + * 1032: Audio Device Module: the playback audio is too low. */ AdmPlayoutAudioLowlevel = 1032, /** - * Audio Device Module: The recording device is busy. + * 1033: Audio Device Module: The recording device is busy. */ AdmRecordIsOccupied = 1033, /** - * Audio Device Module: howling is detected. + * 1051: Audio Device Module: howling is detected. */ ApmHowling = 1051, /** - * Audio Device Module: the device is in the glitch state. + * 1052: Audio Device Module: the device is in the glitch state. */ AdmGlitchState = 1052, /** - * Audio Device Module: the underlying audio settings have changed. + * 1053: Audio Device Module: the underlying audio settings have changed. */ AdmImproperSettings = 1053, } @@ -2310,27 +2308,27 @@ export enum WarningCode { */ export enum AudioChannel { /** - * (Default) Supports dual channels. Depends on the upstream of the broadcaster. + * 0: (Default) Supports dual channels. Depends on the upstream of the host. */ Channel0 = 0, /** - * The audio stream of the broadcaster uses the FL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first. + * 1: The audio stream of the host uses the FL audio channel. If the upstream of the host uses multiple audio channels, these channels will be mixed into mono first. */ Channel1 = 1, /** - * The audio stream of the broadcaster uses the FC audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first. + * 2: The audio stream of the host uses the FC audio channel. If the upstream of the host uses multiple audio channels, these channels will be mixed into mono first. */ Channel2 = 2, /** - * The audio stream of the broadcaster uses the FR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first. + * 3: The audio stream of the host uses the FR audio channel. If the upstream of the host uses multiple audio channels, these channels will be mixed into mono first. */ Channel3 = 3, /** - * The audio stream of the broadcaster uses the BL audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first. + * 4: The audio stream of the host uses the BL audio channel. If the upstream of the host uses multiple audio channels, these channels will be mixed into mono first. */ Channel4 = 4, /** - * The audio stream of the broadcaster uses the BR audio channel. If the upstream of the broadcaster uses multiple audio channels, these channels will be mixed into mono first. + * 5: The audio stream of the host uses the BR audio channel. If the upstream of the host uses multiple audio channels, these channels will be mixed into mono first. */ Channel5 = 5, } @@ -2341,19 +2339,19 @@ export enum AudioChannel { */ export enum VideoCodecType { /** - * Standard VP8. + * 1: Standard VP8. */ VP8 = 1, /** - * Standard H264. + * 2: Standard H264. */ H264 = 2, /** - * Enhanced VP8. + * 3: Enhanced VP8. */ EVP = 3, /** - * Enhanced H264. + * 4: Enhanced H264. */ E264 = 4, } diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index cf9166095..283c458cc 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -57,7 +57,7 @@ const RtcEngineEvent = new NativeEventEmitter(AgoraRtcEngineModule); let engine: RtcEngine | undefined; /** - * RtcEngine is the main class of the Agora SDK. + * [`RtcEngine`]{@link RtcEngine} is the main interface class of the Agora SDK. */ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterface, RtcVideoInterface, RtcAudioMixingInterface, RtcAudioEffectInterface, RtcVoiceChangerInterface, RtcVoicePositionInterface, RtcPublishStreamInterface, @@ -78,33 +78,38 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Creates an RtcEngine instance. - * @see RtcEngine - * Unless otherwise specified, all the methods provided by the RtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread. - * Note - * - You must create an RtcEngine instance before calling any other method. - * - You can create an RtcEngine instance either by calling this method or by calling create2. The difference between create2 and this method is that create2 enables you to specify the connection area. - * @see RtcEngine#createWithAreaCode - * - The Agora RTC Native SDK supports creating only one RtcEngine instance for an app for now. - * @param appId The App ID issued to you by Agora. See How to get the App ID. Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only one RtcEngine instance. To change your App ID, call destroy to destroy the current RtcEngine instance, and after destroy returns 0, call create to create an RtcEngine instance with the new App ID. + * Creates an [`RtcEngine`]{@link RtcEngine} instance. + * + * Unless otherwise specified, all the methods provided by the [`RtcEngine`]{@link RtcEngine} class are executed asynchronously. Agora recommends calling these methods in the same thread. + * + * **Note** + * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. + * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`createWithAreaCode`]{@link createWithAreaCode}. The difference between [`createWithAreaCode`]{@link createWithAreaCode} and this method is that [`createWithAreaCode`]{@link createWithAreaCode} enables you to specify the connection area. + * - The Agora React Native SDK supports creating only one [`RtcEngine`]{@link RtcEngine} instance for an app. + * @param appId The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id). + * Only users in apps with the same App ID can join the same channel and communicate with each other. + * Use an App ID to create only one [`RtcEngine`]{@link RtcEngine} instance. To change your App ID, call [`destroy`]{@link destroy} to destroy the current [`RtcEngine`]{@link RtcEngine} instance, and after [`destroy`]{@link destroy} returns `0`, + * call [`create`]{@link create} to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. */ static async create(appId: string): Promise { return RtcEngine.createWithAreaCode(appId, IPAreaCode.AREA_GLOBAL) } /** - * Creates an RtcEngine instance. - * @see RtcEngine - * Unless otherwise specified, all the methods provided by the RtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread. - * Note - * - You must create an RtcEngine instance before calling any other method. - * - You can create an RtcEngine instance either by calling this method or by calling create1. The difference between create1 and this method is that this method enables you to specify the connection area. - * @see RtcEngine#create - * - The Agora RTC Native SDK supports creating only one RtcEngine instance for an app for now. - * @param appId The App ID issued to you by Agora. See How to get the App ID. Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only one RtcEngine instance. To change your App ID, call destroy to destroy the current RtcEngine instance and after destroy returns 0, call create to create an RtcEngine instance with the new App ID. + * Creates an [`RtcEngine`]{@link RtcEngine} instance. + * + * Unless otherwise specified, all the methods provided by the [`RtcEngine`]{@link RtcEngine} class are executed asynchronously. Agora recommends calling these methods in the same thread. + * + * **Note** + * + * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. + * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`create`]{@link create}. The difference between [`create`]{@link create} and this method is that this method enables you to specify the connection area. + * - The Agora React Native SDK supports creating only one {@link RtcEngine} instance for an app. + * @param appId The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id). + * Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only one [`RtcEngine`]{@link RtcEngine} instance. + * To change your App ID, call [`destroy`]{@link destroy} to destroy the current [`RtcEngine`]{@link RtcEngine} instance and after [`destroy`]{@link destroy} returns `0`, call [`create`]{@link create} to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. * @param areaCode The area of connection. This advanced feature applies to scenarios that have regional restrictions. - * You can use the bitwise OR operator (|) to specify multiple areas. For details, see IPAreaCode. - * @see IPAreaCode + * You can use the bitwise OR operator (|) to specify multiple areas. For details, see {@link IPAreaCode}. * After specifying the area of connection: * - When the app that integrates the Agora SDK is used within the specified area, it connects to the Agora servers within the specified area under normal circumstances. * - When the app that integrates the Agora SDK is used out of the specified area, it connects to the Agora servers either in the specified area or in the area where the app is located. @@ -117,12 +122,19 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Destroys the RtcEngine instance and releases all resources used by the Agora SDK. - * @see RtcEngine - * This method is useful for apps that occasionally make voice or video calls, to free up resources for other operations when not making calls. - * Note - * - Call this method in the subthread. - * - Once the app calls destroy to destroy the created RtcEngine instance, you cannot use any method or callback in the SDK. + * Destroys the [`RtcEngine`]{@link RtcEngine} instance and releases all resources used by the Agora SDK. + * + * Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. + * Once you call this method to destroy the created [`RtcEngine`]{@link RtcEngine} instance, you cannot use any method or callback in the SDK any more. + * If you want to use the real-time communication functions again, you must call `create` to create a new [`RtcEngine`]{@link RtcEngine} instance. + * + * **Note** + * + * - Because [`destroy`]{@link destroy} is a synchronous method and the app cannot move on to another task until the execution completes, + * Agora suggests calling this method in a sub-thread to avoid congestion in the main thread. + * Besides, you cannot call [`destroy`]{@link destroy} in any method or callback of the SDK. + * Otherwise, the SDK cannot release the resources occupied by the [`RtcEngine`]{@link RtcEngine} instance until the callbacks return results, which may result in a deadlock. + * - If you want to create a new [`RtcEngine`]{@link RtcEngine} instance after destroying the current one, ensure that you wait till the [`destroy`]{@link destroy} method completes executing. */ destroy(): Promise { RtcChannel.destroyAll(); @@ -133,6 +145,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adds the engine event handler. + * * After setting the engine event handler, you can listen for engine events and receive the statistics of the corresponding RtcEngine instance. * @param event The event type. * @param listener The event handler. @@ -161,7 +174,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Removes the engine event handler. - * For callback events that you only want to listen for once, call this method to remove it after you have received them. + * + * For callback events that you only want to listen for once, call this method to remove the specific {@link RtcEngineEvents} objects after you have received them. * @param event The event type. * @param listener The event handler. */ @@ -189,27 +203,28 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Sets the channel profile of the Agora RtcEngine. - * The Agora RtcEngine differentiates channel profiles and applies different optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast. - * @param profile The channel profile of the Agora RtcEngine. - * @see ChannelProfile + * Sets the channel profile of the Agora {@link RtcEngine}. + * + * The Agora [`RtcEngine`]{@link RtcEngine} differentiates channel profiles and applies different optimization algorithms accordingly. + * For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast. + * @param profile The channel profile of the Agora [`RtcEngine`]{@link RtcEngine}. + * */ setChannelProfile(profile: ChannelProfile): Promise { return AgoraRtcEngineModule.setChannelProfile(profile) } /** - * Sets the role of a user (Live Broadcast only). + * Sets the role of a user ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). + * * This method sets the role of a user, such as a host or an audience (default), before joining a channel. - * This method can be used to switch the user role after a user joins a channel. In the Live Broadcast profile, when a user switches user roles after joining a channel, a successful setClientRole method call triggers the following callbacks: - * - The local client: onClientRoleChanged. - * @see RtcEngineEvents.ClientRoleChanged - * - The remote client: onUserJoined or onUserOffline(BecomeAudience). - * @see RtcEngineEvents.UserJoined - * @see RtcEngineEvents.UserOffline - * @see UserOfflineReason.BecomeAudience + * + * This method can be used to switch the user role after a user joins a channel. In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful [`setClientRole`]{@link setClientRole }method call triggers the following callbacks: + * - The local client: [`ClientRoleChanged`]{@link RtcEngineEvents.ClientRoleChanged}. + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} or [`UserOffline`]{@link RtcEngineEvents.UserOffline} ([`BecomeAudience`]{@link UserOfflineReason.BecomeAudience}). + * * @param role Sets the role of a user. - * @see ClientRole + * */ setClientRole(role: ClientRole): Promise { return AgoraRtcEngineModule.setClientRole(role) @@ -217,27 +232,31 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Allows a user to join a channel. + * * Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other. - * You must call the leaveChannel method to exit the current call before joining another channel. - * @see RtcEngine.leaveChannel - * A successful joinChannel method call triggers the following callbacks: - * - The local client: onJoinChannelSuccess. - * @see RtcEngineEvents.JoinChannelSuccess - * - The remote client: onUserJoined, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. - * @see RtcEngineEvents.UserJoined - * @see ChannelProfile.Communication - * @see ClientRole.Broadcaster - * @see ChannelProfile.LiveBroadcasting - * When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback on the local client. - * @see RtcEngineEvents.RejoinChannelSuccess - * The uid is represented as a 32-bit unsigned integer in the SDK. Since unsigned integers are not supported by Java, the uid is handled as a 32-bit signed integer and larger numbers are interpreted as negative numbers in Java. If necessary, the uid can be converted to a 64-bit integer through “uid&0xffffffffL”. - * Note - * - A channel does not accept duplicate uids, such as two users with the same uid. If you set uid as 0, the system automatically assigns a uid. - * Warning - * - Ensure that the App ID used for creating the token is the same App ID used in the create method for creating an RtcEngine object. Otherwise, CDN live streaming may fail. + * You must call [`leaveChannel`]{@link leaveChannel} to exit the current call before joining another channel. + * + * A successful [`joinChannel`]{@link joinChannel} method call triggers the following callbacks: + * + * - The local client: [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. + * + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, + * or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * + * When the connection between the client and Agora server is interrupted due to poor network conditions, + * the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the [`RejoinChannelSuccess`]{@link RtcEngineEvents.RejoinChannelSuccess} callback on the local client. + * + * **Note** + * + * A channel does not accept duplicate uids, such as two users with the same `uid`. If you set `uid` as `0`, the system automatically assigns a uid. + * + * **Warning:** + * + * Ensure that the App ID used for creating the token is the same App ID used in the [`create`]{@link create} method for creating an {@link RtcEngine} object. Otherwise, CDN live streaming may fail. + * * @param token The token for authentication: - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. - * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param channelName The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. @@ -245,8 +264,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * @param optionalInfo Additional information about the channel. This parameter can be set as null or contain channel related information. Other users in the channel do not receive this message. - * @param optionalUid (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to (2^32-1). optionalUid must be unique. If optionalUid is not assigned (or set to 0), the SDK assigns and returns uid in the onJoinChannelSuccess callback. Your app must record and maintain the returned uid since the SDK does not do so. - * @see RtcEngineEvents.JoinChannelSuccess + * @param optionalUid (Optional) User ID. A 32-bit unsigned integer with a value ranging from 1 to (2^32-1). `optionalUid` must be unique. If `optionalUid` is not assigned (or set to `0`), the SDK assigns and returns `uid` in the [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callback. + * Your app must record and maintain the returned uid since the SDK does not do so. + * + * The uid is represented as a 32-bit unsigned integer in the SDK. Since unsigned integers are not supported by Java, the uid is handled as a 32-bit signed integer and larger numbers are interpreted as negative numbers in Java. + * If necessary, the uid can be converted to a 64-bit integer through “uid&0xffffffffL”. + * */ joinChannel(token: string | null, channelName: string, optionalInfo: string | null, optionalUid: number): Promise { return AgoraRtcEngineModule.joinChannel(token, channelName, optionalInfo, optionalUid) @@ -254,17 +277,19 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Switches to a different channel. - * This method allows the audience of a Live-broadcast channel to switch to a different channel. - * After the user successfully switches to another channel, the onLeaveChannel and onJoinChannelSuccess callbacks are triggered to indicate that the user has left the original channel and joined a new one. - * @see RtcEngineEvents.LeaveChannel - * @see RtcEngineEvents.JoinChannelSuccess - * Note - * - This method applies to the audience role in a Live-broadcast channel only. - * @see ClientRole.Audience - * @see ChannelProfile.LiveBroadcasting + * + * This method allows the audience of a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel to switch to a different channel. + * + * After the user successfully switches to another channel, the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callbacks are triggered to + * indicate that the user has left the original channel and joined a new one. + * + * **Note** + * + * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel only. + * * @param token The token for authentication: - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. - * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param channelName Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. @@ -278,20 +303,23 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Allows a user to leave a channel. - * After joining a channel, the user must call the leaveChannel method to end the call before joining another channel. This method returns 0 if the user leaves the channel and releases all resources related to the call. This method call is asynchronous, and the user has not exited the channel when the method call returns. Once the user leaves the channel, the SDK triggers the onLeaveChannel callback. - * A successful leaveChannel method call triggers the following callbacks: - * - The local client: onLeaveChannel. - * @see RtcEngineEvents.LeaveChannel - * - The remote client: onUserOffline, if the user leaving the channel is in the Communication channel, or is a BROADCASTER in the Live Broadcast profile. - * @see RtcEngineEvents.UserOffline - * @see ChannelProfile.Communication - * @see ClientRole.Broadcaster - * @see ChannelProfile.LiveBroadcasting - * Note - * - If you call the destroy method immediately after calling the leaveChannel method, the leaveChannel process interrupts, and the SDK does not trigger the onLeaveChannel callback. - * @see RtcEngine.destroy - * - If you call the leaveChannel method during CDN live streaming, the SDK triggers the removeInjectStreamUrl method. - * @see RtcEngine.removeInjectStreamUrl + * + * After joining a channel, the user must call this method to end the call before joining another channel. + * This method returns `0` if the user leaves the channel and releases all resources related to the call. + * + * This method call is asynchronous, and the user has not exited the channel when the method call returns. + * Once the user leaves the channel, the SDK triggers the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} callback. + * A successful [`leaveChannel`]{@link leaveChannel} method call triggers the following callbacks: + * - The local client: [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel}. + * + * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [`Communication`]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} + * in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * + * **Note** + * - If you call [`destroy`]{@link destroy} immediately after calling [`leaveChannel`]{@link leaveChannel}, the [`leaveChannel`]{@link leaveChannel} process interrupts, and the SDK does not trigger the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} callback. + * + * - If you call [`leaveChannel`]{@link leaveChannel} during CDN live streaming, the SDK triggers the [`removeInjectStreamUrl`]{@link removeInjectStreamUrl} method. + * */ leaveChannel(): Promise { return AgoraRtcEngineModule.leaveChannel() @@ -299,12 +327,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Renews the token when the current token expires. + * * The token expires after a period of time once the token schema is enabled when: - * - The SDK triggers the onTokenPrivilegeWillExpire callback, or - * @see RtcEngineEvents.TokenPrivilegeWillExpire - * - The onConnectionStateChanged callback reports the TokenExpired(9) error. - * @see RtcEngineEvents.ConnectionStateChanged - * @see ConnectionChangedReason.TokenExpired + * - The SDK triggers the [`TokenPrivilegeWillExpire`]{@link RtcEngineEvents.TokenPrivilegeWillExpire} callback, or + * + * - The [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback reports the [`TokenExpired(9)`]{@link ConnectionChangedReason.TokenExpired} error. + * * The app should retrieve a new token from the server and call this method to renew it. Failure to do so results in the SDK disconnecting from the server. * @param token The new token. */ @@ -313,10 +341,15 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Enables interoperability with the Agora Web SDK (Live Broadcast only). - * @deprecated As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. + * Enables interoperability with the Agora Web SDK ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). + * + * **Deprecated** + * + * As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. + * + * * If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. - * Use this method when the channel profile is Live Broadcast. Interoperability with the Agora Web SDK is enabled by default when the channel profile is Communication. + * Use this method when the channel profile is [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting}. Interoperability with the Agora Web SDK is enabled by default when the channel profile is [`Communication`]{@link ChannelProfile.Communication}. * @param enabled Sets whether to enable/disable interoperability with the Agora Web SDK: * - true: Enable. * - false: (Default) Disable. @@ -334,10 +367,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the current call ID. - * When a user joins a channel on a client, a call ID is generated to identify the call from the client. Feedback methods, such as the rate and complain method, must be called after the call ends to submit feedback to the SDK. - * @see RtcEngine.rate - * @see RtcEngine.complain - * The rate and complain methods require the callId parameter retrieved from the getCallId method during a call. callId is passed as an argument into the rate and complain methods after the call ends. + * + * When a user joins a channel on a client, a call ID is generated to identify the call from the client. + * Feedback methods, such as [`rate`]{@link rate} and [`complain`]{@link complain}, must be called after the call ends to submit feedback to the SDK. + * + * The [`rate`]{@link rate} and [`complain`]{@link complain} methods require the `callId` parameter retrieved from the [`getCallId`]{@link getCallId} method during a call. + * `callId` is passed as an argument into the [`rate`]{@link rate} and [`complain`]{@link complain} methods after the call ends. */ getCallId(): Promise { return AgoraRtcEngineModule.getCallId() @@ -345,10 +380,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Allows the user to rate a call after the call ends. - * @param callId ID of the call retrieved from the getCallId method. - * @see RtcEngine.getCallId - * @param rating Rating of the call. The value is between 1 (lowest score) and 5 (highest score). If you set a value out of this range, the InvalidArgument(-2) error occurs. - * @see ErrorCode.InvalidArgument + * + * @param callId ID of the call retrieved from the [`getCallId`]{@link getCallId} method. + * @param rating Rating of the call. The value is between 1 (lowest score) and 5 (highest score). + * If you set a value out of this range, the [`InvalidArgument(-2)`]{@link ErrorCode.InvalidArgument} error occurs. * @param description (Optional) The description of the rating. The string length must be less than 800 bytes. */ rate(callId: string, rating: Rate, description?: string): Promise { @@ -357,8 +392,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Allows a user to complain about the call quality after a call ends. - * @param callId ID of the call retrieved from the getCallId method. - * @see RtcEngine.getCallId + * + * @param callId ID of the call retrieved from the [`getCallId`]{@link getCallId} method. * @param description (Optional) The description of the complaint. The string length must be less than 800 bytes. */ complain(callId: string, description: string): Promise { @@ -367,11 +402,14 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Specifies an SDK output log file. + * * The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable. - * Note - * - Ensure that you call this method immediately after calling the create method, otherwise the output log may not be complete. - * @see RtcEngine#create - * @param filePath File path of the log file. The string of the log file is in UTF-8. The default file path is /storage/emulated/0/Android/data/="">/files/agorasdk.log. + * + * **Note** + * + * Ensure that you call this method immediately after calling the [`create`]{@link create} method, otherwise the output log may not be complete. + * + * @param filePath File path of the log file. The string of the log file is in UTF-8. The default file path is `/storage/emulated/0/Android/data/="">/files/agorasdk.log`. */ setLogFile(filePath: string): Promise { return AgoraRtcEngineModule.setLogFile(filePath) @@ -379,9 +417,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the output log level of the SDK. - * You can use one or a combination of the filters. The log level follows the sequence of OFF, CRITICAL, ERROR, WARNING, INFO, and DEBUG. Choose a level to see the logs preceding that level. For example, if you set the log level to WARNING, you see the logs within levels CRITICAL, ERROR, and WARNING. + * + * You can use one or a combination of the filters. The log level follows the sequence of `Off`, `Critical`, `Error`, `Warning`, `Info`, and `Debug`. + * Choose a level to see the logs preceding that level. For example, if you set the log level to `Warning`, you see the logs within levels `Critical`, `Error`, and `Warning`. + * * @param filter Sets the log filter level. - * @see LogFilter + * */ setLogFilter(filter: LogFilter): Promise { return AgoraRtcEngineModule.setLogFilter(filter) @@ -389,7 +430,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the log file size (KB). - * The Agora SDK has two log files, each with a default size of 512 KB. If you set fileSizeInKBytes as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. If the total size of the log files exceed the set value, the new output log files overwrite the old output log files. + * + * The Agora SDK has two log files, each with a default size of 512 KB. + * If you set `fileSizeInKBytes` as 1024 KB, the SDK outputs log files with a total maximum size of 2 MB. + * If the total size of the log files exceed the set value, the new output log files overwrite the old output log files. * @param fileSizeInKBytes The SDK log file size (KB). */ setLogFileSize(fileSizeInKBytes: number): Promise { @@ -398,6 +442,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Provides technical preview functionalities or special customizations by configuring the SDK with JSON options. + * * The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way. * @param parameters Sets the parameter as a JSON string in the specified format. */ @@ -407,10 +452,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the user information by passing in the user ID. - * After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (UserInfo), and triggers the onUserInfoUpdated callback on the local client. - * @see UserInfo - * @see RtcEngineEvents.UserInfoUpdated - * After receiving the onUserInfoUpdated callback, you can call this method to get the user ID of the remote user from the userInfo object by passing in the user account. + * + * After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object ([`UserInfo`]{@link UserInfo}), and triggers the [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated} callback on the local client. + * + * After receiving the [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated} callback, you can call this method to get the user ID of the remote user from the [`UserInfo`]{@link UserInfo} object by passing in the user account. * @param uid The user ID of the user. Ensure that you set this parameter. */ getUserInfoByUid(uid: number): Promise { @@ -419,10 +464,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the user information by passing in the user account. - * After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object (UserInfo), and triggers the onUserInfoUpdated callback on the local client. - * @see UserInfo - * @see RtcEngineEvents.UserInfoUpdated - * After receiving the onUserInfoUpdated callback, you can call this method to get the user ID of the remote user from the userInfo object by passing in the user account. + * + * After a remote user joins the channel, the SDK gets the user ID and user account of the remote user, caches them in a mapping table object ([`UserInfo`]{@link UserInfo}), and triggers the [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated} callback on the local client. + * + * After receiving the [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated} callback, you can call this method to get the user ID of the remote user from the [`UserInfo`]{@link UserInfo} object by passing in the user account. * @param userAccount The user account of the user. Ensure that you set this parameter. */ getUserInfoByUserAccount(userAccount: string): Promise { @@ -431,25 +476,28 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Joins the channel with a user account. + * * After the user successfully joins the channel, the SDK triggers the following callbacks: - * - The local client: onLocalUserRegistered and onJoinChannelSuccess. - * @see RtcEngineEvents.LocalUserRegistered - * @see RtcEngineEvents.JoinChannelSuccess - * - The remote client: onUserJoined and onUserInfoUpdated, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile. - * @see RtcEngineEvents.UserJoined - * @see RtcEngineEvents.UserInfoUpdated - * Note - * - To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + * - The local client: [`LocalUserRegistered`]{@link RtcEngineEvents.LocalUserRegistered} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. + * + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * + * **Note** + * + * To ensure smooth communication, use the same parameter type to identify the user. + * For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. + * If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. * @param token The token generated at your server: - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. - * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param channelName The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. * - All numeric characters: 0 to 9. * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". - * @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. + * @param userAccount The user account. The maximum length of this parameter is 255 bytes. + * Ensure that you set this parameter and do not set it as null. * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. * - All numeric characters: 0 to 9. @@ -462,20 +510,27 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Registers a user account. - * Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and user account of the local user. - * @see RtcEngineEvents.LocalUserRegistered + * + * Once registered, the user account can be used to identify the local user when the user joins the channel. + * After the user successfully registers a user account, the SDK triggers the [`LocalUserRegistered`]{@link RtcEngineEvents.LocalUserRegistered} callback on the local client, reporting the user ID and user account of the local user. + * * To join a channel with a user account, you can choose either of the following: - * - Call the registerLocalUserAccount method to create a user account, and then the joinChannelWithUserAccount method to join the channel. - * @see RtcEngine.registerLocalUserAccount - * - Call the joinChannelWithUserAccount method to join the channel. - * @see RtcEngine.joinChannelWithUserAccount - * The difference between the two is that for the former, the time elapsed between calling the joinChannelWithUserAccount method and joining the channel is shorter than the latter. - * Note - * - Ensure that you set the userAccount parameter. Otherwise, this method does not take effect. - * - Ensure that the value of the userAccount parameter is unique in the channel. - * - To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. + * - Call this method to create a user account, and then [`joinChannelWithUserAccount`]{@link joinChannelWithUserAccount} to join the channel. + * + * - Call [`joinChannelWithUserAccount`]{@link joinChannelWithUserAccount} to join the channel. + * + * The difference between the two is that for the former, the time elapsed between calling the [`joinChannelWithUserAccount`]{@link joinChannelWithUserAccount} method and joining the channel is shorter than the latter. + * + * **Note** + * + * - Ensure that you set the `userAccount` parameter. Otherwise, this method does not take effect. + * - Ensure that the value of the `userAccount` parameter is unique in the channel. + * - To ensure smooth communication, use the same parameter type to identify the user. + * For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. + * The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. * @param appId The App ID of your project. - * @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported character scopes are: + * @param userAccount The user account. The maximum length of this parameter is 255 bytes. + * Ensure that you set this parameter and do not set it as null. Supported character scopes are: * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. * - All numeric characters: 0 to 9. @@ -488,16 +543,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the playback volume of all remote users. - * Note + * + * **Note** + * * - This method adjusts the playback volume which is mixed volume of all remote users. - * - To mute the local audio playback, call both adjustPlaybackSignalVolume and adjustAudioMixingVolume, and set volume as 0. - * @see RtcEngine.adjustPlaybackSignalVolume - * @see RtcEngine.adjustAudioMixingVolume - * - To avoid echoes and improve call quality, Agora recommends setting the value of volume between 0 and 100. If you need to set the value higher than 100, contact support@agora.io first. + * - To mute the local audio playback, call both this method and [`adjustAudioMixingVolume`]{@link adjustAudioMixingVolume}, and set `volume` as `0`. + * * @param volume The playback volume of all remote users. The value ranges from 0 to 400: * - 0: Mute. * - 100: The original volume. - * - 400: (Maximum) Four times the original volume with signal clipping protection. + * - 400: (Maximum) Four times the original volume with signal clipping protection. To avoid echoes and improve call quality, + * Agora recommends setting the value of volume between 0 and 100. If you need to set the value higher than 100, contact support@agora.io first. */ adjustPlaybackSignalVolume(volume: number): Promise { return AgoraRtcEngineModule.adjustPlaybackSignalVolume(volume); @@ -505,12 +561,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the recording volume. - * Note - * - To avoid echoes and improve call quality, Agora recommends setting the value of volume between 0 and 100. If you need to set the value higher than 100, contact support@agora.io first. + * * @param volume Recording volume. The value ranges between 0 and 400: * - 0: Mute. * - 100: Original volume. - * - 400: (Maximum) Four times the original volume with signal-clipping protection. + * - 400: (Maximum) Four times the original volume with signal-clipping protection. To avoid echoes and improve call quality, Agora recommends setting the value of volume between 0 and 100. + * If you need to set the value higher than 100, contact support@agora.io first. */ adjustRecordingSignalVolume(volume: number): Promise { return AgoraRtcEngineModule.adjustRecordingSignalVolume(volume); @@ -518,8 +574,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the playback volume of a specified remote user. + * * You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user. - * Note + * + * **Note** * - Call this method after joining a channel. * - The playback volume here refers to the mixed volume of a specified remote user. * - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. @@ -534,18 +592,23 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Disables the audio module. - * Note - * - This method affects the internal engine and can be called after calling the leaveChannel method. You can call this method either before or after joining a channel. - * @see RtcEngine.leaveChannel - * - This method resets the engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately: - * -- enableLocalAudio: Whether to enable the microphone to create the local audio stream. - * @see RtcEngine.enableLocalAudio - * -- muteLocalAudioStream: Whether to publish the local audio stream. - * @see RtcEngine.muteLocalAudioStream - * -- muteRemoteAudioStream: Whether to subscribe to and play the remote audio stream. - * @see RtcEngine.muteRemoteAudioStream - * -- muteAllRemoteAudioStreams: Whether to subscribe to and play all remote audio streams. - * @see RtcEngine.muteAllRemoteAudioStreams + * + * **Note** + * + * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. + * You can call this method either before or after joining a channel. + * + * - This method resets the engine and takes some time to take effect. + * We recommend using the following API methods to control the audio engine modules separately: + * + * - [`enableLocalAudio`]{@link enableLocalAudio}: Whether to enable the microphone to create the local audio stream. + * + * - [`muteLocalAudioStream`]{@link muteLocalAudioStream}: Whether to publish the local audio stream. + * + * - [`muteRemoteAudioStream`]{@link muteRemoteAudioStream}: Whether to subscribe to and play the remote audio stream. + * + * - [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams}: Whether to subscribe to and play all remote audio streams. + * */ disableAudio(): Promise { return AgoraRtcEngineModule.disableAudio(); @@ -553,35 +616,45 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables the audio module. + * * The audio module is enabled by default. - * Note - * - This method affects the internal engine and can be called after calling the leaveChannel method. You can call this method either before or after joining a channel. - * @see RtcEngine.leaveChannel - * - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the audio engine modules separately: - * -- enableLocalAudio: Whether to enable the microphone to create the local audio stream. - * @see RtcEngine.enableLocalAudio - * -- muteLocalAudioStream: Whether to publish the local audio stream. - * @see RtcEngine.muteLocalAudioStream - * -- muteRemoteAudioStream: Whether to subscribe to and play the remote audio stream. - * @see RtcEngine.muteRemoteAudioStream - * -- muteAllRemoteAudioStreams: Whether to subscribe to and play all remote audio streams. - * @see RtcEngine.muteAllRemoteAudioStreams + * + * **Note** + * + * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. + * You can call this method either before or after joining a channel. + * + * - This method resets the internal engine and takes some time to take effect. + * We recommend using the following API methods to control the audio engine modules separately: + * + * - [`enableLocalAudio`]{@link enableLocalAudio}: Whether to enable the microphone to create the local audio stream. + * + * - [`muteLocalAudioStream`]{@link muteLocalAudioStream}: Whether to publish the local audio stream. + * + * - [`muteRemoteAudioStream`]{@link muteRemoteAudioStream}: Whether to subscribe to and play the remote audio stream. + * + * - [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams}: Whether to subscribe to and play all remote audio streams. + * */ enableAudio(): Promise { return AgoraRtcEngineModule.enableAudio(); } /** - * Enables the onAudioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume. - * @see RtcEngineEvents.AudioVolumeIndication - * Once this method is enabled, the SDK returns the volume indication in the onAudioVolumeIndication callback at the set time interval, regardless of whether any user is speaking in the channel. + * Enables the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback at a set time interval to + * report on which users are speaking and the speakers' volume. + * + * Once this method is enabled, the SDK returns the volume indication in the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback at the set time interval, + * regardless of whether any user is speaking in the channel. * @param interval Sets the time interval between two consecutive volume indications: * - ≤ 0: Disables the volume indication. * - > 0: Time interval (ms) between two consecutive volume indications. We recommend setting interval ≥ 200 ms. - * @param smooth The smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. The recommended value is 3. + * @param smooth The smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. + * The recommended value is 3. * @param report_vad - * - true: Enable the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user. - * - false: (Default) Disable the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback does not report the voice activity status of the local user, except for scenarios where the engine automatically detects the voice activity of the local user. + * - true: Enable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback reports the voice activity status of the local user. + * - false: (Default) Disable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback does not report the voice activity status of the local user, + * except for scenarios where the engine automatically detects the voice activity of the local user. */ enableAudioVolumeIndication(interval: number, smooth: number, report_vad: boolean): Promise { return AgoraRtcEngineModule.enableAudioVolumeIndication(interval, smooth, report_vad); @@ -589,16 +662,24 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables the local audio capture. - * The audio function is enabled by default. This method disables/re-enables the local audio function, that is, to stop or restart local audio capture and processing. - * This method does not affect receiving or playing the remote audio streams, and enableLocalAudio(false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel. - * The SDK triggers the onMicrophoneEnabled callback once the local audio function is disabled or re-enabled. - * @see RtcEngineEvents.MicrophoneEnabled - * Note - * - This method is different from the muteLocalAudioStream method: - * -- enableLocalAudio: Disables/Re-enables the local audio capture and processing. If you disable or re-enable local audio recording using the enableLocalAudio method, the local user may hear a pause in the remote audio playback. - * @see RtcEngine.enableLocalAudio - * -- muteLocalAudioStream: Stops/Continues sending the local audio streams. - * @see RtcEngine.muteLocalAudioStream + * + * The audio function is enabled by default. This method disables/re-enables the local audio function, that is, + * to stop or restart local audio capture and processing. + * + * This method does not affect receiving or playing the remote audio streams, and `enableLocalAudio(false)` is applicable to scenarios + * where the user wants to receive remote audio streams without sending any audio stream to other users in the channel. + * + * The SDK triggers the [`MicrophoneEnabled`]{@link RtcEngineEvents.MicrophoneEnabled} callback once the local audio function is disabled or re-enabled. + * + * **Note** + * + * - This method is different from the [`muteLocalAudioStream`]{@link muteLocalAudioStream} method: + * + * - [`enableLocalAudio`]{@link enableLocalAudio}: Disables/Re-enables the local audio capture and processing. + * If you disable or re-enable local audio recording using [`enableLocalAudio`]{@link enableLocalAudio}, the local user may hear a pause in the remote audio playback. + * + * - [`muteLocalAudioStream`]{@link muteLocalAudioStream}: Stops/Continues sending the local audio streams. + * * @param enabled Sets whether to disable/re-enable the local audio function: * - true: (Default) Re-enable the local audio function, that is, to start local audio capture and processing. * - false: Disable the local audio function, that is, to stop local audio capture and processing. @@ -609,6 +690,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving all remote audio streams. + * * @param muted Sets whether to receive/stop receiving all remote audio streams: * - true: Stop receiving all remote audio streams. * - false: (Default) Receive all remote audio streams. @@ -619,12 +701,14 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes sending the local audio stream. - * A successful muteLocalAudioStream method call triggers the onUserMuteAudio callback on the remote client. - * @see RtcEngineEvents.UserMuteAudio - * Note - * - When muted is set as true, this method does not disable the microphone and thus does not affect any ongoing recording. - * - If you call setChannelProfile after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. Therefore, we recommend calling this method after the setChannelProfile method. - * @see RtcEngine.setChannelProfile + * A successful [`muteLocalAudioStream`]{@link muteLocalAudioStream} method call triggers the [`UserMuteAudio`]{@link RtcEngineEvents.UserMuteAudio} callback on the remote client. + * + * **Note** + * + * - When `muted` is set as `true`, this method does not disable the microphone and thus does not affect any ongoing recording. + * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. + * Therefore, we recommend calling this method after the [`setChannelProfile`]{@link setChannelProfile} method. + * * @param muted Sets whether to send/stop sending the local audio stream: * - true: Stop sending the local audio stream. * - false: (Default) Send the local audio stream. @@ -635,9 +719,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving a specified audio stream. - * Note - * - If you called the muteAllRemoteAudioStreams method and set muted as true to stop receiving all remote video streams, ensure that the muteAllRemoteAudioStreams method is called and set muted as false before calling this method. The muteAllRemoteAudioStreams method sets all remote audio streams, while the muteRemoteAudioStream method sets a specified remote user's audio stream. - * @see RtcEngine.muteAllRemoteAudioStreams + * + * **Note** + * + * - If you called [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} and set `muted` as `true` to stop receiving all remote video streams, + * ensure that the [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} method is called and set `muted` as `false` before calling this method. + * The [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} method sets all remote audio streams, while the [`muteRemoteAudioStream`]{@link muteRemoteAudioStream} method sets a specified remote user's audio stream. + * * @param uid ID of the specified remote user. * @param muted Sets whether to receive/stop receiving the specified remote user's audio stream: * - true: Stop receiving the specified remote user’s audio stream. @@ -649,17 +737,16 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the audio parameters and application scenarios. - * Note - * - You must call this method before calling the joinChannel method. - * @see RtcEngine.joinChannel - * - In the Communication and Live Broadcast profiles, the bitrates may be different from your settings due to network self-adaptation. - * - In scenarios requiring high-quality audio, we recommend setting profile as ShowRoom(4) and scenario as GameStreaming(3). For example, for music education scenarios. - * @see AudioScenario.ShowRoom - * @see AudioScenario.GameStreaming + * + * **Note** + * + * - You must call this method before calling [`joinChannel`]{@link joinChannel}. + * - In the [`Communication`]{@link ChannelProfile.Communication} and [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. + * - In scenarios requiring high-quality audio, we recommend setting profile as [`ShowRoom(4)`]{@link AudioScenario.ShowRoom} and scenario as [`GameStreaming(3)`]{@link AudioScenario.GameStreaming}. + * For example, for music education scenarios. + * * @param profile Sets the sample rate, bitrate, encoding mode, and the number of channels. - * @see AudioProfile * @param scenario Sets the audio application scenarios. Under different audio scenarios, the device uses different volume tracks, i.e. either the in-call volume or the media volume. - * @see AudioScenario */ setAudioProfile(profile: AudioProfile, scenario: AudioScenario): Promise { return AgoraRtcEngineModule.setAudioProfile(profile, scenario); @@ -667,10 +754,16 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets whether to receive all remote audio streams by default. - * You can call this method either before or after joining a channel. If you call setDefaultMuteAllRemoteAudioStreams(true) after joining a channel, you will not receive the audio streams of any subsequent user. - * Note - * - If you want to resume receiving audio streams, call muteRemoteAudioStream(false), and specify the ID of the remote user that you want to subscribe to. To resume audio streams of multiple users, call muteRemoteAudioStream as many times. Calling setDefaultMuteAllRemoteAudioStreams(false) resumes receiving audio streams of the subsequent users only. - * @see RtcEngine.muteRemoteAudioStream + * + * You can call this method either before or after joining a channel. + * If you call `setDefaultMuteAllRemoteAudioStreams(true)` after joining a channel, you will not receive the audio streams of any subsequent user. + * + * **Note** + * + * If you want to resume receiving audio streams, call [`muteRemoteAudioStream(false)`]{@link muteRemoteAudioStream}, and specify the ID of the remote user that you want to subscribe to. + * To resume audio streams of multiple users, call [`muteRemoteAudioStream`]{@link muteRemoteAudioStream} as many times. + * Calling `setDefaultMuteAllRemoteAudioStreams(false)` resumes receiving audio streams of the subsequent users only. + * * @param muted Sets whether or not to receive/stop receiving the remote audio streams by default: * - true: Stop receiving any audio stream by default. * - false: (Default) Receive all remote audio streams by default. @@ -681,23 +774,32 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Disables the video module. - * You can call this method before joining a channel or during a call. If you call this method before joining a channel, the service starts in audio mode. If you call this method during a video call, the video mode switches to the audio mode. - * - A successful disableVideo method call triggers the onUserEnableVideo(false) callback on the remote client. - * @see RtcEngineEvents.UserEnableVideo - * - To enable the video mode, call the enableVideo method. - * @see RtcEngine.enableVideo - * Note - * - This method affects the internal engine and can be called after calling the leaveChannel method. You can call this method either before or after joining a channel. - * @see RtcEngine.leaveChannel - * - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately: - * -- enableLocalVideo: Whether to enable the camera to create the local video stream. - * @see RtcEngine.enableLocalVideo - * -- muteLocalVideoStream: Whether to publish the local video stream. - * @see RtcEngine.muteLocalVideoStream - * -- muteRemoteVideoStream: Whether to subscribe to and play the remote video stream. - * @see RtcEngine.muteRemoteVideoStream - * -- muteAllRemoteVideoStreams: Whether to subscribe to and play all remote video streams. - * @see RtcEngine.muteAllRemoteVideoStreams + * + * You can call this method before joining a channel or during a call: + * + * - If you call this method before joining a channel, the service starts in audio mode. + * - If you call this method during a video call, the video mode switches to the audio mode. + * + * A successful [`disableVideo]`{@link disableVideo} method call triggers the [`UserEnableVideo(false)`]{@link RtcEngineEvents.UserEnableVideo} callback on the remote client. + * + * To enable the video mode, call [`enableVideo`]{@link enableVideo}. + * + * **Note** + * + * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. + * You can call this method either before or after joining a channel. + * + * - This method resets the internal engine and takes some time to take effect. + * We recommend using the following API methods to control the video engine modules separately: + * + * - [`enableLocalVideo`]{@link enableLocalVideo}: Whether to enable the camera to create the local video stream. + * + * - [`muteLocalVideoStream`]{@link muteLocalVideoStream}: Whether to publish the local video stream. + * + * - [`muteRemoteVideoStream`]{@link muteRemoteVideoStream}: Whether to subscribe to and play the remote video stream. + * + * - [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams}: Whether to subscribe to and play all remote video streams. + * */ disableVideo(): Promise { return AgoraRtcEngineModule.disableVideo(); @@ -705,16 +807,22 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Disables/Re-enables the local video capture. + * * This method disables or re-enables the local video capturer, and does not affect receiving the remote video stream. - * After you call the enableVideo method, the local video capturer is enabled by default. You can call enableLocalVideo(false) to disable the local video capturer. If you want to re-enable it, call enableLocalVideo(true). - * @see RtcEngine.enableVideo - * After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onUserEnableLocalVideo callback on the remote client. - * @see RtcEngineEvents.UserEnableLocalVideo - * Note - * - This method affects the internal engine and can be called after calling the leaveChannel method. + * + * After you call [`enableVideo`]{@link enableVideo}, the local video capturer is enabled by default. + * You can call `enableLocalVideo(false)` to disable the local video capturer. If you want to re-enable it, + * call `enableLocalVideo(true)`. + * + * After the local video capturer is successfully disabled or re-enabled, the SDK triggers the [`UserEnableLocalVideo`]{@link RtcEngineEvents.UserEnableLocalVideo} callback on the remote client. + * + * **Note** + * + * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender: * - true: (Default) Re-enable the local video. - * - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of other remote users. When you set enabled as false, this method does not require a local camera. + * - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of other remote users. + * When you set `enabled` as `false`, this method does not require a local camera. */ enableLocalVideo(enabled: boolean): Promise { return AgoraRtcEngineModule.enableLocalVideo(enabled); @@ -722,23 +830,32 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables the video module. - * You can call this method either before joining a channel or during a call. If you call this method before joining a channel, the service starts in the video mode. If you call this method during an audio call, the audio mode switches to the video mode. - * A successful enableVideo method call triggers the onUserEnableVideo(true) callback on the remote client. - * @see RtcEngineEvents.UserEnableVideo - * To disable the video, call the disableVideo method. - * @see RtcEngine.disableVideo - * Note - * - This method affects the internal engine and can be called after calling the leaveChannel method. You can call this method either before or after joining a channel. - * @see RtcEngine.leaveChannel - * - This method resets the internal engine and takes some time to take effect. We recommend using the following API methods to control the video engine modules separately: - * -- enableLocalVideo: Whether to enable the camera to create the local video stream. - * @see RtcEngine.enableLocalVideo - * -- muteLocalVideoStream: Whether to publish the local video stream. - * @see RtcEngine.muteLocalVideoStream - * -- muteRemoteVideoStream: Whether to subscribe to and play the remote video stream. - * @see RtcEngine.muteRemoteVideoStream - * -- muteAllRemoteVideoStreams: Whether to subscribe to and play all remote video streams. - * @see RtcEngine.muteAllRemoteVideoStreams + * + * You can call this method either before joining a channel or during a call: + * + * - If you call this method before joining a channel, + * the service starts in the video mode. + * - If you call this method during an audio call, the audio mode switches to the video mode. + * + * A successful `enableVideo` method call triggers the [`UserEnableVideo(true)`]{@link RtcEngineEvents.UserEnableVideo} callback on the remote client. + * + * To disable the video, call the {@link disableVideo} method. + * + * **Note** + * + * - This method affects the internal engine and can be called after calling the {@link leaveChannel} method. You can call this method either before or after joining a channel. + * + * - This method resets the internal engine and takes some time to take effect. + * We recommend using the following API methods to control the video engine modules separately: + * + * - [`enableLocalVideo`]{@link enableLocalVideo}: Whether to enable the camera to create the local video stream. + * + * - [`muteLocalVideoStream{`]@link muteLocalVideoStream}: Whether to publish the local video stream. + * + * - [`muteRemoteVideoStream`]{@link muteRemoteVideoStream}: Whether to subscribe to and play the remote video stream. + * + * - [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams}: Whether to subscribe to and play all remote video streams. + * */ enableVideo(): Promise { return AgoraRtcEngineModule.enableVideo(); @@ -746,6 +863,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving all remote video streams. + * * @param muted Sets whether to receive/stop receiving all remote video streams: * - true: Stop receiving all remote video streams. * - false: (Default) Receive all remote video streams. @@ -756,13 +874,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes sending the local video stream. - * A successful muteLocalVideoStream method call triggers the onUserMuteVideo callback on the remote client. - * @see RtcEngineEvents.UserMuteVideo - * Note - * - When you set muted as true, this method does not disable the camera and thus does not affect the retrieval of the local video streams. This method responds faster than calling the enableLocalVideo method and set muted as false, which controls sending the local video stream. - * @see RtcEngine.enableLocalVideo - * - If you call setChannelProfile after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. Therefore, we recommend calling this method after the setChannelProfile method. - * @see RtcEngine.setChannelProfile + * + * A successful [`muteLocalVideoStream`]{@link muteLocalVideoStream} method call triggers the [`UserMuteVideo`]{@link RtcEngineEvents.UserMuteVideo} callback on the remote client. + * + * **Note** + * + * - When you set `muted` as `true`, this method does not disable the camera and thus does not affect the retrieval of the local video streams. + * This method responds faster than calling [`enableLocalVideo`]{@link enableLocalVideo} and set `muted` as `false`, which controls sending the local video stream. + * + * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. + * Therefore, we recommend calling this method after the [`setChannelProfile`]{@link setChannelProfile} method. + * * @param muted Sets whether to send/stop sending the local video stream: * - true: Stop sending the local video stream. * - false: (Default) Send the local video stream. @@ -773,9 +895,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving a specified remote user's video stream. - * Note - * - If you call the muteAllRemoteVideoStreams method and set set muted as true to stop receiving all remote video streams, ensure that the muteAllRemoteVideoStreams method is called and set muted as false before calling this method. The muteAllRemoteVideoStreams method sets all remote streams, while this method sets a specified remote user's stream. - * @see RtcEngine.muteAllRemoteVideoStreams + * + * **Note** + * + * If you call [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} and set `muted` as `true` to stop receiving all remote video streams, + * ensure that the [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} method is called and set `muted` as `false` before calling this method. The [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} method sets all remote streams, while this method sets a specified remote user's stream. + * * @param uid User ID of the specified remote user. * @param muted Sets whether to receive/stop receiving a specified remote user's video stream: * - true: Stop receiving a specified remote user’s video stream. @@ -787,14 +912,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables image enhancement and sets the options. - * Note - * - Call this method after calling enableVideo. + * + * **Note** + * + * - Call this method after calling [`enableVideo`]{@link enableVideo}. * - This method applies to Android 4.4 or later. + * * @param enabled Sets whether or not to enable image enhancement: - * - enables image enhancement. - * - disables image enhancement. + * - true: Enable image enhancement. + * - false: Disable image enhancement. * @param options The image enhancement options. - * @see BeautyOptions + * */ setBeautyEffectOptions(enabled: boolean, options: BeautyOptions): Promise { return AgoraRtcEngineModule.setBeautyEffectOptions(enabled, options); @@ -802,10 +930,15 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets whether to receive all remote video streams by default. - * You can call this method either before or after joining a channel. If you call setDefaultMuteAllRemoteVideoStreams(true) after joining a channel, you will not receive the video stream of any subsequent user. - * Note - * - If you want to resume receiving video streams, call muteRemoteVideoStream(false), and specify the ID of the remote user that you want to subscribe to. To resume receiving video streams of multiple users, call muteRemoteVideoStream as many times. Calling setDefaultMuteAllRemoteVideoStreams(false) resumes receiving video streams of the subsequent users only. - * @see RtcEngine.muteRemoteVideoStream + * + * You can call this method either before or after joining a channel. + * If you call `setDefaultMuteAllRemoteVideoStreams(true)` after joining a channel, you will not receive the video stream of any subsequent user. + * + * **Note** + * + * If you want to resume receiving video streams, call [`muteRemoteVideoStream(false)`]{@link muteRemoteVideoStream}, and specify the ID of the remote user that you want to subscribe to. + * To resume receiving video streams of multiple users, call [`muteRemoteVideoStream`]{@link muteRemoteVideoStream} as many times. Calling `setDefaultMuteAllRemoteVideoStreams(false)` resumes receiving video streams of the subsequent users only. + * * @param muted Sets whether to receive/stop receiving all remote video streams by default: * - true: Stop receiving any remote video stream by default. * - false: (Default) Receive all remote video streams by default. @@ -816,11 +949,14 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the video encoder configuration. - * Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation. The parameters specified in this method are the maximum values under ideal network conditions. If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found. - * If you do not set the video encoder configuration after joining the channel, you can call this method before calling the enableVideo method to reduce the render time of the first video frame. - * @see RtcEngine.enableVideo + * + * Each video encoder configuration corresponds to a set of video parameters, including the resolution, frame rate, bitrate, and video orientation. + * The parameters specified in this method are the maximum values under ideal network conditions. + * If the video engine cannot render the video using the specified parameters due to poor network conditions, the parameters further down the list are considered until a successful configuration is found. + * If you do not set the video encoder configuration after joining the channel, you can call this method before calling [`enableVideo`]{@link enableVideo} to reduce the render time of the first video frame. + * * @param config The local video encoder configuration. - * @see VideoEncoderConfiguration + * */ setVideoEncoderConfiguration(config: VideoEncoderConfiguration): Promise { return AgoraRtcEngineModule.setVideoEncoderConfiguration(config); @@ -828,16 +964,18 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Starts the local video preview before joining a channel. + * * Before calling this method, you must: - * - Create the RtcLocalView. - * @see RtcLocalView - * - Call the enableVideo method to enable the video. - * @see RtcEngine.enableVideo - * Note + * - Create the {@link RtcLocalView}.//TODO Check the link. + * + * - Call the [`enableVideo`]{@link enableVideo} method to enable the video. + * + * **Note** + * * - By default, the local preview enables the mirror mode. - * - Once you call this method to start the local video preview, if you leave the channel by calling the leaveChannel method, the local video preview remains until you call the stopPreview method to disable it. - * @see RtcEngine.leaveChannel - * @see RtcEngine.stopPreview + * - Once you call this method to start the local video preview, if you leave the channel by calling [`leaveChannel`]{@link leaveChannel}, + * the local video preview remains until you call [`stopPreview`]{@link stopPreview} to disable it. + * */ startPreview(): Promise { return AgoraRtcEngineModule.startPreview(); @@ -852,7 +990,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing for local playback. + * + * **Note** + * * Call this method when you are in a channel. + * * @param volume Audio mixing volume for local playback. The value ranges between 0 and 100 (default). */ adjustAudioMixingPlayoutVolume(volume: number): Promise { @@ -861,7 +1003,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing for publishing (sending to other users). + * + * **Note** + * * Call this method when you are in a channel. + * * @param volume Audio mixing volume for publishing. The value ranges between 0 and 100 (default). */ adjustAudioMixingPublishVolume(volume: number): Promise { @@ -870,10 +1016,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing. - * Call this method when you are in a channel. - * Note - * - Calling this method does not affect the volume of the audio effect file playback invoked by the playEffect method. - * @see RtcEngine.playEffect + * + * **Note** + * + * - Call this method when you are in a channel. + * + * - Calling this method does not affect the volume of the audio effect file playback invoked by the [`playEffect`]{@link playEffect} method. + * * @param volume Audio mixing volume. The value ranges between 0 and 100 (default). */ adjustAudioMixingVolume(volume: number): Promise { @@ -882,6 +1031,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the playback position (ms) of the music file. + * + * **Note** + * * Call this method when you are in a channel. */ getAudioMixingCurrentPosition(): Promise { @@ -890,6 +1042,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the duration (ms) of the music file. + * + * **Note** + * * Call this method when you are in a channel. */ getAudioMixingDuration(): Promise { @@ -898,6 +1053,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the audio mixing volume for local playback. + * * This method helps troubleshoot audio volume related issues. */ getAudioMixingPlayoutVolume(): Promise { @@ -906,6 +1062,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the audio mixing volume for publishing. + * * This method helps troubleshoot audio volume related issues. */ getAudioMixingPublishVolume(): Promise { @@ -914,6 +1071,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Pauses playing and mixing the music file. + * * Call this method when you are in a channel. */ pauseAudioMixing(): Promise { @@ -922,6 +1080,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Resumes playing and mixing the music file. + * * Call this method when you are in a channel. */ resumeAudioMixing(): Promise { @@ -930,11 +1089,18 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the pitch of the local music file. - * When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only. - * Note - * - Call this method after calling startAudioMixing. - * @see RtcEngine#startAudioMixing - * @param pitch Sets the pitch of the local music file by chromatic scale. The default value is 0, which means keep the original pitch. The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file. + * + * When a local music file is mixed with a local human voice, call this method to + * set the pitch of the local music file only. + * + * **Note** + * + * Call this method after calling [`startAudioMixing`]{@link startAudioMixing}. + * + * @param pitch Sets the pitch of the local music file by chromatic scale. + * The default value is 0, which means keep the original pitch. + * The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. + * The greater the absolute value of this parameter, the higher or lower the pitch of the local music file. */ setAudioMixingPitch(pitch: number): Promise { return AgoraRtcEngineModule.setAudioMixingPitch(pitch); @@ -950,24 +1116,34 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Starts playing and mixing the music file. - * This method mixes the specified local or online audio file with the audio stream from the microphone, or replaces the microphone’s audio stream with the specified local or remote audio file. You can choose whether the other user can hear the local audio playback and specify the number of playback loops. When the audio mixing file playback finishes after calling this method, the SDK triggers the onAudioMixingFinished callback. - * @see RtcEngineEvents.AudioMixingFinished - * A successful startAudioMixing method call triggers the onAudioMixingStateChanged(Playing) callback on the local client. - * @see RtcEngineEvents.AudioMixingStateChanged - * @see AudioMixingStateCode.Playing - * When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged(Stopped) callback on the local client. - * @see RtcEngineEvents.AudioMixingStateChanged - * @see AudioMixingStateCode.Stopped - * Note + * + * This method mixes the specified local or online audio file with the audio stream from the microphone, + * or replaces the microphone’s audio stream with the specified local or remote audio file. + * You can choose whether the other user can hear the local audio playback and specify the number of playback loops. + * When the audio mixing file playback finishes after calling this method, the SDK triggers the [`AudioMixingFinished`]{@link RtcEngineEvents.AudioMixingFinished} callback. + * + * A successful call of this method triggers the [`AudioMixingStateChanged(Playing)`]{@link RtcEngineEvents.AudioMixingStateChanged} callback on the local client. + * + * + * When the audio mixing file playback finishes, the SDK triggers the [`AudioMixingStateChanged(Stopped)`]{@link RtcEngineEvents.AudioMixingStateChanged} callback on the local client. + * + * + * **Note** + * * - To use this method, ensure that the Android device is v4.2 or later, and the API version is v16 or later. + * * - Call this method when you are in the channel, otherwise it may cause issues. - * - If you want to play an online music file, ensure that the time interval between calling this method is more than 100 ms, or the TooFrequentCall = 702 error occurs. - * @see AudioMixingErrorCode.TooFrequentCall + * + * - If you want to play an online music file, ensure that the time interval between calling this method is more than 100 ms, or the [`TooFrequentCall = 702`]{@link AudioMixingErrorCode.TooFrequentCall} error occurs. + * * - If you want to play an online music file, Agora does not recommend using the redirected URL address. Some Android devices may fail to open a redirected URL address. - * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns CanNotOpen = 701. - * @see AudioMixingErrorCode.CanNotOpen + * + * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns [`CanNotOpen = 701`]{@link AudioMixingErrorCode.CanNotOpen}. + * * - If you call this method on an emulator, only the MP3 file format is supported. - * @param filePath Specifies the absolute path (including the suffixes of the filename) of the local or online audio file to be mixed. For example, /sdcard/emulated/0/audio.mp4. Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv, and wav. + * + * @param filePath Specifies the absolute path (including the suffixes of the filename) of the local or online audio file to be mixed. For example, `/sdcard/emulated/0/audio.mp4`. + * Supported audio formats: mp3, mp4, m4a, aac, 3gp, mkv, and wav. * - If the path begins with /assets/, the audio file is in the /assets/ directory. * - Otherwise, the audio file is in the absolute path. * @param loopback Sets which user can hear the audio mixing: @@ -977,8 +1153,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - true: Only publish the specified audio file; the audio stream from the microphone is not published. * - false: The local audio file is mixed with the audio stream from the microphone. * @param cycle Sets the number of playback loops: - * - Positive integer: Number of playback loops - * - -1: Infinite playback loops + * - Positive integer: Number of playback loops. + * - -1: Infinite playback loops. */ startAudioMixing(filePath: string, loopback: boolean, replace: boolean, cycle: number): Promise { return AgoraRtcEngineModule.startAudioMixing(filePath, loopback, replace, cycle); @@ -986,6 +1162,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops playing or mixing the music file. + * * Call this method when you are in a channel. */ stopAudioMixing(): Promise { @@ -994,6 +1171,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the volume of the audio effects. + * * The value ranges between 0.0 and 100.0. */ getEffectsVolume(): Promise { @@ -1017,25 +1195,31 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Plays a specified local or online audio effect file. + * * With this method, you can set the loop count, pitch, pan, and gain of the audio effect file and whether the remote user can hear the audio effect. - * To play multiple audio effect files simultaneously, call this method multiple times with different soundIds and filePaths. We recommend playing no more than three audio effect files at the same time. - * When the audio effect file playback is finished, the SDK triggers the onAudioEffectFinished callback. - * @see RtcEngineEvents.AudioEffectFinished - * @param soundId ID of the specified audio effect. Each audio effect has a unique ID. If you preloaded the audio effect into the memory through the preloadEffect method, ensure that the soundID value is set to the same value as in the preloadEffect method. - * @see RtcEngine.preloadEffect - * @param filePath The absolute file path (including the suffixes of the filename) of the audio effect file or the URL of the online audio effect file. For example, /sdcard/emulated/0/audio.mp4. Supported audio formats: mp3, mp4, m4a, aac. 3gp, mkv, and wav. + * To play multiple audio effect files simultaneously, call this method multiple times with different `soundId` and `filePath`. + * We recommend playing no more than three audio effect files at the same time. + * When the audio effect file playback is finished, the SDK triggers the [`AudioEffectFinished`]{@link RtcEngineEvents.AudioEffectFinished} callback. + * + * @param soundId ID of the specified audio effect. Each audio effect has a unique ID. If you preloaded the audio effect into the memory + * through the [`preloadEffect`]{@link preloadEffect} method, ensure that the `soundID` value is set to the same value as in the [`preloadEffect`]{@link preloadEffect} method. + * + * @param filePath The absolute file path (including the suffixes of the filename) of the audio effect file or + * the URL of the online audio effect file. For example, `/sdcard/emulated/0/audio.mp4`. + * + * Supported audio formats: mp3, mp4, m4a, aac. 3gp, mkv, and wav. * @param loopCount Sets the number of times the audio effect loops: * - 0: Plays the audio effect once. * - 1: Plays the audio effect twice. - * - -1: Plays the audio effect in a loop indefinitely, until you call the stopEffect or stopAllEffects method. - * @see RtcEngine.stopEffect - * @see RtcEngine.stopAllEffects - * @param pitch Sets the pitch of the audio effect. The value ranges between 0.5 and 2. The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. + * - -1: Plays the audio effect in a loop indefinitely, until you call the [`stopEffect`]{@link stopEffect} or [`stopAllEffects`]{@link stopAllEffects} method. + * @param pitch Sets the pitch of the audio effect. The value ranges between 0.5 and 2. + * The default value is 1 (no change to the pitch). The lower the value, the lower the pitch. * @param pan Sets the spatial position of the audio effect. The value ranges between -1.0 and 1.0. * - 0.0: The audio effect shows ahead. * - 1.0: The audio effect shows on the right. * - -1.0: The audio effect shows on the left. - * @param gain Sets the volume of the audio effect. The value ranges between 0.0 and 100,0. The default value is 100.0. The lower the value, the lower the volume of the audio effect. + * @param gain Sets the volume of the audio effect. The value ranges between 0.0 and 100,0. + * The default value is 100.0. The lower the value, the lower the volume of the audio effect. * @param publish Set whether or not to publish the specified audio effect to the remote stream: * - true: The locally played audio effect is published to the Agora Cloud and the remote users can hear it. * - false: The locally played audio effect is not published to the Agora Cloud and the remote users cannot hear it. @@ -1046,12 +1230,15 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Preloads a specified audio effect file into the memory. + * * Supported audio formats: mp3, aac, m4a, 3gp, wav. - * Note + * + * **Note** * - This method does not support online audio effect files. - * Note - * - To ensure smooth communication, limit the size of the audio effect file. We recommend using this method to preload the audio effect before calling the joinChannel method. - * @see RtcEngine.joinChannel + * + * - To ensure smooth communication, limit the size of the audio effect file. + * We recommend using this method to preload the audio effect before calling [`joinChannel`]{@link joinChannel}. + * * @param soundId ID of the audio effect. Each audio effect has a unique ID. * @param filePath Absolute path of the audio effect file. */ @@ -1100,9 +1287,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops playing a specified audio effect. - * Note - * - If you preloaded the audio effect into the memory through the preloadEffect method, ensure that the soundID value is set to the same value as in the preloadEffect method. - * @see RtcEngine.preloadEffect + * + * **Note:** + * + * If you preloaded the audio effect into the memory through the [`preloadEffect`]{@link preloadEffect} method, + * ensure that the `soundID` value is set to the same value as in the [`preloadEffect`]{@link preloadEffect} method. + * * @param soundId ID of the specified audio effect. Each audio effect has a unique ID. */ stopEffect(soundId: number): Promise { @@ -1119,11 +1309,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice changer option. - * Note - * - Do not use this method together with setLocalVoiceReverbPreset, or the method called earlier does not take effect. - * @see RtcEngine.setLocalVoiceReverbPreset + * + * **Note** + * + * Do not use this method together with [`setLocalVoiceReverbPreset`]{@link setLocalVoiceReverbPreset}, or the method called earlier does not take effect. + * * @param voiceChanger The local voice changer option. - * @see AudioVoiceChanger + * */ setLocalVoiceChanger(voiceChanger: AudioVoiceChanger): Promise { return AgoraRtcEngineModule.setLocalVoiceChanger(voiceChanger); @@ -1131,8 +1323,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice equalization effect. + * * @param bandFrequency Sets the band frequency. The value ranges between 0 and 9; representing the respective 10-band center frequencies of the voice effects, including 31, 62, 125, 500, 1k, 2k, 4k, 8k, and 16k Hz. - * @see AudioEqualizationBandFrequency + * * @param bandGain Sets the gain of each band (dB). The value ranges between -15 and 15. The default value is 0. */ setLocalVoiceEqualization(bandFrequency: AudioEqualizationBandFrequency, bandGain: number): Promise { @@ -1141,7 +1334,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Changes the voice pitch of the local speaker. - * @param pitch Sets the voice pitch. The value ranges between 0.5 and 2.0. The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). + * @param pitch Sets the voice pitch. The value ranges between 0.5 and 2.0. + * The lower the value, the lower the voice pitch. The default value is 1.0 (no change to the local voice pitch). */ setLocalVoicePitch(pitch: number): Promise { return AgoraRtcEngineModule.setLocalVoicePitch(pitch); @@ -1149,26 +1343,32 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice reverberation. - * Note - * - Adds the setLocalVoiceReverbPreset method, a more user-friendly method for setting the local voice reverberation. You can use this method to set the local reverberation effect, such as Popular, R&B, Rock, Hip-hop, and more. - * @see RtcEngine.setLocalVoiceReverbPreset - * @param reverbKey Sets the reverberation key. This method contains five reverberation keys. For details, see the description of each @ value. - * @see AudioReverbType - * @param value Sets the local voice reverberation value. + * + * **Note** + * + * Adds the [`setLocalVoiceReverbPreset`]{@link setLocalVoiceReverbPreset} method, a more user-friendly method for setting the + * local voice reverberation. You can use this method to set the local reverberation effect, + * such as Popular, R&B, Rock, Hip-hop, and more. + * + * @param reverbKey The reverberation key: [`AudioReverbType`]{@link AudioReverbType} + * + * @param value The local voice reverberation value. */ setLocalVoiceReverb(reverbKey: AudioReverbType, value: number): Promise { return AgoraRtcEngineModule.setLocalVoiceReverb(reverbKey, value); } /** - * Sets the preset local voice reverberation effect - * Note - * - Do not use this method together with setLocalVoiceReverb. - * @see RtcEngine.setLocalVoiceReverb - * - Do not use this method together with setLocalVoiceChanger, or the method called eariler does not take effect. - * @see RtcEngine.setLocalVoiceChanger - * @param preset The local voice reverberation preset - * @see AudioReverbPreset + * Sets the preset local voice reverberation effect. + * + * **Note** + * + * - Do not use this method together with [`setLocalVoiceReverb`]{@link setLocalVoiceReverb}. + * + * - Do not use this method together with [`setLocalVoiceChanger`]{@link setLocalVoiceChanger}, or the method called earlier does not take effect. + * + * @param preset The local voice reverberation preset. + * */ setLocalVoiceReverbPreset(preset: AudioReverbPreset): Promise { return AgoraRtcEngineModule.setLocalVoiceReverbPreset(preset); @@ -1176,12 +1376,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables stereo panning for remote users. - * Ensure that you call this method before joinChannel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition. - * @see RtcEngine.joinChannel - * @see RtcEngine.setRemoteVoicePosition + * + * Ensure that you call this method before calling [`joinChannel`]{@link joinChannel} to enable stereo panning for remote users so that + * the local user can track the position of a remote user by calling [`setRemoteVoicePosition`]{@link setRemoteVoicePosition}. + * * @param enabled Sets whether or not to enable stereo panning for remote users: - * - true: enables stereo panning. - * - false: disables stereo panning. + * - true: Enable stereo panning. + * - false: Disable stereo panning. */ enableSoundPositionIndication(enabled: boolean): Promise { return AgoraRtcEngineModule.enableSoundPositionIndication(enabled); @@ -1189,17 +1390,26 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the sound position of a remote user. - * When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. - * Note - * - For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel. - * @see RtcEngine.enableSoundPositionIndication + * + * When the local user calls this method to set the sound position of a remote user, + * the sound difference between the left and right channels allows the local user to track the real-time + * position of the remote user, creating a real sense of space. + * This method applies to massively multiplayer online games, such as Battle Royale games. + * + * **Note** + * + * - For this method to work, enable stereo panning for remote users by calling the [`enableSoundPositionIndication`]{@link enableSoundPositionIndication} method before joining a channel. + * * - This method requires hardware support. For the best sound positioning, we recommend using a stereo headset. + * * @param uid The ID of the remote user. - * @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: + * @param pan The sound position of the remote user. + * The value ranges from -1.0 to 1.0: * - 0.0: The remote sound comes from the front. * - -1.0: The remote sound comes from the left. * - 1.0: The remote sound comes from the right. - * @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. + * @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. + * The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. */ setRemoteVoicePosition(uid: number, pan: number, gain: number): Promise { return AgoraRtcEngineModule.setRemoteVoicePosition(uid, pan, gain); @@ -1207,16 +1417,20 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Publishes the local stream to the CDN. - * The addPublishStreamUrl method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN. - * @see RtcEngineEvents.RtmpStreamingStateChanged - * Note - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. - * - This method applies to Live Broadcast only. + * + * This method call triggers the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback on the local client to report the state of adding a local stream to the CDN. + * + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. + * // TODO See Prerequisites in *Push Streams to CDN*? + * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that the user joins a channel before calling this method. * - This method adds only one stream HTTP/HTTPS URL address each time it is called. - * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. - * @param transcodingEnabled Sets whether transcoding is enabled/disabled. If you set this parameter as true, ensure that you call the setLiveTranscoding method before this method. - * @see RtcEngine.setLiveTranscoding + * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. + * The URL address must not contain special characters, such as Chinese language characters. + * @param transcodingEnabled Sets whether transcoding is enabled/disabled. + * If you set this parameter as `true`, ensure that you call [`setLiveTranscoding`]{@link setLiveTranscoding} before this method. + * * - true: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. * - false: Disable transcoding. */ @@ -1226,15 +1440,18 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Removes an RTMP stream from the CDN. - * This method removes the RTMP URL address (added by addPublishStreamUrl) from a CDN live stream. The SDK reports the result of this method call in the onRtmpStreamingStateChanged callback. - * @see RtcEngine.addPublishStreamUrl - * @see RtcEngineEvents.RtmpStreamingStateChanged - * Note - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. + * + * This method removes the RTMP URL address (added by {@link addPublishStreamUrl}) from a CDN live stream. + * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback. + * + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. + * // TODO See Prerequisites in *Push Streams to CDN*? * - Ensure that the user joins a channel before calling this method. - * - This method applies to Live Broadcast only. + * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - This method removes only one stream RTMP URL address each time it is called. - * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. + * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. + * The URL address must not contain special characters, such as Chinese language characters. */ removePublishStreamUrl(url: string): Promise { return AgoraRtcEngineModule.removePublishStreamUrl(url); @@ -1242,18 +1459,20 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the video layout and audio settings for CDN live. - * The SDK triggers the onTranscodingUpdated callback when you call this method to update the LiveTranscodingclass. If you call this method to set the LiveTranscoding class for the first time, the SDK does not trigger the onTranscodingUpdated callback. - * @see RtcEngineEvents.TranscodingUpdated - * Note - * - Before calling the methods listed in this section: - * -- This method applies to Live Broadcast only. - * -- Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. - * -- Ensure that you call the setClientRole method and set the user role as the host. - * @see RtcEngine.setClientRole - * -- Ensure that you call the setLiveTranscoding method before calling the addPublishStreamUrl method. - * @see RtcEngine.addPublishStreamUrl + * + * The SDK triggers the [`TranscodingUpdated`]{@link RtcEngineEvents.TranscodingUpdated} callback when you call this method to update the [`LiveTranscoding`]{@link LiveTranscoding} class. + * If you call this method to set the [`LiveTranscoding`]{@link LiveTranscoding} class for the first time, + * the SDK does not trigger the [`TranscodingUpdated`]{@link RtcEngineEvents.TranscodingUpdated} callback. + * + * **Note** + * + * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. //TODO See Prerequisites in *Push Streams to CDN*? + * - Ensure that you call [`setClientRole`]{@link setClientRole} and set the user role as the host. + * - Ensure that you call [`setLiveTranscoding`]{@link setLiveTranscoding} before calling [`addPublishStreamUrl`]{@link addPublishStreamUrl}. + * * @param transcoding Sets the CDN live audio/video transcoding settings. - * @see LiveTranscoding + * */ setLiveTranscoding(transcoding: LiveTranscoding): Promise { return AgoraRtcEngineModule.setLiveTranscoding(transcoding); @@ -1261,25 +1480,26 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Starts to relay media streams across channels. - * After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay. - * @see RtcEngineEvents.ChannelMediaRelayStateChanged - * @see RtcEngineEvents.ChannelMediaRelayEvent - * - If the onChannelMediaRelayStateChanged callback returns Running(2) and None(0), and the onChannelMediaRelayEvent callback returns SentToDestinationChannel(4), the SDK starts relaying media streams between the original and the destination channel. - * @see ChannelMediaRelayState.Running - * @see ChannelMediaRelayError.None - * @see ChannelMediaRelayEvent.SentToDestinationChannel - * - If the onChannelMediaRelayStateChanged callback returns Failure(3), an exception occurs during the media stream relay. - * @see ChannelMediaRelayState.Failure - * Note + * + * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} and [`ChannelMediaRelayEvent`]{@link RtcEngineEvents.ChannelMediaRelayEvent} callbacks, and these + * callbacks return the state and events of the media stream relay. + * + * If the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback returns [`Running(2)`]{@link ChannelMediaRelayState.Running} and [`None(0)`]{@link ChannelMediaRelayError.None}, + * and the [`ChannelMediaRelayEvent`]{@link RtcEngineEvents.ChannelMediaRelayEvent} callback returns [`SentToDestinationChannel(4)`]{@link ChannelMediaRelayEvent.SentToDestinationChannel}, the SDK starts relaying media streams between the original and the destination channel. + * + * If the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. + * + * **Note** + * * - Contact sales-us@agora.io before implementing this function. * - We do not support string user accounts in this API. - * - Call this method after the joinChannel method. - * @see RtcEngine.joinChannel - * - This method takes effect only when you are a broadcaster in a Live-broadcast channel. - * - After a successful method call, if you want to call this method again, ensure that you call the stopChannelMediaRelay method to quit the current relay. - * @see RtcEngine.stopChannelMediaRelay + * - Call this method after the [`joinChannel`]{@link joinChannel} method. + * - This method takes effect only when you are a [`Broadcaster`]{@link ClientRole.Broadcaster} + * in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel. + * - After a successful method call, if you want to call this method again, ensure that you call [`stopChannelMediaRelay`]{@link stopChannelMediaRelay} to quit the current relay. + * * @param channelMediaRelayConfiguration The configuration of the media stream relay. - * @see ChannelMediaRelayConfiguration + * */ startChannelMediaRelay(channelMediaRelayConfiguration: ChannelMediaRelayConfiguration): Promise { return AgoraRtcEngineModule.startChannelMediaRelay(channelMediaRelayConfiguration); @@ -1287,17 +1507,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops the media stream relay. - * Once the relay stops, the broadcaster quits all the destination channels. - * After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback returns Idle(0) and None(0), the broadcaster successfully stops the relay. - * @see RtcEngineEvents.ChannelMediaRelayStateChanged - * @see ChannelMediaRelayState.Idle - * @see ChannelMediaRelayError.None - * Note - * - If the method call fails, the SDK triggers the onChannelMediaRelayStateChanged callback with the ServerNoResponse(2) or ServerConnectionLost(8) state code. You can leave the channel by calling the leaveChannel method, and the media stream relay automatically stops. - * @see RtcEngineEvents.ChannelMediaRelayStateChanged - * @see ChannelMediaRelayError.ServerNoResponse - * @see ChannelMediaRelayError.ServerConnectionLost - * @see RtcEngine.leaveChannel + * + * Once the relay stops, the host quits all the destination channels. + * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback. + * If the callback returns [`Idle(0)`]{@link ChannelMediaRelayState.Idle} and [`None(0)`]{@link ChannelMediaRelayError.None}, the host successfully stops the relay. + * + * **Note** + * + * If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback with the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} + * or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerNoResponse} state code. + * You can leave the channel by calling [`leaveChannel`]{@link leaveChannel}, and the media stream relay automatically stops. + * */ stopChannelMediaRelay(): Promise { return AgoraRtcEngineModule.stopChannelMediaRelay(); @@ -1305,16 +1525,19 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Updates the channels for media relay. - * After the channel media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay method. - * After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the UpdateDestinationChannel(7) state code. - * @see RtcEngineEvents.ChannelMediaRelayEvent - * @see ChannelMediaRelayEvent.UpdateDestinationChannel - * Note - * - Call this method after the startChannelMediaRelay method to update the destination channel. - * @see RtcEngine.startChannelMediaRelay + * + * After the channel media relay starts, if you want to relay the media stream to more channels, + * or leave the current relay channel, you can call [`updateChannelMediaRelay`]{@link updateChannelMediaRelay}. + * + * After a successful method call, the SDK triggers the [`ChannelMediaRelayEvent`]{@link RtcEngineEvents.ChannelMediaRelayEvent} callback with the [`UpdateDestinationChannel(7)`]{@link ChannelMediaRelayEvent.UpdateDestinationChannel} state code. + * + * **Note** + * + * - Call this method after the [`startChannelMediaRelay`]{@link startChannelMediaRelay} method to update the destination channel. + * * - This method supports adding at most four destination channels in the relay. If there are already four destination channels in the relay. * @param channelMediaRelayConfiguration The media stream relay configuration - * @see ChannelMediaRelayConfiguration + * */ updateChannelMediaRelay(channelMediaRelayConfiguration: ChannelMediaRelayConfiguration): Promise { return AgoraRtcEngineModule.updateChannelMediaRelay(channelMediaRelayConfiguration); @@ -1329,20 +1552,24 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the default audio playback route. - * This method sets whether the received audio is routed to the earpiece or speakerphone by default before joining a channel. If a user does not call this method, the audio is routed to the earpiece by default. If you need to change the default audio route after joining a channel, call the setEnableSpeakerphone method. - * @see RtcEngine.setEnableSpeakerphone + * + * This method sets whether the received audio is routed to the earpiece or speakerphone + * by default before joining a channel. If a user does not call this method, + * the audio is routed to the earpiece by default. If you need to change the default audio route after + * joining a channel, call [`setEnableSpeakerphone`]{@link setEnableSpeakerphone}. + * * The default audio route for each scenario: - * - In the Communication profile: - * @see ChannelProfile.Communication - * -- For a voice call, the default audio route is the earpiece. - * -- For a video call, the default audio route is the speaker. If the user disables the video using disableVideo, or muteLocalVideoStream and muteAllRemoteVideoStreams, the default audio route automatically switches back to the earpiece. - * @see RtcEngine.disableVideo - * @see RtcEngine.muteLocalVideoStream - * @see RtcEngine.muteAllRemoteVideoStreams - * - In the Live Broadcast profile: The default audio route is the speaker. - * @see ChannelProfile.LiveBroadcasting - * Note - * - This method applies to the Communication profile only. + * - In the [`Communication`]{@link ChannelProfile.Communication} profile: + * + * - For a voice call, the default audio route is the earpiece. + * - For a video call, the default audio route is the speaker. If the user disables the video + * using [`disableVideo`]{@link disableVideo}, or [`muteLocalVideoStream`]{@link muteLocalVideoStream} and [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams}, the default audio route automatically switches back to the earpiece. + * + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. + * + * **Note** + * + * - This method applies to the [`Communication`]{@link ChannelProfile.Communication} profile only. * - Call this method before the user joins a channel. * @param defaultToSpeaker Sets the default audio route: * - true: Route the audio to the speaker. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the earpiece. @@ -1354,13 +1581,16 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables the audio playback route to the speakerphone. - * This method sets whether the audio is routed to the speakerphone or earpiece. After calling this method, the SDK returns the onAudioRouteChanged callback to indicate the changes. - * @see RtcEngineEvents.AudioRouteChanged - * Note - * - Ensure that you have successfully called the joinChannel method before calling this method. - * @see RtcEngine.joinChannel - * - This method is invalid for audience users in the Live Broadcast profile. - * @see ChannelProfile.LiveBroadcasting + * + * This method sets whether the audio is routed to the speakerphone or earpiece. + * After calling this method, the SDK returns the [`AudioRouteChanged`]{@link RtcEngineEvents.AudioRouteChanged} callback to indicate the changes. + * + * **Note** + * + * - Ensure that you have successfully called [`joinChannel`]{@link joinChannel} before calling this method. + * + * - This method is invalid for audience users in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * * @param enabled Sets whether to route the audio to the speakerphone or earpiece: * - true: Route the audio to the speakerphone. * - false: Route the audio to the earpiece. If the headset is plugged in, the audio is routed to the headset. @@ -1389,7 +1619,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables the dual video stream mode. - * If dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution high-bitrate video stream) or low stream (low-resolution low-bitrate video stream) video. + * + * If dual-stream mode is enabled, the receiver can choose to receive the high stream (high-resolution high-bitrate video stream) or + * low stream (low-resolution low-bitrate video stream) video. + * * @param enabled Sets the stream mode: * - true: Dual-stream mode. * - false: (Default) Single-stream mode. @@ -1399,9 +1632,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Sets the default video-stream type of the remotely subscribed video stream when the remote user sends dual streams. + * Sets the default video-stream type of the remotely subscribed video stream + * when the remote user sends dual streams. + * * @param streamType Sets the default video-stream type. - * @see VideoStreamType + * */ setRemoteDefaultVideoStreamType(streamType: VideoStreamType): Promise { return AgoraRtcEngineModule.setRemoteDefaultVideoStreamType(streamType); @@ -1409,15 +1644,22 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the stream type of the remote video. - * Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode(false), the receiver can choose to receive either the high-video stream (the high resolution, and high bitrate video stream) or the low-video stream (the low resolution, and low bitrate video stream). - * @see RtcEngine.enableDualStreamMode - * By default, users receive the high-video stream. Call this method if you want to switch to the low-video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. - * The aspect ratio of the low-video stream is the same as the high-video stream. Once the resolution of the high-video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. - * The SDK reports the result of calling this method in the onApiCallExecuted callback. - * @see RtcEngineEvents.ApiCallExecuted + * + * Under limited network conditions, if the publisher has not disabled the + * dual-stream mode using [`enableDualStreamMode(false)`]{@link RtcEngine.enableDualStreamMode}, the receiver can choose to receive + * either the high-video stream (the high resolution, and high bitrate video stream) or the low-video stream (the low resolution, and low bitrate video stream). + * + * By default, users receive the high-video stream. Call this method if you want to switch to the low-video stream. This method allows the app to adjust the corresponding video stream type + * based on the size of the video window to reduce the bandwidth and resources. + * + * The aspect ratio of the low-video stream is the same as the high-video stream. Once the resolution of the high-video stream is set, + * the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + * + * The SDK reports the result of calling this method in the [`ApiCallExecuted`]{@link RtcEngineEvents.ApiCallExecuted} callback. + * * @param uid ID of the remote user sending the video stream. * @param streamType Sets the video-stream type. - * @see VideoStreamType + * */ setRemoteVideoStreamType(uid: number, streamType: VideoStreamType): Promise { return AgoraRtcEngineModule.setRemoteVideoStreamType(uid, streamType); @@ -1425,16 +1667,21 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the fallback option for the locally published video stream based on the network conditions. - * If option is set as AudioOnly(2), the SDK will: - * @see StreamFallbackOptions.AudioOnly + * + * If `option` is set as [`AudioOnly(2)`]{@link StreamFallbackOptions.AudioOnly}, the SDK will: + * * - Disable the upstream video but enable audio only when the network conditions deteriorate and cannot support both video and audio. + * * - Re-enable the video when the network conditions improve. - * When the locally published video stream falls back to audio only or when the audio-only stream switches back to the video, the SDK triggers the onLocalPublishFallbackToAudioOnly. - * @see RtcEngineEvents.LocalPublishFallbackToAudioOnly - * Note - * - Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only. + * + * When the locally published video stream falls back to audio only or when the audio-only stream + * switches back to the video, the SDK triggers the [`LocalPublishFallbackToAudioOnly`]{@link RtcEngineEvents.LocalPublishFallbackToAudioOnly}. + * + * **Note** + * + * Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only. * @param option Sets the fallback option for the locally published video stream. - * @see StreamFallbackOptions + * */ setLocalPublishFallbackOption(option: StreamFallbackOptions): Promise { return AgoraRtcEngineModule.setLocalPublishFallbackOption(option); @@ -1442,11 +1689,16 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the fallback option for the remotely subscribed video stream based on the network conditions. - * If option is set as AudioOnly(2), the SDK automatically switches the video from a high-stream to a low-stream, or disables the video when the downlink network condition cannot support both audio and video to guarantee the quality of the audio. The SDK monitors the network quality and restores the video stream when the network conditions improve. When the remotely subscribed video stream falls back to audio only, or the audio-only stream switches back to the video, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback. - * @see StreamFallbackOptions.AudioOnly - * @see RtcEngineEvents.RemoteSubscribeFallbackToAudioOnly + * + * If `option` is set as [`AudioOnly(2)`]{@link StreamFallbackOptions.AudioOnly}, the SDK automatically switches + * the video from a high-stream to a low-stream, or disables the video when the downlink network condition cannot support + * both audio and video to guarantee the quality of the audio. + * The SDK monitors the network quality and restores the video stream when the network conditions improve. + * When the remotely subscribed video stream falls back to audio only, or the audio-only stream switches back to the video, + * the SDK triggers the [`RemoteSubscribeFallbackToAudioOnly`]{@link RtcEngineEvents.RemoteSubscribeFallbackToAudioOnly} callback. + * * @param option Sets the fallback option for the remotely subscribed video stream. - * @see StreamFallbackOptions + * */ setRemoteSubscribeFallbackOption(option: StreamFallbackOptions): Promise { return AgoraRtcEngineModule.setRemoteSubscribeFallbackOption(option); @@ -1454,13 +1706,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the priority of a remote user's media stream. - * Use this method with the setRemoteSubscribeFallbackOption method. If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. - * @see RtcEngine.setRemoteSubscribeFallbackOption - * Note - * - The Agora SDK supports setting userPriority as high for one user only. + * + * Use this method with the [`setRemoteSubscribeFallbackOption`]{@link setRemoteSubscribeFallbackOption} method. + * If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. + * + * **Note** + * + * The Agora SDK supports setting `userPriority` as high for one user only. + * * @param uid The ID of the remote user. * @param userPriority The priority of the remote user. - * @see UserPriority + * */ setRemoteUserPriority(uid: number, userPriority: UserPriority): Promise { return AgoraRtcEngineModule.setRemoteUserPriority(uid, userPriority); @@ -1475,19 +1731,24 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables the network connection quality test. + * * This method tests the quality of the users' network connections and is disabled by default. - * Before users join a channel or before an audience switches to a host, call this method to check the uplink network quality. This method consumes additional network traffic, which may affect the communication quality. Call the disableLastmileTest method to disable this test after receiving the onLastmileQuality callback, and before the user joins a channel or switches the user role. - * @see RtcEngine.disableLastmileTest - * @see RtcEngineEvents.LastmileQuality - * Note - * - Do not use this method with the startLastmileProbeTest method. - * @see RtcEngine.startLastmileProbeTest - * - Do not call any other methods before receiving the onLastmileQuality callback. Otherwise, the callback may be interrupted by other methods and may not execute. - * @see RtcEngineEvents.LastmileQuality - * - In the Live Broadcast profile, a host should not call this method after joining a channel. - * - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the setVideoEncoderConfiguration method. After you join the channel, whether you have called the disableLastmileTest method or not, the SDK automatically stops consuming the bandwidth. - * @see RtcEngine.setVideoEncoderConfiguration - * @see RtcEngine.disableLastmileTest + * + * Before users join a channel or before an audience switches to a host, call this method to check the + * uplink network quality. This method consumes additional network traffic, which may affect the communication quality. + * Call [`disableLastmileTest`]{@link disableLastmileTest} to disable this test after receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} callback, + * and before the user joins a channel or switches the user role. + * + * **Note** + * + * - Do not use this method with the [`startLastmileProbeTest`]{@link startLastmileProbeTest} method. + * + * - Do not call any other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} callback. Otherwise, the callback may be interrupted by other methods and may not execute. + * + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. + * - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method. + * After you join the channel, whether you have called [`disableLastmileTest`]{@link disableLastmileTest} or not, the SDK automatically stops consuming the bandwidth. + * */ enableLastmileTest(): Promise { return AgoraRtcEngineModule.enableLastmileTest(); @@ -1495,13 +1756,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Starts an audio call test. + * * In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly. - * Note + * + * **Note** + * * - Call this method before joining a channel. - * - After calling this method, call the stopEchoTest method to end the test. Otherwise, the app cannot run the next echo test, or call the joinChannel method. - * @see RtcEngine.stopEchoTest - * @see RtcEngine.joinChannel - * - In the Live Broadcast profile, only a host can call this method. + * + * - After calling this method, call [`stopEchoTest`]{@link stopEchoTest} to end the test. + * Otherwise, the app cannot run the next echo test, or call [`joinChannel`]{@link joinChannel}. + * + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, only a host can call this method. * @param intervalInSeconds The time interval (s) between when you speak and when the recording plays back. */ startEchoTest(intervalInSeconds: number): Promise { @@ -1509,21 +1774,26 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). + * Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, + * including the bandwidth, packet loss, jitter, and round-trip time (RTT). + * * Once this method is enabled, the SDK returns the following callbacks: - * - onLastmileQuality: the SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions with a score and is more closely linked to the user experience. - * @see RtcEngineEvents.LastmileQuality - * - onLastmileProbeResult: the SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. - * @see RtcEngineEvents.LastmileProbeResult + * - [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality}: the SDK triggers this callback within two seconds depending on the network conditions. + * This callback rates the network conditions with a score and is more closely linked to the user experience. + * + * - [`LastmileProbeResult`]{@link RtcEngineEvents.LastmileProbeResult}: the SDK triggers this callback within 30 seconds depending on the network conditions. + * This callback returns the real-time statistics of the network conditions and is more objective. + * * Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. - * Note - * - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with enableLastmileTest. - * @see RtcEngine.enableLastmileTest - * - Do not call other methods before receiving the onLastmileQuality and onLastmileProbeResult callbacks. Otherwise, the callbacks may be interrupted by other methods. - * - In the Live Broadcast profile, a host should not call this method after joining a channel. - * @see ChannelProfile.LiveBroadcasting + * + * **Note** + * + * - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with [`enableLastmileTest`]{@link enableLastmileTest}. + * - Do not call other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} and [`LastmileProbeResult`]{@link RtcEngineEvents.LastmileProbeResult} callbacks. Otherwise, the callbacks may be interrupted by other methods. + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. + * * @param config The configurations of the last-mile network probe test. - * @see LastmileProbeConfig + * */ startLastmileProbeTest(config: LastmileProbeConfig): Promise { return AgoraRtcEngineModule.startLastmileProbeTest(config); @@ -1545,60 +1815,85 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Registers the metadata observer. - * This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. - * Note - * - Call this method before the joinChannel method. - * @see RtcEngine.joinChannel + * + * This method enables you to add synchronized metadata in the video stream for more diversified live streaming interactions, + * such as sending shopping links, digital coupons, and online quizzes. + * + * **Note** + * + * Call this method before the [`joinChannel`]{@link joinChannel} method. + * */ registerMediaMetadataObserver(): Promise { return AgoraRtcEngineModule.registerMediaMetadataObserver(); } - + /** + * Sends the metadata. + * + * @param metadata The metadata to be sent. + * + */ sendMetadata(metadata: string): Promise { return AgoraRtcEngineModule.sendMetadata(metadata); } - + /** + * Sets the maximum size of the metadata. + * + * @param size Buffer size of the sent or received metadata. + * + */ setMaxMetadataSize(size: number): Promise { return AgoraRtcEngineModule.setMaxMetadataSize(size); } - + /** + * Unregisters the metadata observer. + * + */ unregisterMediaMetadataObserver(): Promise { return AgoraRtcEngineModule.unregisterMediaMetadataObserver(); } /** * Adds a watermark image to the local video. - * This method adds a PNG watermark image to the local video stream in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included), and the recording device can see and capture it. - * Agora supports adding only one watermark image onto the local video, and the newly watermark image replaces the previous one. - * The watermark position depends on the settings in the setVideoEncoderConfiguration method: - * @see RtcEngine.setVideoEncoderConfiguration - * - If the orientation mode of the encoding video is FixedLandscape, or the landscape mode in Adaptative, the watermark uses the landscape orientation. - * @see VideoOutputOrientationMode.FixedLandscape - * @see VideoOutputOrientationMode.Adaptative - * - If the orientation mode of the encoding video is FixedPortrait, or the portrait mode in Adaptative, the watermark uses the portrait orientation. - * @see VideoOutputOrientationMode.FixedPortrait - * @see VideoOutputOrientationMode.Adaptative - * - When setting the watermark position, the region must be less than the dimensions set in the setVideoEncoderConfiguration method. Otherwise, the watermark image will be cropped. - * Note - * - Ensure that you have called the enableVideo method to enable the video module before calling this method. - * @see RtcEngine.enableVideo - * - If you only want to add a watermark image to the local video for the audience in the CDN live broadcast channel to see and capture, you can call this method or the setLiveTranscoding method. - * @see RtcEngine.setLiveTranscoding + * + * This method adds a PNG watermark image to the local video stream in a live interactive streaming. + * Once the watermark image is added, all the audience in the channel (CDN audience included), and the recording device can see and capture it. + * + * Agora supports adding only one watermark image onto the local video, and the newly-added watermark image replaces the previous one. + * The watermark position depends on the settings in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method: + * + * - If the orientation mode of the encoding video is [`FixedLandscape`]{@link VideoOutputOrientationMode.FixedLandscape}, or the landscape mode in [`Adaptative`]{@link VideoOutputOrientationMode.Adaptative}, the watermark uses the landscape orientation. + * + * - If the orientation mode of the encoding video is [`FixedPortrait`]{@link VideoOutputOrientationMode.FixedPortrait}, or the portrait mode in [`Adaptative`]{@link VideoOutputOrientationMode.Adaptative}, the watermark uses the portrait orientation. + * + * - When setting the watermark position, the region must be less than the dimensions set in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method. + * Otherwise, the watermark image will be cropped. + * + * **Note** + * + * - Ensure that you have called [`enableVideo`]{@link enableVideo} to enable the video module before calling this method. + * + * - If you only want to add a watermark image to the local video for the audience in the CDN live interactive streaming channel to see and capture, you can call this method or the [`setLiveTranscoding`]{@link setLiveTranscoding} method. + * * - This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray. - * - If the dimensions the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings. - * - If you have enabled the local video preview by calling the startPreview method, you can use the visibleInPreview member in the WatermarkOptions class to set whether or not the watermark is visible in preview. - * - If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer. - * @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from either the local file path or the assets file path. If you use the assets file path, you need to start with /assets/ when filling in this parameter. + * + * - If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings. + * + * - If you have enabled the local video preview by calling [`startPreview`]{@link startPreview}, you can use the `visibleInPreview` member in the `WatermarkOptions` class to set whether or not the watermark is visible in preview. + * + * - If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. + * You can implement the watermark function in your application layer. + * @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from either the local file path or the assets file path. If you use the assets file path, you need to start with `/assets/` when filling in this parameter. * @param options The options of the watermark image to be added. - * @see WatermarkOptions + * */ addVideoWatermark(watermarkUrl: string, options: WatermarkOptions): Promise { return AgoraRtcEngineModule.addVideoWatermark(watermarkUrl, options); } /** - * Removes the watermark image from the video stream added by addVideoWatermark. - * @see RtcEngine.addVideoWatermark + * Removes the watermark image from the video stream added by [`addVideoWatermark`]{@link addVideoWatermark}. + * */ clearVideoWatermarks(): Promise { return AgoraRtcEngineModule.clearVideoWatermarks(); @@ -1606,13 +1901,19 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the built-in encryption mode. - * The Agora SDK supports built-in encryption, which is set to aes-128-xts mode by default. Call this method to set the encryption mode to use other encryption modes. All users in the same channel must use the same encryption mode and password. + * + * The Agora SDK supports built-in encryption, which is set to `aes-128-xts` mode by default. + * Call this method to set the encryption mode to use other encryption modes. + * All users in the same channel must use the same encryption mode and password. + * * Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. - * Note - * - Call the setEncryptionSecret method before calling this method. - * @see RtcEngine.setEncryptionSecret + * + * **Note** + * + * Call [`setEncryptionSecret`]{@link setEncryptionSecret} before calling this method. + * * @param encryptionMode Sets the encryption mode. - * @see EncryptionMode + * */ setEncryptionMode(encryptionMode: EncryptionMode): Promise { return AgoraRtcEngineModule.setEncryptionMode(encryptionMode); @@ -1620,8 +1921,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables built-in encryption with an encryption password before joining a channel. - * All users in a channel must set the same encryption password. The encryption password is automatically cleared once a user leaves the channel. If the encryption password is not specified or set to empty, the encryption functionality is disabled. - * Note + * + * All users in a channel must set the same encryption password. + * The encryption password is automatically cleared once a user leaves the channel. + * If the encryption password is not specified or set to empty, the encryption functionality is disabled. + * + * **Note** + * * - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. * - Do not use this method for CDN live streaming. * @param secret The encryption password. @@ -1632,23 +1938,24 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Starts an audio recording on the client. - * The SDK allows recording during a call. After successfully calling this method, you can record the audio of all the users in the channel and get an audio recording file. + * + * The SDK allows recording during a call. After successfully calling this method, + * you can record the audio of all the users in the channel and get an audio recording file. + * * Supported formats of the recording file are as follows: * - .wav: Large file size with high fidelity. * - .aac: Small file size with low fidelity. - * Note + * + * **Note** + * * - Ensure that the directory to save the recording file exists and is writable. - * - This method is usually called after calling the joinChannel method. The recording automatically stops when you call the leaveChannel method. - * @see RtcEngine.joinChannel - * @see RtcEngine.leaveChannel - * - For better recording effects, set quality as AUDIO_RECORDING_QUALITY_MEDIUM or AUDIO_RECORDING_QUALITY_HIGH when sampleRate is 44.1 kHz or 48 kHz. - * @see AudioRecordingQuality.Medium - * @see AudioRecordingQuality.High - * @param filePath Absolute file path (including the suffixes of the filename) of the recording file. The string of the file name is in UTF-8. For example, /sdcard/emulated/0/audio/aac. - * @param sampleRate Sample rate (Hz) of the recording file. Supported values are as follows. - * @see AudioSampleRateType + * - This method is usually called after calling [`joinChannel`]{@link joinChannel}. The recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. + * - For better recording effects, set quality as [`AUDIO_RECORDING_QUALITY_MEDIUM`]{@link AudioRecordingQuality.Medium} or [`AUDIO_RECORDING_QUALITY_HIGH`]{@link AudioRecordingQuality.High} when sampleRate is 44.1 kHz or 48 kHz. + * + * @param filePath Absolute file path (including the suffixes of the filename) of the recording file. The string of the file name is in UTF-8. For example, `/sdcard/emulated/0/audio/aac`. + * @param sampleRate Sample rate (Hz) of the recording file. * @param quality The audio recording quality. - * @see AudioRecordingQuality + * */ startAudioRecording(filePath: string, sampleRate: AudioSampleRateType, quality: AudioRecordingQuality): Promise { return AgoraRtcEngineModule.startAudioRecording(filePath, sampleRate, quality); @@ -1656,46 +1963,55 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops the audio recording on the client. - * Note - * - You can call this method before calling the leaveChannel method; else, the recording automatically stops when you call the leaveChannel method. - * @see RtcEngine.leaveChannel + * + * **Note** + * + * You can call this method before calling [`leaveChannel`]{@link leaveChannel}; + * else, the recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. + * */ stopAudioRecording(): Promise { return AgoraRtcEngineModule.stopAudioRecording(); } /** - * Injects an online media stream to a live broadcast. - * If this method call is successful, the server pulls the voice or video stream and injects it into a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. - * Note - * - This method applies to the Live-Broadcast profile only. - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. - * - You can inject only one media stream into the channel at the same time. - * The addInjectStreamUrl method call triggers the following callbacks: + * Injects an online media stream to a live interactive streaming channel. + * + * If this method call is successful, the server pulls the voice or video stream and injects it into + * a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. + * + * This method call triggers the following callbacks: * - The local client: - * -- onStreamInjectedStatus, with the state of the injecting the online stream. - * @see RtcEngineEvents.StreamInjectedStatus - * -- onUserJoined(uid: 666), if the method call is successful and the online media stream is injected into the channel. - * @see RtcEngineEvents.UserJoined + * - [`StreamInjectedStatus`]{@link RtcEngineEvents.StreamInjectedStatus}, with the state of the injecting the online stream. + * + * - [`UserJoined`]{@link RtcEngineEvents.UserJoined}(uid: 666), if the method call is successful and the online media stream is injected into the channel. + * * - The remote client: - * -- onUserJoined(uid: 666), if the method call is successful and the online media stream is injected into the channel. - * @see RtcEngineEvents.UserJoined - * @param url The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and HTTP-FLV. + * - [`UserJoined`]{@link RtcEngineEvents.UserJoined}(uid: 666), if the method call is successful and the online media stream is injected into the channel. + * + * **Note** + * + * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*.//TODO See Prerequisites in *Push Streams to CDN*? + * - You can inject only one media stream into the channel at the same time. + * + * @param url The URL address to be added to the ongoing live interactive streaming. Valid protocols are RTMP, HLS, and HTTP-FLV. * - Supported audio codec type: AAC. * - Supported video codec type: H264(AVC). - * @param config The LiveInjectStreamConfig object which contains the configuration information for the added voice or video stream. - * @see LiveInjectStreamConfig + * @param config The `LiveInjectStreamConfig` object which contains the configuration information for the added voice or video stream. + * */ addInjectStreamUrl(url: string, config: LiveInjectStreamConfig): Promise { return AgoraRtcEngineModule.addInjectStreamUrl(url, config); } /** - * Removes the injected online media stream from a live broadcast. - * This method removes the URL address (added by addInjectStreamUrl) from a live broadcast. - * @see RtcEngine.addInjectStreamUrl - * If this method call is successful, the SDK triggers the onUserOffline callback and returns a stream uid of 666. - * @see RtcEngineEvents.UserOffline + * Removes the injected online media stream from live interactive streaming. + * + * This method removes the URL address (added by [`addInjectStreamUrl`]{@link addInjectStreamUrl}) from interactive streaming. + * + * If this method call is successful, the SDK triggers the [`UserOffline`]{@link RtcEngineEvents.UserOffline} callback and returns a stream uid of 666. + * * @param url HTTP/HTTPS URL address of the added stream to be removed. */ removeInjectStreamUrl(url: string): Promise { @@ -1704,11 +2020,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables face detection for the local user. - * Once face detection is enabled, the SDK triggers the onFacePositionChanged callback to report the face information of the local user, which includes the following aspects: - * @see RtcEngineEvents.FacePositionChanged + * + * Once face detection is enabled, the SDK triggers the [`FacePositionChanged`]{@link RtcEngineEvents.FacePositionChanged} callback to report the face information of the local user, which includes the following aspects: + * * - The width and height of the local video. * - The position of the human face in the local video. * - The distance between the human face and the device screen. + * * @param enable Determines whether to enable the face detection function for the local user: * - true: Enable face detection. * - false: (Default) Disable face detection. @@ -1761,6 +2079,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables the camera auto-face focus function. + * * @param enabled Sets whether to enable/disable the camera auto-face focus function: * - true: Enable the camera auto-face focus function. * - false: (Default) Disable the camera auto-face focus function. @@ -1771,21 +2090,24 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the camera capturer configuration. - * For a video call or live broadcast, generally the SDK controls the camera output parameters. When the default camera capture settings do not meet special requirements or cause performance problems, we recommend using this method to set the camera capturer configuration: - * - If the resolution or frame rate of the captured raw video data are higher than those set by setVideoEncoderConfiguration, processing video frames requires extra CPU and RAM usage and degrades performance. We recommend setting config as Performance(1) to avoid such problems. - * @see RtcEngine.setVideoEncoderConfiguration - * @see CameraCaptureOutputPreference.Performance - * - If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting config as Performance(1) to optimize CPU and RAM usage. - * @see CameraCaptureOutputPreference.Performance - * - If you want better quality for the local video preview, we recommend setting config as Preview(2). - * @see CameraCaptureOutputPreference.Preview - * Note - * - Call this method before enabling the local camera. That said, you can call this method before calling joinChannel, enableVideo, or enableLocalVideo, depending on which method you use to turn on your local camera. - * @see RtcEngine.joinChannel - * @see RtcEngine.enableVideo - * @see RtcEngine.enableLocalVideo + * + * For a video call or live interactive video streaming, generally the SDK controls the camera output parameters. + * When the default camera capture settings do not meet special requirements or cause performance problems, + * we recommend using this method to set the camera capturer configuration: + * + * - If the resolution or frame rate of the captured raw video data are higher than those set by [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration}, processing video frames requires extra CPU and RAM usage and degrades performance. + * We recommend setting `config` as [`Performance(1)`]{@link CameraCaptureOutputPreference.Performance} to avoid such problems. + * + * - If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting `config` as [`Performance(1)`]{@link CameraCaptureOutputPreference.Performance} to optimize CPU and RAM usage. + * + * - If you want better quality for the local video preview, we recommend setting `config` as [`Preview(2)`]{@link CameraCaptureOutputPreference.Preview}. + * + * **Note** + * + * Call this method before enabling the local camera. That said, you can call this method before calling [`joinChannel`]{@link joinChannel}, [`enableVideo`]{@link enableVideo}, or [`enableLocalVideo`]{@link enableLocalVideo}, depending on which method you use to turn on your local camera. + * * @param config The camera capturer configuration. - * @see CameraCapturerConfiguration + * */ setCameraCapturerConfiguration(config: CameraCapturerConfiguration): Promise { return AgoraRtcEngineModule.setCameraCapturerConfiguration(config); @@ -1793,8 +2115,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the camera exposure position. - * A successful setCameraExposurePosition method call triggers the onCameraExposureAreaChanged callback on the local client. - * @see RtcEngineEvents.CameraExposureAreaChanged + * + * A successful [`setCameraExposurePosition`]{@link setCameraExposurePosition} method call triggers the [`CameraExposureAreaChanged`]{@link RtcEngineEvents.CameraExposureAreaChanged} callback on the local client. + * * @param positionXinView The horizontal coordinate of the touch point in the view. * @param positionYinView The vertical coordinate of the touch point in the view. */ @@ -1804,8 +2127,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the camera manual focus position. - * A successful setCameraFocusPositionInPreview method call triggers the onCameraFocusAreaChanged callback on the local client. - * @see RtcEngineEvents.CameraFocusAreaChanged + * + * A successful [`setCameraFocusPositionInPreview`]{@link setCameraFocusPositionInPreview} method call triggers the [`CameraFocusAreaChanged`]{@link RtcEngineEvents.CameraFocusAreaChanged} callback on the local client. + * * @param positionX The horizontal coordinate of the touch point in the view. * @param positionY The vertical coordinate of the touch point in the view. */ @@ -1840,13 +2164,16 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Creates a data stream. - * Each user can create up to five data streams during the lifecycle of the RtcEngine. - * @see RtcEngine - * Note - * - Set both the reliable and ordered parameters to true or false. Do not set one as true and the other as false. + * + * Each user can create up to five data streams during the lifecycle of the [`RtcEngine`]{@link RtcEngine}. + * + * **Note** + * + * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. * @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds: - * - true: The recipients receive the data from the sender within five seconds. If the recipient does not receive the data within five seconds, the SDK triggers the onStreamMessageError callback and returns an error code. - * @see RtcEngineEvents.StreamMessageError + * - true: The recipients receive the data from the sender within five seconds. + * If the recipient does not receive the data within five seconds, the SDK triggers the [`StreamMessageError`]{@link RtcEngineEvents.StreamMessageError} callback and returns an error code. + * * - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. * @param ordered Sets whether or not the recipients receive the data stream in the sent order: * - true: The recipients receive the data in the sent order. @@ -1858,20 +2185,23 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sends data stream messages. + * * The SDK has the following restrictions on this method: + * * - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 kB. * - Each client can send up to 6 kB of data per second. * - Each user can have up to five data channels simultaneously. - * A successful sendStreamMessage method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. - * @see RtcEngineEvents.StreamMessage - * A failed sendStreamMessage method call triggers the onStreamMessageError callback on the remote client. - * @see RtcEngineEvents.StreamMessageError - * Note - * - Ensure that you have created the data stream using createDataStream before calling this method. - * @see RtcEngine.createDataStream - * - This method applies only to the Communication profile or to hosts in the Live Broadcast profile. - * @param streamId ID of the sent data stream returned by the createDataStream method. - * @see RtcEngine.createDataStream + * + * A successful [`sendStreamMessage`]{@link sendStreamMessage} method call triggers the [`StreamMessage`]{@link RtcEngineEvents.StreamMessage} callback on the remote client, from which the remote user gets the stream message. + * + * A failed [`sendStreamMessage`]{@link sendStreamMessage} method call triggers the [`StreamMessageError`]{@link RtcEngineEvents.StreamMessageError} callback on the remote client. + * + * **Note** + * + * - Ensure that you have created the data stream using [`createDataStream`]{@link createDataStream} before calling this method. + * + * - This method applies only to the [`Communication`]{@link ChannelProfile.Communication} profile or to hosts in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * @param streamId ID of the sent data stream returned by the [`createDataStream`]{@link createDataStream} method. * @param message Sent data. */ sendStreamMessage(streamId: number, message: string): Promise { diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index 611a4e3d8..35ebada46 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -36,6 +36,7 @@ import { WarningCode } from "../Types" + /** * @internal */ @@ -48,6 +49,7 @@ export interface Subscription { remove(): void } + export type EmptyCallback = () => void export type WarningCallback = (warn: WarningCode) => void export type ErrorCallback = (err: ErrorCode) => void @@ -63,7 +65,7 @@ export type ConnectionStateCallback = (state: ConnectionStateType, reason: Conne export type NetworkTypeCallback = (type: NetworkType) => void export type TokenCallback = (token: string) => void export type AudioVolumeCallback = (speakers: AudioVolumeInfo[], totalVolume: number) => void -export type UidCallback = (uid: number) => void +export type UidCallback = ( uid: number) => void export type ElapsedCallback = (elapsed: number) => void export type VideoFrameCallback = (width: number, height: number, elapsed: number) => void export type UidWithMutedCallback = (uid: number, muted: boolean) => void @@ -102,7 +104,7 @@ export type MetadataCallback = (buffer: string, uid: number, timeStampMs: number export type FacePositionCallback = (imageWidth: number, imageHeight: number, faces: FacePositionInfo[]) => void /** - * The SDK uses the RtcEngineEvents interface class to send callbacks to the application, and the application inherits the methods of this interface class to retrieve these callbacks. + * The SDK uses the [`RtcEngineEvents`]{@link RtcEngineEvents} interface class to send callbacks to the application, and the application inherits the methods of this interface class to retrieve these callbacks. * * All methods in this interface class have their (empty) default implementations, and the application can inherit only some of the required events instead of all of them. * @@ -114,7 +116,11 @@ export interface RtcEngineEvents { * * In most cases, the app can ignore the warning reported by the SDK because the SDK can usually fix the issue and resume running. * - * For instance, the SDK may report a {@link WarningCode.LookupChannelTimeout} warning upon disconnection with the server and tries to reconnect. For detailed warning codes, see {@link WarningCode}. + * For instance, the SDK may report a [`LookupChannelTimeout`]{@link WarningCode.LookupChannelTimeout} warning upon disconnection with the server and tries to reconnect. For detailed warning codes, see [`WarningCode`]{@link WarningCode}. + * + * [`WarningCallback`]{@link WarningCallback} has the following parameters: + * - `warn`: [`WarningCode`]{@link WarningCode} + * Warning code. See [`WarningCode`]{@link WarningCode}. * * @event Warning */ @@ -125,8 +131,12 @@ export interface RtcEngineEvents { * * In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user about the issue. * - * For example, the SDK reports an {@link ErrorCode.StartCall} error when failing to initialize a call. The app informs the user that the call initialization failed and invokes the {@link RtcEngine.leaveChannel} method to leave the channel. For detailed error codes, see {@link ErrorCode}. + * For example, the SDK reports a [`StartCall`]{@link ErrorCode.StartCall} error when failing to initialize a call. The app informs the user that the call initialization failed and invokes the [`leaveChannel`]{@link RtcEngine.leaveChannel} method to leave the channel. For detailed error codes, see {@link ErrorCode}. + * + * [`ErrorCallback`]{@link ErrorCallback} has the following parameters: + * - `err`: [`ErrorCode`]{@link ErrorCode} * + * Error code. See [`ErrorCode`]{@link ErrorCode}. * @event Error */ Error: ErrorCallback @@ -134,6 +144,18 @@ export interface RtcEngineEvents { /** * Occurs when an API method is executed. * + * [`ApiCallCallback`]{@link ApiCallCallback} has the following parameters: + * - `error`: [`ErrorCode`]{@link ErrorCode} + * + * [Error Code]{@link ErrorCode} that the SDK returns when the method call fails. + * If the SDK returns 0, then the method call was successful. + * - `api`: *string* + * + * The method executed by the SDK. + * - `result`: *string* + * + * The result of the method call. + * * @event ApiCallExecuted */ ApiCallExecuted: ApiCallCallback @@ -143,7 +165,18 @@ export interface RtcEngineEvents { * * The channel name assignment is based on channelName specified in the joinChannel method. * - * If the uid is not specified when {@link RtcEngine.joinChannel} is called, the server automatically assigns a uid. + * If the uid is not specified when [`joinChannel`]{@link RtcEngine.joinChannel} is called, the server automatically assigns a uid. + * + * [`UidWithElapsedAndChannelCallback`]{@link UidWithElapsedAndChannelCallback} has the following parameters: + * - `channel`: *string* + * + * Channel name. + * - `uid`: *number* + * + * User ID. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * * @event JoinChannelSuccess */ @@ -154,6 +187,16 @@ export interface RtcEngineEvents { * * When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. * + * [`UidWithElapsedAndChannelCallback`]{@link UidWithElapsedAndChannelCallback} has the following parameters: + * - `channel`: *string* + * + * Channel name. + * - `uid`: *number* + * + * User ID. + * - `elapsed`: *number* + * + * Time elapsed (ms) from starting to reconnect until this callback is triggered. * @event RejoinChannelSuccess */ RejoinChannelSuccess: UidWithElapsedAndChannelCallback @@ -165,6 +208,10 @@ export interface RtcEngineEvents { * * With this callback, the application retrieves the channel information, such as the call duration and statistics. * + * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: + * - `RtcStats`:[`RtcStats`]{@link RtcStats} + * + * Statistics of the call. * @event LeaveChannel */ LeaveChannel: RtcStatsCallback @@ -172,8 +219,15 @@ export interface RtcEngineEvents { /** * Occurs when the local user registers a user account. * - * This callback is triggered when the local user successfully registers a user account by calling the {@link RtcEngine.registerLocalUserAccount} method, or joins a channel by calling the {@link RtcEngine.joinChannelWithUserAccount} method. This callback reports the user ID and user account of the local user. + * This callback is triggered when the local user successfully registers a user account by calling [`registerLocalUserAccount`]{@link RtcEngine.registerLocalUserAccount}, or joins a channel by calling [`joinChannelWithUserAccount`]{@link RtcEngine.joinChannelWithUserAccount}. + * This callback reports the user ID and user account of the local user. + * [`UserAccountCallback`]{@link UserAccountCallback} has the following parameters: + * - `uid`: *number* * + * The ID of the local user. + * - `userAccount`: *string* + * + * The user account of the local user. * @event LocalUserRegistered */ LocalUserRegistered: UserAccountCallback @@ -181,49 +235,78 @@ export interface RtcEngineEvents { /** * Occurs when the SDK gets the user ID and user account of the remote user. * - * After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object ({@link UserInfo}), and triggers this callback on the local client. + * After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object ([`UserInfo`]{@link UserInfo}), and triggers this callback on the local client. + * + * [`UserInfoCallback`]{@link UserInfoCallback} has the following parameters: + * - `uid`: *number* * + * The ID of the remote user. + * - `userInfo`: [`UserInfo`]{@link UserInfo} + * + * The `UserInfo` object that contains the user ID and user account of the remote user. * @event UserInfoUpdated */ UserInfoUpdated: UserInfoCallback /** - * Occurs when the user role switches in a live broadcast. For example, from a host to an audience or vice versa. + * Occurs when the user role switches in live interactive streaming. For example, from a host to an audience or vice versa. + * + * The SDK triggers this callback when the local user switches the user role by calling [`setClientRole`]{@link RtcEngine.setClientRole} after joining the channel. + * + * [`ClientRoleCallback`]{@link ClientRoleCallback} has the following parameters: + * - `oldRole`: [`ClientRole`]{@link ClientRole} * - * The SDK triggers this callback when the local user switches the user role by calling the {@link RtcEngine.setClientRole} method after joining the channel. + * Role that the user switches from. + * - `newRole`: [`ClientRole`]{@link ClientRole} * + * Role that the user switches to. * @event ClientRoleChanged */ ClientRoleChanged: ClientRoleCallback /** - * Occurs when a remote user (Communication)/host (Live Broadcast) joins the channel. - * - Communication profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users. - * - Live Broadcast profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel + * Occurs when a remote user ([`Communication`]{@link ChannelProfile.Communication})/host ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting}) joins the channel. + * - [`Communication`]{@link ChannelProfile.Communication} profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users. + * - [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel * * The SDK triggers this callback under one of the following circumstances: - * - A remote user/host joins the channel by calling the {@link RtcEngine.joinChannel} method. - * - A remote user switches the user role to the host by calling the {@link RtcEngine.setClientRole} method after joining the channel. + * - A remote user/host joins the channel by calling [`joinChannel`]{@link RtcEngine.joinChannel}. + * - A remote user switches the user role to the host by calling [`setClientRole`]{@link RtcEngine.setClientRole}after joining the channel. * - A remote user/host rejoins the channel after a network interruption. - * - The host injects an online media stream into the channel by calling the {@link RtcEngine.addInjectStreamUrl} method. + * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcEngine.addInjectStreamUrl}. * * **Note** - * - In the Live Broadcast profile: - * - The host receives the onUserJoined callback when another host joins the channel. - * - The audience in the channel receives the onUserJoined callback when a new host joins the channel. - * - When a web application joins the channel, the onUserJoined callback is triggered as long as the web application publishes streams. + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: + * - The host receives the [`UserJoined`]{@link UserJoined} callback when another host joins the channel. + * - The audience in the channel receives the [`UserJoined`]{@link UserJoined} callback when a new host joins the channel. + * - When a web application joins the channel, the [`UserJoined`]{@link UserJoined} callback is triggered as long as the web application publishes streams. + * + * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: + * - `uid`: *number* * + * ID of the user or host who joins the channel. + * - `elapsed`: *number* + * + * Time delay (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel}/[`setClientRole`]{@link RtcEngine.setClientRole}setClientRole + * until this callback is triggered. * @event UserJoined */ UserJoined: UidWithElapsedCallback /** - * Occurs when a remote user (Communication)/host (Live Broadcast) leaves the channel. + * Occurs when a remote user ([`Communication`]{@link ChannelProfile.Communication})/host ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting}) leaves the channel. * * There are two reasons for users to become offline: * - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel. - * - Drop offline: When no data packet of the user or host is received for a certain period of time (20 seconds for the communication profile, and more for the live broadcast profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. + * - Drop offline: When no data packet of the user or host is received for a certain period of time (20 seconds for the [`Communication`]{@link ChannelProfile.Communication} profile, and more for the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. + * + * [`UserOfflineCallback`]{@link UserOfflineCallback} has the following parameters: + * - `uid`: *number* * + * ID of the user or host who leaves the channel or goes offline. + * -` reason`: [`UserOfflineReason`]{@link UserOfflineReason} + * + * - Reason why the user goes offline. * @event UserOffline */ UserOffline: UserOfflineCallback @@ -233,6 +316,13 @@ export interface RtcEngineEvents { * * The Agora SDK returns this callback to report on the current network connection state when it changes, and the reason to such change. * + * [`ConnectionStateCallback`]{@link ConnectionStateCallback} has the following parameters: + * - `state`: [`ConnectionStateType`][@link ConnectionStateType] + * + * The current network connection state. + * - `reason`: [`ConnectionChangedReason`]{@link ConnectionChangedReason} + * + * The reason causing the change of the connection state. * @event ConnectionStateChanged */ ConnectionStateChanged: ConnectionStateCallback @@ -242,6 +332,10 @@ export interface RtcEngineEvents { * * The SDK returns the current network type in this callback. When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions. * + * [`NetworkTypeCallback`]{@link NetworkTypeCallback} has the following parameters: + * - `type`: [`NetworkType`]{@link NetworkType} + * + * The network type. * @event NetworkTypeChanged */ NetworkTypeChanged: NetworkTypeCallback @@ -262,6 +356,10 @@ export interface RtcEngineEvents { * * The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call {@link RtcEngine.renewToken} to pass the new token to the SDK. * + * [`TokenCallback`]{@link TokenCallback} has the following parameters: + * - `token`: *string* + * + * The token that will expire in 30 seconds. * @event TokenPrivilegeWillExpire */ TokenPrivilegeWillExpire: TokenCallback @@ -269,7 +367,9 @@ export interface RtcEngineEvents { /** * Occurs when the token has expired. * - * After a token is specified when joining the channel, the token expires after a certain period of time, and a new token is required to reconnect to the server. This callback notifies the app to generate a new token and call {@link RtcEngine.joinChannel} to rejoin the channel with the new token. + * After a token is specified when joining the channel, the token expires after a certain period of time, + * and a new token is required to reconnect to the server. This callback notifies the app to generate a + * new token and call [`joinChannel`]{@link RtcEngine.joinChannel} to rejoin the channel with the new token. * * @event RequestToken */ @@ -280,16 +380,37 @@ export interface RtcEngineEvents { * * This callback reports the IDs and volumes of the loudest speakers (at most 3) at the moment in the channel, and whether the local user is speaking. * - * By default, this callback is disabled. You can enable it by calling the {@link RtcEngine.enableAudioVolumeIndication} method. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not. + * By default, this callback is disabled. You can enable it by calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. Once enabled, this callback is triggered at the set interval, regardless of whether a user speaks or not. * - * The SDK triggers two independent onAudioVolumeIndication callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions. + * The SDK triggers two independent `AudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions. * * **Note** - * - To enable the voice activity detection of the local user, ensure that you set report_vad(true) in the {@link RtcEngine.enableAudioVolumeIndication} method. - * - Calling the {@link RtcEngine.muteLocalAudioStream} method affects the SDK's behavior. - * - If the local user calls the {@link RtcEngine.muteLocalAudioStream} method, the SDK stops triggering the local user's callback. - * - 20 seconds after a remote speaker calls the {@link RtcEngine.muteLocalAudioStream} method, the remote speakers' callback does not include information of this remote user; 20 seconds after all remote users call the the muteLocalAudioStream method, the SDK stops triggering the remote speakers' callback. + * - To enable the voice activity detection of the local user, ensure that you set `report_vad(true)` in the [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication} method. + * - Calling [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream} affects the SDK's behavior. + * - If the local user calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}, the SDK stops triggering the local user's callback. + * - 20 seconds after a remote speaker calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}, the remote speakers' callback does not include information of this remote user; 20 seconds after all remote users call the the [`muteLocalAudioStream`]{@link muteLocalAudioStream} method, the SDK stops triggering the remote speakers' callback. + * + * [`AudioVolumeCallback`]{@link AudioVolumeCallback} has the following parameters: + * - `speakers`: [`AudioVolumeInfo`]{@link AudioVolumeInfo}[] + * + * An array containing the user ID and volume information for each speaker. + * + * In the local user’s callback, this array contains the following members: + * - `uid` = 0, + * - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and + * - `vad`, which reports the voice activity status of the local user. + * + * In the remote speakers' callback, this array contains the following members: + * - `uid` of each remote speaker, + * - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and + * - `vad` = 0. + * + * An empty `speakers` array in the callback indicates that no remote user is speaking at the moment. + * - `totalVolume`: *number* * + * Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume). + * - 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 speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of all remote speakers. * @event AudioVolumeIndication */ AudioVolumeIndication: AudioVolumeCallback @@ -297,12 +418,17 @@ export interface RtcEngineEvents { /** * Reports which user is the loudest speaker. * - * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by calling {@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. + * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by + * calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. * * **Note** - * - To receive this callback, you need to call {@link RtcEngine.enableAudioVolumeIndication}. + * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. * + * [`UidCallback`]{@link UidCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the active speaker. A `uid` of 0 represents the local user. * @event ActiveSpeaker */ ActiveSpeaker: UidCallback @@ -310,6 +436,10 @@ export interface RtcEngineEvents { /** * Occurs when the first local audio frame is sent. * + * [`ElapsedCallback`]{@link ElapsedCallback} has the following parameters: + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling the [`joinChannel`]{@ink RtcEngine.joinChannel} until this callback is triggered. * @event FirstLocalAudioFrame */ FirstLocalAudioFrame: ElapsedCallback @@ -319,6 +449,17 @@ export interface RtcEngineEvents { * * This callback is triggered after the first local video frame is rendered on the local video window. * + * [`VideoFrameCallback`]{@link VideoFrameCallback} has the following parameters: + * - `width`: *number* + * + * Width (pixels) of the first local video frame. + * - `height`: *number* + * + * Height (pixels) of the first local video frame. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until this callback is triggered. + * If [`startPreview`]{@link RtcEngine.startPreview} is called before `joinChannel`, elapsed is the time elapsed (ms) from the local user calling `startPreview` until this callback is triggered. * @event FirstLocalVideoFrame */ FirstLocalVideoFrame: VideoFrameCallback @@ -326,15 +467,26 @@ export interface RtcEngineEvents { /** * Occurs when a remote user stops/resumes sending the video stream. * - * @deprecated This callback is deprecated. Use the {@link RemoteVideoStateChanged} callback with the following parameters for the same function: - * - {@link VideoRemoteState.Stopped} and {@link VideoRemoteStateReason.RemoteMuted}. - * - {@link VideoRemoteState.Decoding} and {@link VideoRemoteStateReason.RemoteUnmuted}. + * **Deprecated** + * This callback is deprecated. Use the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters for the same function: + * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. + * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. * - * The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the {@link RtcEngine.muteLocalVideoStream} method. + * The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the [`muteLocalVideoStream`]{@link RtcEngine.muteLocalVideoStream} method. * * **Note** - * - This callback is invalid when the number of users or broadcasters in the channel exceeds 20. * + * This callback is invalid when the number of users or broadcasters in the channel exceeds 20. + * + * [`UidWithMutedCallback`]{@link UidWithMutedCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the remote user. + * - `muted`: *boolean* + * + * Whether the remote user's video stream playback pauses/resumes: + * - true: Pause. + * - false: Resume. * @event UserMuteVideo */ UserMuteVideo: UidWithMutedCallback @@ -342,6 +494,19 @@ export interface RtcEngineEvents { /** * Occurs when the video size or rotation information of a remote user changes. * + * [`VideoSizeCallback`]{@link VideoSizeCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user or local user (0) whose video size or rotation changes. + * - `width`: *number* + * + * New width (pixels) of the video. + * - `height`: *number* + * + * New height (pixels) of the video. + * - `rotation`: *number* + * + * New rotation of the video [0 to 360). * @event VideoSizeChanged */ VideoSizeChanged: VideoSizeCallback @@ -349,6 +514,20 @@ export interface RtcEngineEvents { /** * Occurs when the remote video state changes. * + * [`RemoteVideoStateCallback`]{@link RemoteVideoStateCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the remote user whose video state changes. + * - `state`: [`VideoRemoteState`]{@link VideoRemoteState} + * + * State of the remote video. + * - `reason`: [`VideoRemoteStateReason`]{@link VideoRemoteStateReason} + * + * The reason of the remote video state change. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. + * * @event RemoteVideoStateChanged */ RemoteVideoStateChanged: RemoteVideoStateCallback @@ -356,10 +535,23 @@ export interface RtcEngineEvents { /** * Occurs when the local video state changes. * - * The SDK returns the current video state in this callback. When the state is {@link LocalVideoStreamState.Failed}, see the error parameter for details. + * The SDK returns the current video state in this callback. When the state is [`Failed`]{@link LocalVideoStreamState.Failed}, see the error parameter for details. * * **Note** - * - This callback reports the current state of the local video, which keeps changing throughout the RtcEngine life cycle. We recommend maintaining the states reported in this callback, and check the local video state before starting the local camera. If the SDK reports {@link LocalVideoStreamError.CaptureFailure}, the local camera is occupied by either the system or a third-party app. To access the camera, call {@link RtcEngine.enableLocalVideo} (false) first, and then {@link RtcEngine.enableLocalVideo} (video). + * + * This callback reports the current state of the local video, + * which keeps changing throughout the RtcEngine life cycle. We recommend maintaining the states reported + * in this callback, and check the local video state before starting the local camera. + * If the SDK reports [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure}, the local camera is occupied by either the system or a third-party app. + * To access the camera, call [`enableLocalVideo`]{@link RtcEngine.enableLocalVideo} (false) first, and then [`enableLocalVideo`]{@link RtcEngine.enableLocalVideo} (video). + * + * [`LocalVideoStateCallback`]{@link LocalVideoStateCallback} has the following parameters: + * - localVideoState: [`LocalVideoStreamState`]{@link LocalVideoStreamState} + * + * The local video state. + * - error: [`LocalVideoStreamError`]{@link LocalVideoStreamError} + * + * The detailed error information of the local video. * * @event LocalVideoStateChanged */ @@ -370,6 +562,19 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the remote audio stream. * + * [`RemoteAudioStateCallback`]{@link RemoteAudioStateCallback } has the following parameters: + * - `uid`: *number* + * + * ID of the user whose audio state changes. + * - `state`: [`AudioRemoteState`]{@link AudioRemoteState} + * + * State of the remote audio. + * - `reason`: [`AudioRemoteStateReason`]{@link AudioRemoteStateReason} + * + * The reason of the remote audio state change. + * - `elapsed`: number + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. * @event RemoteAudioStateChanged */ RemoteAudioStateChanged: RemoteAudioStateCallback @@ -380,8 +585,16 @@ export interface RtcEngineEvents { * This callback indicates the state change of the local audio stream, including the state of the audio recording and encoding, and allows you to troubleshoot issues when exceptions occur. * * **Note** - * - When the state is {@link AudioLocalState.Failed}, see the error parameter for details. * + * When the state is [`Failed`]{@link AudioLocalState.Failed}, see the error parameter for details. + * + * [`LocalAudioStateCallback`]{@link LocalAudioStateCallback} has the following parameters: + * - state: [`AudioLocalState`]{@link AudioLocalState} + * + * State of the local audio. + * - error: [`AudioLocalError`]{@link AudioLocalError} + * + * The error information of the local audio. * @event LocalAudioStateChanged */ LocalAudioStateChanged: LocalAudioStateCallback @@ -389,8 +602,16 @@ export interface RtcEngineEvents { /** * Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. * - * If you call {@link RtcEngine.setLocalPublishFallbackOption} and set option as {@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. + * If you call [`setLocalPublishFallbackOption`]{@link RtcEngine.setLocalPublishFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, + * this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, + * or when the audio stream switches back to the video after the uplink network condition improves. + * + * [`FallbackCallback`]{@link FallbackCallback} has the following parameters: + * - `isFallbackOrRecover`: *boolean* * + * Whether the published stream fell back to audio-only or switched back to the video: + * - true: The published stream fell back to audio-only due to poor network conditions. + * - false: The published stream switched back to the video after the network conditions improved. * @event LocalPublishFallbackToAudioOnly */ LocalPublishFallbackToAudioOnly: FallbackCallback @@ -398,8 +619,18 @@ export interface RtcEngineEvents { /** * Occurs when the remote media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. * - * If you call {@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as {@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the remotely subscribed media stream falls back to audio-only mode due to poor uplink conditions, or when the remotely subscribed media stream switches back to the video after the uplink network condition improves. + * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, + * this callback is triggered when the remotely subscribed media stream falls back to audio-only mode due to poor uplink conditions, or when the remotely subscribed media stream switches back to the video after the uplink network condition improves. * + * [`FallbackWithUidCallback`]{@link FallbackWithUidCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the remote user sending the stream. + * - `isFallbackOrRecover`: *boolean* + * + * Whether the remote media stream fell back to audio-only or switched back to the video: + * - true: The remote media stream fell back to audio-only due to poor network conditions. + * - false: The remote media stream switched back to the video stream after the network conditions improved. * @event RemoteSubscribeFallbackToAudioOnly */ RemoteSubscribeFallbackToAudioOnly: FallbackWithUidCallback @@ -409,9 +640,10 @@ export interface RtcEngineEvents { * * This callback returns that the audio route switched to an earpiece, speakerphone, headset, or Bluetooth device. * - * The definition of the routing is listed as follows: - * - {@link AudioOutputRouting} + * The definition of the routing is listed in [`AudioOutputRouting`]{@link AudioOutputRouting}. * + * [`AudioRouteCallback`]{@link AudioRouteCallback} has the following parameters: + * - `routing`: [`AudioOutputRouting`]{@link AudioOutputRouting}. * @event AudioRouteChanged */ AudioRouteChanged: AudioRouteCallback @@ -419,8 +651,12 @@ export interface RtcEngineEvents { /** * Occurs when the camera focus area is changed. * - * The SDK triggers this callback when the local user changes the camera focus position by calling the {@link RtcEngine.setCameraFocusPositionInPreview} method. + * The SDK triggers this callback when the local user changes the camera focus position by calling [`setCameraFocusPositionInPreview`]{@link RtcEngine.setCameraFocusPositionInPreview}. + * + * [`RectCallback`]{@link RectCallback} has the following parameters: + * - rect: [`Rect`]{@link rect: Rect} * + * Rectangular area in the camera zoom specifying the focus area. * @event CameraFocusAreaChanged */ CameraFocusAreaChanged: RectCallback @@ -428,8 +664,12 @@ export interface RtcEngineEvents { /** * The camera exposure area has changed. * - * The SDK triggers this callback when the local user changes the camera exposure position by calling the {@link RtcEngine.setCameraExposurePosition} method. + * The SDK triggers this callback when the local user changes the camera exposure position by calling [`setCameraExposurePosition`]{@link RtcEngine.setCameraExposurePosition}. * + * [`RectCallback`]{@link RectCallback} has the following parameters: + * - rect: [`Rect`]{@link rect: Rect} + * + * Rectangular area in the camera zoom specifying the exposure area. * @event CameraExposureAreaChanged */ CameraExposureAreaChanged: RectCallback @@ -437,7 +677,7 @@ export interface RtcEngineEvents { /** * Reports the face detection result of the local user. * - * Once you enable face detection by calling {@link RtcEngine.enableFaceDetection}, you can get the following information on the local user in real-time: + * Once you enable face detection by calling [`enableFaceDetection`]{@link RtcEngine.enableFaceDetection}, you can get the following information on the local user in real-time: * - The width and height of the local video. * - The position of the human face in the local video. * - The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face. @@ -447,20 +687,42 @@ export interface RtcEngineEvents { * - The SDK stops triggering this callback when a human face is in close proximity to the screen. * - On Android, the distance value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for accurate calculation. * + * [`FacePositionCallback`]{@link FacePositionCallback} has the following parameters: + * - `imageWidth`: *number* + * + * The width (px) of the local video. + * - `imageHeight`: *number* + * + * The height (px) of the local video. + * - `faces`: [`FacePositionInfo`]{@link FacePositionInfo}[] + * + * The information of the detected human face. For details, see [`FacePositionInfo`]{@link FacePositionInfo}. + * The number of the `FacePositionInfo` array depends on the number of human faces detected. + * If the array length is 0, it means that no human face is detected. * @event FacePositionChanged */ FacePositionChanged: FacePositionCallback /** - * Reports the statistics of the {@link RtcEngine} once every two seconds. + * Reports the statistics of the [`RtcEngine`]{@link RtcEngine} once every two seconds. + * + * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: + * - `stats`: [`RtcStats`]{@link RtcStats} * + * RTC engine statistics. * @event RtcStats */ RtcStats: RtcStatsCallback /** - * Reports the last mile network quality of the local user once every two seconds before the user joins the channel. Last mile refers to the connection between the local device and Agora's edge server. After the application calls the {@link RtcEngine.enableLastmileTest} method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel. + * Reports the last mile network quality of the local user once every two seconds before the user joins the channel. + * Last mile refers to the connection between the local device and Agora's edge server. After the application calls the [`enableLastmileTest`]{@link RtcEngine.enableLastmileTest} method, + * this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel. + * + * [`NetworkQualityCallback`]{@link NetworkQualityCallback} has the following parameters: + * - `quality`: [`NetworkQuality`]{@link NetworkQuality} * + * The last mile network quality based on the uplink and downlink packet loss rate and jitter. * @event LastmileQuality */ LastmileQuality: NetworkQualityCallback @@ -470,6 +732,19 @@ export interface RtcEngineEvents { * * Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times. * + * [`NetworkQualityWithUidCallback`]{@link NetworkQualityWithUidCallback} has the following parameters: + * - `uid`: *number* + * + * User ID. The network quality of the user with this uid is reported. + * If `uid` is 0, the local network quality is reported. + * - `txQuality`: [`NetworkQuality`]{@link NetworkQuality} + * + * Uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) + * and jitter of the uplink network. `txQuality` is a quality rating helping you understand how well the current uplink + * network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 680 × 480 and a frame rate of 30 fps, but may be inadequate for resolutions higher than 1280 × 720. + * - `rxQuality`: [`NetworkQuality`]{@link NetworkQuality} + * + * Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. * @event NetworkQuality */ NetworkQuality: NetworkQualityWithUidCallback @@ -477,8 +752,12 @@ export interface RtcEngineEvents { /** * Reports the last-mile network probe result. * - * The SDK triggers this callback within 30 seconds after the app calls the {@link RtcEngine.startLastmileProbeTest} method. + * The SDK triggers this callback within 30 seconds after the app calls [`startLastmileProbeTest`]{@link RtcEngine.startLastmileProbeTest}. + * + * [`LastmileProbeCallback`]{@link LastmileProbeCallback} has the following parameters: + * - `result`: [`LastmileProbeResult`]{@link LastmileProbeResult} * + * The uplink and downlink last-mile network probe test result. * @event LastmileProbeResult */ LastmileProbeResult: LastmileProbeCallback @@ -488,6 +767,10 @@ export interface RtcEngineEvents { * * The SDK triggers this callback once every two seconds for each user/host. If there are multiple users/hosts in the channel, the SDK triggers this callback as many times. * + * [`LocalVideoStatsCallback`]{@link LocalVideoStatsCallback} has the following parameters: + * - `stats`: [`LocalVideoStats`]{@link LocalVideoStats} + * + * The statistics of the local video stream. * @event LocalVideoStats */ LocalVideoStats: LocalVideoStatsCallback @@ -495,6 +778,10 @@ export interface RtcEngineEvents { /** * Reports the statistics of the local audio stream. * + * [`LocalAudioStatsCallback`]{@link LocalAudioStatsCallback} has the following parameters: + * - `stats`: [`LocalAudioStats`]{@link LocalAudioStats} + * + * The statistics of the local audio stream. * @event LocalAudioStats */ LocalAudioStats: LocalAudioStatsCallback @@ -502,6 +789,10 @@ export interface RtcEngineEvents { /** * Reports the statistics of the video stream from each remote user/host. The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. * + * [`RemoteVideoStatsCallback`]{@link RemoteVideoStatsCallback} has the following parameters: + * - `stats`: [`RemoteVideoStats`]{@link RemoteVideoStats} + * + * Statistics of the received remote video streams. * @event RemoteVideoStats */ RemoteVideoStats: RemoteVideoStatsCallback @@ -513,6 +804,10 @@ export interface RtcEngineEvents { * * Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high. * + * [`RemoteAudioStatsCallback`]{@link RemoteAudioStatsCallback} has the following parameters: + * - `stats`: [`RemoteAudioStats`]{@link RemoteAudioStats} + * + * Statistics of the received remote audio streams. * @event RemoteAudioStats */ RemoteAudioStats: RemoteAudioStatsCallback @@ -520,11 +815,14 @@ export interface RtcEngineEvents { /** * Occurs when the audio mixing file playback finishes. * - * @deprecated This callback is deprecated. Use {@link AudioMixingStateChanged} instead. + * **Deprecated** + * + * This callback is deprecated. + * Use [`AudioMixingStateChanged`]{@link AudioMixingStateChanged} instead. * - * You can start an audio mixing file playback by calling the {@link RtcEngine.startAudioMixing} method. This callback is triggered when the audio mixing file playback finishes. + * You can start an audio mixing file playback by calling [`startAudioMixing`]{@link RtcEngine.startAudioMixing}. This callback is triggered when the audio mixing file playback finishes. * - * If the {@link RtcEngine.startAudioMixing} method call fails, an {@link WarningCode.AudioMixingOpenError} warning returns in the {@link Warning} callback. + * If the [`startAudioMixing`]{@link RtcEngine.startAudioMixing} method call fails, an [`AudioMixingOpenError`]{@link WarningCode.AudioMixingOpenError} warning returns in the [`Warning`]{@link Warning} callback. * * @event AudioMixingFinished */ @@ -533,11 +831,18 @@ export interface RtcEngineEvents { /** * Occurs when the state of the local user's audio mixing file changes. * - * When you call the {@link RtcEngine.startAudioMixing} method and the state of audio mixing file changes, the Agora SDK triggers this callback. - * - When the audio mixing file plays, pauses playing, or stops playing, this callback returns 710, 711, or 713 in state, and 0 in errorCode. - * - When exceptions occur during playback, this callback returns 714 in state and an error in errorCode. - * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns {@link WarningCode.AudioMixingOpenError}. + * When you call [`startAudioMixing`]{@link RtcEngine.startAudioMixing} and the state of audio mixing file changes, the Agora SDK triggers this callback. + * - When the audio mixing file plays, pauses playing, or stops playing, this callback returns [`710`]{@link AudioMixingStateCode.Playing}, `711`, or `713` in state, and `0` in errorCode. + * - When exceptions occur during playback, this callback returns `714` in state and an error in errorCode. + * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns [`AudioMixingOpenError`]{@link WarningCode.AudioMixingOpenError}. + * + * [`AudioMixingStateCallback`]{@link AudioMixingStateCallback} has the following parameters: + * - `state`: [`AudioMixingStateCode`]{@link AudioMixingStateCode} + * + * The state code. + * - `errorCode`: [`AudioMixingErrorCode`]{@link AudioMixingErrorCode} * + * The error code. * @event AudioMixingStateChanged */ AudioMixingStateChanged: AudioMixingStateCallback @@ -545,8 +850,12 @@ export interface RtcEngineEvents { /** * Occurs when the audio effect file playback finishes. * - * You can start a local audio effect playback by calling the {@link RtcEngine.playEffect} method. This callback is triggered when the local audio effect file playback finishes. + * You can start a local audio effect playback by calling [`playEffect`]{@link RtcEngine.playEffect}. This callback is triggered when the local audio effect file playback finishes. * + * [`SoundIdCallback`]{@link SoundIdCallback} has the following parameters: + * - `soundId`: *number* + * + * ID of the local audio effect. Each local audio effect has a unique ID. * @event AudioEffectFinished */ AudioEffectFinished: SoundIdCallback @@ -554,10 +863,21 @@ export interface RtcEngineEvents { /** * Occurs when the state of the RTMP streaming changes. * - * The SDK triggers this callback to report the result of the local user calling the {@link RtcEngine.addPublishStreamUrl} or {@link RtcEngine.removePublishStreamUrl} method. This callback returns the URL and its current streaming state. When the streaming state is {@link RtmpStreamingState.Failure}, see the errCode parameter for details. + * The SDK triggers this callback to report the result of the local user calling [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} or [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl}. + * This callback returns the URL and its current streaming state. When the streaming state is [`Failure`]{@link RtmpStreamingState.Failure}, see the errCode parameter for details. * * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter. * + * [`RtmpStreamingStateCallback`]{@link RtmpStreamingStateCallback} has the following parameters: + * - `url`: *string* + * + * The RTMP URL address. + * - `state`: *RtmpStreamingState* + * + * The RTMP streaming state. + * - `errCode`: *RtmpStreamingErrorCode* + * + * The detailed error information for streaming. * @event RtmpStreamingStateChanged */ RtmpStreamingStateChanged: RtmpStreamingStateCallback @@ -577,6 +897,16 @@ export interface RtcEngineEvents { /** * Reports the status of injecting the online media stream. * + * [`StreamInjectedStatusCallback`]{@link StreamInjectedStatusCallback} has the following parameters: + * - `url`: *string* + * + * The URL address of the externally injected stream. + * - `uid`: *number* + * + * User ID. + * - `status`: [`InjectStreamStatus`]{@link InjectStreamStatus} + * + * State of the externally injected stream. * @event StreamInjectedStatus */ StreamInjectedStatus: StreamInjectedStatusCallback @@ -584,8 +914,19 @@ export interface RtcEngineEvents { /** * Occurs when the local user receives a remote data stream. * - * The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the {@link RtcEngine.sendStreamMessage} method. + * The SDK triggers this callback when the local user receives the stream message that the remote user sends + * by calling the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} method. + * + * [`StreamMessageCallback`]{@link StreamMessageCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the data stream. + * - `streamId`: *number* + * + * Stream ID. + * - `data`: *string* * + * Data received by the local user. * @event StreamMessage */ StreamMessage: StreamMessageCallback @@ -593,8 +934,24 @@ export interface RtcEngineEvents { /** * Occurs when the local user fails to receive a remote data stream. * - * The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the {@link RtcEngine.sendStreamMessage} method. + * The SDK triggers this callback when the local user fails to receive the stream message that the remote + * user sends by calling the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} method. * + * [`StreamMessageErrorCallback`]{@link StreamMessageErrorCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the data stream. + * - `streamId`: *number* + * + * Stream ID. + * - `error`: [`ErrorCode`]{@link ErrorCode} + * Error code. + * - `missed`: *number* + * + * The number of lost messages. + * - `cached`: *number* + * + * The number of incoming cached messages when the data stream is interrupted. * @event StreamMessageError */ StreamMessageError: StreamMessageErrorCallback @@ -618,6 +975,13 @@ export interface RtcEngineEvents { * * The SDK reports the state of the current media relay and possible error messages in this callback. * + * [`MediaRelayStateCallback`]{@link MediaRelayStateCallback} has the following parameters: + * - `state`: [`ChannelMediaRelayState`]{@link ChannelMediaRelayState} + * + * The state code. + * - `code`: [`ChannelMediaRelayError`]{@link ChannelMediaRelayError} + * + * The error code. * @event ChannelMediaRelayStateChanged */ ChannelMediaRelayStateChanged: MediaRelayStateCallback @@ -625,6 +989,10 @@ export interface RtcEngineEvents { /** * Reports events during the media stream relay. * + * [`MediaRelayEventCallback`]{@link MediaRelayEventCallback} has the following parameters: + * - `code`: [`ChannelMediaRelayEvent`]{@link ChannelMediaRelayEvent} + * + * The event code for media stream relay. * @event ChannelMediaRelayEvent */ ChannelMediaRelayEvent: MediaRelayEventCallback @@ -632,10 +1000,25 @@ export interface RtcEngineEvents { /** * Occurs when the first remote video frame is rendered. * - * @deprecated Use {@link VideoRemoteState.Starting} or {@link VideoRemoteState.Decoding} in the {@link RemoteVideoStateChanged} callback instead. + * **Deprecated** + * + * Use [`Starting`]{@link VideoRemoteState.Starting} or [`Decoding`]{@link VideoRemoteState.Decoding} in the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback instead. * * This callback is triggered after the first frame of the remote video is rendered on the video window. The application can retrieve the data of the time elapsed from the user joining the channel until the first video frame is displayed. * + * [`VideoFrameWithUidCallback`]{@link VideoFrameWithUidCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the video streams. + * - `width`: *number* + * + * Width (pixels) of the video stream. + * - `height`: *number* + * + * Height (pixels) of the video stream. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * @event FirstRemoteVideoFrame */ FirstRemoteVideoFrame: VideoFrameWithUidCallback @@ -643,8 +1026,17 @@ export interface RtcEngineEvents { /** * Occurs when the first remote audio frame is received. * - * @deprecated Use {@link AudioRemoteState.Starting} in {@link RemoteAudioStateChanged} instead. + * **Deprecated** + * + * Use [`Starting`]{@link AudioRemoteState.Starting} in [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} instead. * + * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * @event FirstRemoteAudioFrame */ FirstRemoteAudioFrame: UidWithElapsedCallback @@ -652,16 +1044,25 @@ export interface RtcEngineEvents { /** * Occurs when the engine receives the first audio frame from a specified remote user. * - * @deprecated Use {@link VideoRemoteState.Decoding} in {@link RemoteAudioStateChanged} instead. + * **Deprecated** + * + * Use [`Decoding`]{@link VideoRemoteState.Decoding} in [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} instead. * * This callback is triggered in either of the following scenarios: * - The remote user joins the channel and sends the audio stream. * - The remote user stops sending the audio stream and re-sends it after 15 seconds. Possible reasons include: * - The remote user leaves channel. * - The remote user drops offline. - * - The remote user calls the {@link RtcEngine.muteLocalAudioStream} method. - * - The remote user calls the {@link RtcEngine.disableAudio} method. + * - The remote user calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}. + * - The remote user calls [`disableAudio`]{@link RtcEngine.disableAudio}. + * + * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: + * - `uid`: *number* * + * User ID of the remote user sending the audio stream. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * @event FirstRemoteAudioDecoded */ FirstRemoteAudioDecoded: UidWithElapsedCallback @@ -669,37 +1070,63 @@ export interface RtcEngineEvents { /** * Occurs when a remote user stops/resumes sending the audio stream. * - * @deprecated Use the {@link RemoteAudioStateChanged} callback with the following parameters instead: - * - {@link VideoRemoteState.Stopped} and {@link VideoRemoteStateReason.RemoteMuted}. - * - {@link VideoRemoteState.Decoding} and {@link VideoRemoteStateReason.RemoteUnmuted}. + * **Deprecated** + * Use the [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} callback with the following parameters instead: + * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. + * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. * - * The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the {@link RtcEngine.muteLocalAudioStream} method. + * The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream} method. * * **Note** - * - This callback is invalid when the number of users or broadcasters in the channel exceeds 20. * + * This callback is invalid when the number of users or broadcasters in the channel exceeds 20. + * + * [`UidWithMutedCallback`]{@link UidWithMutedCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the remote user. + * - `muted`: *boolean* + * + * Whether the remote user's audio stream is muted/unmuted: + * - true: Muted. + * - false: Unmuted. * @event UserMuteAudio */ UserMuteAudio: UidWithMutedCallback /** - * Reports the result of calling the {@link RtcEngine.addPublishStreamUrl} method. + * Reports the result of calling [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl}. + * + * **Deprecated** * - * @deprecated Use {@link RtmpStreamingStateChanged} instead. + * Use [`RtmpStreamingStateChanged`]{@link RtmpStreamingStateChanged} instead. * * This callback indicates whether you have successfully added an RTMP stream to the CDN. * + * [`UrlWithErrorCallback`]{@link UrlWithErrorCallback} has the following parameters: + * - `url`: *string* + * + * The RTMP URL address. + * - `error`: *ErrorCode* + * + * The detailed error information. * @event StreamPublished */ StreamPublished: UrlWithErrorCallback /** - * Reports the result of calling the {@link RtcEngine.removePublishStreamUrl} method. + * Reports the result of calling [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl}. * - * @deprecated Use {@link RtmpStreamingStateChanged} instead. + * **Deprecated** + * + * Use [`RtmpStreamingStateChanged`]{@link RtmpStreamingStateChanged} instead. * * This callback indicates whether you have successfully removed an RTMP stream from the CDN. * + * [`UrlCallback`]{@link UrlCallback} has the following parameters: + * - `url`: *string* + * + * The RTMP URL address. * @event StreamUnpublished */ StreamUnpublished: UrlCallback @@ -707,10 +1134,25 @@ export interface RtcEngineEvents { /** * Reports the transport-layer statistics of each remote audio stream. * - * @deprecated This callback is deprecated. Use {@link RemoteAudioStats} instead. + * **Deprecated** + * + * This callback is deprecated. Use [`RemoteAudioStats`]{@link RemoteAudioStats} instead. * * This callback reports the transport-layer statistics, such as the packet loss rate and time delay, once every two seconds after the local user receives an audio packet from a remote user. * + * [`TransportStatsCallback`]{@link TransportStatsCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the audio packet. + * - `delay`: *number* + * + * Network time delay (ms) from the remote user sending the audio packet to the local user. + * - `lost`: *number* + * + * Packet loss rate (%) of the audio packet sent from the remote user. + * - `rxKBitRate`: *number* + * + * Received bitrate (Kbps) of the audio packet sent from the remote user. * @event RemoteAudioTransportStats */ RemoteAudioTransportStats: TransportStatsCallback @@ -718,10 +1160,26 @@ export interface RtcEngineEvents { /** * Reports the transport-layer statistics of each remote video stream. * - * @deprecated This callback is deprecated. Use {@link RemoteVideoStats} instead. + * **Deprecated** + * + * This callback is deprecated. Use [`RemoteVideoStats`]{@link RemoteVideoStats} instead. + * + * This callback reports the transport-layer statistics, such as the packet loss rate and time delay, + * once every two seconds after the local user receives the video packet from a remote user. + * + * [`TransportStatsCallback`]{@link TransportStatsCallback} has the following parameters: + * - `uid`: *number* * - * This callback reports the transport-layer statistics, such as the packet loss rate and time delay, once every two seconds after the local user receives the video packet from a remote user. + * User ID of the remote user sending the audio packet. + * - `delay`: *number* * + * Network time delay (ms) from the remote user sending the video packet to the local user. + * - `lost`: *number* + * + * Packet loss rate (%) of the video packet sent from the remote user. + * - `rxKBitRate`: *number* + * + * Received bitrate (Kbps) of the video packet sent from the remote user. * @event RemoteVideoTransportStats */ RemoteVideoTransportStats: TransportStatsCallback @@ -729,17 +1187,28 @@ export interface RtcEngineEvents { /** * Occurs when a remote user enables/disables the video module. * - * @deprecated This callback is deprecated and replaced by the {@link RemoteVideoStateChanged} callback with the following parameters: - * - {@link VideoRemoteState.Stopped} and {@link VideoRemoteStateReason.RemoteMuted}. - * - {@link VideoRemoteState.Decoding} and {@link VideoRemoteStateReason.RemoteUnmuted}. + * **Deprecated** + * This callback is deprecated and replaced by the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters: + * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. + * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. * * Once the video module is disabled, the remote user can only use a voice call. The remote user cannot send or receive any video from other users. * - * The SDK triggers this callback when the remote user enables or disables the video module by calling the {@link RtcEngine.enableVideo} or {@link RtcEngine.disableVideo} method. + * The SDK triggers this callback when the remote user enables or disables the video module by calling the [`enableVideo`]{@link RtcEngine.enableVideo} or [`disableVideo`]{@link RtcEngine.disableVideo} method. * * **Note** - * - This callback is invalid when the number of users or broadcasters in the channel exceeds 20. * + * This callback is invalid when the number of users or broadcasters in the channel exceeds 20. + * + * [`UidWithEnabledCallback`]{@link UidWithEnabledCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user. + * - `enabled`: *boolean* + * + * Whether the specific remote user enables/disables the video module: + * - true: Enable. The remote user can enter a video session. + * - false: Disable. The remote user can only enter a voice session, and cannot send or receive any video stream. * @event UserEnableVideo */ UserEnableVideo: UidWithEnabledCallback @@ -747,14 +1216,26 @@ export interface RtcEngineEvents { /** * Occurs when a remote user enables/disables the local video capture function. * - * @deprecated This callback is deprecated and replaced by the {@link RemoteVideoStateChanged} callback with the following parameters: - * - {@link VideoRemoteState.Stopped} and {@link VideoRemoteStateReason.RemoteMuted}. - * - {@link VideoRemoteState.Decoding} and {@link VideoRemoteStateReason.RemoteUnmuted}. + * **Deprecated** + * + * This callback is deprecated and replaced by the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters: + * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. + * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. * - * The SDK triggers this callback when the remote user resumes or stops capturing the video stream by calling the {@link RtcEngine.enableLocalVideo} method. + * The SDK triggers this callback when the remote user resumes or stops capturing the video stream by + * calling [`enableLocalVideo`]{@link RtcEngine.enableLocalVideo}. * * This callback is only applicable to the scenario when the remote user only wants to watch the remote video without sending any video stream to the other user. * + * [`UidWithEnabledCallback`]{@link UidWithEnabledCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user. + * - `enabled`: *boolean* + * + * Whether the specific remote user enables/disables the local video capturing function: + * - true: Enabled. Other users in the channel can see the video of this remote user. + * - false: Disabled. Other users in the channel can no longer receive the video stream from this remote user, while this remote user can still receive the video streams from other users. * @event UserEnableLocalVideo */ UserEnableLocalVideo: UidWithEnabledCallback @@ -762,16 +1243,31 @@ export interface RtcEngineEvents { /** * Occurs when the first remote video frame is received and decoded. * - * @deprecated This callback is deprecated. Use {@link VideoRemoteState.Starting} or {@link VideoRemoteState.Decoding} in the {@link RemoteVideoStateChanged} callback instead. + * **Deprecated** + * + * This callback is deprecated. Use [`Starting`]{@link VideoRemoteState.Starting} or [`Decoding`]{@link VideoRemoteState.Decoding} in the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback instead. * * This callback is triggered in either of the following scenarios: * - The remote user joins the channel and sends the video stream. * - The remote user stops sending the video stream and re-sends it after 15 seconds. Possible reasons include: * - The remote user leaves channel. * - The remote user drops offline. - * - The remote user calls the {@link RtcEngine.muteLocalVideoStream} method. - * - The remote user calls the {@link RtcEngine.disableVideo} method. + * - The remote user calls [`muteLocalVideoStream`]{@link RtcEngine.muteLocalVideoStream}. + * - The remote user calls [`disableVideo`]{@link RtcEngine.disableVideo}. + * + * [`VideoFrameWithUidCallback`]{@link VideoFrameWithUidCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the video streams. + * - `width`: *number* * + * Width (pixels) of the video stream. + * - `height`: *number* + * + * Height (pixels) of the video stream. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@link joinChannel} until this callback is triggered. * @event FirstRemoteVideoDecoded */ FirstRemoteVideoDecoded: VideoFrameWithUidCallback @@ -779,9 +1275,12 @@ export interface RtcEngineEvents { /** * Occurs when the microphone is enabled/disabled. * - * @deprecated This callback is deprecated. Use {@link AudioLocalState.Stopped} or {@link AudioLocalState.Recording} in the {@link LocalAudioStateChanged} callback instead. + * **Deprecated** + * + * This callback is deprecated. Use [`Stopped`]{@link AudioLocalState.Stopped} or [`Recording`]{@link AudioLocalState.Recording} in the [`LocalAudioStateChanged`]{@link LocalAudioStateChanged} callback instead. + * + * The SDK triggers this callback when the local user resumes or stops capturing the local audio stream by calling [`enableLocalAudio`]{@link RtcEngine.enableLocalAudio}. * - * The SDK triggers this callback when the local user resumes or stops capturing the local audio stream by calling the {@link RtcEngine.enableLocalAudio} method. * * @event MicrophoneEnabled */ @@ -790,11 +1289,15 @@ export interface RtcEngineEvents { /** * Occurs when the connection between the SDK and the server is interrupted. * - * @deprecated Use {@link ConnectionStateChanged} instead. + * **Deprecated** + * + * Use {@link ConnectionStateChanged} instead. * - * The SDK triggers this callback when it loses connection to the server for more than four seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. You can use this callback to implement pop-up reminders. This callback is different from {@link ConnectionLost}: - * - The SDK triggers the {@link ConnectionInterrupted} callback when the SDK loses connection with the server for more than four seconds after it joins the channel. - * - The SDK triggers the {@link ConnectionLost} callback when it loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not. + * The SDK triggers this callback when it loses connection to the server for more than four seconds after + * the connection is established. After triggering this callback, the SDK tries to reconnect to the server. + * You can use this callback to implement pop-up reminders. This callback is different from [`ConnectionLost`]{@link ConnectionLost}: + * - The SDK triggers the [`ConnectionInterrupted`]{@link ConnectionInterrupted} callback when the SDK loses connection with the server for more than four seconds after it joins the channel. + * - The SDK triggers the [`ConnectionLost`]{@link ConnectionLost} callback when it loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not. * * If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. * @@ -805,7 +1308,9 @@ export interface RtcEngineEvents { /** * Occurs when your connection is banned by the Agora Server. * - * @deprecated Use {@link ConnectionStateChanged} instead. + * **Deprecated** + * + * Use {@link ConnectionStateChanged} instead. * * @event ConnectionBanned */ @@ -814,10 +1319,24 @@ export interface RtcEngineEvents { /** * Reports the statistics of the audio stream from each remote user/host. * - * @deprecated Use {@link RemoteAudioStats} instead. + * **Deprecated** + * + * Use [`RemoteAudioStats`]{@link RemoteAudioStats} instead. * * The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple remote users/hosts sending audio streams, the SDK trggers this callback as many times. * + * [`AudioQualityCallback`]{@link AudioQualityCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the speaker. + * - `quality`: *number* + * + * Time delay (ms) of the audio packet from the sender to the receiver, including the time delay from audio sampling pre-processing, transmission, and the jitter buffer. + * Audio quality of the user. + * - `delay`: *number* + * + * Packet loss rate (%) of the audio packet sent from the sender to the receiver. + * - `lost`: *number* * @event AudioQuality */ AudioQuality: AudioQualityCallback @@ -825,7 +1344,10 @@ export interface RtcEngineEvents { /** * Occurs when the camera is turned on and ready to capture video. * - * @deprecated Use {@link LocalVideoStreamState.Capturing} in the {@link LocalVideoStateChanged} callback instead. If the camera fails to turn on, fix the error reported in the {@link Error} callback. + * **Deprecated** + * + * Use [`Capturing`]{@link LocalVideoStreamState.Capturing} in the [`LocalVideoStateChanged`]{@link LocalVideoStateChanged} callback instead. + * If the camera fails to turn on, fix the error reported in the [`Error`]{@link Error} callback. * * @event CameraReady */ @@ -834,7 +1356,9 @@ export interface RtcEngineEvents { /** * Occurs when the video stops playing. * - * @deprecated Use {@link LocalVideoStreamState.Stopped} in the {@link LocalVideoStateChanged} callback instead. The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing. + * **Deprecated** + * + * Use [`Stopped`]{@link LocalVideoStreamState.Stopped} in the [`LocalVideoStateChanged`]{@link LocalVideoStateChanged} callback instead. The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing. * * @event VideoStopped */ @@ -843,6 +1367,16 @@ export interface RtcEngineEvents { /** * Occurs when the local user receives the metadata. * + * [`MetadataCallback`]{@link MetadataCallback} has the following parameters: + * - `buffer`: *string* + * + * The received metadata. + * - `uid`: *number* + * + * The ID of the user who sent the metadata. + * - `timeStampMs`: *number* + * + * The timestamp (ms) of the received metadata. * @event MetadataReceived */ MetadataReceived: MetadataCallback @@ -855,6 +1389,10 @@ export interface RtcChannelEvents { /** * Reports the warning code of the {@link RtcChannel} instance. * + * [`WarningCallback`]{@link WarningCallback} has the following parameters: + * - `warn`: [`WarningCode`]{@link WarningCode}. + * + * Warning code. * @event Warning */ Warning: WarningCallback @@ -862,6 +1400,10 @@ export interface RtcChannelEvents { /** * Reports the error code of the {@link RtcChannel} instance. * + * [`ErrorCallback`]{@link ErrorCallback} has the following parameters: + * - `err`: [`ErrorCode`]{@link ErrorCode} + * + * Error code. * @event Error */ Error: ErrorCallback @@ -869,7 +1411,16 @@ export interface RtcChannelEvents { /** * Occurs when the local user joins a specified channel. * - * If the uid is not specified when calling {@link RtcChannel.joinChannel}, the server automatically assigns a uid. + * If the uid is not specified when calling [`joinChannel`]{@link RtcChannel.joinChannel}, the server automatically assigns a uid. + * + * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: + * - `uid`: *number* + * + * User ID. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. + * * * @event JoinChannelSuccess */ @@ -880,6 +1431,14 @@ export interface RtcChannelEvents { * * When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. * + * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: + * - `uid`: *number* + * + * User ID. + * - `elapsed`: *number* + * + * Time elapsed (ms) from starting to reconnect until this callback is triggered. + * * @event RejoinChannelSuccess */ RejoinChannelSuccess: UidWithElapsedCallback @@ -887,10 +1446,14 @@ export interface RtcChannelEvents { /** * Occurs when a user leaves the channel. * - * When a user leaves the channel by using the {@link RtcChannel.leaveChannel} method, the SDK uses this callback to notify the app when the user leaves the channel. + * When a user leaves the channel by using the [`leaveChannel`]{@link RtcChannel.leaveChannel} method, the SDK uses this callback to notify the app when the user leaves the channel. * * With this callback, the app retrieves the channel information, such as the call duration and statistics. * + * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: + * - `RtcStats`:[`RtcStats`]{@link RtcStats} + * + * Statistics of the call. * @event LeaveChannel */ LeaveChannel: RtcStatsCallback @@ -900,6 +1463,13 @@ export interface RtcChannelEvents { * * The SDK triggers this callback when the local user switches the user role by calling the {@link RtcChannel.setClientRole} method after joining the channel. * + * [`ClientRoleCallback`]{@link ClientRoleCallback} has the following parameters: + * - `oldRole`: [`ClientRole`]{@link ClientRole} + * + * Role that the user switches from. + * - `newRole`: [`ClientRole`]{@link ClientRole} + * + * Role that the user switches to. * @event ClientRoleChanged */ ClientRoleChanged: ClientRoleCallback @@ -915,6 +1485,14 @@ export interface RtcChannelEvents { * - The audience in the channel receives this callback when a new host joins the channel. * - When a web app joins the channel, this callback is triggered as long as the web app publishes streams. * + * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the user or host who joins the channel. + * - `elapsed`: *number* + * + * Time delay (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel}/[`setClientRole`]{@link RtcEngine.setClientRole}setClientRole + * until this callback is triggered. * @event UserJoined */ UserJoined: UidWithElapsedCallback @@ -926,6 +1504,13 @@ export interface RtcChannelEvents { * - Leave the channel: When the user/broadcaster leaves the channel, the user/broadcaster sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel. * - Go offline: When no data packet of the user or broadcaster is received for a certain period of time (around 20 seconds), the SDK assumes that the user/broadcaster drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. * + * [`UserOfflineCallback`]{@link UserOfflineCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the user or host who leaves the channel or goes offline. + * -` reason`: [`UserOfflineReason`]{@link UserOfflineReason} + * + * - Reason why the user goes offline. * @event UserOffline */ UserOffline: UserOfflineCallback @@ -935,6 +1520,13 @@ export interface RtcChannelEvents { * * The Agora SDK triggers this callback to report on the current network connection state when it changes, and the reason to such change. * + * [`ConnectionStateCallback`]{@link ConnectionStateCallback} has the following parameters: + * - `state`: [`ConnectionStateType`][@link ConnectionStateType] + * + * The current network connection state. + * - `reason`: [`ConnectionChangedReason`]{@link ConnectionChangedReason} + * + * The reason causing the change of the connection state. * @event ConnectionStateChanged */ ConnectionStateChanged: ConnectionStateCallback @@ -942,7 +1534,7 @@ export interface RtcChannelEvents { /** * Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. * - * The SDK also triggers this callback when it cannot connect to the server 10 seconds after calling {@link RtcChannel.joinChannel}, regardless of whether it is in the channel or not. + * The SDK also triggers this callback when it cannot connect to the server 10 seconds after calling [`joinChannel`]{@link RtcChannel.joinChannel}, regardless of whether it is in the channel or not. * * If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. * @@ -953,8 +1545,14 @@ export interface RtcChannelEvents { /** * Occurs when the token expires in 30 seconds. * - * The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires, to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call {@link RtcChannel.renewToken} to pass the new token to the SDK. + * The user becomes offline if the token used when joining the channel expires. This callback is + * triggered 30 seconds before the token expires, to remind the app to get a new token. Upon receiving this callback, + * you need to generate a new token on the server and call [`renewToken`]{@link RtcChannel.renewToken} to pass the new token to the SDK. + * + * [`TokenCallback`]{@link TokenCallback} has the following parameters: + * - `token`: *string* * + * The token that will expire in 30 seconds. * @event TokenPrivilegeWillExpire */ TokenPrivilegeWillExpire: TokenCallback @@ -962,7 +1560,9 @@ export interface RtcChannelEvents { /** * Occurs when the token has expired. * - * After a token is specified when joining the channel, the token expires after a certain period of time, and a new token is required to reconnect to the server. This callback notifies the app to generate a new token and call {@link RtcChannel.renewToken} to renew the token. + * After a token is specified when joining the channel, the token expires after a certain period of time, + * and a new token is required to reconnect to the server. + * This callback notifies the app to generate a new token and call [`renewToken`]{@link RtcChannel.renewToken} to renew the token. * * @event RequestToken */ @@ -977,6 +1577,10 @@ export interface RtcChannelEvents { * - To receive this callback, you need to call {@link RtcEngine.enableAudioVolumeIndication}. * - This callback reports the ID of the user with the highest voice volume during a period of time, instead of at the moment. * + * [`UidCallback`]{@link UidCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the active speaker. A `uid` of 0 represents the local user. * @event ActiveSpeaker */ ActiveSpeaker: UidCallback @@ -984,6 +1588,19 @@ export interface RtcChannelEvents { /** * Occurs when the video size or rotation information of a remote user changes. * + * [`VideoSizeCallback`]{@link VideoSizeCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user or local user (0) whose video size or rotation changes. + * - `width`: *number* + * + * New width (pixels) of the video. + * - `height`: *number* + * + * New height (pixels) of the video. + * - `rotation`: *number* + * + * New rotation of the video [0 to 360). * @event VideoSizeChanged */ VideoSizeChanged: VideoSizeCallback @@ -991,6 +1608,20 @@ export interface RtcChannelEvents { /** * Occurs when the remote video state changes. * + * [`RemoteVideoStateCallback`]{@link RemoteVideoStateCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the remote user whose video state changes. + * - `state`: [`VideoRemoteState`]{@link VideoRemoteState} + * + * State of the remote video. + * - `reason`: [`VideoRemoteStateReason`]{@link VideoRemoteStateReason} + * + * The reason of the remote video state change. + * - `elapsed`: *number* + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. + * * @event RemoteVideoStateChanged */ RemoteVideoStateChanged: RemoteVideoStateCallback @@ -1000,6 +1631,19 @@ export interface RtcChannelEvents { * * This callback indicates the state change of the remote audio stream. * + * [`RemoteAudioStateCallback`]{@link RemoteAudioStateCallback } has the following parameters: + * - `uid`: *number* + * + * ID of the user whose audio state changes. + * - `state`: [`AudioRemoteState`]{@link AudioRemoteState} + * + * State of the remote audio. + * - `reason`: [`AudioRemoteStateReason`]{@link AudioRemoteStateReason} + * + * The reason of the remote audio state change. + * - `elapsed`: number + * + * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. * @event RemoteAudioStateChanged */ RemoteAudioStateChanged: RemoteAudioStateCallback @@ -1009,6 +1653,12 @@ export interface RtcChannelEvents { * * If you call {@link RtcEngine.setLocalPublishFallbackOption} and set option as {@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. * + * [`FallbackCallback`]{@link FallbackCallback} has the following parameters: + * - `isFallbackOrRecover`: *boolean* + * + * Whether the published stream fell back to audio-only or switched back to the video: + * - true: The published stream fell back to audio-only due to poor network conditions. + * - false: The published stream switched back to the video after the network conditions improved. * @event LocalPublishFallbackToAudioOnly */ LocalPublishFallbackToAudioOnly: FallbackCallback @@ -1016,11 +1666,20 @@ export interface RtcChannelEvents { /** * Occurs when the remote media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. * - * If you call {@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as {@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves. + * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves. * * **Note** * - Once the remote media stream is switched to the low stream due to poor network conditions, you can monitor the stream switch between a high and low stream in the {@link RemoteVideoStats} callback. * + * [`FallbackWithUidCallback`]{@link FallbackWithUidCallback} has the following parameters: + * - `uid`: *number* + * + * ID of the remote user sending the stream. + * - `isFallbackOrRecover`: *boolean* + * + * Whether the remote media stream fell back to audio-only or switched back to the video: + * - true: The remote media stream fell back to audio-only due to poor network conditions. + * - false: The remote media stream switched back to the video stream after the network conditions improved. * @event RemoteSubscribeFallbackToAudioOnly */ RemoteSubscribeFallbackToAudioOnly: FallbackWithUidCallback @@ -1028,6 +1687,10 @@ export interface RtcChannelEvents { /** * Reports the statistics of the {@link RtcEngine} once every two seconds. * + * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: + * - `stats`: [`RtcStats`]{@link RtcStats} + * + * RTC engine statistics. * @event RtcStats */ RtcStats: RtcStatsCallback @@ -1037,6 +1700,19 @@ export interface RtcChannelEvents { * * Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times. * + * [`NetworkQualityWithUidCallback`]{@link NetworkQualityWithUidCallback} has the following parameters: + * - `uid`: *number* + * + * User ID. The network quality of the user with this uid is reported. + * If `uid` is 0, the local network quality is reported. + * - `txQuality`: [`NetworkQuality`]{@link NetworkQuality} + * + * Uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) + * and jitter of the uplink network. `txQuality` is a quality rating helping you understand how well the current uplink + * network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 680 × 480 and a frame rate of 30 fps, but may be inadequate for resolutions higher than 1280 × 720. + * - `rxQuality`: [`NetworkQuality`]{@link NetworkQuality} + * + * Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. * @event NetworkQuality */ NetworkQuality: NetworkQualityWithUidCallback @@ -1044,6 +1720,10 @@ export interface RtcChannelEvents { /** * Reports the statistics of the video stream from each remote user/broadcaster. The SDK triggers this callback once every two seconds for each remote user/broadcaster. If a channel includes multiple remote users, the SDK triggers this callback as many times. * + * [`RemoteVideoStatsCallback`]{@link RemoteVideoStatsCallback} has the following parameters: + * - `stats`: [`RemoteVideoStats`]{@link RemoteVideoStats} + * + * Statistics of the received remote video streams. * @event RemoteVideoStats */ RemoteVideoStats: RemoteVideoStatsCallback @@ -1055,6 +1735,10 @@ export interface RtcChannelEvents { * * Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high. * + * [`RemoteAudioStatsCallback`]{@link RemoteAudioStatsCallback} has the following parameters: + * - `stats`: [`RemoteAudioStats`]{@link RemoteAudioStats} + * + * Statistics of the received remote audio streams. * @event RemoteAudioStats */ RemoteAudioStats: RemoteAudioStatsCallback @@ -1066,6 +1750,16 @@ export interface RtcChannelEvents { * * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter. * + * [`RtmpStreamingStateCallback`]{@link RtmpStreamingStateCallback} has the following parameters: + * - `url`: *string* + * + * The RTMP URL address. + * - `state`: *RtmpStreamingState* + * + * The RTMP streaming state. + * - `errCode`: *RtmpStreamingErrorCode* + * + * The detailed error information for streaming. * @event RtmpStreamingStateChanged */ RtmpStreamingStateChanged: RtmpStreamingStateCallback @@ -1073,10 +1767,11 @@ export interface RtcChannelEvents { /** * Occurs when the publisher's transcoding settings are updated. * - * When the LiveTranscoding class in the {@link RtcChannel.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. + * When the `LiveTranscoding` class in the [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * * **Note** - * - If you call the setLiveTranscoding method to set the LiveTranscoding class for the first time, the SDK does not trigger this callback. + * + * If you call [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * * @event TranscodingUpdated */ @@ -1085,6 +1780,16 @@ export interface RtcChannelEvents { /** * Reports the status of injecting the online media stream. * + * [`StreamInjectedStatusCallback`]{@link StreamInjectedStatusCallback} has the following parameters: + * - `url`: *string* + * + * The URL address of the externally injected stream. + * - `uid`: *number* + * + * User ID. + * - `status`: [`InjectStreamStatus`]{@link InjectStreamStatus} + * + * State of the externally injected stream. * @event StreamInjectedStatus */ StreamInjectedStatus: StreamInjectedStatusCallback @@ -1094,6 +1799,16 @@ export interface RtcChannelEvents { * * The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the {@link RtcChannel.sendStreamMessage} method. * + * [`StreamMessageCallback`]{@link StreamMessageCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the data stream. + * - `streamId`: *number* + * + * Stream ID. + * - `data`: *string* + * + * Data received by the local user. * @event StreamMessage */ StreamMessage: StreamMessageCallback @@ -1103,6 +1818,21 @@ export interface RtcChannelEvents { * * The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the {@link RtcChannel.sendStreamMessage} method. * + * [`StreamMessageErrorCallback`]{@link StreamMessageErrorCallback} has the following parameters: + * - `uid`: *number* + * + * User ID of the remote user sending the data stream. + * - `streamId`: *number* + * + * Stream ID. + * - `error`: [`ErrorCode`]{@link ErrorCode} + * Error code. + * - `missed`: *number* + * + * The number of lost messages. + * - `cached`: *number* + * + * The number of incoming cached messages when the data stream is interrupted. * @event StreamMessageError */ StreamMessageError: StreamMessageErrorCallback @@ -1112,6 +1842,13 @@ export interface RtcChannelEvents { * * The SDK reports the state of the current media relay and possible error messages in this callback. * + * [`MediaRelayStateCallback`]{@link MediaRelayStateCallback} has the following parameters: + * - `state`: [`ChannelMediaRelayState`]{@link ChannelMediaRelayState} + * + * The state code. + * - `code`: [`ChannelMediaRelayError`]{@link ChannelMediaRelayError} + * + * The error code. * @event ChannelMediaRelayStateChanged */ ChannelMediaRelayStateChanged: MediaRelayStateCallback @@ -1119,6 +1856,10 @@ export interface RtcChannelEvents { /** * Reports events during the media stream relay. * + * [`MediaRelayEventCallback`]{@link MediaRelayEventCallback} has the following parameters: + * - `code`: [`ChannelMediaRelayEvent`]{@link ChannelMediaRelayEvent} + * + * The event code for media stream relay. * @event ChannelMediaRelayEvent */ ChannelMediaRelayEvent: MediaRelayEventCallback @@ -1126,6 +1867,16 @@ export interface RtcChannelEvents { /** * Occurs when the local user receives the metadata. * + * [`MetadataCallback`]{@link MetadataCallback} has the following parameters: + * - `buffer`: *string* + * + * The received metadata. + * - `uid`: *number* + * + * The ID of the user who sent the metadata. + * - `timeStampMs`: *number* + * + * The timestamp (ms) of the received metadata. * @event MetadataReceived */ MetadataReceived: MetadataCallback From f6c3e602c17ca7f091b689f828a2196e3fbe4960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Wed, 19 Aug 2020 12:47:21 +0800 Subject: [PATCH 2/9] Udate documentation comments --- src/src/RtcChannel.native.ts | 404 ++++++++++++++++++------------- src/src/RtcEngine.native.ts | 87 ++++--- src/src/RtcEvents.ts | 4 +- src/src/RtcRenderView.native.tsx | 72 +++--- 4 files changed, 320 insertions(+), 247 deletions(-) diff --git a/src/src/RtcChannel.native.ts b/src/src/RtcChannel.native.ts index 73fa1c7e1..482870a37 100644 --- a/src/src/RtcChannel.native.ts +++ b/src/src/RtcChannel.native.ts @@ -56,18 +56,24 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Creates and gets an RtcChannel instance. - * @see RtcChannel - * To join more than one channel, call this method multiple times to create as many RtcChannel instances as needed, and call the joinChannel method of each created RtcChannel object. - * @see RtcChannel.joinChannel + * Creates and gets an [`RtcChannel`]{@link RtcChannel} instance. + * + * To join more than one channel, call this method multiple times to create as many `RtcChannel` instances as needed, + * and call the [`joinChannel`]{@link RtcChannel.joinChannel} method of each created `RtcChannel` object. + * * After joining multiple channels, you can simultaneously subscribe to streams of all the channels, but publish a stream in only one channel at one time. - * @param channelId The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. This parameter does not have a default value. You must set it. Do not set it as the empty string "". Otherwise, the SDK returns Refused(-5). Supported character scopes are: - * @see ErrorCode.Refused + * @param channelId The unique channel name for the AgoraRTC session in the string format. + * The string length must be less than 64 bytes. + * Supported character scopes are: * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. * - All numeric characters: 0 to 9. * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + * + * **Note** + * - This parameter does not have a default value. You must set it. + * - Do not set it as the empty string "". Otherwise, the SDK returns [`Refused(-5)`]{@link ErrorCode.Refused}. */ static async create(channelId: string): Promise { if (channels.get(channelId)) return channels.get(channelId) as RtcChannel; @@ -77,8 +83,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Destroys all RtcChannel instance. - * @see RtcChannel + * Destroys all [`RtcChannel`]{@link RtcChannel} instance. */ static destroyAll() { channels.forEach(async (value, key) => { @@ -88,8 +93,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Destroys the RtcChannel instance. - * @see RtcChannel + * Destroys the [`RtcChannel`]{@link RtcChannel} instance. + * */ destroy(): Promise { this.removeAllListeners(); @@ -99,7 +104,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Adds the channel event handler. - * After setting the channel event handler, you can listen for channel events and receive the statistics of the corresponding RtcChannel instance. + * + * After setting the channel event handler, you can listen for channel events and receive the statistics of the corresponding [`RtcChannel`]{@link RtcChannel} instance. * @param event The event type. * @param listener The event handler. */ @@ -127,7 +133,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Removes the channel event handler. - * For callback events that you only want to listen for once, call this method to remove it after you have received them. + * + * For callback events that you only want to listen for once, call this method to remove the specific [`RtcEngineEvents`]{@link RtcEngineEvents} objects after you have received them. * @param event The event type. * @param listener The event handler. */ @@ -156,17 +163,16 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the role of a user. - * This method sets the role of a user, such as a host or an audience. In a Live-Broadcast channel, only a broadcaster can call the publish method in the RtcChannel class. - * @see RtcChannel.publish + * + * This method sets the role of a user, such as a host or an audience. In a Live-Broadcast channel, + * only a host can call the [`publish`]{@link publish} method in the [`RtcChannel`]{@link RtcChannel} class. + * * A successful call of this method triggers the following callbacks: - * - The local client: onClientRoleChanged. - * @see RtcChannelEvents.ClientRoleChanged - * - The remote client: onUserJoined or onUserOffline(BecomeAudience). - * @see RtcChannelEvents.UserJoined - * @see RtcChannelEvents.UserOffline - * @see UserOfflineReason.BecomeAudience + * - The local client: [`ClientRoleChanged`]{@link RtcChannelEvents.ClientRoleChanged}. + * - The remote client: [`UserJoined`]{@link RtcChannelEvents.UserJoined} + * or [`UserOffline(BecomeAudience)`]{@link RtcChannelEvents.UserOffline}. * @param role The role of the user. - * @see ClientRole + * */ setClientRole(role: ClientRole): Promise { return AgoraRtcChannelModule.setClientRole(this._channelId, role) @@ -174,19 +180,20 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Joins the channel with a user ID. - * Note + * + * **Note** * - If you are already in a channel, you cannot rejoin it with the same uid. * - We recommend using different UIDs for different channels. * - If you want to join the same channel from different devices, ensure that the UIDs in all devices are different. - * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the RtcEngine instance. - * @see RtcEngine + * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the [`RtcEngine`]{@link RtcEngine} instance. + * * @param token The token generated at your server. * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. * @param optionalInfo Additional information about the channel. This parameter can be set as null. Other users in the channel do not receive this information. * @param optionalUid The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If uid is not assigned (or set as 0), the SDK assigns a uid and reports it in the onJoinChannelSuccess callback. The app must maintain this user ID. * @param options The channel media options. - * @see ChannelMediaOptions + * */ joinChannel(token: string | null, optionalInfo: string | null, optionalUid: number, options: ChannelMediaOptions): Promise { return AgoraRtcChannelModule.joinChannel(this._channelId, token, optionalInfo, optionalUid, options) @@ -194,12 +201,13 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Joins a channel with the user account. - * Note + * + * **Note** * - If you are already in a channel, you cannot rejoin it with the same uid. * - We recommend using different user accounts for different channels. * - If you want to join the same channel from different devices, ensure that the user accounts in all devices are different. - * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the RtcEngine instance. - * @see RtcEngine + * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the [`RtcEngine`]{@link RtcEngine} instance. + * * @param token The token generated at your server. * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. @@ -210,7 +218,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * @param options The channel media options. - * @see ChannelMediaOptions + * */ joinChannelWithUserAccount(token: string | null, userAccount: string, options: ChannelMediaOptions): Promise { return AgoraRtcChannelModule.joinChannelWithUserAccount(this._channelId, token, userAccount, options) @@ -218,11 +226,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Leaves the current channel. - * A successful leaveChannel method call triggers the following callbacks: - * - The local client: onLeaveChannel. - * @see RtcChannelEvents.LeaveChannel - * - The remote client: onUserOffline, if the user leaving the channel is in a Communication channel, or is a broadcaster in a Live-Broadcast channel. - * @see RtcChannelEvents.UserOffline + * + * A successful call of this method triggers the following callbacks: + * - The local client: [`LeaveChannel`]{@link RtcChannelEvents.LeaveChannel}. + * - The remote client: [`UserOffline`]{@link RtcChannelEvents.UserOffline}, if the user leaving the channel is in a Communication channel, or is a host in a Live-Broadcast channel. + * */ leaveChannel(): Promise { return AgoraRtcChannelModule.leaveChannel(this._channelId) @@ -230,12 +238,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Renews the token when the current token expires. + * * In the following situations, the SDK decides that the current token has expired: - * - The SDK triggers the onTokenPrivilegeWillExpire callback, or - * @see RtcChannelEvents.TokenPrivilegeWillExpire - * - The onConnectionStateChanged callback reports the TokenExpired(9) error. - * @see RtcChannelEvents.ConnectionStateChanged - * @see ConnectionChangedReason.TokenExpired + * - The SDK triggers the [`TokenPrivilegeWillExpire`]{@link RtcChannelEvents.TokenPrivilegeWillExpire} callback, or + * - The [`ConnectionStateChanged`]{@link RtcChannelEvents.ConnectionStateChanged} callback reports the [`TokenExpired(9)`]{@link ConnectionChangedReason.TokenExpired} error. + * * You should get a new token from your server and call this method to renew it. Failure to do so results in the SDK disconnecting from the Agora server. * @param token The new token. */ @@ -252,11 +259,10 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Publishes the local stream to the channel. - * You must keep the following restrictions in mind when calling this method. Otherwise, the SDK returns the Refused(-5): - * @see ErrorCode.Refused - * - This method publishes one stream only to the channel corresponding to the current RtcChannel instance. - * - In a Live-Broadcast channel, only a broadcaster can call this method. To switch the client role, call setClientRole of the current RtcChannel instance. - * @see RtcChannel.setClientRole + * You must keep the following restrictions in mind when calling this method. + * Otherwise, the SDK returns the [`Refused(-5)`]{@link ErrorCode.Refused}: + * - This method publishes one stream only to the channel corresponding to the current [`RtcChannel`]{@link RtcChannel} instance. + * - In a Live-Broadcast channel, only a host can call this method. To switch the client role, call [`setClientRole`]{@link RtcChannel.setClientRole} of the current [`RtcChannel`]{@link RtcChannel} instance. * - You can publish a stream to only one channel at a time. For details, see the advanced guide Join Multiple Channels. */ publish(): Promise { @@ -265,8 +271,9 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Stops publishing a stream to the channel. - * If you call this method in a channel where you are not publishing streams, the SDK returns Refused(-5). - * @see ErrorCode.Refused + * + * If you call this method in a channel where you are not publishing streams, the SDK returns [`Refused(-5)`]{@link ErrorCode.Refused}. + * */ unpublish(): Promise { return AgoraRtcChannelModule.unpublish(this._channelId) @@ -281,11 +288,16 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Adjusts the playback volume of a specified remote user. - * You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user. - * Note + * + * You can call this method as many times as necessary to adjust the playback volume of different remote + * users, or to repeatedly adjust the playback volume of the same remote user. + * + * **Note** * - Call this method after joining a channel. * - The playback volume here refers to the mixed volume of a specified remote user. - * - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. + * - This method can only adjust the playback volume of one specified remote user at a time. + * To adjust the playback volume of different remote users, call the method as many times, once for each remote user. + * * @param uid ID of the remote user. * @param volume The playback volume of the specified remote user. The value ranges from 0 to 100: * - 0: Mute. @@ -297,6 +309,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Stops/Resumes receiving the audio stream of the specified user. + * * @param uid ID of the remote user whose audio stream you want to mute. * @param muted Determines whether to receive/stop receiving the audio stream of the specified user: * - true: Stop receiving the audio stream of the user. @@ -308,6 +321,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Stops/Resumes receiving all remote audio streams. + * * @param muted Determines whether to receive/stop receiving all remote audio streams: * - true: Stop receiving all remote audio streams. * - false: (Default) Receive all remote audio streams. @@ -318,6 +332,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets whether to receive all remote audio streams by default. + * * @param muted Determines whether to receive/stop receiving all remote audio streams by default: * - true: Stop receiving all remote audio streams by default. * - false: (Default) Receive all remote audio streams by default. @@ -328,6 +343,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Stops/Resumes receiving all remote video streams. + * * @param muted Determines whether to receive/stop receiving all remote video streams: * - true: Stop receiving all remote video streams. * - false: (Default) Receive all remote video streams. @@ -338,6 +354,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Stops/Resumes receiving the video stream of the specified user. + * * @param uid ID of the remote user whose video stream you want to mute. * @param muted Determines whether to receive/stop receiving the video stream of the specified user: * - true: Stop receiving the video stream of the user. @@ -349,6 +366,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets whether to receive all remote video streams by default. + * * @param muted Determines whether to receive/stop receiving all remote video streams by default: * - true: Stop receiving all remote video streams by default. * - false: (Default) Receive all remote video streams by default. @@ -359,11 +377,13 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the sound position of a remote user. + * * When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. - * Note - * - For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel. - * @see RtcEngine.enableSoundPositionIndication + * + * **Note** + * - For this method to work, enable stereo panning for remote users by calling the [`enableSoundPositionIndication`]{@link RtcEngine.enableSoundPositionIndication} method before joining a channel. * - This method requires hardware support. For the best sound positioning, we recommend using a stereo headset. + * * @param uid The ID of the remote user. * @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: * - 0.0: The remote sound comes from the front. @@ -377,17 +397,20 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Publishes the local stream to the CDN. - * This method call triggers the onRtmpStreamingStateChanged callback on the local client to report the state of adding a local stream to the CDN. - * @see RtcChannelEvents.RtmpStreamingStateChanged - * Note - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. + * + * This method call triggers the [`RtmpStreamingStateChanged`]{@link RtcChannelEvents.RtmpStreamingStateChanged} + * callback on the local client to report the state of adding a local stream to the CDN. + * + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. - * - This method can only be called by a broadcaster in a Live-Broadcast channel. + * - This method can only be called by a host in a Live-Broadcast channel. * - This method adds only one stream HTTP/HTTPS URL address each time it is called. + * * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. - * @param transcodingEnabled Sets whether transcoding is enabled/disabled. If you set this parameter as true, ensure that you call the setLiveTranscoding method before this method. - * @see RtcChannel.setLiveTranscoding - * - true: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple broadcasters in CDN live. + * @param transcodingEnabled Sets whether transcoding is enabled/disabled. If you set this parameter as true, + * ensure that you call the [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} method before this method. + * - true: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. * - false: Disable transcoding. */ addPublishStreamUrl(url: string, transcodingEnabled: boolean): Promise { @@ -396,14 +419,17 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Removes an RTMP stream from the CDN. - * This method removes the RTMP URL address (added by addPublishStreamUrl) from a CDN live stream. The SDK reports the result of this method call in the onRtmpStreamingStateChanged callback. - * @see RtcChannel.addPublishStreamUrl - * @see RtcChannelEvents.RtmpStreamingStateChanged - * Note - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. + * + * This method removes the RTMP URL address (added by [`addPublishStreamUrl`]{@link RtcChannel.addPublishStreamUrl}) from a CDN live stream. + * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcChannelEvents.RtmpStreamingStateChanged} callback. + * + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method can only be called by a broadcaster in a Live-Broadcast channel. * - This method removes only one stream HTTP/HTTPS URL address each time it is called. - * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. + * + * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, + * such as Chinese language characters. */ removePublishStreamUrl(url: string): Promise { return AgoraRtcChannelModule.removePublishStreamUrl(this._channelId, url); @@ -411,16 +437,19 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the video layout and audio settings for CDN live. - * The SDK triggers the onTranscodingUpdated callback when you call this method to update the LiveTranscodingclass. If you call this method to set the LiveTranscoding class for the first time, the SDK does not trigger the onTranscodingUpdated callback. - * @see RtcChannelEvents.TranscodingUpdated - * Note - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. + * + * The SDK triggers the [`TranscodingUpdated`]{@link RtcChannelEvents.TranscodingUpdated} callback when you + * call this method to update the [`LiveTranscoding`]{@link LiveTranscoding} class. If you call this method to set the [`LiveTranscoding`]{@link LiveTranscoding} + * class for the first time, the SDK does not trigger the [`TranscodingUpdated`]{@link RtcChannelEvents.TranscodingUpdated} callback. + * + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. - * - This method can only be called by a broadcaster in a Live-Broadcast channel. - * - Ensure that you call this method before calling the addPublishStreamUrl method. - * @see RtcChannel.addPublishStreamUrl + * - This method can only be called by a host in a Live-Broadcast channel. + * - Ensure that you call this method before calling the [`addPublishStreamUrl`]{@link RtcChannel.addPublishStreamUrl} method. + * * @param transcoding Sets the CDN live audio/video transcoding settings. - * @see LiveTranscoding + * */ setLiveTranscoding(transcoding: LiveTranscoding): Promise { return AgoraRtcChannelModule.setLiveTranscoding(this._channelId, transcoding); @@ -428,22 +457,23 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Starts to relay media streams across channels. - * After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks report the state and events of the media stream relay. - * @see RtcChannelEvents.ChannelMediaRelayStateChanged - * @see RtcChannelEvents.ChannelMediaRelayEvent - * - If the onChannelMediaRelayStateChanged callback reports Running(2) and None(0), and the onChannelMediaRelayEvent callback reports SentToDestinationChannel(4), the SDK starts relaying media streams between the original and the destination channel. - * @see ChannelMediaRelayState.Running - * @see ChannelMediaRelayError.None - * @see ChannelMediaRelayEvent.SentToDestinationChannel - * - If the onChannelMediaRelayStateChanged callback returns Failure(3), an exception occurs during the media stream relay. - * @see ChannelMediaRelayState.Failure - * Note + * + * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} and [`ChannelMediaRelayEvent`]{@link RtcChannelEvents.ChannelMediaRelayEvent} callbacks, + * and these callbacks report the state and events of the media stream relay. + * + * - If the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback reports [`Running(2)`]{@link ChannelMediaRelayState.Running} and [`None(0)`]{@link ChannelMediaRelayError.None}, and + * the [`ChannelMediaRelayEvent`]{@link RtcChannelEvents.ChannelMediaRelayEvent} callback + * reports [`SentToDestinationChannel(4)`]{@link ChannelMediaRelayEvent.SentToDestinationChannel}, the SDK starts relaying media streams between the original and the destination channel. + * + * - If the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. + * + * **Note** * - Call this method after joining the channel. - * - This method can only be called by a broadcaster in a Live-Broadcast channel. - * - After a successful method call, if you want to call this method again, ensure that you call the stopChannelMediaRelay method to quit the current relay. - * @see RtcChannel.stopChannelMediaRelay + * - This method can only be called by a host in a Live-Broadcast channel. + * - After a successful method call, if you want to call this method again, ensure that you call the [`stopChannelMediaRelay`]{@link RtcChannel.stopChannelMediaRelay} method to quit the current relay. + * * @param channelMediaRelayConfiguration The configuration of the media stream relay. - * @see ChannelMediaRelayConfiguration + * */ startChannelMediaRelay(channelMediaRelayConfiguration: ChannelMediaRelayConfiguration): Promise { return AgoraRtcChannelModule.startChannelMediaRelay(this._channelId, channelMediaRelayConfiguration); @@ -451,17 +481,16 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Stops the media stream relay. - * Once the relay stops, the broadcaster quits all the destination channels. - * After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback reports Idle(0) and None(0), the broadcaster successfully stops the relay. - * @see RtcChannelEvents.ChannelMediaRelayStateChanged - * @see ChannelMediaRelayState.Idle - * @see ChannelMediaRelayError.None - * Note - * - If the method call fails, the SDK triggers the onChannelMediaRelayStateChanged callback with the ServerNoResponse(2) or ServerConnectionLost(8) state code. You can leave the channel using leaveChannel, and the media stream relay automatically stops. - * @see RtcChannelEvents.ChannelMediaRelayStateChanged - * @see ChannelMediaRelayError.ServerNoResponse - * @see ChannelMediaRelayError.ServerConnectionLost - * @see RtcChannel.leaveChannel + * + * Once the relay stops, the host quits all the destination channels. + * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback. If the callback reports [`Idle(0)`]{@link ChannelMediaRelayState.Idle} and + * [`None(0)`]{@link ChannelMediaRelayError.None}, the host successfully stops the relay. + * + * **Note** + * - If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback with + * the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerConnectionLost} state code. + * You can leave the channel using [`leaveChannel`]{@link RtcChannel.leaveChannel}, and the media stream relay automatically stops. + * */ stopChannelMediaRelay(): Promise { return AgoraRtcChannelModule.stopChannelMediaRelay(this._channelId); @@ -469,16 +498,17 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Updates the channels for media relay. - * After the channel media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call the updateChannelMediaRelay method. - * After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the UpdateDestinationChannel(7) state code. - * @see RtcChannelEvents.ChannelMediaRelayEvent - * @see ChannelMediaRelayEvent.UpdateDestinationChannel - * Note - * - Call this method after the startChannelMediaRelay method to update the destination channel. - * @see RtcChannel.startChannelMediaRelay + * + * After the channel media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call this method. + * After a successful method call, the SDK triggers the [`ChannelMediaRelayEvent`]{@link RtcChannelEvents.ChannelMediaRelayEvent} callback with + * the [`UpdateDestinationChannel(7)`]{@link ChannelMediaRelayEvent.UpdateDestinationChannel} state code. + * + * **Note** + * - Call this method after the [`startChannelMediaRelay`]{@link RtcChannel.startChannelMediaRelay} method to update the destination channel. * - This method supports adding at most four destination channels in the relay. + * * @param channelMediaRelayConfiguration The media stream relay configuration. - * @see ChannelMediaRelayConfiguration + * */ updateChannelMediaRelay(channelMediaRelayConfiguration: ChannelMediaRelayConfiguration): Promise { return AgoraRtcChannelModule.updateChannelMediaRelay(this._channelId, channelMediaRelayConfiguration); @@ -486,8 +516,9 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the default video-stream type of the remote video stream when the remote user sends dual streams. + * * @param streamType Sets the default video-stream type. - * @see VideoStreamType + * */ setRemoteDefaultVideoStreamType(streamType: VideoStreamType): Promise { return AgoraRtcChannelModule.setRemoteDefaultVideoStreamType(this._channelId, streamType); @@ -495,14 +526,17 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the video stream type of the remote video stream when the remote user sends dual streams. - * This method allows the app to adjust the corresponding video-stream type based on the size of the video window to reduce the bandwidth and resources. - * - If the remote user enables the dual-stream mode by calling the enableDualStreamMode method, the SDK receives the high-video stream by default. You can use this method to switch to the low-video stream. - * @see RtcEngine.enableDualStreamMode + * This method allows the app to adjust the corresponding video-stream type based on the size of the + * video window to reduce the bandwidth and resources. + * - If the remote user enables the dual-stream mode by calling the [`enableDualStreamMode`]{@link RtcEngine.enableDualStreamMode} method, + * the SDK receives the high-video stream by default. You can use this method to switch to the low-video stream. * - If dual-stream mode is not enabled, the SDK receives the high-stream video by default. - * By default, the aspect ratio of the low-video stream is the same as the high-video stream. Once the resolution of the high-video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + * By default, the aspect ratio of the low-video stream is the same as the high-video stream. Once the resolution of the high-video stream is set, + * the system automatically sets the resolution, frame rate, and bitrate of the low-video stream. + * * @param uid ID of the remote user sending the video stream. * @param streamType Sets the video-stream type. - * @see VideoStreamType + * */ setRemoteVideoStreamType(uid: number, streamType: VideoStreamType): Promise { return AgoraRtcChannelModule.setRemoteVideoStreamType(this._channelId, uid, streamType); @@ -510,13 +544,16 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the priority of a remote user's media stream. - * Use this method with the setRemoteSubscribeFallbackOption method. If a remote video stream experiences the fallback, the SDK ensures the high-priority user gets the best possible stream quality. - * @see RtcEngine.setRemoteSubscribeFallbackOption - * Note - * - The Agora SDK supports setting userPriority as high for one user only. + * + * Use this method with the [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} method. + * If a remote video stream experiences the fallback, the SDK ensures the high-priority user gets the best possible stream quality. + * + * **Note** + * The Agora SDK supports setting userPriority as high for one user only. + * * @param uid The ID of the remote user. * @param userPriority The priority of the remote user. - * @see UserPriority + * */ setRemoteUserPriority(uid: number, userPriority: UserPriority): Promise { return AgoraRtcChannelModule.setRemoteUserPriority(this._channelId, uid, userPriority); @@ -524,41 +561,60 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Registers the metadata observer. - * A successful call of this method triggers the getMaxMetadataSize callback. - * @see RtcChannel.setMaxMetadataSize - * This method enables you to add synchronized metadata in the video stream for more diversified live broadcast interactions, such as sending shopping links, digital coupons, and online quizzes. - * Note - * - Call this method before the joinChannel method. - * @see RtcChannel.joinChannel - * - This method applies to the Live-Broadcast profile only. - * @see ChannelProfile.LiveBroadcasting + * + * A successful call of this method triggers the [`setMaxMetadataSize`]{@link RtcChannel.setMaxMetadataSize} callback. + * + * This method enables you to add synchronized metadata in the video stream for more diversified live streaming interactions, + * such as sending shopping links, digital coupons, and online quizzes. + * + * **Note** + * - Call this method before the [`joinChannel`]{@link RtcChannel.joinChannel} method. + * - This method applies to the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile only. + * */ registerMediaMetadataObserver(): Promise { return AgoraRtcChannelModule.registerMediaMetadataObserver(this._channelId); } - + /** + * Sends the metadata. + * + * @param metadata The metadata to be sent. + * + */ sendMetadata(metadata: string): Promise { return AgoraRtcChannelModule.sendMetadata(this._channelId, metadata); } - + /** + * Sets the maximum size of the metadata. + * + * @param size Buffer size of the sent or received metadata. + * + */ setMaxMetadataSize(size: number): Promise { return AgoraRtcChannelModule.setMaxMetadataSize(this._channelId, size); } - + /** + * Unregisters the metadata observer. + * + */ unregisterMediaMetadataObserver(): Promise { return AgoraRtcChannelModule.unregisterMediaMetadataObserver(this._channelId); } /** * Sets the built-in encryption mode. - * The Agora SDK supports built-in encryption, which is set to aes-128-xts mode by default. Call this method to set the encryption mode to use other encryption modes. All users in the same channel must use the same encryption mode and password. + * + * The Agora SDK supports built-in encryption, which is set to aes-128-xts mode by default. + * Call this method to set the encryption mode to use other encryption modes. + * All users in the same channel must use the same encryption mode and password. * Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. - * Note + * + * **Note** * - Do not use this method for CDN streaming. - * - Before calling this method, ensure that you have called setEncryptionSecret to enable encryption. - * @see RtcEngine.setEncryptionSecret + * - Before calling this method, ensure that you have called [`setEncryptionSecret`]{@link RtcEngine.setEncryptionSecret} to enable encryption. + * * @param encryptionMode Sets the encryption mode. - * @see EncryptionMode + * */ setEncryptionMode(encryptionMode: EncryptionMode): Promise { return AgoraRtcChannelModule.setEncryptionMode(this._channelId, encryptionMode); @@ -566,10 +622,15 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Enables built-in encryption with an encryption password before joining a channel. - * All users in a channel must set the same encryption password. The encryption password is automatically cleared once a user leaves the channel. If the encryption password is not specified or set to empty, the encryption functionality is disabled. - * Note + * + * All users in a channel must set the same encryption password. + * The encryption password is automatically cleared once a user leaves the channel. + * If the encryption password is not specified or set to empty, the encryption functionality is disabled. + * + * **Note** * - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. * - Do not use this method for CDN live streaming. + * * @param secret The encryption password. */ setEncryptionSecret(secret: string): Promise { @@ -578,24 +639,27 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Injects an online media stream to a Live-Broadcast channel. - * If this method call succeeds, the server pulls the voice or video stream and injects it into a live channel. This applies to scenarios where all audience members in the channel can watch a live show and interact with each other. - * Note - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites. - * - This method can only be called by a broadcaster in a Live-Broadcast channel. + * + * If this method call succeeds, the servers pulls the voice or video stream and injects it into a live channel. This applies to scenarios where all audience members in the channel can watch a live show and interact with each other. + * + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. + * - This method can only be called by a host in a Live-Broadcast channel. + * * Calling this method triggers the following callbacks: * - The local client: - * -- onStreamInjectedStatus, with the state of injecting the media stream. - * @see RtcChannelEvents.StreamInjectedStatus - * -- onUserJoined(uid: 666), if the method call succeeds and the online media stream is injected into the channel. - * @see RtcChannelEvents.UserJoined + * - [`StreamInjectedStatus`]{@link RtcChannelEvents.StreamInjectedStatus}, with the state of injecting the media stream. + * - [`UserJoined`]{@link RtcChannelEvents.UserJoined}(uid: 666), if the method call succeeds and the online + * media stream is injected into the channel. * - The remote client: - * -- onUserJoined(uid: 666), if the method call succeeds and the online media stream is injected into the channel. - * @see RtcChannelEvents.UserJoined + * - [`UserJoined`]{@link RtcChannelEvents.UserJoined}(uid: 666), if the method call succeeds and the online + * media stream is injected into the channel. + * * @param url The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV. * - Supported FLV audio codec type: AAC. * - Supported FLV video codec type: H264(AVC). - * @param config The LiveInjectStreamConfig object, which contains the configuration information for the added voice or video stream. - * @see LiveInjectStreamConfig + * @param config The [`LiveInjectStreamConfig`]{@link LiveInjectStreamConfig} object, which contains the configuration information for the added voice or video stream. + * */ addInjectStreamUrl(url: string, config: LiveInjectStreamConfig): Promise { return AgoraRtcChannelModule.addInjectStreamUrl(this._channelId, url, config); @@ -603,10 +667,12 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Removes the injected online media stream from a Live-Broadcast channel. - * This method removes the URL address added by addInjectStreamUrl. - * @see RtcChannel.addInjectStreamUrl - * If you successfully remove the URL address from the Live-Broadcast, the SDK triggers the onUserJoined callback, with the stream uid of 666. - * @see RtcChannelEvents.UserJoined + * + * This method removes the URL address added by [`addInjectStreamUrl`]{@link RtcChannel.addInjectStreamUrl}. + * + * If you successfully remove the URL address from the Live-Broadcast, the SDK triggers the + * [`UserJoined`]{@link RtcChannelEvents.UserJoined} callback, with the stream uid of 666. + * * @param url The URL address to be removed. */ removeInjectStreamUrl(url: string): Promise { @@ -615,15 +681,19 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Creates a data stream. - * Each user can create up to five data streams during the life cycle of the RtcChannel instance. - * @see RtcChannel - * Note - * - Set both the reliable and ordered parameters to true or false. Do not set one as true and the other as false. - * @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds. - * - true: The recipients receive the data from the sender within five seconds. If the recipient does not receive the data within five seconds, the SDK triggers the onStreamMessageError callback and returns an error code. - * @see RtcChannelEvents.StreamMessageError + * + * Each user can create up to five data streams during the life cycle of the [`RtcChannel`]{@link RtcChannel} instance. + * + * **Note** + * + * Set both the reliable and ordered parameters to true or false. Do not set one as true + * and the other as false. + * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the + * sender within five seconds. + * - true: The recipients receive the data from the sender within five seconds. If the recipient does + * not receive the data within five seconds, the SDK triggers the [`StreamMessageError`]{@link RtcChannelEvents.StreamMessageError} callback and returns an error code. * - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. - * @param ordered Determines whether or not the recipients receive the data stream in the sent order. + * @param ordered Determines whether the recipients receive the data stream in the sent order. * - true: The recipients receive the data in the sent order. * - false: The recipients do not receive the data in the sent order. */ @@ -633,16 +703,18 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sends the data stream message. + * * The SDK has the following restrictions on this method: * - Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 KB. * - Each client can send up to 6 KB of data per second. * - Each user can have up to five data channels simultaneously. - * A successful sendStreamMessage method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. - * @see RtcChannelEvents.StreamMessage - * A failed sendStreamMessage method call triggers the onStreamMessageError callback on the remote client. - * @see RtcChannelEvents.StreamMessageError - * @param streamId ID of the sent data stream returned by the createDataStream method. - * @see RtcChannel.createDataStream + * + * A successful call of this method triggers the [`StreamMessage`]{@link RtcChannelEvents.StreamMessage} callback on the remote client, from which the remote user gets the stream message. + * + * A failed call of this method triggers the [`StreamMessageError`]{@link RtcChannelEvents.StreamMessageError} callback on the remote client. + * + * @param streamId ID of the sent data stream returned by the [`createDataStream`]{@link RtcChannel.createDataStream} method. + * * @param message The message data. */ sendStreamMessage(streamId: number, message: string): Promise { diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index 283c458cc..9dd100266 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -175,7 +175,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Removes the engine event handler. * - * For callback events that you only want to listen for once, call this method to remove the specific {@link RtcEngineEvents} objects after you have received them. + * For callback events that you only want to listen for once, call this method to remove the specific [`RtcEngineEvents`]{@link RtcEngineEvents} objects after you have received them. * @param event The event type. * @param listener The event handler. */ @@ -215,11 +215,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Sets the role of a user ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). + * Sets the role of a user ([Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only). * * This method sets the role of a user, such as a host or an audience (default), before joining a channel. * - * This method can be used to switch the user role after a user joins a channel. In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful [`setClientRole`]{@link setClientRole }method call triggers the following callbacks: + * This method can be used to switch the user role after a user joins a channel. In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful [`setClientRole`]{@link setClientRole }method call triggers the following callbacks: * - The local client: [`ClientRoleChanged`]{@link RtcEngineEvents.ClientRoleChanged}. * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} or [`UserOffline`]{@link RtcEngineEvents.UserOffline} ([`BecomeAudience`]{@link UserOfflineReason.BecomeAudience}). * @@ -240,8 +240,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - The local client: [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. * - * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, - * or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined}, if the user joining the channel is in the [Communication]{@link ChannelProfile.Communication} profile, + * or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. * * When the connection between the client and Agora server is interrupted due to poor network conditions, * the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the [`RejoinChannelSuccess`]{@link RtcEngineEvents.RejoinChannelSuccess} callback on the local client. @@ -278,14 +278,14 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Switches to a different channel. * - * This method allows the audience of a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel to switch to a different channel. + * This method allows the audience of a [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} channel to switch to a different channel. * * After the user successfully switches to another channel, the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callbacks are triggered to * indicate that the user has left the original channel and joined a new one. * * **Note** * - * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel only. + * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} channel only. * * @param token The token for authentication: * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). @@ -312,8 +312,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * A successful [`leaveChannel`]{@link leaveChannel} method call triggers the following callbacks: * - The local client: [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel}. * - * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [`Communication`]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} - * in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [Communication]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} + * in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. * * **Note** * - If you call [`destroy`]{@link destroy} immediately after calling [`leaveChannel`]{@link leaveChannel}, the [`leaveChannel`]{@link leaveChannel} process interrupts, and the SDK does not trigger the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} callback. @@ -341,7 +341,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Enables interoperability with the Agora Web SDK ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). + * Enables interoperability with the Agora Web SDK ([Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only). * * **Deprecated** * @@ -349,7 +349,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * * If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. - * Use this method when the channel profile is [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting}. Interoperability with the Agora Web SDK is enabled by default when the channel profile is [`Communication`]{@link ChannelProfile.Communication}. + * Use this method when the channel profile is [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting}. Interoperability with the Agora Web SDK is enabled by default when the channel profile is [Communication]{@link ChannelProfile.Communication}. * @param enabled Sets whether to enable/disable interoperability with the Agora Web SDK: * - true: Enable. * - false: (Default) Disable. @@ -480,7 +480,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * After the user successfully joins the channel, the SDK triggers the following callbacks: * - The local client: [`LocalUserRegistered`]{@link RtcEngineEvents.LocalUserRegistered} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. * - * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [Communication]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. * * **Note** * @@ -648,7 +648,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * regardless of whether any user is speaking in the channel. * @param interval Sets the time interval between two consecutive volume indications: * - ≤ 0: Disables the volume indication. - * - > 0: Time interval (ms) between two consecutive volume indications. We recommend setting interval ≥ 200 ms. + * - > 0: Time interval (ms) between two consecutive volume indications. Agora recommends setting interval ≥ 200 ms. * @param smooth The smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. * The recommended value is 3. * @param report_vad @@ -706,7 +706,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * - When `muted` is set as `true`, this method does not disable the microphone and thus does not affect any ongoing recording. - * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether or not to mute the local audio according to the channel profile and user role. + * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether to mute the local audio according to the channel profile and user role. * Therefore, we recommend calling this method after the [`setChannelProfile`]{@link setChannelProfile} method. * * @param muted Sets whether to send/stop sending the local audio stream: @@ -741,7 +741,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * - You must call this method before calling [`joinChannel`]{@link joinChannel}. - * - In the [`Communication`]{@link ChannelProfile.Communication} and [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. + * - In the [Communication]{@link ChannelProfile.Communication} and [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. * - In scenarios requiring high-quality audio, we recommend setting profile as [`ShowRoom(4)`]{@link AudioScenario.ShowRoom} and scenario as [`GameStreaming(3)`]{@link AudioScenario.GameStreaming}. * For example, for music education scenarios. * @@ -764,7 +764,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * To resume audio streams of multiple users, call [`muteRemoteAudioStream`]{@link muteRemoteAudioStream} as many times. * Calling `setDefaultMuteAllRemoteAudioStreams(false)` resumes receiving audio streams of the subsequent users only. * - * @param muted Sets whether or not to receive/stop receiving the remote audio streams by default: + * @param muted Sets whether to receive/stop receiving the remote audio streams by default: * - true: Stop receiving any audio stream by default. * - false: (Default) Receive all remote audio streams by default. */ @@ -780,7 +780,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - If you call this method before joining a channel, the service starts in audio mode. * - If you call this method during a video call, the video mode switches to the audio mode. * - * A successful [`disableVideo]`{@link disableVideo} method call triggers the [`UserEnableVideo(false)`]{@link RtcEngineEvents.UserEnableVideo} callback on the remote client. + * A successful call of this method triggers the [`UserEnableVideo(false)`]{@link RtcEngineEvents.UserEnableVideo} callback on the remote client. * * To enable the video mode, call [`enableVideo`]{@link enableVideo}. * @@ -850,7 +850,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - [`enableLocalVideo`]{@link enableLocalVideo}: Whether to enable the camera to create the local video stream. * - * - [`muteLocalVideoStream{`]@link muteLocalVideoStream}: Whether to publish the local video stream. + * - [`muteLocalVideoStream`]{@link muteLocalVideoStream}: Whether to publish the local video stream. * * - [`muteRemoteVideoStream`]{@link muteRemoteVideoStream}: Whether to subscribe to and play the remote video stream. * @@ -882,7 +882,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - When you set `muted` as `true`, this method does not disable the camera and thus does not affect the retrieval of the local video streams. * This method responds faster than calling [`enableLocalVideo`]{@link enableLocalVideo} and set `muted` as `false`, which controls sending the local video stream. * - * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether or not to mute the local video according to the channel profile and user role. + * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether to mute the local video according to the channel profile and user role. * Therefore, we recommend calling this method after the [`setChannelProfile`]{@link setChannelProfile} method. * * @param muted Sets whether to send/stop sending the local video stream: @@ -918,7 +918,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - Call this method after calling [`enableVideo`]{@link enableVideo}. * - This method applies to Android 4.4 or later. * - * @param enabled Sets whether or not to enable image enhancement: + * @param enabled Sets whether to enable image enhancement: * - true: Enable image enhancement. * - false: Disable image enhancement. * @param options The image enhancement options. @@ -965,10 +965,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Starts the local video preview before joining a channel. * - * Before calling this method, you must: - * - Create the {@link RtcLocalView}.//TODO Check the link. - * - * - Call the [`enableVideo`]{@link enableVideo} method to enable the video. + * Before calling this method, you must call the [`enableVideo`]{@link enableVideo} method to enable the video. * * **Note** * @@ -1220,7 +1217,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - -1.0: The audio effect shows on the left. * @param gain Sets the volume of the audio effect. The value ranges between 0.0 and 100,0. * The default value is 100.0. The lower the value, the lower the volume of the audio effect. - * @param publish Set whether or not to publish the specified audio effect to the remote stream: + * @param publish Set whether to publish the specified audio effect to the remote stream: * - true: The locally played audio effect is published to the Agora Cloud and the remote users can hear it. * - false: The locally played audio effect is not published to the Agora Cloud and the remote users cannot hear it. */ @@ -1380,7 +1377,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Ensure that you call this method before calling [`joinChannel`]{@link joinChannel} to enable stereo panning for remote users so that * the local user can track the position of a remote user by calling [`setRemoteVoicePosition`]{@link setRemoteVoicePosition}. * - * @param enabled Sets whether or not to enable stereo panning for remote users: + * @param enabled Sets whether to enable stereo panning for remote users: * - true: Enable stereo panning. * - false: Disable stereo panning. */ @@ -1422,8 +1419,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. - * // TODO See Prerequisites in *Push Streams to CDN*? - * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. + * - This method applies to [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that the user joins a channel before calling this method. * - This method adds only one stream HTTP/HTTPS URL address each time it is called. * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. @@ -1446,9 +1442,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. - * // TODO See Prerequisites in *Push Streams to CDN*? * - Ensure that the user joins a channel before calling this method. - * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. + * - This method applies to [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only. * - This method removes only one stream RTMP URL address each time it is called. * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. * The URL address must not contain special characters, such as Chinese language characters. @@ -1466,8 +1461,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. //TODO See Prerequisites in *Push Streams to CDN*? + * - This method applies to [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only. + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. * - Ensure that you call [`setClientRole`]{@link setClientRole} and set the user role as the host. * - Ensure that you call [`setLiveTranscoding`]{@link setLiveTranscoding} before calling [`addPublishStreamUrl`]{@link addPublishStreamUrl}. * @@ -1495,7 +1490,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - We do not support string user accounts in this API. * - Call this method after the [`joinChannel`]{@link joinChannel} method. * - This method takes effect only when you are a [`Broadcaster`]{@link ClientRole.Broadcaster} - * in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel. + * in a [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} channel. * - After a successful method call, if you want to call this method again, ensure that you call [`stopChannelMediaRelay`]{@link stopChannelMediaRelay} to quit the current relay. * * @param channelMediaRelayConfiguration The configuration of the media stream relay. @@ -1559,17 +1554,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * joining a channel, call [`setEnableSpeakerphone`]{@link setEnableSpeakerphone}. * * The default audio route for each scenario: - * - In the [`Communication`]{@link ChannelProfile.Communication} profile: + * - In the [Communication]{@link ChannelProfile.Communication} profile: * * - For a voice call, the default audio route is the earpiece. * - For a video call, the default audio route is the speaker. If the user disables the video * using [`disableVideo`]{@link disableVideo}, or [`muteLocalVideoStream`]{@link muteLocalVideoStream} and [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams}, the default audio route automatically switches back to the earpiece. * - * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. + * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. * * **Note** * - * - This method applies to the [`Communication`]{@link ChannelProfile.Communication} profile only. + * - This method applies to the [Communication]{@link ChannelProfile.Communication} profile only. * - Call this method before the user joins a channel. * @param defaultToSpeaker Sets the default audio route: * - true: Route the audio to the speaker. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the earpiece. @@ -1589,7 +1584,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Ensure that you have successfully called [`joinChannel`]{@link joinChannel} before calling this method. * - * - This method is invalid for audience users in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * - This method is invalid for audience users in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. * * @param enabled Sets whether to route the audio to the speakerphone or earpiece: * - true: Route the audio to the speakerphone. @@ -1745,7 +1740,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Do not call any other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} callback. Otherwise, the callback may be interrupted by other methods and may not execute. * - * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. + * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. * - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method. * After you join the channel, whether you have called [`disableLastmileTest`]{@link disableLastmileTest} or not, the SDK automatically stops consuming the bandwidth. * @@ -1766,7 +1761,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - After calling this method, call [`stopEchoTest`]{@link stopEchoTest} to end the test. * Otherwise, the app cannot run the next echo test, or call [`joinChannel`]{@link joinChannel}. * - * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, only a host can call this method. + * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, only a host can call this method. * @param intervalInSeconds The time interval (s) between when you speak and when the recording plays back. */ startEchoTest(intervalInSeconds: number): Promise { @@ -1790,7 +1785,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with [`enableLastmileTest`]{@link enableLastmileTest}. * - Do not call other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} and [`LastmileProbeResult`]{@link RtcEngineEvents.LastmileProbeResult} callbacks. Otherwise, the callbacks may be interrupted by other methods. - * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. + * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. * * @param config The configurations of the last-mile network probe test. * @@ -1879,7 +1874,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings. * - * - If you have enabled the local video preview by calling [`startPreview`]{@link startPreview}, you can use the `visibleInPreview` member in the `WatermarkOptions` class to set whether or not the watermark is visible in preview. + * - If you have enabled the local video preview by calling [`startPreview`]{@link startPreview}, you can use the `visibleInPreview` member in the `WatermarkOptions` class to set whether the watermark is visible in preview. * * - If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. * You can implement the watermark function in your application layer. @@ -1991,8 +1986,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*.//TODO See Prerequisites in *Push Streams to CDN*? + * - This method applies to the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile only. + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - You can inject only one media stream into the channel at the same time. * * @param url The URL address to be added to the ongoing live interactive streaming. Valid protocols are RTMP, HLS, and HTTP-FLV. @@ -2170,12 +2165,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. - * @param reliable Sets whether or not the recipients are guaranteed to receive the data stream from the sender within five seconds: + * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds: * - true: The recipients receive the data from the sender within five seconds. * If the recipient does not receive the data within five seconds, the SDK triggers the [`StreamMessageError`]{@link RtcEngineEvents.StreamMessageError} callback and returns an error code. * * - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. - * @param ordered Sets whether or not the recipients receive the data stream in the sent order: + * @param ordered Sets whether the recipients receive the data stream in the sent order: * - true: The recipients receive the data in the sent order. * - false: The recipients do not receive the data in the sent order. */ @@ -2200,7 +2195,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Ensure that you have created the data stream using [`createDataStream`]{@link createDataStream} before calling this method. * - * - This method applies only to the [`Communication`]{@link ChannelProfile.Communication} profile or to hosts in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. + * - This method applies only to the [Communication]{@link ChannelProfile.Communication} profile or to hosts in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. * @param streamId ID of the sent data stream returned by the [`createDataStream`]{@link createDataStream} method. * @param message Sent data. */ diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index 35ebada46..ca9ee4dbe 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -1207,8 +1207,8 @@ export interface RtcEngineEvents { * - `enabled`: *boolean* * * Whether the specific remote user enables/disables the video module: - * - true: Enable. The remote user can enter a video session. - * - false: Disable. The remote user can only enter a voice session, and cannot send or receive any video stream. + * - true: Enabled. The remote user can enter a video session. + * - false: Disabled. The remote user can only enter a voice session, and cannot send or receive any video stream. * @event UserEnableVideo */ UserEnableVideo: UidWithEnabledCallback diff --git a/src/src/RtcRenderView.native.tsx b/src/src/RtcRenderView.native.tsx index 53c695415..522faeafa 100644 --- a/src/src/RtcRenderView.native.tsx +++ b/src/src/RtcRenderView.native.tsx @@ -5,57 +5,63 @@ import {VideoMirrorMode, VideoRenderMode} from "./Enums"; /** * Properties of the uid. - * @property uid: int | User ID. */ export interface RtcUidProps { + /** User ID. */ uid: number; } -/** - * Properties of the SurfaceView. - * @property zOrderMediaOverlay: boolean | Control whether the surface view's surface is placed on top of another regular surface view in the window (but still behind the window itself). - * @property zOrderOnTop: boolean | Control whether the surface view's surface is placed on top of its window. - * @property renderMode: number | The rendering mode of the video view. - * @see VideoRenderMode - * @property channelId: string | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: - * - All lowercase English letters: a to z. - * - All uppercase English letters: A to Z. - * - All numeric characters: 0 to 9. - * - The space character. - * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". - * Note - * - The default value is the empty string "". Use the default value if the user joins the channel using the joinChannel method in the RtcEngine class. - * @see RtcEngine.joinChannel - * - If the user joins the channel using the joinChannel method in the RtcChannel class, set this parameter as the channelId of the RtcChannel object. - * @see RtcChannel.joinChannel - * @property mirrorMode: number | The video mirror mode. - * @see VideoMirrorMode - */ export interface RtcSurfaceViewProps extends ViewProps { + /** + * Controls whether the surface view's surface is placed on top of another regular surface + * view in the window (but still behind the window itself). + */ zOrderMediaOverlay?: boolean; + /** + * Controls whether the surface view's surface is placed on top of its window. + */ zOrderOnTop?: boolean; + /** + * The rendering mode of the video view. + */ renderMode?: VideoRenderMode; + /** + * The unique channel name for the AgoraRTC session in the string format. + * The string length must be less than 64 bytes. Supported character scopes are: + * - All lowercase English letters: a to z. + * - All uppercase English letters: A to Z. + * - All numeric characters: 0 to 9. + * - The space character. + * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + * + * **Note** + * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcEngine` class. + * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel object. + */ channelId?: string; + /** The video mirror mode. */ mirrorMode?: VideoMirrorMode; } /** * Properties of the TextureView. - * @property channelId: string | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: - * - All lowercase English letters: a to z. - * - All uppercase English letters: A to Z. - * - All numeric characters: 0 to 9. - * - The space character. - * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". - * Note - * - The default value is the empty string "". Use the default value if the user joins the channel using the joinChannel method in the RtcEngine class. - * @see RtcEngine.joinChannel - * - If the user joins the channel using the joinChannel method in the RtcChannel class, set this parameter as the channelId of the RtcChannel object. - * @see RtcChannel.joinChannel - * @property mirror: boolean | The video mirror. */ export interface RtcTextureViewProps extends ViewProps { + /** + * The unique channel name for the AgoraRTC session in the string format. + * The string length must be less than 64 bytes. Supported character scopes are: + * - All lowercase English letters: a to z. + * - All uppercase English letters: A to Z. + * - All numeric characters: 0 to 9. + * - The space character. + * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". + * + * **Note** + * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the RtcEngine class. + * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel object. + */ channelId?: string; + /** The video mirror. */ mirror?: boolean; } From 2f503f5d78eaae7499f2b96a0f19866e302a5147 Mon Sep 17 00:00:00 2001 From: HUI <15215604969@163.com> Date: Tue, 25 Aug 2020 16:15:33 +0800 Subject: [PATCH 3/9] optimize for doc --- src/RtcLocalView.tsx | 6 +++--- src/RtcRemoteView.tsx | 6 +++--- src/src/RtcRenderView.native.tsx | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/RtcLocalView.tsx b/src/RtcLocalView.tsx index 943dfdce1..0c5c3e187 100644 --- a/src/RtcLocalView.tsx +++ b/src/RtcLocalView.tsx @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {Platform} from "react-native"; +import {Platform, ViewProps} from "react-native"; import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps} from "./src/RtcRenderView.native"; @@ -7,7 +7,7 @@ import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps * Use SurfaceView in Android. * Use UIView in iOS. */ -class SurfaceView extends Component { +class SurfaceView extends Component { render() { return ( { * Use TextureView in Android. * Not support for iOS. */ -class TextureView extends Component { +class TextureView extends Component { render() { if (Platform.OS === 'ios') throw new Error('TextureView not support for iOS') diff --git a/src/RtcRemoteView.tsx b/src/RtcRemoteView.tsx index 90a941528..2bbaa2cc7 100644 --- a/src/RtcRemoteView.tsx +++ b/src/RtcRemoteView.tsx @@ -1,5 +1,5 @@ import React, {Component} from "react"; -import {Platform} from "react-native"; +import {Platform, ViewProps} from "react-native"; import { RtcSurfaceView, @@ -13,7 +13,7 @@ import { * Use SurfaceView in Android. * Use UIView in iOS. */ -class SurfaceView extends Component { +class SurfaceView extends Component { render() { return ( @@ -25,7 +25,7 @@ class SurfaceView extends Component { * Use TextureView in Android. * Not support for iOS. */ -class TextureView extends Component { +class TextureView extends Component { render() { if (Platform.OS === 'ios') throw new Error('TextureView not support for iOS') diff --git a/src/src/RtcRenderView.native.tsx b/src/src/RtcRenderView.native.tsx index 53c695415..ec21f96dc 100644 --- a/src/src/RtcRenderView.native.tsx +++ b/src/src/RtcRenderView.native.tsx @@ -31,7 +31,7 @@ export interface RtcUidProps { * @property mirrorMode: number | The video mirror mode. * @see VideoMirrorMode */ -export interface RtcSurfaceViewProps extends ViewProps { +export interface RtcSurfaceViewProps { zOrderMediaOverlay?: boolean; zOrderOnTop?: boolean; renderMode?: VideoRenderMode; @@ -54,7 +54,7 @@ export interface RtcSurfaceViewProps extends ViewProps { * @see RtcChannel.joinChannel * @property mirror: boolean | The video mirror. */ -export interface RtcTextureViewProps extends ViewProps { +export interface RtcTextureViewProps { channelId?: string; mirror?: boolean; } @@ -67,7 +67,7 @@ const RCTRtcSurfaceView = requireNativeComponent('RCTAgoraRtcSurfaceView'); /** * @ignore */ -export class RtcSurfaceView extends Component { +export class RtcSurfaceView extends Component { render() { const {channelId = null, uid, ...others} = this.props return ( @@ -87,7 +87,7 @@ const RCTRtcTextureView = requireNativeComponent('RCTAgoraRtcTextureView'); /** * @ignore */ -export class RtcTextureView extends Component { +export class RtcTextureView extends Component { render() { const {channelId = null, uid, ...others} = this.props return ( From 7433808d154976e7a024df2e6ecbfe4d1a03aba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Thu, 27 Aug 2020 22:56:40 +0800 Subject: [PATCH 4/9] documentation update --- src/src/Classes.ts | 28 +- src/src/Enums.ts | 236 +++++- src/src/RtcChannel.native.ts | 38 +- src/src/RtcEngine.native.ts | 138 ++-- src/src/RtcEvents.ts | 1174 +++++++++++------------------- src/src/RtcRenderView.native.tsx | 47 +- 6 files changed, 737 insertions(+), 924 deletions(-) diff --git a/src/src/Classes.ts b/src/src/Classes.ts index 2b47a632f..8d99d68bb 100644 --- a/src/src/Classes.ts +++ b/src/src/Classes.ts @@ -270,8 +270,8 @@ export class LiveTranscoding { videoFramerate?: VideoFrameRate /** * **Deprecated** - * - true: Low latency with unassured quality. - * - false: (Default) High latency with assured quality. + * - `true`: Low latency with unassured quality. + * - `false`: (Default) High latency with assured quality. */ lowLatency?: boolean /** @@ -448,8 +448,8 @@ export class Rectangle { export class WatermarkOptions { /** * Sets whether or not the watermark image is visible in the local video preview: - * - true: (Default) The watermark image is visible in preview. - * - false: The watermark image is not visible in preview. + * - `true`: (Default) The watermark image is visible in preview. + * - `false`: The watermark image is not visible in preview. */ visibleInPreview?: boolean /** @@ -556,7 +556,7 @@ export class ChannelMediaOptions { } /** - * Statistics of RTCEngine. + * Statistics of the call. * */ export interface RtcStats { @@ -678,24 +678,24 @@ export interface AudioVolumeInfo { } /** - * Rect. + * The rectangular area. * */ export interface Rect { /** - * Left. + * The x coordinate of the left side of the rectangular area. */ left: number /** - * Top. + * The y coordinate of the upper side of the rectangular area. */ top: number /** - * Right. + * The x coordinate of the right side of the rectangular area. */ right: number /** - * Bottom. + * The y coordinate of the bottom side of the rectangular area. */ bottom: number } @@ -875,11 +875,13 @@ export interface RemoteVideoStats { /** * User ID of the user sending the video streams. - */uid: number + */ + uid: number /** * **Deprecated** - * Time delay (ms). In scenarios where audio and video is synchronized, you can use the value of networkTransportDelay and jitterBufferDelay - * in RemoteAudioStats to know the delay statistics of the remote video. + * Time delay (ms). In scenarios where audio and video is synchronized, you can use the value + * of `networkTransportDelay` and `jitterBufferDelay` + * in [`RemoteAudioStats`]{@link RemoteAudioStats} to know the delay statistics of the remote video. */ delay: number /** diff --git a/src/src/Enums.ts b/src/src/Enums.ts index fc15e44ab..42ecb8a79 100644 --- a/src/src/Enums.ts +++ b/src/src/Enums.ts @@ -437,9 +437,11 @@ export enum AudioReverbPreset { */ FX_PHONOGRAPH = 0x00100008, /** - * The reverberation of the virtual stereo. The virtual stereo is an effect that renders the monophonic audio as the stereo audio, so that all users in the channel can hear the stereo voice effect. To achieve better virtual stereo reverberation, Agora recommends setting the profile parameter in setAudioProfile as MusicHighQualityStereo(5). - * @see RtcEngine#setAudioProfile - * @see AudioProfile.MusicHighQualityStereo + * The reverberation of the virtual stereo. The virtual stereo is an effect that renders + * the monophonic audio as the stereo audio, so that all users in the channel can hear the stereo voice effect. + * To achieve better virtual stereo reverberation, Agora recommends setting the profile + * parameter in [`RtcEngine#setAudioProfile`]{@link RtcEngine#setAudioProfile} as [`MusicHighQualityStereo(5)`]{@link AudioProfile.MusicHighQualityStereo}. + * */ VIRTUAL_STEREO = 0x00200001, } @@ -738,7 +740,7 @@ export enum ChannelMediaRelayEvent { */ Disconnect = 0, /** - * 1: The network reconnects. + * 1: The network reconnects.//TODO 为什么是 reconnects? */ Connected = 1, /** @@ -784,7 +786,7 @@ export enum ChannelMediaRelayEvent { } /** - * The state code in AgoraChannelMediaRelayState. + * The state code in [`ChannelMediaRelayState`]{@link ChannelMediaRelayState}. * @enum {number} */ export enum ChannelMediaRelayState { @@ -952,11 +954,10 @@ export enum ConnectionStateType { Reconnecting = 4, /** * 5: The SDK fails to connect to Agora's edge server or join the channel. - * You must call leaveChannel to leave this state, and call joinChannel again to rejoin the channel. - * @see RtcEngine.leaveChannel - * @see RtcEngine.joinChannel - * If the SDK is banned from joining the channel by Agora’s edge server (through the RESTful API), the SDK triggers the onConnectionStateChanged callbacks. - * @see RtcEngineEvents.onConnectionStateChanged + * You must call [`leaveChannel`]{@link RtcEngine.leaveChannel} to leave this state, and call [`joinChannel`]{@link RtcEngine.joinChannel} again to rejoin the channel. + * + * If the SDK is banned from joining the channel by Agora’s edge server (through the RESTful API), the SDK triggers the [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callbacks. + * */ Failed = 5, } @@ -1108,7 +1109,7 @@ export enum ErrorCode { InvalidChannelId = 102, /** * 109: The token expired. - * **DEPRECATED** as of v2.4.1. Use [`TokenExpired`]{@link ConnectionChangedReason.TokenExpired} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. + * **DEPRECATED** Use [`TokenExpired`]{@link ConnectionChangedReason.TokenExpired} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. * * Possible reasons are: * - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the token to access the Agora service within five minutes after the token is generated. If the user does not access the Agora service after five minutes, this token is no longer valid. @@ -1118,7 +1119,7 @@ export enum ErrorCode { TokenExpired = 109, /** * 110: The token is invalid. - * **DEPRECATED** as of v2.4.1. Use [`InvalidToken`]{@link ConnectionChangedReason.InvalidToken} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. + * **DEPRECATED** Use [`InvalidToken`]{@link ConnectionChangedReason.InvalidToken} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. * * Possible reasons are: * - The App Certificate for the project is enabled in Console, but the user is using the App ID. Once the App Certificate is enabled, the user must use a token. @@ -1139,8 +1140,8 @@ export enum ErrorCode { */ NotInChannel = 113, /** - * 114: The size of the sent data is over 1024 bytes when the user calls the sendStreamMessage method. - * @see [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} + * 114: The size of the sent data is over 1024 bytes when the user calls the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} method. + * */ SizeTooLarge = 114, /** @@ -1226,7 +1227,7 @@ export enum ErrorCode { /** * 1003: Fails to start the camera. * - * **DEPRECATED** as of v2.4.1. Use [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure} in the error parameter of [`LocalVideoStateChanged`]{@link RtcEngineEvents.LocalVideoStateChanged}. + * **DEPRECATED** Use [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure} in the error parameter of [`LocalVideoStateChanged`]{@link RtcEngineEvents.LocalVideoStateChanged}. * */ StartCamera = 1003, @@ -1299,7 +1300,7 @@ export enum ErrorCode { */ AdmStartLoopback = 1023, /** - * 1027: Audio Device Module: An error occurs in no recording Permission. + * 1027: Audio Device Module: No recording permission. */ AdmNoPermission = 1027, /** @@ -1365,7 +1366,7 @@ export enum InjectStreamStatus { */ StartFailed = 4, /** - * 5: The external video stream imports successfully. + * 5: The external video stream stops importing successfully. */ StopSuccess = 5, /** @@ -1373,19 +1374,19 @@ export enum InjectStreamStatus { */ StopNotFound = 6, /** - * 7: The external video stream is stopped from being unauthorized. + * 7: The external video stream to be stopped importing is unauthorized. */ StopUnauthorized = 7, /** - * 8: Importing the external video stream timeout. + * 8: Stopping importing the external video stream timed out. */ StopTimedout = 8, /** - * 9: Importing the external video stream failed. + * 9: Stopping Importing the external video stream failed. */ StopFailed = 9, /** - * 10: The external video stream import is interrupted. + * 10: The external video stream import is corrupted. */ Broken = 10, } @@ -1404,7 +1405,7 @@ export enum LastmileProbeResultState { */ IncompleteNoBwe = 2, /** - * 3: the last-mile network probe test is not carried out, probably due to poor network conditions. + * 3: The last-mile network probe test is not carried out, probably due to poor network conditions. */ Unavailable = 3, } @@ -1572,11 +1573,11 @@ export enum MediaType { */ export enum MetadataType { /** - * -1: the metadata type is unknown. + * -1: The metadata type is unknown. */ Unknown = -1, /** - * 0: the metadata type is video. + * 0: The metadata type is video. */ Video = 0, } @@ -1846,7 +1847,6 @@ export enum UserPriority { * Video buffer type * @enum {number} * TODO iOS AgoraVideoSourceProtocol AgoraVideoSinkProtocol - * //TODO ? */ export enum VideoBufferType { /** @@ -1882,7 +1882,7 @@ export enum VideoCodecProfileType { * The content hint for screen sharing. * @enum {number} * TODO MacOS setScreenCaptureContentHint - * //TODO ? + * */ export enum VideoContentHint { /** @@ -1904,9 +1904,12 @@ export enum VideoContentHint { * @enum {number} */ export enum VideoFrameRate { + /** + * -1: The minimum frame rate of the video. + */ Min = -1, /** - * -1: 1 fps. + * 1: 1 fps. */ Fps1 = 1, /** @@ -1936,7 +1939,172 @@ export enum VideoFrameRate { } /** - * Sets the video bitrate (Kbps). Refer to the table below and set your bitrate. If you set a bitrate beyond the proper range, the SDK automatically adjusts it to a value within the range. You can also choose from the following options: + * Bitrate of the video (Kbps). Refer to the table below and set your bitrate. + * If you set a bitrate beyond the proper range, the SDK automatically adjusts it to a value within the range. + * + * **Video Bitrate Table** + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ResolutionFrame rate

(fps)

Base Bitrate

(Kbps, for Communication)

Live Bitrate

(Kbps, for Live Broadcasting)

160*1201565130
120*1201550100
320*18015140280
180*18015100200
240*18015120240
320*24015200400
240*24015140280
424*24015220440
640*36015400800
360*36015260520
640*360306001200
360*36030400800
480*36015320640
480*36030490980
640*480155001000
480*48015400800
640*480307501500
480*480306001200
848*480156101220
848*480309301860
640*48010400800
1280*7201511302260
1280*7203017103420
960*720159101820
960*7203013802760
+ * + * Agora uses different video codecs for different profiles to optimize the user experience. For example, + * the Communication profile prioritizes the smoothness while the LIVE_BROADCASTING profile prioritizes the + * video quality (a higher bitrate). Therefore, We recommend setting this parameter as STANDARD_BITRATE = 0. * @enum {number} */ export enum BitRate { @@ -1947,7 +2115,8 @@ export enum BitRate { */ Standard = 0, /** - * -1: The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. In the Live-broadcast profile, if you choose this mode, the video frame rate may be lower than the set value. + * -1: The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. In the Live-broadcast profile, + * if you choose this mode, the video frame rate may be lower than the set value. */ Compatible = -1, } @@ -2002,7 +2171,7 @@ export enum VideoOutputOrientationMode { * Video pixel format. * @enum {number} * TODO iOS AgoraVideoSinkProtocol - * //TODO ? + * */ export enum VideoPixelFormat { /** @@ -2096,7 +2265,7 @@ export enum VideoRemoteStateReason { */ LocalMuted = 3, /** - * 4: The local user stops receiving the remote video stream or disables the video module. + * 4: The local user resumes receiving the remote video stream or disables the video module. */ LocalUnmuted = 4, /** @@ -2215,13 +2384,14 @@ export enum WarningCode { /** * 105: The server rejects the request to look up the channel. * The server cannot process this request or the request is illegal. - * **DEPRECATED** as of v2.4.1. Use [`RejectedByServer(10)`]{@link ConnectionChangedReason.RejectedByServer} in the reason parameter + * **DEPRECATED** Use [`RejectedByServer(10)`]{@link ConnectionChangedReason.RejectedByServer} in the reason parameter * of [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged}. * */ LookupChannelRejected = 105, /** - * 106: The server rejects the request to look up the channel. The server cannot process this request or the request is illegal. + * 106: The server rejects the request to look up the channel. The server cannot process this request + * or the request is illegal. */ OpenChannelTimeout = 106, /** diff --git a/src/src/RtcChannel.native.ts b/src/src/RtcChannel.native.ts index 482870a37..9edb3b9c9 100644 --- a/src/src/RtcChannel.native.ts +++ b/src/src/RtcChannel.native.ts @@ -34,7 +34,7 @@ const RtcChannelEvent = new NativeEventEmitter(AgoraRtcChannelModule); const channels = new Map(); /** - * The RtcChannel class. + * The {@link RtcChannel} class. */ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, RtcVoicePositionInterface, RtcPublishStreamInterface, RtcMediaRelayInterface, RtcDualStreamInterface, RtcFallbackInterface, @@ -312,8 +312,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * @param uid ID of the remote user whose audio stream you want to mute. * @param muted Determines whether to receive/stop receiving the audio stream of the specified user: - * - true: Stop receiving the audio stream of the user. - * - false: (Default) Receive the audio stream of the user. + * - `true`: Stop receiving the audio stream of the user. + * - `false`: (Default) Receive the audio stream of the user. */ muteRemoteAudioStream(uid: number, muted: boolean): Promise { return AgoraRtcChannelModule.muteRemoteAudioStream(this._channelId, uid, muted) @@ -323,8 +323,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Stops/Resumes receiving all remote audio streams. * * @param muted Determines whether to receive/stop receiving all remote audio streams: - * - true: Stop receiving all remote audio streams. - * - false: (Default) Receive all remote audio streams. + * - `true`: Stop receiving all remote audio streams. + * - `false`: (Default) Receive all remote audio streams. */ muteAllRemoteAudioStreams(muted: boolean): Promise { return AgoraRtcChannelModule.muteAllRemoteAudioStreams(this._channelId, muted) @@ -334,8 +334,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Sets whether to receive all remote audio streams by default. * * @param muted Determines whether to receive/stop receiving all remote audio streams by default: - * - true: Stop receiving all remote audio streams by default. - * - false: (Default) Receive all remote audio streams by default. + * - `true`: Stop receiving all remote audio streams by default. + * - `false`: (Default) Receive all remote audio streams by default. */ setDefaultMuteAllRemoteAudioStreams(muted: boolean): Promise { return AgoraRtcChannelModule.setDefaultMuteAllRemoteAudioStreams(this._channelId, muted) @@ -345,8 +345,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Stops/Resumes receiving all remote video streams. * * @param muted Determines whether to receive/stop receiving all remote video streams: - * - true: Stop receiving all remote video streams. - * - false: (Default) Receive all remote video streams. + * - `true`: Stop receiving all remote video streams. + * - `false`: (Default) Receive all remote video streams. */ muteAllRemoteVideoStreams(muted: boolean): Promise { return AgoraRtcChannelModule.muteAllRemoteVideoStreams(this._channelId, muted) @@ -357,8 +357,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * @param uid ID of the remote user whose video stream you want to mute. * @param muted Determines whether to receive/stop receiving the video stream of the specified user: - * - true: Stop receiving the video stream of the user. - * - false: (Default) Receive the video stream of the user. + * - `true`: Stop receiving the video stream of the user. + * - `false`: (Default) Receive the video stream of the user. */ muteRemoteVideoStream(uid: number, muted: boolean): Promise { return AgoraRtcChannelModule.muteRemoteVideoStream(this._channelId, uid, muted) @@ -368,8 +368,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Sets whether to receive all remote video streams by default. * * @param muted Determines whether to receive/stop receiving all remote video streams by default: - * - true: Stop receiving all remote video streams by default. - * - false: (Default) Receive all remote video streams by default. + * - `true`: Stop receiving all remote video streams by default. + * - `false`: (Default) Receive all remote video streams by default. */ setDefaultMuteAllRemoteVideoStreams(muted: boolean): Promise { return AgoraRtcChannelModule.setDefaultMuteAllRemoteVideoStreams(this._channelId, muted) @@ -410,8 +410,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. * @param transcodingEnabled Sets whether transcoding is enabled/disabled. If you set this parameter as true, * ensure that you call the [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} method before this method. - * - true: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. - * - false: Disable transcoding. + * - `true`: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. + * - `false`: Disable transcoding. */ addPublishStreamUrl(url: string, transcodingEnabled: boolean): Promise { return AgoraRtcChannelModule.addPublishStreamUrl(this._channelId, url, transcodingEnabled); @@ -690,12 +690,12 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * and the other as false. * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the * sender within five seconds. - * - true: The recipients receive the data from the sender within five seconds. If the recipient does + * - `true`: The recipients receive the data from the sender within five seconds. If the recipient does * not receive the data within five seconds, the SDK triggers the [`StreamMessageError`]{@link RtcChannelEvents.StreamMessageError} callback and returns an error code. - * - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. + * - `false`: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. * @param ordered Determines whether the recipients receive the data stream in the sent order. - * - true: The recipients receive the data in the sent order. - * - false: The recipients do not receive the data in the sent order. + * - `true`: The recipients receive the data in the sent order. + * - `false`: The recipients do not receive the data in the sent order. */ createDataStream(reliable: boolean, ordered: boolean): Promise { return AgoraRtcChannelModule.createDataStream(this._channelId, reliable, ordered); diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index 9dd100266..1cfc62591 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -110,9 +110,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * To change your App ID, call [`destroy`]{@link destroy} to destroy the current [`RtcEngine`]{@link RtcEngine} instance and after [`destroy`]{@link destroy} returns `0`, call [`create`]{@link create} to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. * @param areaCode The area of connection. This advanced feature applies to scenarios that have regional restrictions. * You can use the bitwise OR operator (|) to specify multiple areas. For details, see {@link IPAreaCode}. - * After specifying the area of connection: - * - When the app that integrates the Agora SDK is used within the specified area, it connects to the Agora servers within the specified area under normal circumstances. - * - When the app that integrates the Agora SDK is used out of the specified area, it connects to the Agora servers either in the specified area or in the area where the app is located. + * After specifying the region, the app that integrates the Agora SDK connects to the Agora servers within that region. */ static async createWithAreaCode(appId: string, areaCode: IPAreaCode): Promise { if (engine) return engine; @@ -144,11 +142,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Adds the engine event handler. + * Adds the [`RtcEngineEvents`]{@link RtcEngineEvents} handler. * - * After setting the engine event handler, you can listen for engine events and receive the statistics of the corresponding RtcEngine instance. + * After setting the [`RtcEngineEvents`]{@link RtcEngineEvents} handler, you can listen for `RtcEngine` events and receive the statistics of the corresponding RtcEngine instance. * @param event The event type. - * @param listener The event handler. + * @param listener The [`RtcEngineEvents`]{@link RtcEngineEvents} handler. */ addListener(event: EventType, listener: RtcEngineEvents[EventType]): Subscription { const callback = (res: any) => { @@ -173,11 +171,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Removes the engine event handler. + * Removes the [`RtcEngineEvents`]{@link RtcEngineEvents} handler. * * For callback events that you only want to listen for once, call this method to remove the specific [`RtcEngineEvents`]{@link RtcEngineEvents} objects after you have received them. * @param event The event type. - * @param listener The event handler. + * @param listener The [`RtcEngineEvents`]{@link RtcEngineEvents} handler. */ removeListener(event: EventType, listener: RtcEngineEvents[EventType]) { const map = this._listeners.get(event); @@ -187,7 +185,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Removes all of the engine event handlers. + * Removes all the [`RtcEngineEvents`]{@link RtcEngineEvents} handlers. * @param event The event type. */ removeAllListeners(event?: EventType) { @@ -236,7 +234,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other. * You must call [`leaveChannel`]{@link leaveChannel} to exit the current call before joining another channel. * - * A successful [`joinChannel`]{@link joinChannel} method call triggers the following callbacks: + * A successful call of this method triggers the following callbacks: * * - The local client: [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. * @@ -345,14 +343,14 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Deprecated** * - * As of v3.0.0, the Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. + * This method is deprecated. The Agora Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. * * * If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. * Use this method when the channel profile is [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting}. Interoperability with the Agora Web SDK is enabled by default when the channel profile is [Communication]{@link ChannelProfile.Communication}. * @param enabled Sets whether to enable/disable interoperability with the Agora Web SDK: - * - true: Enable. - * - false: (Default) Disable. + * - `true`: Enable. + * - `false`: (Default) Disable. */ enableWebSdkInteroperability(enabled: boolean): Promise { return AgoraRtcEngineModule.enableWebSdkInteroperability(enabled) @@ -652,8 +650,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * @param smooth The smoothing factor sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The greater the value, the more sensitive the indicator. * The recommended value is 3. * @param report_vad - * - true: Enable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback reports the voice activity status of the local user. - * - false: (Default) Disable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback does not report the voice activity status of the local user, + * - `true`: Enable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback reports the voice activity status of the local user. + * - `false`: (Default) Disable the voice activity detection of the local user. Once it is enabled, the `vad` parameter of the [`AudioVolumeIndication`]{@link RtcEngineEvents.AudioVolumeIndication} callback does not report the voice activity status of the local user, * except for scenarios where the engine automatically detects the voice activity of the local user. */ enableAudioVolumeIndication(interval: number, smooth: number, report_vad: boolean): Promise { @@ -681,8 +679,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - [`muteLocalAudioStream`]{@link muteLocalAudioStream}: Stops/Continues sending the local audio streams. * * @param enabled Sets whether to disable/re-enable the local audio function: - * - true: (Default) Re-enable the local audio function, that is, to start local audio capture and processing. - * - false: Disable the local audio function, that is, to stop local audio capture and processing. + * - `true`: (Default) Re-enable the local audio function, that is, to start local audio capture and processing. + * - `false`: Disable the local audio function, that is, to stop local audio capture and processing. */ enableLocalAudio(enabled: boolean): Promise { return AgoraRtcEngineModule.enableLocalAudio(enabled); @@ -692,8 +690,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Stops/Resumes receiving all remote audio streams. * * @param muted Sets whether to receive/stop receiving all remote audio streams: - * - true: Stop receiving all remote audio streams. - * - false: (Default) Receive all remote audio streams. + * - `true`: Stop receiving all remote audio streams. + * - `false`: (Default) Receive all remote audio streams. */ muteAllRemoteAudioStreams(muted: boolean): Promise { return AgoraRtcEngineModule.muteAllRemoteAudioStreams(muted); @@ -705,13 +703,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - When `muted` is set as `true`, this method does not disable the microphone and thus does not affect any ongoing recording. + * - When `muted` is set as ``true``, this method does not disable the microphone and thus does not affect any ongoing recording. * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether to mute the local audio according to the channel profile and user role. * Therefore, we recommend calling this method after the [`setChannelProfile`]{@link setChannelProfile} method. * * @param muted Sets whether to send/stop sending the local audio stream: - * - true: Stop sending the local audio stream. - * - false: (Default) Send the local audio stream. + * - `true`: Stop sending the local audio stream. + * - `false`: (Default) Send the local audio stream. */ muteLocalAudioStream(muted: boolean): Promise { return AgoraRtcEngineModule.muteLocalAudioStream(muted); @@ -728,8 +726,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * @param uid ID of the specified remote user. * @param muted Sets whether to receive/stop receiving the specified remote user's audio stream: - * - true: Stop receiving the specified remote user’s audio stream. - * - false: (Default) Receive the specified remote user’s audio stream. + * - `true`: Stop receiving the specified remote user’s audio stream. + * - `false`: (Default) Receive the specified remote user’s audio stream. */ muteRemoteAudioStream(uid: number, muted: boolean): Promise { return AgoraRtcEngineModule.muteRemoteAudioStream(uid, muted); @@ -765,8 +763,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Calling `setDefaultMuteAllRemoteAudioStreams(false)` resumes receiving audio streams of the subsequent users only. * * @param muted Sets whether to receive/stop receiving the remote audio streams by default: - * - true: Stop receiving any audio stream by default. - * - false: (Default) Receive all remote audio streams by default. + * - `true`: Stop receiving any audio stream by default. + * - `false`: (Default) Receive all remote audio streams by default. */ setDefaultMuteAllRemoteAudioStreams(muted: boolean): Promise { return AgoraRtcEngineModule.setDefaultMuteAllRemoteAudioStreams(muted); @@ -820,8 +818,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender: - * - true: (Default) Re-enable the local video. - * - false: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of other remote users. + * - `true`: (Default) Re-enable the local video. + * - `false`: Disable the local video. Once the local video is disabled, the remote users can no longer receive the video stream of this user, while this user can still receive the video streams of other remote users. * When you set `enabled` as `false`, this method does not require a local camera. */ enableLocalVideo(enabled: boolean): Promise { @@ -837,9 +835,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * the service starts in the video mode. * - If you call this method during an audio call, the audio mode switches to the video mode. * - * A successful `enableVideo` method call triggers the [`UserEnableVideo(true)`]{@link RtcEngineEvents.UserEnableVideo} callback on the remote client. + * A successful call of this method triggers the [`UserEnableVideo(true)`]{@link RtcEngineEvents.UserEnableVideo} callback on the remote client. * - * To disable the video, call the {@link disableVideo} method. + * To disable the video, call the [`disableVideo`]{@link disableVideo} method. * * **Note** * @@ -865,8 +863,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Stops/Resumes receiving all remote video streams. * * @param muted Sets whether to receive/stop receiving all remote video streams: - * - true: Stop receiving all remote video streams. - * - false: (Default) Receive all remote video streams. + * - `true`: Stop receiving all remote video streams. + * - `false`: (Default) Receive all remote video streams. */ muteAllRemoteVideoStreams(muted: boolean): Promise { return AgoraRtcEngineModule.muteAllRemoteVideoStreams(muted); @@ -886,8 +884,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Therefore, we recommend calling this method after the [`setChannelProfile`]{@link setChannelProfile} method. * * @param muted Sets whether to send/stop sending the local video stream: - * - true: Stop sending the local video stream. - * - false: (Default) Send the local video stream. + * - `true`: Stop sending the local video stream. + * - `false`: (Default) Send the local video stream. */ muteLocalVideoStream(muted: boolean): Promise { return AgoraRtcEngineModule.muteLocalVideoStream(muted); @@ -903,8 +901,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * @param uid User ID of the specified remote user. * @param muted Sets whether to receive/stop receiving a specified remote user's video stream: - * - true: Stop receiving a specified remote user’s video stream. - * - false: (Default) Receive a specified remote user’s video stream. + * - `true`: Stop receiving a specified remote user’s video stream. + * - `false`: (Default) Receive a specified remote user’s video stream. */ muteRemoteVideoStream(uid: number, muted: boolean): Promise { return AgoraRtcEngineModule.muteRemoteVideoStream(uid, muted); @@ -919,8 +917,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - This method applies to Android 4.4 or later. * * @param enabled Sets whether to enable image enhancement: - * - true: Enable image enhancement. - * - false: Disable image enhancement. + * - `true`: Enable image enhancement. + * - `false`: Disable image enhancement. * @param options The image enhancement options. * */ @@ -940,8 +938,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * To resume receiving video streams of multiple users, call [`muteRemoteVideoStream`]{@link muteRemoteVideoStream} as many times. Calling `setDefaultMuteAllRemoteVideoStreams(false)` resumes receiving video streams of the subsequent users only. * * @param muted Sets whether to receive/stop receiving all remote video streams by default: - * - true: Stop receiving any remote video stream by default. - * - false: (Default) Receive all remote video streams by default. + * - `true`: Stop receiving any remote video stream by default. + * - `false`: (Default) Receive all remote video streams by default. */ setDefaultMuteAllRemoteVideoStreams(muted: boolean): Promise { return AgoraRtcEngineModule.setDefaultMuteAllRemoteVideoStreams(muted); @@ -1144,11 +1142,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - If the path begins with /assets/, the audio file is in the /assets/ directory. * - Otherwise, the audio file is in the absolute path. * @param loopback Sets which user can hear the audio mixing: - * - true: Only the local user can hear the audio mixing. - * - false: Both users can hear the audio mixing. + * - `true`: Only the local user can hear the audio mixing. + * - `false`: Both users can hear the audio mixing. * @param replace Sets the audio mixing content: - * - true: Only publish the specified audio file; the audio stream from the microphone is not published. - * - false: The local audio file is mixed with the audio stream from the microphone. + * - `true`: Only publish the specified audio file; the audio stream from the microphone is not published. + * - `false`: The local audio file is mixed with the audio stream from the microphone. * @param cycle Sets the number of playback loops: * - Positive integer: Number of playback loops. * - -1: Infinite playback loops. @@ -1218,8 +1216,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * @param gain Sets the volume of the audio effect. The value ranges between 0.0 and 100,0. * The default value is 100.0. The lower the value, the lower the volume of the audio effect. * @param publish Set whether to publish the specified audio effect to the remote stream: - * - true: The locally played audio effect is published to the Agora Cloud and the remote users can hear it. - * - false: The locally played audio effect is not published to the Agora Cloud and the remote users cannot hear it. + * - `true`: The locally played audio effect is published to the Agora Cloud and the remote users can hear it. + * - `false`: The locally played audio effect is not published to the Agora Cloud and the remote users cannot hear it. */ playEffect(soundId: number, filePath: string, loopCount: number, pitch: number, pan: number, gain: number, publish: Boolean): Promise { return AgoraRtcEngineModule.playEffect(soundId, filePath, loopCount, pitch, pan, gain, publish); @@ -1285,7 +1283,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops playing a specified audio effect. * - * **Note:** + * **Note** * * If you preloaded the audio effect into the memory through the [`preloadEffect`]{@link preloadEffect} method, * ensure that the `soundID` value is set to the same value as in the [`preloadEffect`]{@link preloadEffect} method. @@ -1378,8 +1376,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * the local user can track the position of a remote user by calling [`setRemoteVoicePosition`]{@link setRemoteVoicePosition}. * * @param enabled Sets whether to enable stereo panning for remote users: - * - true: Enable stereo panning. - * - false: Disable stereo panning. + * - `true`: Enable stereo panning. + * - `false`: Disable stereo panning. */ enableSoundPositionIndication(enabled: boolean): Promise { return AgoraRtcEngineModule.enableSoundPositionIndication(enabled); @@ -1427,8 +1425,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * @param transcodingEnabled Sets whether transcoding is enabled/disabled. * If you set this parameter as `true`, ensure that you call [`setLiveTranscoding`]{@link setLiveTranscoding} before this method. * - * - true: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. - * - false: Disable transcoding. + * - `true`: Enable transcoding. To transcode the audio or video streams when publishing them to CDN live, often used for combining the audio and video streams of multiple hosts in CDN live. + * - `false`: Disable transcoding. */ addPublishStreamUrl(url: string, transcodingEnabled: boolean): Promise { return AgoraRtcEngineModule.addPublishStreamUrl(url, transcodingEnabled); @@ -1567,8 +1565,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - This method applies to the [Communication]{@link ChannelProfile.Communication} profile only. * - Call this method before the user joins a channel. * @param defaultToSpeaker Sets the default audio route: - * - true: Route the audio to the speaker. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the earpiece. - * - false: (Default) Route the audio to the earpiece. If a headset is plugged in, the audio is routed to the headset. + * - `true`: Route the audio to the speaker. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the earpiece. + * - `false`: (Default) Route the audio to the earpiece. If a headset is plugged in, the audio is routed to the headset. */ setDefaultAudioRoutetoSpeakerphone(defaultToSpeaker: boolean): Promise { return AgoraRtcEngineModule.setDefaultAudioRoutetoSpeakerphone(defaultToSpeaker); @@ -1587,8 +1585,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - This method is invalid for audience users in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. * * @param enabled Sets whether to route the audio to the speakerphone or earpiece: - * - true: Route the audio to the speakerphone. - * - false: Route the audio to the earpiece. If the headset is plugged in, the audio is routed to the headset. + * - `true`: Route the audio to the speakerphone. + * - `false`: Route the audio to the earpiece. If the headset is plugged in, the audio is routed to the headset. */ setEnableSpeakerphone(enabled: boolean): Promise { return AgoraRtcEngineModule.setEnableSpeakerphone(enabled); @@ -1597,8 +1595,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables in-ear monitoring. * @param enabled Sets whether to enable/disable in-ear monitoring: - * - true: Enable. - * - false: (Default) Disable. + * - `true`: Enable. + * - `false`: (Default) Disable. */ enableInEarMonitoring(enabled: boolean): Promise { return AgoraRtcEngineModule.enableInEarMonitoring(enabled); @@ -1619,8 +1617,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * low stream (low-resolution low-bitrate video stream) video. * * @param enabled Sets the stream mode: - * - true: Dual-stream mode. - * - false: (Default) Single-stream mode. + * - `true`: Dual-stream mode. + * - `false`: (Default) Single-stream mode. */ enableDualStreamMode(enabled: boolean): Promise { return AgoraRtcEngineModule.enableDualStreamMode(enabled); @@ -1874,7 +1872,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings. * - * - If you have enabled the local video preview by calling [`startPreview`]{@link startPreview}, you can use the `visibleInPreview` member in the `WatermarkOptions` class to set whether the watermark is visible in preview. + * - If you have enabled the local video preview by calling [`startPreview`]{@link startPreview}, you can use the `visibleInPreview` member in the [`WatermarkOptions`]{@link WatermarkOptions} class to set whether the watermark is visible in preview. * * - If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. * You can implement the watermark function in your application layer. @@ -2023,8 +2021,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - The distance between the human face and the device screen. * * @param enable Determines whether to enable the face detection function for the local user: - * - true: Enable face detection. - * - false: (Default) Disable face detection. + * - `true`: Enable face detection. + * - `false`: (Default) Disable face detection. */ enableFaceDetection(enable: boolean): Promise { return AgoraRtcEngineModule.enableFaceDetection(enable) @@ -2076,8 +2074,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Enables the camera auto-face focus function. * * @param enabled Sets whether to enable/disable the camera auto-face focus function: - * - true: Enable the camera auto-face focus function. - * - false: (Default) Disable the camera auto-face focus function. + * - `true`: Enable the camera auto-face focus function. + * - `false`: (Default) Disable the camera auto-face focus function. */ setCameraAutoFocusFaceModeEnabled(enabled: boolean): Promise { return AgoraRtcEngineModule.setCameraAutoFocusFaceModeEnabled(enabled); @@ -2135,8 +2133,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables the camera flash function. * @param isOn Sets whether to enable/disable the camera flash function: - * - true: Enable the camera flash function. - * - false: Disable the camera flash function. + * - `true`: Enable the camera flash function. + * - `false`: Disable the camera flash function. */ setCameraTorchOn(isOn: boolean): Promise { return AgoraRtcEngineModule.setCameraTorchOn(isOn); @@ -2166,13 +2164,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds: - * - true: The recipients receive the data from the sender within five seconds. + * - `true`: The recipients receive the data from the sender within five seconds. * If the recipient does not receive the data within five seconds, the SDK triggers the [`StreamMessageError`]{@link RtcEngineEvents.StreamMessageError} callback and returns an error code. * - * - false: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. + * - `false`: There is no guarantee that the recipients receive the data stream within five seconds and no error message is reported for any delay or missing data stream. * @param ordered Sets whether the recipients receive the data stream in the sent order: - * - true: The recipients receive the data in the sent order. - * - false: The recipients do not receive the data in the sent order. + * - `true`: The recipients receive the data in the sent order. + * - `false`: The recipients do not receive the data in the sent order. */ createDataStream(reliable: boolean, ordered: boolean): Promise { return AgoraRtcEngineModule.createDataStream(reliable, ordered); diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index ca9ee4dbe..a34f2a52a 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -39,11 +39,14 @@ import { /** * @internal + * @ignore */ + export type Listener = (...args: any[]) => any /** * @internal + * @ignore */ export interface Subscription { remove(): void @@ -51,57 +54,382 @@ export interface Subscription { export type EmptyCallback = () => void -export type WarningCallback = (warn: WarningCode) => void -export type ErrorCallback = (err: ErrorCode) => void -export type ApiCallCallback = (error: ErrorCode, api: string, result: string) => void -export type UidWithElapsedAndChannelCallback = (channel: string, uid: number, elapsed: number) => void -export type RtcStatsCallback = (stats: RtcStats) => void -export type UserAccountCallback = (uid: number, userAccount: string) => void -export type UserInfoCallback = (uid: number, userInfo: UserInfo) => void -export type ClientRoleCallback = (oldRole: ClientRole, newRole: ClientRole) => void -export type UidWithElapsedCallback = (uid: number, elapsed: number) => void -export type UserOfflineCallback = (uid: number, reason: UserOfflineReason) => void -export type ConnectionStateCallback = (state: ConnectionStateType, reason: ConnectionChangedReason) => void -export type NetworkTypeCallback = (type: NetworkType) => void -export type TokenCallback = (token: string) => void -export type AudioVolumeCallback = (speakers: AudioVolumeInfo[], totalVolume: number) => void -export type UidCallback = ( uid: number) => void -export type ElapsedCallback = (elapsed: number) => void -export type VideoFrameCallback = (width: number, height: number, elapsed: number) => void -export type UidWithMutedCallback = (uid: number, muted: boolean) => void -export type VideoSizeCallback = (uid: number, width: number, height: number, rotation: number) => void -export type RemoteVideoStateCallback = (uid: number, state: VideoRemoteState, reason: VideoRemoteStateReason, elapsed: number) => void -export type LocalVideoStateCallback = (localVideoState: LocalVideoStreamState, error: LocalVideoStreamError) => void -export type RemoteAudioStateCallback = (uid: number, state: AudioRemoteState, reason: AudioRemoteStateReason, elapsed: number) => void -export type LocalAudioStateCallback = (state: AudioLocalState, error: AudioLocalError) => void -export type FallbackCallback = (isFallbackOrRecover: boolean) => void -export type FallbackWithUidCallback = (uid: number, isFallbackOrRecover: boolean) => void -export type AudioRouteCallback = (routing: AudioOutputRouting) => void -export type RectCallback = (rect: Rect) => void -export type NetworkQualityCallback = (quality: NetworkQuality) => void -export type NetworkQualityWithUidCallback = (uid: number, txQuality: NetworkQuality, rxQuality: NetworkQuality) => void -export type LastmileProbeCallback = (result: LastmileProbeResult) => void -export type LocalVideoStatsCallback = (stats: LocalVideoStats) => void -export type LocalAudioStatsCallback = (stats: LocalAudioStats) => void -export type RemoteVideoStatsCallback = (stats: RemoteVideoStats) => void -export type RemoteAudioStatsCallback = (stats: RemoteAudioStats) => void -export type AudioMixingStateCallback = (state: AudioMixingStateCode, errorCode: AudioMixingErrorCode) => void -export type SoundIdCallback = (soundId: number) => void -export type RtmpStreamingStateCallback = (url: string, state: RtmpStreamingState, errCode: RtmpStreamingErrorCode) => void -export type StreamInjectedStatusCallback = (url: string, uid: number, status: InjectStreamStatus) => void -export type StreamMessageCallback = (uid: number, streamId: number, data: string) => void -export type StreamMessageErrorCallback = (uid: number, streamId: number, error: ErrorCode, missed: number, cached: number) => void -export type MediaRelayStateCallback = (state: ChannelMediaRelayState, code: ChannelMediaRelayError) => void -export type MediaRelayEventCallback = (code: ChannelMediaRelayEvent) => void -export type VideoFrameWithUidCallback = (uid: number, width: number, height: number, elapsed: number) => void -export type UrlWithErrorCallback = (url: string, error: ErrorCode) => void -export type UrlCallback = (url: string) => void -export type TransportStatsCallback = (uid: number, delay: number, lost: number, rxKBitRate: number) => void -export type UidWithEnabledCallback = (uid: number, enabled: boolean) => void -export type EnabledCallback = (enabled: boolean) => void -export type AudioQualityCallback = (uid: number, quality: number, delay: number, lost: number) => void -export type MetadataCallback = (buffer: string, uid: number, timeStampMs: number) => void -export type FacePositionCallback = (imageWidth: number, imageHeight: number, faces: FacePositionInfo[]) => void +export type WarningCallback = +/** + * @param warn Warning code. + * + */ +(warn: WarningCode) => void +export type ErrorCallback = +/** + * @param err Error code. + */ +(err: ErrorCode) => void +export type ApiCallCallback = +/** + * @param error [Error Code]{@link ErrorCode} that the SDK returns when the method call fails. + * @param api The method executed by the SDK. + * @param result The result of the method call. + * + */ +(error: ErrorCode, api: string, result: string) => void +export type UidWithElapsedAndChannelCallback = +/** + * @param channel Channel name. + * @param uid User ID. + * @param elapsed Time elapsed (ms) from the user calling [`joinChannel`]{@link RtcEngine.joinChannel} until + * this callback is triggered. + */ +(channel: string, uid: number, elapsed: number) => void +export type RtcStatsCallback = +/** + * @param stats Statistics of the call. + */ +(stats: RtcStats) => void +export type UserAccountCallback = +/** + * @param uid The ID of the local user. + * @param userAccount The user account of the local user. + * + */ +(uid: number, userAccount: string) => void +export type UserInfoCallback = +/** + * @param uid The ID of the remote user. + * @param userInfo The `UserInfo` object that contains the user ID and user account of the remote user. + */ +(uid: number, userInfo: UserInfo) => void +export type ClientRoleCallback = +/** + * @param oldRole Role that the user switches from. + * @param newRole Role that the user switches to. + */ +(oldRole: ClientRole, newRole: ClientRole) => void +export type UidWithElapsedCallback = +/** + * @param uid ID of the user or host who joins the channel. + * @param elapsed Time delay (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} or [`setClientRole`]{@link RtcEngine.setClientRole} + * until this callback is triggered. + */ +(uid: number, elapsed: number) => void +export type UserOfflineCallback = +/** + * @param uid ID of the user or host who leaves the channel or goes offline. + * @param reason Reason why the user goes offline. + */ +(uid: number, reason: UserOfflineReason) => void +export type ConnectionStateCallback = +/** + * @param state The current network connection state. + * @param reason The reason causing the change of the connection state. + */ +(state: ConnectionStateType, reason: ConnectionChangedReason) => void +export type NetworkTypeCallback = +/** + * @param type The network type. + */ +(type: NetworkType) => void +export type TokenCallback = +/** + * @param token The token that will expire in 30 seconds. + */ +(token: string) => void +export type AudioVolumeCallback = +/** + * @param speakers An array containing the user ID and volume information for each speaker. + * + * In the local user’s callback, this array contains the following members: + * - `uid` = 0, + * - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and + * - `vad`, which reports the voice activity status of the local user. + * + * In the remote speakers' callback, this array contains the following members: + * - `uid` of each remote speaker, + * - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and + * - `vad` = 0. + * + * An empty `speakers` array in the callback indicates that no remote user is speaking at the moment. + * + * @param totalVolume Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume). + * - 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 speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing + * volume of all remote speakers. + */ +(speakers: AudioVolumeInfo[], totalVolume: number) => void +export type UidCallback = +/** + * @param uid User ID of the active speaker. A `uid` of 0 represents the local user. + */ +( uid: number) => void +export type ElapsedCallback = +/** + * @param elapsed Time elapsed (ms) from the local user calling the [`joinChannel`]{@link RtcEngine.joinChannel} until + * this callback is triggered. + */ +(elapsed: number) => void +export type VideoFrameCallback = +/** + * @param width Width (pixels) of the first local video frame. + * @param height Height (pixels) of the first local video frame. + * @param elapsed Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this + * callback is triggered. + * If [`startPreview`]{@link RtcEngine.startPreview} is called before [`joinChannel`]{@link RtcEngine.joinChannel}, elapsed is the + * time elapsed (ms) from the local user calling [`startPreview`]{@link RtcEngine.startPreview} until this callback is triggered. + */ +(width: number, height: number, elapsed: number) => void +export type UidWithMutedCallback = +/** + * @param uid ID of the remote user. + * @param muted Whether the remote user's video stream playback pauses/resumes: + * + * - `true`: Pause. + * - `false`: Resume. + */ +(uid: number, muted: boolean) => void +export type VideoSizeCallback = +/** + * @param uid User ID of the remote user or local user (0) whose video size or rotation changes. + * @param width New width (pixels) of the video. + * @param height New height (pixels) of the video. + * @param rotation New rotation of the video [0 to 360). + */ +(uid: number, width: number, height: number, rotation: number) => void +export type RemoteVideoStateCallback = +/** + * @param uid ID of the remote user whose video state changes. + * @param state State of the remote video. + * @param reason The reason of the remote video state change. + * @param elapsed Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until the SDK + * triggers this callback. + * + */ +(uid: number, state: VideoRemoteState, reason: VideoRemoteStateReason, elapsed: number) => void +export type LocalVideoStateCallback = +/** + * @param localVideoState The local video state. + * @param error The detailed error information of the local video. + */ +(localVideoState: LocalVideoStreamState, error: LocalVideoStreamError) => void +export type RemoteAudioStateCallback = +/** + * @param uid ID of the user whose audio state changes. + * @param state State of the remote audio. + * @param reason The reason of the remote audio state change. + * @param elapsed Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until the + * SDK triggers this callback. + * + */ +(uid: number, state: AudioRemoteState, reason: AudioRemoteStateReason, elapsed: number) => void +export type LocalAudioStateCallback = +/** + * @param state State of the local audio. + * @param error The error information of the local audio. + */ +(state: AudioLocalState, error: AudioLocalError) => void +export type FallbackCallback = +/** + * @param isFallbackOrRecover Whether the published stream fell back to audio-only or switched back to the video: + * + * - `true`: The published stream fell back to audio-only due to poor network conditions. + * - `false`: The published stream switched back to the video after the network conditions improved. + */ +(isFallbackOrRecover: boolean) => void +export type FallbackWithUidCallback = +/** + * @param uid ID of the remote user sending the stream. + * @param isFallbackOrRecover Whether the remote media stream fell back to audio-only or + * switched back to the video: + * + * - `true`: The remote media stream fell back to audio-only due to poor network conditions. + * - `false`: The remote media stream switched back to the video stream after the network conditions improved. + */ +(uid: number, isFallbackOrRecover: boolean) => void +export type AudioRouteCallback = +/** + * @param routing Audio output routing. + */ +(routing: AudioOutputRouting) => void +export type RectCallback = +/** + * @param rect Rectangular area in the camera zoom specifying the focus area. + */ + +(rect: Rect) => void +export type NetworkQualityCallback = +/** + * @param quality The last mile network quality based on the uplink and downlink packet loss rate and jitter. + */ +(quality: NetworkQuality) => void +export type NetworkQualityWithUidCallback = +/** + * @param uid User ID. The network quality of the user with this uid is reported. + * @param txQuality Uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) + * and jitter of the uplink network. `txQuality` is a quality rating helping you understand how well the current uplink + * network conditions can support the selected VideoEncoderConfiguration. + * For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution + * of 680 × 480 and a frame rate of 30 fps, but may be inadequate for resolutions higher than 1280 × 720. + * @param rxQuality Downlink network quality rating of the user in terms of packet loss rate, average RTT, and + * jitter of the downlink network. + * + */ +(uid: number, txQuality: NetworkQuality, rxQuality: NetworkQuality) => void +export type LastmileProbeCallback = +/** + * @param result The uplink and downlink last-mile network probe test result. + */ +(result: LastmileProbeResult) => void +export type LocalVideoStatsCallback = +/** + * @param stats The statistics of the local video stream. + */ +(stats: LocalVideoStats) => void +export type LocalAudioStatsCallback = +/** + * @param stats The statistics of the local audio stream. + */ +(stats: LocalAudioStats) => void +export type RemoteVideoStatsCallback = +/** + * @param stats Statistics of the received remote video streams. + */ +(stats: RemoteVideoStats) => void +export type RemoteAudioStatsCallback = +/** + * @param stats Statistics of the received remote audio streams. + */ +(stats: RemoteAudioStats) => void +export type AudioMixingStateCallback = +/** + * @param state The state code. + * @param errorCode The error code. + */ +(state: AudioMixingStateCode, errorCode: AudioMixingErrorCode) => void +export type SoundIdCallback = +/** + * @param soundId ID of the local audio effect. Each local audio effect has a unique ID. + */ +(soundId: number) => void +export type RtmpStreamingStateCallback = +/** + * @param url The RTMP URL address. + * @param state The RTMP streaming state. + * @param errCode The detailed error information for streaming. + * + */ +(url: string, state: RtmpStreamingState, errCode: RtmpStreamingErrorCode) => void +export type StreamInjectedStatusCallback = +/** + * @param url The URL address of the externally injected stream. + * @param uid User ID. + * @param status State of the externally injected stream. + * + */ +(url: string, uid: number, status: InjectStreamStatus) => void +export type StreamMessageCallback = +/** + * @param uid User ID of the remote user sending the data stream. + * @param streamId Stream ID. + * @param data Data received by the local user. + * + */ +(uid: number, streamId: number, data: string) => void +export type StreamMessageErrorCallback = +/** + * @param uid User ID of the remote user sending the data stream. + * @param streamId Stream ID. + * @param error Error code. + * @param missed The number of lost messages. + * @param cached The number of incoming cached messages when the data stream is interrupted. + */ +(uid: number, streamId: number, error: ErrorCode, missed: number, cached: number) => void +export type MediaRelayStateCallback = +/** + * @param state The state code. + * @param code The error code. + */ +(state: ChannelMediaRelayState, code: ChannelMediaRelayError) => void +export type MediaRelayEventCallback = +/** + * @param code The event code for media stream relay. + * + */ +(code: ChannelMediaRelayEvent) => void +export type VideoFrameWithUidCallback = +/** + * @param uid User ID of the remote user sending the video streams. + * @param width Width (pixels) of the video stream. + * @param height Height (pixels) of the video stream. + * @param elapsed Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this + * callback is triggered. + * + */ +(uid: number, width: number, height: number, elapsed: number) => void +export type UrlWithErrorCallback = +/** + * @param url The RTMP URL address. + * @param error The detailed error information. + * + */ +(url: string, error: ErrorCode) => void +export type UrlCallback = +/** + * @param url The RTMP URL address. + */ +(url: string) => void +export type TransportStatsCallback = +/** + * @param uid User ID of the remote user sending the audio packet. + * @param delay Network time delay (ms) from the remote user sending the audio packet to the local user. + * @param lost Packet loss rate (%) of the audio packet sent from the remote user. + * @param rxKBitRate Received bitrate (Kbps) of the audio packet sent from the remote user. + * + */ +(uid: number, delay: number, lost: number, rxKBitRate: number) => void +export type UidWithEnabledCallback = +/** + * @param uid User ID of the remote user. + * @param enabled Whether the specific remote user enables/disables the video module: + * + * - `true`: Enabled. The remote user can enter a video session. + * - `false`: Disabled. The remote user can only enter a voice session, and cannot send or receive + * any video stream. + */ +(uid: number, enabled: boolean) => void +export type EnabledCallback = +/** + * @param enabled Whether the microphone is enabled/disabled: + * - `true`:Enabled. + * - `false`:Disabled. + * + */ +(enabled: boolean) => void +export type AudioQualityCallback = +/** + * @param uid User ID of the speaker. + * @param quality Audio quality of the user. + * @param delay Time delay (ms) of the audio packet from the sender to the receiver, including the time delay + * from audio sampling pre-processing, transmission, and the jitter buffer. + * @param lost Packet loss rate (%) of the audio packet sent from the sender to the receiver. + * + */ +(uid: number, quality: number, delay: number, lost: number) => void +export type MetadataCallback = +/** + * @param buffer The received metadata. + * @param uid The ID of the user who sent the metadata. + * @param timeStampMs The timestamp (ms) of the received metadata. + * + */ +(buffer: string, uid: number, timeStampMs: number) => void +export type FacePositionCallback = +/** + * @param imageWidth The width (px) of the local video. + * @param imageHeight The height (px) of the local video. + * @param faces The information of the detected human face. For details, see [`FacePositionInfo`]{@link FacePositionInfo}. + * The number of the `FacePositionInfo` array depends on the number of human faces detected. + * If the array length is 0, it means that no human face is detected. + */ +(imageWidth: number, imageHeight: number, faces: FacePositionInfo[]) => void /** * The SDK uses the [`RtcEngineEvents`]{@link RtcEngineEvents} interface class to send callbacks to the application, and the application inherits the methods of this interface class to retrieve these callbacks. @@ -133,10 +461,6 @@ export interface RtcEngineEvents { * * For example, the SDK reports a [`StartCall`]{@link ErrorCode.StartCall} error when failing to initialize a call. The app informs the user that the call initialization failed and invokes the [`leaveChannel`]{@link RtcEngine.leaveChannel} method to leave the channel. For detailed error codes, see {@link ErrorCode}. * - * [`ErrorCallback`]{@link ErrorCallback} has the following parameters: - * - `err`: [`ErrorCode`]{@link ErrorCode} - * - * Error code. See [`ErrorCode`]{@link ErrorCode}. * @event Error */ Error: ErrorCallback @@ -144,18 +468,6 @@ export interface RtcEngineEvents { /** * Occurs when an API method is executed. * - * [`ApiCallCallback`]{@link ApiCallCallback} has the following parameters: - * - `error`: [`ErrorCode`]{@link ErrorCode} - * - * [Error Code]{@link ErrorCode} that the SDK returns when the method call fails. - * If the SDK returns 0, then the method call was successful. - * - `api`: *string* - * - * The method executed by the SDK. - * - `result`: *string* - * - * The result of the method call. - * * @event ApiCallExecuted */ ApiCallExecuted: ApiCallCallback @@ -167,17 +479,6 @@ export interface RtcEngineEvents { * * If the uid is not specified when [`joinChannel`]{@link RtcEngine.joinChannel} is called, the server automatically assigns a uid. * - * [`UidWithElapsedAndChannelCallback`]{@link UidWithElapsedAndChannelCallback} has the following parameters: - * - `channel`: *string* - * - * Channel name. - * - `uid`: *number* - * - * User ID. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. - * * @event JoinChannelSuccess */ JoinChannelSuccess: UidWithElapsedAndChannelCallback @@ -187,16 +488,6 @@ export interface RtcEngineEvents { * * When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. * - * [`UidWithElapsedAndChannelCallback`]{@link UidWithElapsedAndChannelCallback} has the following parameters: - * - `channel`: *string* - * - * Channel name. - * - `uid`: *number* - * - * User ID. - * - `elapsed`: *number* - * - * Time elapsed (ms) from starting to reconnect until this callback is triggered. * @event RejoinChannelSuccess */ RejoinChannelSuccess: UidWithElapsedAndChannelCallback @@ -208,10 +499,6 @@ export interface RtcEngineEvents { * * With this callback, the application retrieves the channel information, such as the call duration and statistics. * - * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: - * - `RtcStats`:[`RtcStats`]{@link RtcStats} - * - * Statistics of the call. * @event LeaveChannel */ LeaveChannel: RtcStatsCallback @@ -221,13 +508,7 @@ export interface RtcEngineEvents { * * This callback is triggered when the local user successfully registers a user account by calling [`registerLocalUserAccount`]{@link RtcEngine.registerLocalUserAccount}, or joins a channel by calling [`joinChannelWithUserAccount`]{@link RtcEngine.joinChannelWithUserAccount}. * This callback reports the user ID and user account of the local user. - * [`UserAccountCallback`]{@link UserAccountCallback} has the following parameters: - * - `uid`: *number* - * - * The ID of the local user. - * - `userAccount`: *string* * - * The user account of the local user. * @event LocalUserRegistered */ LocalUserRegistered: UserAccountCallback @@ -237,13 +518,6 @@ export interface RtcEngineEvents { * * After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object ([`UserInfo`]{@link UserInfo}), and triggers this callback on the local client. * - * [`UserInfoCallback`]{@link UserInfoCallback} has the following parameters: - * - `uid`: *number* - * - * The ID of the remote user. - * - `userInfo`: [`UserInfo`]{@link UserInfo} - * - * The `UserInfo` object that contains the user ID and user account of the remote user. * @event UserInfoUpdated */ UserInfoUpdated: UserInfoCallback @@ -253,13 +527,6 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the local user switches the user role by calling [`setClientRole`]{@link RtcEngine.setClientRole} after joining the channel. * - * [`ClientRoleCallback`]{@link ClientRoleCallback} has the following parameters: - * - `oldRole`: [`ClientRole`]{@link ClientRole} - * - * Role that the user switches from. - * - `newRole`: [`ClientRole`]{@link ClientRole} - * - * Role that the user switches to. * @event ClientRoleChanged */ ClientRoleChanged: ClientRoleCallback @@ -271,7 +538,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback under one of the following circumstances: * - A remote user/host joins the channel by calling [`joinChannel`]{@link RtcEngine.joinChannel}. - * - A remote user switches the user role to the host by calling [`setClientRole`]{@link RtcEngine.setClientRole}after joining the channel. + * - A remote user switches the user role to the host by calling [`setClientRole`]{@link RtcEngine.setClientRole} after joining the channel. * - A remote user/host rejoins the channel after a network interruption. * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcEngine.addInjectStreamUrl}. * @@ -281,14 +548,6 @@ export interface RtcEngineEvents { * - The audience in the channel receives the [`UserJoined`]{@link UserJoined} callback when a new host joins the channel. * - When a web application joins the channel, the [`UserJoined`]{@link UserJoined} callback is triggered as long as the web application publishes streams. * - * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the user or host who joins the channel. - * - `elapsed`: *number* - * - * Time delay (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel}/[`setClientRole`]{@link RtcEngine.setClientRole}setClientRole - * until this callback is triggered. * @event UserJoined */ UserJoined: UidWithElapsedCallback @@ -300,13 +559,6 @@ export interface RtcEngineEvents { * - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel. * - Drop offline: When no data packet of the user or host is received for a certain period of time (20 seconds for the [`Communication`]{@link ChannelProfile.Communication} profile, and more for the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. * - * [`UserOfflineCallback`]{@link UserOfflineCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the user or host who leaves the channel or goes offline. - * -` reason`: [`UserOfflineReason`]{@link UserOfflineReason} - * - * - Reason why the user goes offline. * @event UserOffline */ UserOffline: UserOfflineCallback @@ -316,13 +568,6 @@ export interface RtcEngineEvents { * * The Agora SDK returns this callback to report on the current network connection state when it changes, and the reason to such change. * - * [`ConnectionStateCallback`]{@link ConnectionStateCallback} has the following parameters: - * - `state`: [`ConnectionStateType`][@link ConnectionStateType] - * - * The current network connection state. - * - `reason`: [`ConnectionChangedReason`]{@link ConnectionChangedReason} - * - * The reason causing the change of the connection state. * @event ConnectionStateChanged */ ConnectionStateChanged: ConnectionStateCallback @@ -332,10 +577,6 @@ export interface RtcEngineEvents { * * The SDK returns the current network type in this callback. When the network connection is interrupted, this callback indicates whether the interruption is caused by a network type change or poor network conditions. * - * [`NetworkTypeCallback`]{@link NetworkTypeCallback} has the following parameters: - * - `type`: [`NetworkType`]{@link NetworkType} - * - * The network type. * @event NetworkTypeChanged */ NetworkTypeChanged: NetworkTypeCallback @@ -356,10 +597,6 @@ export interface RtcEngineEvents { * * The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call {@link RtcEngine.renewToken} to pass the new token to the SDK. * - * [`TokenCallback`]{@link TokenCallback} has the following parameters: - * - `token`: *string* - * - * The token that will expire in 30 seconds. * @event TokenPrivilegeWillExpire */ TokenPrivilegeWillExpire: TokenCallback @@ -390,27 +627,6 @@ export interface RtcEngineEvents { * - If the local user calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}, the SDK stops triggering the local user's callback. * - 20 seconds after a remote speaker calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}, the remote speakers' callback does not include information of this remote user; 20 seconds after all remote users call the the [`muteLocalAudioStream`]{@link muteLocalAudioStream} method, the SDK stops triggering the remote speakers' callback. * - * [`AudioVolumeCallback`]{@link AudioVolumeCallback} has the following parameters: - * - `speakers`: [`AudioVolumeInfo`]{@link AudioVolumeInfo}[] - * - * An array containing the user ID and volume information for each speaker. - * - * In the local user’s callback, this array contains the following members: - * - `uid` = 0, - * - `volume` = `totalVolume`, which reports the sum of the voice volume and audio-mixing volume of the local user, and - * - `vad`, which reports the voice activity status of the local user. - * - * In the remote speakers' callback, this array contains the following members: - * - `uid` of each remote speaker, - * - `volume`, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and - * - `vad` = 0. - * - * An empty `speakers` array in the callback indicates that no remote user is speaking at the moment. - * - `totalVolume`: *number* - * - * Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume). - * - 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 speakers' callback, `totalVolume` is the sum of the voice volume and audio-mixing volume of all remote speakers. * @event AudioVolumeIndication */ AudioVolumeIndication: AudioVolumeCallback @@ -425,10 +641,6 @@ export interface RtcEngineEvents { * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. * - * [`UidCallback`]{@link UidCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the active speaker. A `uid` of 0 represents the local user. * @event ActiveSpeaker */ ActiveSpeaker: UidCallback @@ -436,10 +648,6 @@ export interface RtcEngineEvents { /** * Occurs when the first local audio frame is sent. * - * [`ElapsedCallback`]{@link ElapsedCallback} has the following parameters: - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling the [`joinChannel`]{@ink RtcEngine.joinChannel} until this callback is triggered. * @event FirstLocalAudioFrame */ FirstLocalAudioFrame: ElapsedCallback @@ -449,17 +657,6 @@ export interface RtcEngineEvents { * * This callback is triggered after the first local video frame is rendered on the local video window. * - * [`VideoFrameCallback`]{@link VideoFrameCallback} has the following parameters: - * - `width`: *number* - * - * Width (pixels) of the first local video frame. - * - `height`: *number* - * - * Height (pixels) of the first local video frame. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until this callback is triggered. - * If [`startPreview`]{@link RtcEngine.startPreview} is called before `joinChannel`, elapsed is the time elapsed (ms) from the local user calling `startPreview` until this callback is triggered. * @event FirstLocalVideoFrame */ FirstLocalVideoFrame: VideoFrameCallback @@ -476,17 +673,8 @@ export interface RtcEngineEvents { * * **Note** * - * This callback is invalid when the number of users or broadcasters in the channel exceeds 20. + * This callback is invalid when the number of users or hosts in the channel exceeds 17. * - * [`UidWithMutedCallback`]{@link UidWithMutedCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the remote user. - * - `muted`: *boolean* - * - * Whether the remote user's video stream playback pauses/resumes: - * - true: Pause. - * - false: Resume. * @event UserMuteVideo */ UserMuteVideo: UidWithMutedCallback @@ -494,19 +682,6 @@ export interface RtcEngineEvents { /** * Occurs when the video size or rotation information of a remote user changes. * - * [`VideoSizeCallback`]{@link VideoSizeCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user or local user (0) whose video size or rotation changes. - * - `width`: *number* - * - * New width (pixels) of the video. - * - `height`: *number* - * - * New height (pixels) of the video. - * - `rotation`: *number* - * - * New rotation of the video [0 to 360). * @event VideoSizeChanged */ VideoSizeChanged: VideoSizeCallback @@ -514,20 +689,6 @@ export interface RtcEngineEvents { /** * Occurs when the remote video state changes. * - * [`RemoteVideoStateCallback`]{@link RemoteVideoStateCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the remote user whose video state changes. - * - `state`: [`VideoRemoteState`]{@link VideoRemoteState} - * - * State of the remote video. - * - `reason`: [`VideoRemoteStateReason`]{@link VideoRemoteStateReason} - * - * The reason of the remote video state change. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. - * * @event RemoteVideoStateChanged */ RemoteVideoStateChanged: RemoteVideoStateCallback @@ -535,23 +696,10 @@ export interface RtcEngineEvents { /** * Occurs when the local video state changes. * - * The SDK returns the current video state in this callback. When the state is [`Failed`]{@link LocalVideoStreamState.Failed}, see the error parameter for details. - * - * **Note** - * - * This callback reports the current state of the local video, - * which keeps changing throughout the RtcEngine life cycle. We recommend maintaining the states reported - * in this callback, and check the local video state before starting the local camera. - * If the SDK reports [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure}, the local camera is occupied by either the system or a third-party app. - * To access the camera, call [`enableLocalVideo`]{@link RtcEngine.enableLocalVideo} (false) first, and then [`enableLocalVideo`]{@link RtcEngine.enableLocalVideo} (video). - * - * [`LocalVideoStateCallback`]{@link LocalVideoStateCallback} has the following parameters: - * - localVideoState: [`LocalVideoStreamState`]{@link LocalVideoStreamState} + * The SDK returns the current video state in this callback. + * This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. + * When the state is [`Failed`]{@link LocalVideoStreamState.Failed}, see the error parameter for details. * - * The local video state. - * - error: [`LocalVideoStreamError`]{@link LocalVideoStreamError} - * - * The detailed error information of the local video. * * @event LocalVideoStateChanged */ @@ -562,19 +710,6 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the remote audio stream. * - * [`RemoteAudioStateCallback`]{@link RemoteAudioStateCallback } has the following parameters: - * - `uid`: *number* - * - * ID of the user whose audio state changes. - * - `state`: [`AudioRemoteState`]{@link AudioRemoteState} - * - * State of the remote audio. - * - `reason`: [`AudioRemoteStateReason`]{@link AudioRemoteStateReason} - * - * The reason of the remote audio state change. - * - `elapsed`: number - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. * @event RemoteAudioStateChanged */ RemoteAudioStateChanged: RemoteAudioStateCallback @@ -588,30 +723,19 @@ export interface RtcEngineEvents { * * When the state is [`Failed`]{@link AudioLocalState.Failed}, see the error parameter for details. * - * [`LocalAudioStateCallback`]{@link LocalAudioStateCallback} has the following parameters: - * - state: [`AudioLocalState`]{@link AudioLocalState} - * - * State of the local audio. - * - error: [`AudioLocalError`]{@link AudioLocalError} - * - * The error information of the local audio. * @event LocalAudioStateChanged */ LocalAudioStateChanged: LocalAudioStateCallback /** - * Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. + * Occurs when the published media stream falls back to an audio-only stream due to poor network conditions + * or switches back to video stream after the network conditions improve. * * If you call [`setLocalPublishFallbackOption`]{@link RtcEngine.setLocalPublishFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, * this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, - * or when the audio stream switches back to the video after the uplink network condition improves. + * or when the audio stream switches back to the video after the uplink network condition improves. Once the published stream falls back to audio only, + * the remote app receives the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback. * - * [`FallbackCallback`]{@link FallbackCallback} has the following parameters: - * - `isFallbackOrRecover`: *boolean* - * - * Whether the published stream fell back to audio-only or switched back to the video: - * - true: The published stream fell back to audio-only due to poor network conditions. - * - false: The published stream switched back to the video after the network conditions improved. * @event LocalPublishFallbackToAudioOnly */ LocalPublishFallbackToAudioOnly: FallbackCallback @@ -619,18 +743,12 @@ export interface RtcEngineEvents { /** * Occurs when the remote media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. * - * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, - * this callback is triggered when the remotely subscribed media stream falls back to audio-only mode due to poor uplink conditions, or when the remotely subscribed media stream switches back to the video after the uplink network condition improves. - * - * [`FallbackWithUidCallback`]{@link FallbackWithUidCallback} has the following parameters: - * - `uid`: *number* + * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set + * option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, + * this callback is triggered when the remotely subscribed media stream falls back to audio-only mode due + * to poor uplink conditions, or when the remotely subscribed media stream switches back to the video after + * the uplink network condition improves. * - * ID of the remote user sending the stream. - * - `isFallbackOrRecover`: *boolean* - * - * Whether the remote media stream fell back to audio-only or switched back to the video: - * - true: The remote media stream fell back to audio-only due to poor network conditions. - * - false: The remote media stream switched back to the video stream after the network conditions improved. * @event RemoteSubscribeFallbackToAudioOnly */ RemoteSubscribeFallbackToAudioOnly: FallbackWithUidCallback @@ -642,8 +760,6 @@ export interface RtcEngineEvents { * * The definition of the routing is listed in [`AudioOutputRouting`]{@link AudioOutputRouting}. * - * [`AudioRouteCallback`]{@link AudioRouteCallback} has the following parameters: - * - `routing`: [`AudioOutputRouting`]{@link AudioOutputRouting}. * @event AudioRouteChanged */ AudioRouteChanged: AudioRouteCallback @@ -651,12 +767,9 @@ export interface RtcEngineEvents { /** * Occurs when the camera focus area is changed. * - * The SDK triggers this callback when the local user changes the camera focus position by calling [`setCameraFocusPositionInPreview`]{@link RtcEngine.setCameraFocusPositionInPreview}. - * - * [`RectCallback`]{@link RectCallback} has the following parameters: - * - rect: [`Rect`]{@link rect: Rect} + * The SDK triggers this callback when the local user changes the camera focus position by + * calling [`setCameraFocusPositionInPreview`]{@link RtcEngine.setCameraFocusPositionInPreview}. * - * Rectangular area in the camera zoom specifying the focus area. * @event CameraFocusAreaChanged */ CameraFocusAreaChanged: RectCallback @@ -666,10 +779,6 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the local user changes the camera exposure position by calling [`setCameraExposurePosition`]{@link RtcEngine.setCameraExposurePosition}. * - * [`RectCallback`]{@link RectCallback} has the following parameters: - * - rect: [`Rect`]{@link rect: Rect} - * - * Rectangular area in the camera zoom specifying the exposure area. * @event CameraExposureAreaChanged */ CameraExposureAreaChanged: RectCallback @@ -687,18 +796,6 @@ export interface RtcEngineEvents { * - The SDK stops triggering this callback when a human face is in close proximity to the screen. * - On Android, the distance value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for accurate calculation. * - * [`FacePositionCallback`]{@link FacePositionCallback} has the following parameters: - * - `imageWidth`: *number* - * - * The width (px) of the local video. - * - `imageHeight`: *number* - * - * The height (px) of the local video. - * - `faces`: [`FacePositionInfo`]{@link FacePositionInfo}[] - * - * The information of the detected human face. For details, see [`FacePositionInfo`]{@link FacePositionInfo}. - * The number of the `FacePositionInfo` array depends on the number of human faces detected. - * If the array length is 0, it means that no human face is detected. * @event FacePositionChanged */ FacePositionChanged: FacePositionCallback @@ -706,10 +803,7 @@ export interface RtcEngineEvents { /** * Reports the statistics of the [`RtcEngine`]{@link RtcEngine} once every two seconds. * - * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: - * - `stats`: [`RtcStats`]{@link RtcStats} * - * RTC engine statistics. * @event RtcStats */ RtcStats: RtcStatsCallback @@ -719,10 +813,7 @@ export interface RtcEngineEvents { * Last mile refers to the connection between the local device and Agora's edge server. After the application calls the [`enableLastmileTest`]{@link RtcEngine.enableLastmileTest} method, * this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel. * - * [`NetworkQualityCallback`]{@link NetworkQualityCallback} has the following parameters: - * - `quality`: [`NetworkQuality`]{@link NetworkQuality} * - * The last mile network quality based on the uplink and downlink packet loss rate and jitter. * @event LastmileQuality */ LastmileQuality: NetworkQualityCallback @@ -732,19 +823,6 @@ export interface RtcEngineEvents { * * Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times. * - * [`NetworkQualityWithUidCallback`]{@link NetworkQualityWithUidCallback} has the following parameters: - * - `uid`: *number* - * - * User ID. The network quality of the user with this uid is reported. - * If `uid` is 0, the local network quality is reported. - * - `txQuality`: [`NetworkQuality`]{@link NetworkQuality} - * - * Uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) - * and jitter of the uplink network. `txQuality` is a quality rating helping you understand how well the current uplink - * network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 680 × 480 and a frame rate of 30 fps, but may be inadequate for resolutions higher than 1280 × 720. - * - `rxQuality`: [`NetworkQuality`]{@link NetworkQuality} - * - * Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. * @event NetworkQuality */ NetworkQuality: NetworkQualityWithUidCallback @@ -754,10 +832,6 @@ export interface RtcEngineEvents { * * The SDK triggers this callback within 30 seconds after the app calls [`startLastmileProbeTest`]{@link RtcEngine.startLastmileProbeTest}. * - * [`LastmileProbeCallback`]{@link LastmileProbeCallback} has the following parameters: - * - `result`: [`LastmileProbeResult`]{@link LastmileProbeResult} - * - * The uplink and downlink last-mile network probe test result. * @event LastmileProbeResult */ LastmileProbeResult: LastmileProbeCallback @@ -767,10 +841,6 @@ export interface RtcEngineEvents { * * The SDK triggers this callback once every two seconds for each user/host. If there are multiple users/hosts in the channel, the SDK triggers this callback as many times. * - * [`LocalVideoStatsCallback`]{@link LocalVideoStatsCallback} has the following parameters: - * - `stats`: [`LocalVideoStats`]{@link LocalVideoStats} - * - * The statistics of the local video stream. * @event LocalVideoStats */ LocalVideoStats: LocalVideoStatsCallback @@ -778,10 +848,6 @@ export interface RtcEngineEvents { /** * Reports the statistics of the local audio stream. * - * [`LocalAudioStatsCallback`]{@link LocalAudioStatsCallback} has the following parameters: - * - `stats`: [`LocalAudioStats`]{@link LocalAudioStats} - * - * The statistics of the local audio stream. * @event LocalAudioStats */ LocalAudioStats: LocalAudioStatsCallback @@ -789,10 +855,6 @@ export interface RtcEngineEvents { /** * Reports the statistics of the video stream from each remote user/host. The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. * - * [`RemoteVideoStatsCallback`]{@link RemoteVideoStatsCallback} has the following parameters: - * - `stats`: [`RemoteVideoStats`]{@link RemoteVideoStats} - * - * Statistics of the received remote video streams. * @event RemoteVideoStats */ RemoteVideoStats: RemoteVideoStatsCallback @@ -804,10 +866,6 @@ export interface RtcEngineEvents { * * Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high. * - * [`RemoteAudioStatsCallback`]{@link RemoteAudioStatsCallback} has the following parameters: - * - `stats`: [`RemoteAudioStats`]{@link RemoteAudioStats} - * - * Statistics of the received remote audio streams. * @event RemoteAudioStats */ RemoteAudioStats: RemoteAudioStatsCallback @@ -836,13 +894,6 @@ export interface RtcEngineEvents { * - When exceptions occur during playback, this callback returns `714` in state and an error in errorCode. * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns [`AudioMixingOpenError`]{@link WarningCode.AudioMixingOpenError}. * - * [`AudioMixingStateCallback`]{@link AudioMixingStateCallback} has the following parameters: - * - `state`: [`AudioMixingStateCode`]{@link AudioMixingStateCode} - * - * The state code. - * - `errorCode`: [`AudioMixingErrorCode`]{@link AudioMixingErrorCode} - * - * The error code. * @event AudioMixingStateChanged */ AudioMixingStateChanged: AudioMixingStateCallback @@ -852,10 +903,7 @@ export interface RtcEngineEvents { * * You can start a local audio effect playback by calling [`playEffect`]{@link RtcEngine.playEffect}. This callback is triggered when the local audio effect file playback finishes. * - * [`SoundIdCallback`]{@link SoundIdCallback} has the following parameters: - * - `soundId`: *number* * - * ID of the local audio effect. Each local audio effect has a unique ID. * @event AudioEffectFinished */ AudioEffectFinished: SoundIdCallback @@ -868,16 +916,6 @@ export interface RtcEngineEvents { * * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter. * - * [`RtmpStreamingStateCallback`]{@link RtmpStreamingStateCallback} has the following parameters: - * - `url`: *string* - * - * The RTMP URL address. - * - `state`: *RtmpStreamingState* - * - * The RTMP streaming state. - * - `errCode`: *RtmpStreamingErrorCode* - * - * The detailed error information for streaming. * @event RtmpStreamingStateChanged */ RtmpStreamingStateChanged: RtmpStreamingStateCallback @@ -888,7 +926,7 @@ export interface RtcEngineEvents { * When the LiveTranscoding class in the {@link RtcEngine.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * * **Note** - * - If you call the setLiveTranscoding method to set the LiveTranscoding class for the first time, the SDK does not trigger this callback. + * - If you call {@link RtcEngine.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * * @event TranscodingUpdated */ @@ -897,16 +935,6 @@ export interface RtcEngineEvents { /** * Reports the status of injecting the online media stream. * - * [`StreamInjectedStatusCallback`]{@link StreamInjectedStatusCallback} has the following parameters: - * - `url`: *string* - * - * The URL address of the externally injected stream. - * - `uid`: *number* - * - * User ID. - * - `status`: [`InjectStreamStatus`]{@link InjectStreamStatus} - * - * State of the externally injected stream. * @event StreamInjectedStatus */ StreamInjectedStatus: StreamInjectedStatusCallback @@ -917,16 +945,6 @@ export interface RtcEngineEvents { * The SDK triggers this callback when the local user receives the stream message that the remote user sends * by calling the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} method. * - * [`StreamMessageCallback`]{@link StreamMessageCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the data stream. - * - `streamId`: *number* - * - * Stream ID. - * - `data`: *string* - * - * Data received by the local user. * @event StreamMessage */ StreamMessage: StreamMessageCallback @@ -937,21 +955,6 @@ export interface RtcEngineEvents { * The SDK triggers this callback when the local user fails to receive the stream message that the remote * user sends by calling the [`sendStreamMessage`]{@link RtcEngine.sendStreamMessage} method. * - * [`StreamMessageErrorCallback`]{@link StreamMessageErrorCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the data stream. - * - `streamId`: *number* - * - * Stream ID. - * - `error`: [`ErrorCode`]{@link ErrorCode} - * Error code. - * - `missed`: *number* - * - * The number of lost messages. - * - `cached`: *number* - * - * The number of incoming cached messages when the data stream is interrupted. * @event StreamMessageError */ StreamMessageError: StreamMessageErrorCallback @@ -975,13 +978,6 @@ export interface RtcEngineEvents { * * The SDK reports the state of the current media relay and possible error messages in this callback. * - * [`MediaRelayStateCallback`]{@link MediaRelayStateCallback} has the following parameters: - * - `state`: [`ChannelMediaRelayState`]{@link ChannelMediaRelayState} - * - * The state code. - * - `code`: [`ChannelMediaRelayError`]{@link ChannelMediaRelayError} - * - * The error code. * @event ChannelMediaRelayStateChanged */ ChannelMediaRelayStateChanged: MediaRelayStateCallback @@ -989,10 +985,6 @@ export interface RtcEngineEvents { /** * Reports events during the media stream relay. * - * [`MediaRelayEventCallback`]{@link MediaRelayEventCallback} has the following parameters: - * - `code`: [`ChannelMediaRelayEvent`]{@link ChannelMediaRelayEvent} - * - * The event code for media stream relay. * @event ChannelMediaRelayEvent */ ChannelMediaRelayEvent: MediaRelayEventCallback @@ -1006,19 +998,6 @@ export interface RtcEngineEvents { * * This callback is triggered after the first frame of the remote video is rendered on the video window. The application can retrieve the data of the time elapsed from the user joining the channel until the first video frame is displayed. * - * [`VideoFrameWithUidCallback`]{@link VideoFrameWithUidCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the video streams. - * - `width`: *number* - * - * Width (pixels) of the video stream. - * - `height`: *number* - * - * Height (pixels) of the video stream. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * @event FirstRemoteVideoFrame */ FirstRemoteVideoFrame: VideoFrameWithUidCallback @@ -1030,13 +1009,6 @@ export interface RtcEngineEvents { * * Use [`Starting`]{@link AudioRemoteState.Starting} in [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} instead. * - * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * @event FirstRemoteAudioFrame */ FirstRemoteAudioFrame: UidWithElapsedCallback @@ -1056,13 +1028,6 @@ export interface RtcEngineEvents { * - The remote user calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}. * - The remote user calls [`disableAudio`]{@link RtcEngine.disableAudio}. * - * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the audio stream. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. * @event FirstRemoteAudioDecoded */ FirstRemoteAudioDecoded: UidWithElapsedCallback @@ -1079,17 +1044,8 @@ export interface RtcEngineEvents { * * **Note** * - * This callback is invalid when the number of users or broadcasters in the channel exceeds 20. + * This callback is invalid when the number of users or hosts in the channel exceeds 17. * - * [`UidWithMutedCallback`]{@link UidWithMutedCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the remote user. - * - `muted`: *boolean* - * - * Whether the remote user's audio stream is muted/unmuted: - * - true: Muted. - * - false: Unmuted. * @event UserMuteAudio */ UserMuteAudio: UidWithMutedCallback @@ -1103,13 +1059,6 @@ export interface RtcEngineEvents { * * This callback indicates whether you have successfully added an RTMP stream to the CDN. * - * [`UrlWithErrorCallback`]{@link UrlWithErrorCallback} has the following parameters: - * - `url`: *string* - * - * The RTMP URL address. - * - `error`: *ErrorCode* - * - * The detailed error information. * @event StreamPublished */ StreamPublished: UrlWithErrorCallback @@ -1123,10 +1072,6 @@ export interface RtcEngineEvents { * * This callback indicates whether you have successfully removed an RTMP stream from the CDN. * - * [`UrlCallback`]{@link UrlCallback} has the following parameters: - * - `url`: *string* - * - * The RTMP URL address. * @event StreamUnpublished */ StreamUnpublished: UrlCallback @@ -1138,21 +1083,9 @@ export interface RtcEngineEvents { * * This callback is deprecated. Use [`RemoteAudioStats`]{@link RemoteAudioStats} instead. * - * This callback reports the transport-layer statistics, such as the packet loss rate and time delay, once every two seconds after the local user receives an audio packet from a remote user. - * - * [`TransportStatsCallback`]{@link TransportStatsCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the audio packet. - * - `delay`: *number* - * - * Network time delay (ms) from the remote user sending the audio packet to the local user. - * - `lost`: *number* - * - * Packet loss rate (%) of the audio packet sent from the remote user. - * - `rxKBitRate`: *number* + * This callback reports the transport-layer statistics, such as the packet loss rate and time delay, + * once every two seconds after the local user receives an audio packet from a remote user. * - * Received bitrate (Kbps) of the audio packet sent from the remote user. * @event RemoteAudioTransportStats */ RemoteAudioTransportStats: TransportStatsCallback @@ -1167,19 +1100,6 @@ export interface RtcEngineEvents { * This callback reports the transport-layer statistics, such as the packet loss rate and time delay, * once every two seconds after the local user receives the video packet from a remote user. * - * [`TransportStatsCallback`]{@link TransportStatsCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the audio packet. - * - `delay`: *number* - * - * Network time delay (ms) from the remote user sending the video packet to the local user. - * - `lost`: *number* - * - * Packet loss rate (%) of the video packet sent from the remote user. - * - `rxKBitRate`: *number* - * - * Received bitrate (Kbps) of the video packet sent from the remote user. * @event RemoteVideoTransportStats */ RemoteVideoTransportStats: TransportStatsCallback @@ -1198,17 +1118,8 @@ export interface RtcEngineEvents { * * **Note** * - * This callback is invalid when the number of users or broadcasters in the channel exceeds 20. + * This callback is invalid when the number of users or hosts in the channel exceeds 17. * - * [`UidWithEnabledCallback`]{@link UidWithEnabledCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user. - * - `enabled`: *boolean* - * - * Whether the specific remote user enables/disables the video module: - * - true: Enabled. The remote user can enter a video session. - * - false: Disabled. The remote user can only enter a voice session, and cannot send or receive any video stream. * @event UserEnableVideo */ UserEnableVideo: UidWithEnabledCallback @@ -1227,15 +1138,6 @@ export interface RtcEngineEvents { * * This callback is only applicable to the scenario when the remote user only wants to watch the remote video without sending any video stream to the other user. * - * [`UidWithEnabledCallback`]{@link UidWithEnabledCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user. - * - `enabled`: *boolean* - * - * Whether the specific remote user enables/disables the local video capturing function: - * - true: Enabled. Other users in the channel can see the video of this remote user. - * - false: Disabled. Other users in the channel can no longer receive the video stream from this remote user, while this remote user can still receive the video streams from other users. * @event UserEnableLocalVideo */ UserEnableLocalVideo: UidWithEnabledCallback @@ -1255,19 +1157,6 @@ export interface RtcEngineEvents { * - The remote user calls [`muteLocalVideoStream`]{@link RtcEngine.muteLocalVideoStream}. * - The remote user calls [`disableVideo`]{@link RtcEngine.disableVideo}. * - * [`VideoFrameWithUidCallback`]{@link VideoFrameWithUidCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the video streams. - * - `width`: *number* - * - * Width (pixels) of the video stream. - * - `height`: *number* - * - * Height (pixels) of the video stream. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@link joinChannel} until this callback is triggered. * @event FirstRemoteVideoDecoded */ FirstRemoteVideoDecoded: VideoFrameWithUidCallback @@ -1296,8 +1185,10 @@ export interface RtcEngineEvents { * The SDK triggers this callback when it loses connection to the server for more than four seconds after * the connection is established. After triggering this callback, the SDK tries to reconnect to the server. * You can use this callback to implement pop-up reminders. This callback is different from [`ConnectionLost`]{@link ConnectionLost}: - * - The SDK triggers the [`ConnectionInterrupted`]{@link ConnectionInterrupted} callback when the SDK loses connection with the server for more than four seconds after it joins the channel. - * - The SDK triggers the [`ConnectionLost`]{@link ConnectionLost} callback when it loses connection with the server for more than 10 seconds, regardless of whether it joins the channel or not. + * - The SDK triggers the [`ConnectionInterrupted`]{@link ConnectionInterrupted} callback when the SDK loses + * connection with the server for more than four seconds after it joins the channel. + * - The SDK triggers the [`ConnectionLost`]{@link ConnectionLost} callback when it loses connection with + * the server for more than 10 seconds, regardless of whether it joins the channel or not. * * If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. * @@ -1310,7 +1201,7 @@ export interface RtcEngineEvents { * * **Deprecated** * - * Use {@link ConnectionStateChanged} instead. + * Use [`ConnectionStateChanged`]{@link ConnectionStateChanged} instead. * * @event ConnectionBanned */ @@ -1325,18 +1216,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback once every two seconds to report the audio quality of each remote user/host sending an audio stream. If a channel has multiple remote users/hosts sending audio streams, the SDK trggers this callback as many times. * - * [`AudioQualityCallback`]{@link AudioQualityCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the speaker. - * - `quality`: *number* * - * Time delay (ms) of the audio packet from the sender to the receiver, including the time delay from audio sampling pre-processing, transmission, and the jitter buffer. - * Audio quality of the user. - * - `delay`: *number* - * - * Packet loss rate (%) of the audio packet sent from the sender to the receiver. - * - `lost`: *number* * @event AudioQuality */ AudioQuality: AudioQualityCallback @@ -1358,7 +1238,9 @@ export interface RtcEngineEvents { * * **Deprecated** * - * Use [`Stopped`]{@link LocalVideoStreamState.Stopped} in the [`LocalVideoStateChanged`]{@link LocalVideoStateChanged} callback instead. The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) after the video stops playing. + * Use [`Stopped`]{@link LocalVideoStreamState.Stopped} in the [`LocalVideoStateChanged`]{@link LocalVideoStateChanged} callback instead. + * The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) + * after the video stops playing. * * @event VideoStopped */ @@ -1367,32 +1249,18 @@ export interface RtcEngineEvents { /** * Occurs when the local user receives the metadata. * - * [`MetadataCallback`]{@link MetadataCallback} has the following parameters: - * - `buffer`: *string* - * - * The received metadata. - * - `uid`: *number* - * - * The ID of the user who sent the metadata. - * - `timeStampMs`: *number* - * - * The timestamp (ms) of the received metadata. * @event MetadataReceived */ MetadataReceived: MetadataCallback } /** - * The RtcChannelEvents interface. + * The [`RtcChannelEvents`]{@link RtcChannelEvents} interface. */ export interface RtcChannelEvents { /** * Reports the warning code of the {@link RtcChannel} instance. * - * [`WarningCallback`]{@link WarningCallback} has the following parameters: - * - `warn`: [`WarningCode`]{@link WarningCode}. - * - * Warning code. * @event Warning */ Warning: WarningCallback @@ -1400,10 +1268,6 @@ export interface RtcChannelEvents { /** * Reports the error code of the {@link RtcChannel} instance. * - * [`ErrorCallback`]{@link ErrorCallback} has the following parameters: - * - `err`: [`ErrorCode`]{@link ErrorCode} - * - * Error code. * @event Error */ Error: ErrorCallback @@ -1411,16 +1275,8 @@ export interface RtcChannelEvents { /** * Occurs when the local user joins a specified channel. * - * If the uid is not specified when calling [`joinChannel`]{@link RtcChannel.joinChannel}, the server automatically assigns a uid. - * - * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: - * - `uid`: *number* - * - * User ID. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the user calling [`joinChannel`]{@link RtcEngine.joinChannel} until this callback is triggered. - * + * If the uid is not specified when calling [`joinChannel`]{@link RtcChannel.joinChannel}, the + * server automatically assigns a uid. * * @event JoinChannelSuccess */ @@ -1429,15 +1285,9 @@ export interface RtcChannelEvents { /** * Occurs when a user rejoins the channel after being disconnected due to network problems. * - * When a user loses connection with the server because of network problems, the SDK automatically tries to reconnect and triggers this callback upon reconnection. - * - * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: - * - `uid`: *number* + * When a user loses connection with the server because of network problems, the SDK automatically tries + * to reconnect and triggers this callback upon reconnection. * - * User ID. - * - `elapsed`: *number* - * - * Time elapsed (ms) from starting to reconnect until this callback is triggered. * * @event RejoinChannelSuccess */ @@ -1450,26 +1300,15 @@ export interface RtcChannelEvents { * * With this callback, the app retrieves the channel information, such as the call duration and statistics. * - * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: - * - `RtcStats`:[`RtcStats`]{@link RtcStats} - * - * Statistics of the call. * @event LeaveChannel */ LeaveChannel: RtcStatsCallback /** - * Occurs when the user role switches in a Live-Broadcast channel. For example, from broadcaster to audience or vice versa. + * Occurs when the user role switches in a live interactive streaming channel. For example, from a host to an audience member or vice versa. * - * The SDK triggers this callback when the local user switches the user role by calling the {@link RtcChannel.setClientRole} method after joining the channel. + * The SDK triggers this callback when the local user switches the user role by calling the [`setClientRole`]{@link RtcChannel.setClientRole} method after joining the channel. * - * [`ClientRoleCallback`]{@link ClientRoleCallback} has the following parameters: - * - `oldRole`: [`ClientRole`]{@link ClientRole} - * - * Role that the user switches from. - * - `newRole`: [`ClientRole`]{@link ClientRole} - * - * Role that the user switches to. * @event ClientRoleChanged */ ClientRoleChanged: ClientRoleCallback @@ -1485,14 +1324,6 @@ export interface RtcChannelEvents { * - The audience in the channel receives this callback when a new host joins the channel. * - When a web app joins the channel, this callback is triggered as long as the web app publishes streams. * - * [`UidWithElapsedCallback`]{@link UidWithElapsedCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the user or host who joins the channel. - * - `elapsed`: *number* - * - * Time delay (ms) from the local user calling [`joinChannel`]{@link RtcEngine.joinChannel}/[`setClientRole`]{@link RtcEngine.setClientRole}setClientRole - * until this callback is triggered. * @event UserJoined */ UserJoined: UidWithElapsedCallback @@ -1504,13 +1335,6 @@ export interface RtcChannelEvents { * - Leave the channel: When the user/broadcaster leaves the channel, the user/broadcaster sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel. * - Go offline: When no data packet of the user or broadcaster is received for a certain period of time (around 20 seconds), the SDK assumes that the user/broadcaster drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. * - * [`UserOfflineCallback`]{@link UserOfflineCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the user or host who leaves the channel or goes offline. - * -` reason`: [`UserOfflineReason`]{@link UserOfflineReason} - * - * - Reason why the user goes offline. * @event UserOffline */ UserOffline: UserOfflineCallback @@ -1518,15 +1342,9 @@ export interface RtcChannelEvents { /** * Occurs when the network connection state changes. * - * The Agora SDK triggers this callback to report on the current network connection state when it changes, and the reason to such change. - * - * [`ConnectionStateCallback`]{@link ConnectionStateCallback} has the following parameters: - * - `state`: [`ConnectionStateType`][@link ConnectionStateType] - * - * The current network connection state. - * - `reason`: [`ConnectionChangedReason`]{@link ConnectionChangedReason} + * The Agora SDK triggers this callback to report on the current network connection state when it changes, + * and the reason to such change. * - * The reason causing the change of the connection state. * @event ConnectionStateChanged */ ConnectionStateChanged: ConnectionStateCallback @@ -1549,10 +1367,6 @@ export interface RtcChannelEvents { * triggered 30 seconds before the token expires, to remind the app to get a new token. Upon receiving this callback, * you need to generate a new token on the server and call [`renewToken`]{@link RtcChannel.renewToken} to pass the new token to the SDK. * - * [`TokenCallback`]{@link TokenCallback} has the following parameters: - * - `token`: *string* - * - * The token that will expire in 30 seconds. * @event TokenPrivilegeWillExpire */ TokenPrivilegeWillExpire: TokenCallback @@ -1571,16 +1385,12 @@ export interface RtcChannelEvents { /** * Reports which user is the loudest speaker. * - * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by calling {@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. + * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. * * **Note** - * - To receive this callback, you need to call {@link RtcEngine.enableAudioVolumeIndication}. + * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback reports the ID of the user with the highest voice volume during a period of time, instead of at the moment. * - * [`UidCallback`]{@link UidCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the active speaker. A `uid` of 0 represents the local user. * @event ActiveSpeaker */ ActiveSpeaker: UidCallback @@ -1588,19 +1398,6 @@ export interface RtcChannelEvents { /** * Occurs when the video size or rotation information of a remote user changes. * - * [`VideoSizeCallback`]{@link VideoSizeCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user or local user (0) whose video size or rotation changes. - * - `width`: *number* - * - * New width (pixels) of the video. - * - `height`: *number* - * - * New height (pixels) of the video. - * - `rotation`: *number* - * - * New rotation of the video [0 to 360). * @event VideoSizeChanged */ VideoSizeChanged: VideoSizeCallback @@ -1608,19 +1405,6 @@ export interface RtcChannelEvents { /** * Occurs when the remote video state changes. * - * [`RemoteVideoStateCallback`]{@link RemoteVideoStateCallback} has the following parameters: - * - `uid`: *number* - * - * ID of the remote user whose video state changes. - * - `state`: [`VideoRemoteState`]{@link VideoRemoteState} - * - * State of the remote video. - * - `reason`: [`VideoRemoteStateReason`]{@link VideoRemoteStateReason} - * - * The reason of the remote video state change. - * - `elapsed`: *number* - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. * * @event RemoteVideoStateChanged */ @@ -1631,19 +1415,6 @@ export interface RtcChannelEvents { * * This callback indicates the state change of the remote audio stream. * - * [`RemoteAudioStateCallback`]{@link RemoteAudioStateCallback } has the following parameters: - * - `uid`: *number* - * - * ID of the user whose audio state changes. - * - `state`: [`AudioRemoteState`]{@link AudioRemoteState} - * - * State of the remote audio. - * - `reason`: [`AudioRemoteStateReason`]{@link AudioRemoteStateReason} - * - * The reason of the remote audio state change. - * - `elapsed`: number - * - * Time elapsed (ms) from the local user calling [`joinChannel`]{@ink RtcEngine.joinChannel} until the SDK triggers this callback. * @event RemoteAudioStateChanged */ RemoteAudioStateChanged: RemoteAudioStateCallback @@ -1653,12 +1424,6 @@ export interface RtcChannelEvents { * * If you call {@link RtcEngine.setLocalPublishFallbackOption} and set option as {@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. * - * [`FallbackCallback`]{@link FallbackCallback} has the following parameters: - * - `isFallbackOrRecover`: *boolean* - * - * Whether the published stream fell back to audio-only or switched back to the video: - * - true: The published stream fell back to audio-only due to poor network conditions. - * - false: The published stream switched back to the video after the network conditions improved. * @event LocalPublishFallbackToAudioOnly */ LocalPublishFallbackToAudioOnly: FallbackCallback @@ -1669,17 +1434,11 @@ export interface RtcChannelEvents { * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves. * * **Note** - * - Once the remote media stream is switched to the low stream due to poor network conditions, you can monitor the stream switch between a high and low stream in the {@link RemoteVideoStats} callback. * - * [`FallbackWithUidCallback`]{@link FallbackWithUidCallback} has the following parameters: - * - `uid`: *number* + * Once the remote media stream is switched to the low stream due to poor network conditions, + * you can monitor the stream switch between a high and low stream in the [`RemoteVideoStats`]{@link RemoteVideoStats} callback. * - * ID of the remote user sending the stream. - * - `isFallbackOrRecover`: *boolean* * - * Whether the remote media stream fell back to audio-only or switched back to the video: - * - true: The remote media stream fell back to audio-only due to poor network conditions. - * - false: The remote media stream switched back to the video stream after the network conditions improved. * @event RemoteSubscribeFallbackToAudioOnly */ RemoteSubscribeFallbackToAudioOnly: FallbackWithUidCallback @@ -1687,10 +1446,6 @@ export interface RtcChannelEvents { /** * Reports the statistics of the {@link RtcEngine} once every two seconds. * - * [`RtcStatsCallback`]{@link RtcStatsCallback} has the following parameters: - * - `stats`: [`RtcStats`]{@link RtcStats} - * - * RTC engine statistics. * @event RtcStats */ RtcStats: RtcStatsCallback @@ -1700,19 +1455,6 @@ export interface RtcChannelEvents { * * Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times. * - * [`NetworkQualityWithUidCallback`]{@link NetworkQualityWithUidCallback} has the following parameters: - * - `uid`: *number* - * - * User ID. The network quality of the user with this uid is reported. - * If `uid` is 0, the local network quality is reported. - * - `txQuality`: [`NetworkQuality`]{@link NetworkQuality} - * - * Uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) - * and jitter of the uplink network. `txQuality` is a quality rating helping you understand how well the current uplink - * network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 680 × 480 and a frame rate of 30 fps, but may be inadequate for resolutions higher than 1280 × 720. - * - `rxQuality`: [`NetworkQuality`]{@link NetworkQuality} - * - * Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network. * @event NetworkQuality */ NetworkQuality: NetworkQualityWithUidCallback @@ -1720,10 +1462,6 @@ export interface RtcChannelEvents { /** * Reports the statistics of the video stream from each remote user/broadcaster. The SDK triggers this callback once every two seconds for each remote user/broadcaster. If a channel includes multiple remote users, the SDK triggers this callback as many times. * - * [`RemoteVideoStatsCallback`]{@link RemoteVideoStatsCallback} has the following parameters: - * - `stats`: [`RemoteVideoStats`]{@link RemoteVideoStats} - * - * Statistics of the received remote video streams. * @event RemoteVideoStats */ RemoteVideoStats: RemoteVideoStatsCallback @@ -1735,10 +1473,6 @@ export interface RtcChannelEvents { * * Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high. * - * [`RemoteAudioStatsCallback`]{@link RemoteAudioStatsCallback} has the following parameters: - * - `stats`: [`RemoteAudioStats`]{@link RemoteAudioStats} - * - * Statistics of the received remote audio streams. * @event RemoteAudioStats */ RemoteAudioStats: RemoteAudioStatsCallback @@ -1750,16 +1484,6 @@ export interface RtcChannelEvents { * * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter. * - * [`RtmpStreamingStateCallback`]{@link RtmpStreamingStateCallback} has the following parameters: - * - `url`: *string* - * - * The RTMP URL address. - * - `state`: *RtmpStreamingState* - * - * The RTMP streaming state. - * - `errCode`: *RtmpStreamingErrorCode* - * - * The detailed error information for streaming. * @event RtmpStreamingStateChanged */ RtmpStreamingStateChanged: RtmpStreamingStateCallback @@ -1780,16 +1504,6 @@ export interface RtcChannelEvents { /** * Reports the status of injecting the online media stream. * - * [`StreamInjectedStatusCallback`]{@link StreamInjectedStatusCallback} has the following parameters: - * - `url`: *string* - * - * The URL address of the externally injected stream. - * - `uid`: *number* - * - * User ID. - * - `status`: [`InjectStreamStatus`]{@link InjectStreamStatus} - * - * State of the externally injected stream. * @event StreamInjectedStatus */ StreamInjectedStatus: StreamInjectedStatusCallback @@ -1799,16 +1513,6 @@ export interface RtcChannelEvents { * * The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the {@link RtcChannel.sendStreamMessage} method. * - * [`StreamMessageCallback`]{@link StreamMessageCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the data stream. - * - `streamId`: *number* - * - * Stream ID. - * - `data`: *string* - * - * Data received by the local user. * @event StreamMessage */ StreamMessage: StreamMessageCallback @@ -1818,21 +1522,6 @@ export interface RtcChannelEvents { * * The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the {@link RtcChannel.sendStreamMessage} method. * - * [`StreamMessageErrorCallback`]{@link StreamMessageErrorCallback} has the following parameters: - * - `uid`: *number* - * - * User ID of the remote user sending the data stream. - * - `streamId`: *number* - * - * Stream ID. - * - `error`: [`ErrorCode`]{@link ErrorCode} - * Error code. - * - `missed`: *number* - * - * The number of lost messages. - * - `cached`: *number* - * - * The number of incoming cached messages when the data stream is interrupted. * @event StreamMessageError */ StreamMessageError: StreamMessageErrorCallback @@ -1842,13 +1531,6 @@ export interface RtcChannelEvents { * * The SDK reports the state of the current media relay and possible error messages in this callback. * - * [`MediaRelayStateCallback`]{@link MediaRelayStateCallback} has the following parameters: - * - `state`: [`ChannelMediaRelayState`]{@link ChannelMediaRelayState} - * - * The state code. - * - `code`: [`ChannelMediaRelayError`]{@link ChannelMediaRelayError} - * - * The error code. * @event ChannelMediaRelayStateChanged */ ChannelMediaRelayStateChanged: MediaRelayStateCallback @@ -1856,10 +1538,6 @@ export interface RtcChannelEvents { /** * Reports events during the media stream relay. * - * [`MediaRelayEventCallback`]{@link MediaRelayEventCallback} has the following parameters: - * - `code`: [`ChannelMediaRelayEvent`]{@link ChannelMediaRelayEvent} - * - * The event code for media stream relay. * @event ChannelMediaRelayEvent */ ChannelMediaRelayEvent: MediaRelayEventCallback @@ -1867,16 +1545,6 @@ export interface RtcChannelEvents { /** * Occurs when the local user receives the metadata. * - * [`MetadataCallback`]{@link MetadataCallback} has the following parameters: - * - `buffer`: *string* - * - * The received metadata. - * - `uid`: *number* - * - * The ID of the user who sent the metadata. - * - `timeStampMs`: *number* - * - * The timestamp (ms) of the received metadata. * @event MetadataReceived */ MetadataReceived: MetadataCallback diff --git a/src/src/RtcRenderView.native.tsx b/src/src/RtcRenderView.native.tsx index 318a808de..b38151e73 100644 --- a/src/src/RtcRenderView.native.tsx +++ b/src/src/RtcRenderView.native.tsx @@ -11,38 +11,17 @@ export interface RtcUidProps { uid: number; } -<<<<<<< HEAD -export interface RtcSurfaceViewProps extends ViewProps { - /** - * Controls whether the surface view's surface is placed on top of another regular surface - * view in the window (but still behind the window itself). - */ -======= /** * Properties of the SurfaceView. - * @property zOrderMediaOverlay: boolean | Control whether the surface view's surface is placed on top of another regular surface view in the window (but still behind the window itself). - * @property zOrderOnTop: boolean | Control whether the surface view's surface is placed on top of its window. - * @property renderMode: number | The rendering mode of the video view. - * @see VideoRenderMode - * @property channelId: string | The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: - * - All lowercase English letters: a to z. - * - All uppercase English letters: A to Z. - * - All numeric characters: 0 to 9. - * - The space character. - * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". - * Note - * - The default value is the empty string "". Use the default value if the user joins the channel using the joinChannel method in the RtcEngine class. - * @see RtcEngine.joinChannel - * - If the user joins the channel using the joinChannel method in the RtcChannel class, set this parameter as the channelId of the RtcChannel object. - * @see RtcChannel.joinChannel - * @property mirrorMode: number | The video mirror mode. - * @see VideoMirrorMode */ export interface RtcSurfaceViewProps { ->>>>>>> rc/3.0.1 + /** + * Controls whether the SurfaceView's surface is placed on top of another + * regular surface view in the window (but still behind the window itself). + */ zOrderMediaOverlay?: boolean; /** - * Controls whether the surface view's surface is placed on top of its window. + * Controls whether the SurfaceView's surface is placed on top of its window. */ zOrderOnTop?: boolean; /** @@ -59,8 +38,8 @@ export interface RtcSurfaceViewProps { * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * * **Note** - * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcEngine` class. - * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel object. + * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcEngine.joinChannel} method in the `RtcEngine` class. + * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel` object. */ channelId?: string; /** The video mirror mode. */ @@ -70,8 +49,7 @@ export interface RtcSurfaceViewProps { /** * Properties of the TextureView. */ -<<<<<<< HEAD -export interface RtcTextureViewProps extends ViewProps { +export interface RtcTextureViewProps { /** * The unique channel name for the AgoraRTC session in the string format. * The string length must be less than 64 bytes. Supported character scopes are: @@ -82,14 +60,11 @@ export interface RtcTextureViewProps extends ViewProps { * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * * **Note** - * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the RtcEngine class. - * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel object. + * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcEngine.joinChannel} method in the `RtcEngine` class. + * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel` object. */ -======= -export interface RtcTextureViewProps { ->>>>>>> rc/3.0.1 channelId?: string; - /** The video mirror. */ + /** The video mirror mode. */ mirror?: boolean; } From 61e48553e0190c9b6e62ecf1eafc0cd7114cac41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Mon, 31 Aug 2020 09:58:33 +0800 Subject: [PATCH 5/9] documentation update --- src/src/Classes.ts | 185 +++++++++++++++++++++++++++++++++-- src/src/Enums.ts | 15 +-- src/src/RtcChannel.native.ts | 24 ++--- src/src/RtcEngine.native.ts | 34 ++++--- src/src/RtcEvents.ts | 33 +++---- 5 files changed, 232 insertions(+), 59 deletions(-) diff --git a/src/src/Classes.ts b/src/src/Classes.ts index 8d99d68bb..632d467df 100644 --- a/src/src/Classes.ts +++ b/src/src/Classes.ts @@ -70,8 +70,181 @@ export class VideoEncoderConfiguration { */ minFrameRate?: VideoFrameRate /** - * Bitrate of the video (Kbps). Refer to the table below and set your bitrate. If you set a bitrate beyond the proper range, - * the SDK automatically adjusts it to a value within the range. + * Bitrate of the video (Kbps). Refer to the table below and set your bitrate. If you set a bitrate beyond the proper range, the SDK automatically adjusts it to a value within the range. + * You can also choose from the following options: + * - [`Standard`]{@link BitRate.Standard}: (Recommended) The standard bitrate mode. In this mode, the bitrates differ between the `LiveBroadcasting` and `Communication` profiles: + * - In the `Communication` profile, the video bitrate is the same as the base bitrate. + * - In the `LiveBroadcasting` profile, the video bitrate is twice the base bitrate. + * - [`Compatible`]{@link BitRate.Compatible}: The compatible bitrate mode. In this mode, the bitrate stays the same regardless of the profile. If you choose this mode for the `LiveBroadcasting` profile, the video frame rate may be lower than the set value. + * + * Agora uses different video codecs for different profiles to optimize the user experience. For example, the Communication profile prioritizes the smoothness while the `LiveBroadcasting` profile prioritizes the video quality (a higher bitrate). Therefore, We recommend setting this parameter as [`Standard`]{@link BitRate.Standard}. + * + * **Video Bitrate Table** + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
ResolutionFrame rate

(fps)

Base Bitrate

(Kbps, for Communication)

Live Bitrate

(Kbps, for Live Broadcasting)

160*1201565130
120*1201550100
320*18015140280
180*18015100200
240*18015120240
320*24015200400
240*24015140280
424*24015220440
640*36015400800
360*36015260520
640*360306001200
360*36030400800
480*36015320640
480*36030490980
640*480155001000
480*48015400800
640*480307501500
480*480306001200
848*480156101220
848*480309301860
640*48010400800
1280*7201511302260
1280*7203017103420
960*720159101820
960*7203013802760
+ * + * **Note** + * + * The base bitrate in this table applies to the Communication profile. + * The `LiveBroadcasting` profile generally requires a higher bitrate for better video quality. + * We recommend setting the bitrate mode as [`Standard`]{@link BitRate.Standard}. You can also set the bitrate as the base bitrate value × 2. + * */ bitrate?: number /** @@ -683,19 +856,19 @@ export interface AudioVolumeInfo { */ export interface Rect { /** - * The x coordinate of the left side of the rectangular area. + * The horizontal coordinate of the left side of the rectangular area. */ left: number /** - * The y coordinate of the upper side of the rectangular area. + * The vertical coordinate of the upper side of the rectangular area. */ top: number /** - * The x coordinate of the right side of the rectangular area. + * The horizontal coordinate of the right side of the rectangular area. */ right: number /** - * The y coordinate of the bottom side of the rectangular area. + * The vertical coordinate of the bottom side of the rectangular area. */ bottom: number } diff --git a/src/src/Enums.ts b/src/src/Enums.ts index 42ecb8a79..d7304189c 100644 --- a/src/src/Enums.ts +++ b/src/src/Enums.ts @@ -644,8 +644,7 @@ export enum CameraCaptureOutputPreference { */ Auto = 0, /** - * 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration. - * [`setVideoEncoderConfiguration`]{@link RtcEngine.setVideoEncoderConfiguration} + * 1: Prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by [`setVideoEncoderConfiguration`]{@link RtcEngine.setVideoEncoderConfiguration}. */ Performance = 1, /** @@ -731,7 +730,7 @@ export enum ChannelMediaRelayError { } /** - * The event code in AgoraChannelMediaRelayEvent. + * The event code in `ChannelMediaRelayEvent`. * @enum {number} */ export enum ChannelMediaRelayEvent { @@ -740,7 +739,7 @@ export enum ChannelMediaRelayEvent { */ Disconnect = 0, /** - * 1: The network reconnects.//TODO 为什么是 reconnects? + * 1: The network reconnects. */ Connected = 1, /** @@ -947,9 +946,9 @@ export enum ConnectionStateType { * 4: The SDK keeps rejoining the channel after being disconnected from a joined channel because of network issues. * - If the SDK cannot rejoin the channel within 10 seconds after being disconnected from Agora’s edge server, the SDK triggers the [`ConnectionLost`]{@link RtcEngineEvents.ConnectionLost} callback, stays in the [`Reconnecting`]{@link ConnectionStateType.Reconnecting} state, and keeps rejoining the channel. * - * - If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora’s edge server, the SDK triggers the [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback, switches to the Failed state, and stops rejoining the channel. + * - If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora’s edge server, the SDK triggers the [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} callback, switches to the [`Failed`]{@link ConnectionStateType.Failed} state, and stops rejoining the channel. * [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged} - * @see [`Failed`]{@link ConnectionStateType.Failed} + * */ Reconnecting = 4, /** @@ -2384,7 +2383,9 @@ export enum WarningCode { /** * 105: The server rejects the request to look up the channel. * The server cannot process this request or the request is illegal. - * **DEPRECATED** Use [`RejectedByServer(10)`]{@link ConnectionChangedReason.RejectedByServer} in the reason parameter + * **Deprecated** + * + * Use [`RejectedByServer(10)`]{@link ConnectionChangedReason.RejectedByServer} in the reason parameter * of [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged}. * */ diff --git a/src/src/RtcChannel.native.ts b/src/src/RtcChannel.native.ts index 9edb3b9c9..28c0ca022 100644 --- a/src/src/RtcChannel.native.ts +++ b/src/src/RtcChannel.native.ts @@ -83,7 +83,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Destroys all [`RtcChannel`]{@link RtcChannel} instance. + * Destroys all [`RtcChannel`]{@link RtcChannel} instances. */ static destroyAll() { channels.forEach(async (value, key) => { @@ -103,11 +103,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Adds the channel event handler. + * Adds the [`RtcChannelEvents`]{@link RtcChannelEvents} handler. * - * After setting the channel event handler, you can listen for channel events and receive the statistics of the corresponding [`RtcChannel`]{@link RtcChannel} instance. + * After setting the [`RtcChannelEvents`]{@link RtcChannelEvents} handler, you can listen for channel events and receive the statistics of the corresponding [`RtcChannel`]{@link RtcChannel} instance. * @param event The event type. - * @param listener The event handler. + * @param listener The [`RtcChannelEvents`]{@link RtcChannelEvents} handler. */ addListener(event: EventType, listener: RtcChannelEvents[EventType]): Subscription { const callback = (res: any) => { @@ -132,11 +132,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Removes the channel event handler. + * Removes the [`RtcChannelEvents`]{@link RtcChannelEvents} handler. * * For callback events that you only want to listen for once, call this method to remove the specific [`RtcEngineEvents`]{@link RtcEngineEvents} objects after you have received them. * @param event The event type. - * @param listener The event handler. + * @param listener The [`RtcChannelEvents`]{@link RtcChannelEvents} handler. */ removeListener(event: EventType, listener: RtcChannelEvents[EventType]) { const map = this._listeners.get(event); @@ -146,7 +146,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Removes all of the engine event handlers. + * Removes all the [`RtcChannelEvents`]{@link RtcChannelEvents} handlers. * @param event The event type. */ removeAllListeners(event?: EventType) { @@ -188,10 +188,10 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the [`RtcEngine`]{@link RtcEngine} instance. * * @param token The token generated at your server. - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. - * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param optionalInfo Additional information about the channel. This parameter can be set as null. Other users in the channel do not receive this information. - * @param optionalUid The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If uid is not assigned (or set as 0), the SDK assigns a uid and reports it in the onJoinChannelSuccess callback. The app must maintain this user ID. + * @param optionalUid The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If uid is not assigned (or set as 0), the SDK assigns a uid and reports it in the [`JoinChannelSuccess`]{@link RtcChannelEvents.JoinChannelSuccess} callback. The app must maintain this user ID. * @param options The channel media options. * */ @@ -260,7 +260,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Publishes the local stream to the channel. * You must keep the following restrictions in mind when calling this method. - * Otherwise, the SDK returns the [`Refused(-5)`]{@link ErrorCode.Refused}: + * Otherwise, the SDK returns the [`Refused(-5)`]{@link ErrorCode.Refused}: * - This method publishes one stream only to the channel corresponding to the current [`RtcChannel`]{@link RtcChannel} instance. * - In a Live-Broadcast channel, only a host can call this method. To switch the client role, call [`setClientRole`]{@link RtcChannel.setClientRole} of the current [`RtcChannel`]{@link RtcChannel} instance. * - You can publish a stream to only one channel at a time. For details, see the advanced guide Join Multiple Channels. @@ -611,7 +611,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * **Note** * - Do not use this method for CDN streaming. - * - Before calling this method, ensure that you have called [`setEncryptionSecret`]{@link RtcEngine.setEncryptionSecret} to enable encryption. + * - Before calling this method, ensure that you have called [`setEncryptionSecret`]{@link RtcChannel.setEncryptionSecret} to enable encryption. * * @param encryptionMode Sets the encryption mode. * diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index 1cfc62591..992dc70b8 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -89,7 +89,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * @param appId The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id). * Only users in apps with the same App ID can join the same channel and communicate with each other. * Use an App ID to create only one [`RtcEngine`]{@link RtcEngine} instance. To change your App ID, call [`destroy`]{@link destroy} to destroy the current [`RtcEngine`]{@link RtcEngine} instance, and after [`destroy`]{@link destroy} returns `0`, - * call [`create`]{@link create} to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. + * call `create` to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. */ static async create(appId: string): Promise { return RtcEngine.createWithAreaCode(appId, IPAreaCode.AREA_GLOBAL) @@ -104,12 +104,13 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`create`]{@link create}. The difference between [`create`]{@link create} and this method is that this method enables you to specify the connection area. - * - The Agora React Native SDK supports creating only one {@link RtcEngine} instance for an app. + * - The Agora React Native SDK supports creating only one [`RtcEngine`]{@link RtcEngine} instance for an app. * @param appId The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id). * Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only one [`RtcEngine`]{@link RtcEngine} instance. * To change your App ID, call [`destroy`]{@link destroy} to destroy the current [`RtcEngine`]{@link RtcEngine} instance and after [`destroy`]{@link destroy} returns `0`, call [`create`]{@link create} to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. * @param areaCode The area of connection. This advanced feature applies to scenarios that have regional restrictions. * You can use the bitwise OR operator (|) to specify multiple areas. For details, see {@link IPAreaCode}. + * * After specifying the region, the app that integrates the Agora SDK connects to the Agora servers within that region. */ static async createWithAreaCode(appId: string, areaCode: IPAreaCode): Promise { @@ -201,10 +202,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Sets the channel profile of the Agora {@link RtcEngine}. + * Sets the channel profile of the Agora [`RtcEngine`]{@link RtcEngine}. * * The Agora [`RtcEngine`]{@link RtcEngine} differentiates channel profiles and applies different optimization algorithms accordingly. - * For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for a video broadcast. + * For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for live interactive video streaming. * @param profile The channel profile of the Agora [`RtcEngine`]{@link RtcEngine}. * */ @@ -217,7 +218,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * This method sets the role of a user, such as a host or an audience (default), before joining a channel. * - * This method can be used to switch the user role after a user joins a channel. In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful [`setClientRole`]{@link setClientRole }method call triggers the following callbacks: + * This method can be used to switch the user role after a user joins a channel. In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful call of this method triggers the following callbacks: * - The local client: [`ClientRoleChanged`]{@link RtcEngineEvents.ClientRoleChanged}. * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} or [`UserOffline`]{@link RtcEngineEvents.UserOffline} ([`BecomeAudience`]{@link UserOfflineReason.BecomeAudience}). * @@ -248,9 +249,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * A channel does not accept duplicate uids, such as two users with the same `uid`. If you set `uid` as `0`, the system automatically assigns a uid. * - * **Warning:** + * **Warning** * - * Ensure that the App ID used for creating the token is the same App ID used in the [`create`]{@link create} method for creating an {@link RtcEngine} object. Otherwise, CDN live streaming may fail. + * Ensure that the App ID used for creating the token is the same App ID used in the `create` method for creating an [`RtcEngine`]{@link RtcEngine} object. Otherwise, CDN live streaming may fail. * * @param token The token for authentication: * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). @@ -405,7 +406,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * Ensure that you call this method immediately after calling the [`create`]{@link create} method, otherwise the output log may not be complete. + * Ensure that you call this method immediately after calling the `create` method, otherwise the output log may not be complete. * * @param filePath File path of the log file. The string of the log file is in UTF-8. The default file path is `/storage/emulated/0/Android/data/="">/files/agorasdk.log`. */ @@ -667,7 +668,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method does not affect receiving or playing the remote audio streams, and `enableLocalAudio(false)` is applicable to scenarios * where the user wants to receive remote audio streams without sending any audio stream to other users in the channel. * - * The SDK triggers the [`MicrophoneEnabled`]{@link RtcEngineEvents.MicrophoneEnabled} callback once the local audio function is disabled or re-enabled. + * Once the local audio function is disabled or re-enabled, the SDK triggers the [`LocalAudioStateChanged`]{@link RtcEngineEvents.LocalAudioStateChanged} callback, which reports [`Stopped`]{@link AudioLocalState.Stopped} or [`Recording`]{@link AudioLocalState.Recording}. + * The SDK triggers the [`LocalAudioStateChanged`]{@link RtcEngineEvents.LocalAudioStateChanged} callback once the local audio function is disabled or re-enabled. * * **Note** * @@ -740,7 +742,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - You must call this method before calling [`joinChannel`]{@link joinChannel}. * - In the [Communication]{@link ChannelProfile.Communication} and [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. - * - In scenarios requiring high-quality audio, we recommend setting profile as [`ShowRoom(4)`]{@link AudioScenario.ShowRoom} and scenario as [`GameStreaming(3)`]{@link AudioScenario.GameStreaming}. + * - In scenarios requiring high-quality audio, we recommend setting profile as [`MusicHighQuality(4)`]{@link AudioProfile.MusicHighQuality} and scenario as [`GameStreaming(3)`]{@link AudioScenario.GameStreaming}. * For example, for music education scenarios. * * @param profile Sets the sample rate, bitrate, encoding mode, and the number of channels. @@ -841,7 +843,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - This method affects the internal engine and can be called after calling the {@link leaveChannel} method. You can call this method either before or after joining a channel. + * - This method affects the internal engine and can be called after calling the [`leaveChannel`]{@link leaveChannel} method. You can call this method either before or after joining a channel. * * - This method resets the internal engine and takes some time to take effect. * We recommend using the following API methods to control the video engine modules separately: @@ -1117,10 +1119,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * You can choose whether the other user can hear the local audio playback and specify the number of playback loops. * When the audio mixing file playback finishes after calling this method, the SDK triggers the [`AudioMixingFinished`]{@link RtcEngineEvents.AudioMixingFinished} callback. * - * A successful call of this method triggers the [`AudioMixingStateChanged(Playing)`]{@link RtcEngineEvents.AudioMixingStateChanged} callback on the local client. + * A successful call of this method triggers the [`AudioMixingStateChanged`]{@link RtcEngineEvents.AudioMixingStateChanged} callback and reports [`Playing`]{@link AudioMixingStateCode.Playing} on the local client. * * - * When the audio mixing file playback finishes, the SDK triggers the [`AudioMixingStateChanged(Stopped)`]{@link RtcEngineEvents.AudioMixingStateChanged} callback on the local client. + * When the audio mixing file playback finishes, the SDK triggers the [`AudioMixingStateChanged`]{@link RtcEngineEvents.AudioMixingStateChanged} callback and reports [`Stopped`]{@link AudioMixingStateCode.Stopped} on the local client. * * * **Note** @@ -1435,7 +1437,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Removes an RTMP stream from the CDN. * - * This method removes the RTMP URL address (added by {@link addPublishStreamUrl}) from a CDN live stream. + * This method removes the RTMP URL address (added by [`addPublishStreamUrl`]{@link addPublishStreamUrl}) from a CDN live stream. * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback. * * **Note** @@ -1508,7 +1510,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback with the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} - * or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerNoResponse} state code. + * or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerConnectionLost} state code. * You can leave the channel by calling [`leaveChannel`]{@link leaveChannel}, and the media stream relay automatically stops. * */ @@ -1943,7 +1945,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Ensure that the directory to save the recording file exists and is writable. * - This method is usually called after calling [`joinChannel`]{@link joinChannel}. The recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. - * - For better recording effects, set quality as [`AUDIO_RECORDING_QUALITY_MEDIUM`]{@link AudioRecordingQuality.Medium} or [`AUDIO_RECORDING_QUALITY_HIGH`]{@link AudioRecordingQuality.High} when sampleRate is 44.1 kHz or 48 kHz. + * - For better recording effects, set quality as [`Medium`]{@link AudioRecordingQuality.Medium} or [`High`]{@link AudioRecordingQuality.High} when sampleRate is 44.1 kHz or 48 kHz. * * @param filePath Absolute file path (including the suffixes of the filename) of the recording file. The string of the file name is in UTF-8. For example, `/sdcard/emulated/0/audio/aac`. * @param sampleRate Sample rate (Hz) of the recording file. diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index a34f2a52a..2807fb708 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -446,10 +446,6 @@ export interface RtcEngineEvents { * * For instance, the SDK may report a [`LookupChannelTimeout`]{@link WarningCode.LookupChannelTimeout} warning upon disconnection with the server and tries to reconnect. For detailed warning codes, see [`WarningCode`]{@link WarningCode}. * - * [`WarningCallback`]{@link WarningCallback} has the following parameters: - * - `warn`: [`WarningCode`]{@link WarningCode} - * Warning code. See [`WarningCode`]{@link WarningCode}. - * * @event Warning */ Warning: WarningCallback @@ -495,7 +491,7 @@ export interface RtcEngineEvents { /** * Occurs when a user leaves the channel. * - * When the app calls the {@link RtcEngine.leaveChannel} method, the SDK uses this callback to notify the app when the user leaves the channel. + * When the app calls the [`leaveChannel`]{@link RtcEngine.leaveChannel} method, the SDK uses this callback to notify the app when the user leaves the channel. * * With this callback, the application retrieves the channel information, such as the call duration and statistics. * @@ -534,7 +530,7 @@ export interface RtcEngineEvents { /** * Occurs when a remote user ([`Communication`]{@link ChannelProfile.Communication})/host ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting}) joins the channel. * - [`Communication`]{@link ChannelProfile.Communication} profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users. - * - [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel + * - [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel. * * The SDK triggers this callback under one of the following circumstances: * - A remote user/host joins the channel by calling [`joinChannel`]{@link RtcEngine.joinChannel}. @@ -543,7 +539,7 @@ export interface RtcEngineEvents { * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcEngine.addInjectStreamUrl}. * * **Note** - * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: + * In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: * - The host receives the [`UserJoined`]{@link UserJoined} callback when another host joins the channel. * - The audience in the channel receives the [`UserJoined`]{@link UserJoined} callback when a new host joins the channel. * - When a web application joins the channel, the [`UserJoined`]{@link UserJoined} callback is triggered as long as the web application publishes streams. @@ -584,7 +580,7 @@ export interface RtcEngineEvents { /** * Occurs when the SDK cannot reconnect to Agora's edge server 10 seconds after its connection to the server is interrupted. * - * The SDK triggers this callback when it cannot connect to the server 10 seconds after calling {@link RtcEngine.joinChannel}, regardless of whether it is in the channel or not. + * The SDK triggers this callback when it cannot connect to the server 10 seconds after calling [`joinChannel`]{@link RtcEngine.joinChannel}, regardless of whether it is in the channel or not. * * If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel. * @@ -595,7 +591,7 @@ export interface RtcEngineEvents { /** * Occurs when the token expires in 30 seconds. * - * The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call {@link RtcEngine.renewToken} to pass the new token to the SDK. + * The user becomes offline if the token used when joining the channel expires. This callback is triggered 30 seconds before the token expires to remind the app to get a new token. Upon receiving this callback, you need to generate a new token on the server and call [`renewToken`]{@link RtcEngine.renewToken} to pass the new token to the SDK. * * @event TokenPrivilegeWillExpire */ @@ -665,6 +661,7 @@ export interface RtcEngineEvents { * Occurs when a remote user stops/resumes sending the video stream. * * **Deprecated** + * * This callback is deprecated. Use the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters for the same function: * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. @@ -890,7 +887,7 @@ export interface RtcEngineEvents { * Occurs when the state of the local user's audio mixing file changes. * * When you call [`startAudioMixing`]{@link RtcEngine.startAudioMixing} and the state of audio mixing file changes, the Agora SDK triggers this callback. - * - When the audio mixing file plays, pauses playing, or stops playing, this callback returns [`710`]{@link AudioMixingStateCode.Playing}, `711`, or `713` in state, and `0` in errorCode. + * - When the audio mixing file plays, pauses playing, or stops playing, this callback returns `710`, `711`, or `713` in state, and `0` in errorCode. * - When exceptions occur during playback, this callback returns `714` in state and an error in errorCode. * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns [`AudioMixingOpenError`]{@link WarningCode.AudioMixingOpenError}. * @@ -923,10 +920,10 @@ export interface RtcEngineEvents { /** * Occurs when the publisher's transcoding settings are updated. * - * When the LiveTranscoding class in the {@link RtcEngine.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. + * When the `LiveTranscoding` class in the [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * * **Note** - * - If you call {@link RtcEngine.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. + * - If you call [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * * @event TranscodingUpdated */ @@ -1259,14 +1256,14 @@ export interface RtcEngineEvents { */ export interface RtcChannelEvents { /** - * Reports the warning code of the {@link RtcChannel} instance. + * Reports the warning code of the [`RtcChannel`]{@link RtcChannel} instance. * * @event Warning */ Warning: WarningCallback /** - * Reports the error code of the {@link RtcChannel} instance. + * Reports the error code of the [`RtcChannel`]{@link RtcChannel} instance. * * @event Error */ @@ -1422,7 +1419,7 @@ export interface RtcChannelEvents { /** * Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. * - * If you call {@link RtcEngine.setLocalPublishFallbackOption} and set option as {@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. + * If you call {@link RtcEngine.setLocalPublishFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. * * @event LocalPublishFallbackToAudioOnly */ @@ -1444,7 +1441,7 @@ export interface RtcChannelEvents { RemoteSubscribeFallbackToAudioOnly: FallbackWithUidCallback /** - * Reports the statistics of the {@link RtcEngine} once every two seconds. + * Reports the statistics of the [`RtcEngine`]{@link RtcEngine} once every two seconds. * * @event RtcStats */ @@ -1480,7 +1477,7 @@ export interface RtcChannelEvents { /** * Occurs when the state of the RTMP streaming changes. * - * The SDK triggers this callback to report the result of the local user calling the {@link RtcChannel.addPublishStreamUrl} or {@link RtcChannel.removePublishStreamUrl} method. This callback returns the URL and its current streaming state. When the streaming state is {@link RtmpStreamingState.Failure}, see the errCode parameter for details. + * The SDK triggers this callback to report the result of the local user calling the [`addPublishStreamUrl`]{@link RtcChannel.addPublishStreamUrl} or [`removePublishStreamUrl`]{@link RtcChannel.removePublishStreamUrl} method. This callback returns the URL and its current streaming state. When the streaming state is [`Failure`]{@link RtmpStreamingState.Failure}, see the errCode parameter for details. * * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter. * @@ -1520,7 +1517,7 @@ export interface RtcChannelEvents { /** * Occurs when the local user fails to receive a remote data stream. * - * The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the {@link RtcChannel.sendStreamMessage} method. + * The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the [`sendStreamMessage`]{@link RtcChannel.sendStreamMessage} method. * * @event StreamMessageError */ From 542f3cec6c0476505b5c3ec2fb3aeb2028bdd457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Fri, 4 Sep 2020 09:48:09 +0800 Subject: [PATCH 6/9] update documentation --- package.json | 3 +- src/RtcLocalView.tsx | 17 +++- src/RtcRemoteView.tsx | 10 +-- src/src/Classes.ts | 146 +++++++++++++++++++++++++++------ src/src/Enums.ts | 2 +- src/src/RtcChannel.native.ts | 75 ++++++++++------- src/src/RtcEngine.native.ts | 153 ++++++++++++++++++++++++++--------- src/src/RtcEvents.ts | 36 ++++++--- 8 files changed, 324 insertions(+), 118 deletions(-) diff --git a/package.json b/package.json index dd1655028..fffc2e176 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,8 @@ "jest": "^24.9.0", "metro-react-native-babel-preset": "^0.56.0", "react-test-renderer": "16.9.0", - "typescript": "^3.7.3" + "typedoc-plugin-no-inherit": "^1.1.10", + "typescript": "^4.0.2" }, "jest": { "preset": "react-native", diff --git a/src/RtcLocalView.tsx b/src/RtcLocalView.tsx index 0c5c3e187..f9731022e 100644 --- a/src/RtcLocalView.tsx +++ b/src/RtcLocalView.tsx @@ -4,8 +4,13 @@ import {Platform, ViewProps} from "react-native"; import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps} from "./src/RtcRenderView.native"; /** - * Use SurfaceView in Android. - * Use UIView in iOS. + * The SurfaceView class. + * + * **Note** + * + * SurfaceView only applies to Android. Use UIView on iOS. + * + * @noInheritDoc */ class SurfaceView extends Component { render() { @@ -18,8 +23,12 @@ class SurfaceView extends Component { } /** - * Use TextureView in Android. - * Not support for iOS. + * The TextureView class. + * + * **Note** + * + * TextureView only applies to Android. iOS does not support TextureView. + * @noInheritDoc */ class TextureView extends Component { render() { diff --git a/src/RtcRemoteView.tsx b/src/RtcRemoteView.tsx index 2bbaa2cc7..43b29ac12 100644 --- a/src/RtcRemoteView.tsx +++ b/src/RtcRemoteView.tsx @@ -9,10 +9,7 @@ import { RtcUidProps } from "./src/RtcRenderView.native"; -/** - * Use SurfaceView in Android. - * Use UIView in iOS. - */ + class SurfaceView extends Component { render() { return ( @@ -21,10 +18,7 @@ class SurfaceView extends Component { render() { if (Platform.OS === 'ios') diff --git a/src/src/Classes.ts b/src/src/Classes.ts index 632d467df..324ab40bb 100644 --- a/src/src/Classes.ts +++ b/src/src/Classes.ts @@ -43,7 +43,9 @@ export class VideoDimensions { * The video resolution on the vertical axis. */ height: number - + /** + * @ignore + */ constructor(width: number, height: number) { this.width = width; this.height = height; @@ -58,6 +60,32 @@ export class VideoEncoderConfiguration { /** * The video frame dimensions (px), which is used to specify the video quality and measured by the total number of pixels along a * frame's width and height. The default value is 640 × 360. + * You can customize the dimension, or select from the following list: + *
    + *
  • 120x120
  • + *
  • 160x120
  • + *
  • 180x180
  • + *
  • 240x180
  • + *
  • 320x180
  • + *
  • 240x240
  • + *
  • 320x240
  • + *
  • 424x240
  • + *
  • 360x360
  • + *
  • 480x360
  • + *
  • 640x360
  • + *
  • 480x480
  • + *
  • 640x480
  • + *
  • 840x480
  • + *
  • 960x720
  • + *
  • 1280x720
  • + *
+ * + * **Note** + *
    + *
  • The value of the dimension does not indicate the orientation mode of the output ratio. For how to set the video orientation, see [`VideoOutputOrientationMode`]{@link VideoOutputOrientationMode}.
  • + *
  • Whether 720p+ can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the one listed in the table.
  • + *
+ * */ dimensions?: VideoDimensions /** @@ -264,7 +292,9 @@ export class VideoEncoderConfiguration { * Sets the mirror mode of the published local video stream. */ mirrorMode?: VideoMirrorMode - + /** + * @ignore + */ constructor({dimensions, frameRate, minFrameRate, bitrate, minBitrate, orientationMode, degradationPrefer, mirrorMode}: { dimensions?: VideoDimensions, frameRate?: VideoFrameRate, minFrameRate?: VideoFrameRate, bitrate?: number, minBitrate?: number, orientationMode?: VideoOutputOrientationMode, degradationPrefer?: DegradationPreference, mirrorMode?: VideoMirrorMode }) { this.dimensions = dimensions; this.frameRate = frameRate; @@ -299,7 +329,9 @@ export class BeautyOptions { * The default value is 0.1. This parameter adjusts the red saturation level. */ rednessLevel?: number - + /** + * @ignore + */ constructor({lighteningContrastLevel, lighteningLevel, smoothnessLevel, rednessLevel}: { lighteningContrastLevel?: LighteningContrastLevel, lighteningLevel?: number, smoothnessLevel?: number, rednessLevel?: number }) { this.lighteningContrastLevel = lighteningContrastLevel; this.lighteningLevel = lighteningLevel; @@ -332,7 +364,9 @@ export class AgoraImage { * Height of the image on the broadcasting video. */ height: number - + /** + * @ignore + */ constructor(url: string, x: number, y: number, width: number, height: number) { this.url = url; this.x = x; @@ -371,14 +405,28 @@ export class TranscodingUser { */ zOrder?: number /** - * The transparency of the video frame of the user in the CDN live stream that ranges between 0.0 and 1.0. 0.0 means that the video frame is completely transparent and 1.0 means opaque. The default value is 1.0. + * The transparency of the video frame of the user in the CDN live streaming that ranges between 0.0 and 1.0. 0.0 means that the video frame is completely transparent and 1.0 means opaque. The default value is 1.0. */ alpha?: number /** * The audio channel ranging between 0 and 5. The default value is 0. + * + * - 0: (default) Supports dual channels. Depends on the upstream of the broadcaster. + * - 1: The audio stream of the broadcaster uses the FL audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. + * - 2: The audio stream of the broadcaster uses the FC audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. + * - 3: The audio stream of the broadcaster uses the FR audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. + * - 4: The audio stream of the broadcaster uses the BL audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. + * - 5: The audio stream of the broadcaster uses the BR audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. + * + * **Note** + * + * Special players are needed if `audioChannel` is not set as 0. + * */ audioChannel?: AudioChannel - + /** + * @ignore + */ constructor(uid: number, x: number, y: number, {width, height, zOrder, alpha, audioChannel}: { width?: number, height?: number, zOrder?: number, alpha?: number, audioChannel?: AudioChannel }) { this.uid = uid; this.x = x; @@ -408,7 +456,9 @@ export class Color { * Blue. */ blue: number - + /** + * @ignore + */ constructor(red: number, green: number, blue: number) { this.red = red; this.green = green; @@ -470,7 +520,14 @@ export class LiveTranscoding { */ audioBitrate?: number /** - * Agora self-defined audio channel type. We recommend choosing `1` or `2`. Special players are required if you choose `3`, `4` or `5`. + * The number of audio channels for the CDN live stream. + * + * Agora recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose 3, 4, or 5. + * - 1: (Default) Mono + * - 2: Stereo + * - 3: Three audio channels + * - 4: Four audio channels + * - 5: Five audio channels */ audioChannels?: AudioChannel /** @@ -493,7 +550,9 @@ export class LiveTranscoding { * An TranscodingUser object managing the user layout configuration in the CDN live stream. Agora supports a maximum of 17 transcoding users in a CDN live stream channel. */ transcodingUsers: TranscodingUser[] - + /** + * @ignore + */ constructor(transcodingUsers: TranscodingUser[], {width, height, videoBitrate, videoFramerate, lowLatency, videoGop, watermark, backgroundImage, audioSampleRate, audioBitrate, audioChannels, audioCodecProfile, videoCodecProfile, backgroundColor, userConfigExtraInfo}: { width?: number, height?: number, videoBitrate?: number, videoFramerate?: VideoFrameRate, lowLatency?: boolean, videoGop?: number, watermark?: AgoraImage, backgroundImage?: AgoraImage, audioSampleRate?: AudioSampleRateType, audioBitrate?: number, audioChannels?: AudioChannel, audioCodecProfile?: AudioCodecProfileType, videoCodecProfile?: VideoCodecProfileType, backgroundColor?: Color, userConfigExtraInfo?: string, }) { this.width = width; this.height = height; @@ -530,7 +589,9 @@ export class ChannelMediaInfo { * The user ID. */ uid: number - + /** + * @ignore + */ constructor(uid: number, {channelName, token}: { channelName?: string, token?: string }) { this.channelName = channelName; this.token = token; @@ -543,14 +604,26 @@ export class ChannelMediaInfo { */ export class ChannelMediaRelayConfiguration { /** - * Sets the information of the source channel. + * The information of the source channel: [`ChannelMediaInfo`]{@link ChannelMediaInfo}. It contains the following members: + * - `channelName`: The name of the source channel. The default value is null, which means the SDK applies the name of the current channel. + * - `uid`: ID of the host whose media stream you want to relay. The default value is 0, which means the SDK generates a random UID. You must set it as 0. + * - `token`: The token for joining the source channel. It is generated with the `channelName` and `uid` you set in `srcInfo`. + * - If you have not enabled the App Certificate, set this parameter as the default value null, which means the SDK applies the App ID. + * - If you have enabled the App Certificate, you must use the token generated with the `channelName` and `uid`, and the `uid` must be set as 0. */ srcInfo: ChannelMediaInfo /** - * Sets the information of the destination channel. + * The information of the destination channel: [`ChannelMediaInfo`]{@link ChannelMediaInfo}. It contains the following members: + * - `channelName`: The name of the destination channel. + * - `uid`: ID of the host in the destination channel. The value ranges from 0 to (232-1). To avoid UID conflicts, this uid must be different from any other UIDs in the destination channel. The default value is 0, which means the SDK generates a random UID. + * - `token`: The token for joining the source channel. It is generated with the `channelName` and `uid` you set in `destInfo`. + * - If you have not enabled the App Certificate, set this parameter as the default value null, which means the SDK applies the App ID. + * - If you have enabled the App Certificate, you must use the token generated with the `channelName` and `uid`, and the `uid` must be set as 0. */ destInfos: ChannelMediaInfo[] - + /** + * @ignore + */ constructor(srcInfo: ChannelMediaInfo, destInfos: ChannelMediaInfo[]) { this.srcInfo = srcInfo; this.destInfos = destInfos; @@ -577,7 +650,9 @@ export class LastmileProbeConfig { * The expected maximum receive bitrate in bps in range of [100000,5000000]. */ expectedDownlinkBitrate: number - + /** + * @ignore + */ constructor(probeUplink: boolean, probeDownlink: boolean, expectedUplinkBitrate: number, expectedDownlinkBitrate: number) { this.probeUplink = probeUplink; this.probeDownlink = probeDownlink; @@ -606,7 +681,9 @@ export class Rectangle { * The height (pixels) of the watermark image. */ height: number - + /** + * @ignore + */ constructor(x: number, y: number, width: number, height: number) { this.x = x; this.y = y; @@ -633,7 +710,9 @@ export class WatermarkOptions { * The watermark position in the portrait mode. */ positionInPortraitMode: Rectangle - + /** + * @ignore + */ constructor(positionInLandscapeMode: Rectangle, positionInPortraitMode: Rectangle, visibleInPreview?: boolean) { this.visibleInPreview = visibleInPreview; this.positionInLandscapeMode = positionInLandscapeMode; @@ -642,15 +721,15 @@ export class WatermarkOptions { } /** - * Configuration of the imported live broadcast voice or video stream. + * Configuration of the imported live interactive voice or video stream. */ export class LiveInjectStreamConfig { /** - * Width of the added stream to the live interactive streaming. The default value is 0, which is the same width as the original stream. + * Width (pixels) of the added stream to the live interactive streaming. The default value is 0, which is the same width as the original stream. */ width?: number /** - * Height of the added stream to the live interactive streaming. The default value is 0, which is the same height as the original stream. + * Height (pixels) of the added stream to the live interactive streaming. The default value is 0, which is the same height as the original stream. */ height?: number /** @@ -666,18 +745,27 @@ export class LiveInjectStreamConfig { */ videoBitrate?: number /** - * Audio sample rate of the added stream to the live interactive streaming: AudioSampleRateType. The default value is 44100 Hz. + * Audio sample rate of the added stream to the live interactive streaming. The default value is 44100 Hz. */ audioSampleRate?: AudioSampleRateType /** - * Audio bitrate of the added stream to the live interactive streaming. The default value is 48. + * Audio bitrate of the added stream to the live interactive streaming. The default value is 48 Kbps. */ audioBitrate?: number /** - * Audio channels to add into the live interactive streaming. The value ranges between `1` and `2`. The default value is `1`. + * Audio channels to be added to the live interactive streaming. + * + * Agora recommends choosing 1 (mono), or 2 (stereo) audio channels. Special players are required if you choose 3, 4, or 5. + * - 1: (Default) Mono + * - 2: Stereo + * - 3: Three audio channels + * - 4: Four audio channels + * - 5: Five audio channels */ audioChannels?: AudioChannel - + /** + * @ignore + */ constructor({width, height, videoGop, videoFramerate, videoBitrate, audioSampleRate, audioBitrate, audioChannels}: { width?: number, height?: number, videoGop?: number, videoFramerate?: VideoFrameRate, videoBitrate?: number, audioSampleRate?: AudioSampleRateType, audioBitrate?: number, audioChannels?: AudioChannel }) { this.width = width; this.height = height; @@ -702,7 +790,9 @@ export class CameraCapturerConfiguration { * The camera direction. */ cameraDirection: CameraDirection - + /** + * @ignore + */ constructor(preference: CameraCaptureOutputPreference, cameraDirection: CameraDirection) { this.preference = preference; this.cameraDirection = cameraDirection; @@ -715,13 +805,19 @@ export class CameraCapturerConfiguration { export class ChannelMediaOptions { /** * Determines whether to subscribe to audio streams when the user joins the channel. + * - `true`: (Default) Subscribe. + * - `false`: Do not subscribe. */ autoSubscribeAudio: boolean /** * Determines whether to subscribe to video streams when the user joins the channel. + * - `true`: (Default) Subscribe. + * - `false`: Do not subscribe. */ autoSubscribeVideo: boolean - + /** + * @ignore + */ constructor(autoSubscribeAudio: boolean, autoSubscribeVideo: boolean) { this.autoSubscribeAudio = autoSubscribeAudio; this.autoSubscribeVideo = autoSubscribeVideo; diff --git a/src/src/Enums.ts b/src/src/Enums.ts index d7304189c..7c9e22c5c 100644 --- a/src/src/Enums.ts +++ b/src/src/Enums.ts @@ -775,7 +775,7 @@ export enum ChannelMediaRelayEvent { */ UpdateDestinationChannelNotChange = 9, /** - * 10: The destination channel name is NULL. + * 10: The destination channel name is null. */ UpdateDestinationChannelIsNil = 10, /** diff --git a/src/src/RtcChannel.native.ts b/src/src/RtcChannel.native.ts index 28c0ca022..880d88838 100644 --- a/src/src/RtcChannel.native.ts +++ b/src/src/RtcChannel.native.ts @@ -62,7 +62,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * and call the [`joinChannel`]{@link RtcChannel.joinChannel} method of each created `RtcChannel` object. * * After joining multiple channels, you can simultaneously subscribe to streams of all the channels, but publish a stream in only one channel at one time. - * @param channelId The unique channel name for the AgoraRTC session in the string format. + * @param channelId The unique channel name for the Agora RTC session in the string format. * The string length must be less than 64 bytes. * Supported character scopes are: * - All lowercase English letters: a to z. @@ -74,6 +74,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * **Note** * - This parameter does not have a default value. You must set it. * - Do not set it as the empty string "". Otherwise, the SDK returns [`Refused(-5)`]{@link ErrorCode.Refused}. + * + * @returns + * - An `RtcChannel` instance, if the method call succeeds. + * - Null, if the method call fails. + * - [`Refused(-5)`]{@link ErrorCode.Refused}, if you set channelId as the empty string "". */ static async create(channelId: string): Promise { if (channels.get(channelId)) return channels.get(channelId) as RtcChannel; @@ -164,13 +169,13 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Sets the role of a user. * - * This method sets the role of a user, such as a host or an audience. In a Live-Broadcast channel, + * This method sets the role of a user, such as a host or an audience member. In a `LiveBroadcasting` channel, * only a host can call the [`publish`]{@link publish} method in the [`RtcChannel`]{@link RtcChannel} class. * * A successful call of this method triggers the following callbacks: * - The local client: [`ClientRoleChanged`]{@link RtcChannelEvents.ClientRoleChanged}. * - The remote client: [`UserJoined`]{@link RtcChannelEvents.UserJoined} - * or [`UserOffline(BecomeAudience)`]{@link RtcChannelEvents.UserOffline}. + * or [`UserOffline(BecomeAudience)`]{@link UserOfflineReason.BecomeAudience}. * @param role The role of the user. * */ @@ -182,13 +187,13 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Joins the channel with a user ID. * * **Note** - * - If you are already in a channel, you cannot rejoin it with the same uid. + * - If you are already in a channel, you cannot rejoin it with the same UID. * - We recommend using different UIDs for different channels. * - If you want to join the same channel from different devices, ensure that the UIDs in all devices are different. * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the [`RtcEngine`]{@link RtcEngine} instance. * * @param token The token generated at your server. - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param optionalInfo Additional information about the channel. This parameter can be set as null. Other users in the channel do not receive this information. * @param optionalUid The user ID. A 32-bit unsigned integer with a value ranging from 1 to (232-1). This parameter must be unique. If uid is not assigned (or set as 0), the SDK assigns a uid and reports it in the [`JoinChannelSuccess`]{@link RtcChannelEvents.JoinChannelSuccess} callback. The app must maintain this user ID. @@ -203,14 +208,14 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Joins a channel with the user account. * * **Note** - * - If you are already in a channel, you cannot rejoin it with the same uid. + * - If you are already in a channel, you cannot rejoin it with the same user account. * - We recommend using different user accounts for different channels. * - If you want to join the same channel from different devices, ensure that the user accounts in all devices are different. * - Ensure that the app ID you use to generate the token is the same with the app ID used when creating the [`RtcEngine`]{@link RtcEngine} instance. * * @param token The token generated at your server. - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see Get a temporary token. - * - In situations requiring high security: Set it as the token generated at your server. For details, see Generate a token. + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). + * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param userAccount The user account. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. * - All lowercase English letters: a to z. * - All uppercase English letters: A to Z. @@ -229,7 +234,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * A successful call of this method triggers the following callbacks: * - The local client: [`LeaveChannel`]{@link RtcChannelEvents.LeaveChannel}. - * - The remote client: [`UserOffline`]{@link RtcChannelEvents.UserOffline}, if the user leaving the channel is in a Communication channel, or is a host in a Live-Broadcast channel. + * - The remote client: [`UserOffline`]{@link RtcChannelEvents.UserOffline}, if the user leaving the channel is in a `Communication` channel, or is a host in a `LiveBroadcasting` channel. * */ leaveChannel(): Promise { @@ -251,7 +256,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Gets the connection state of the SDK. + * Gets the network connection state of the SDK. */ getConnectionState(): Promise { return AgoraRtcChannelModule.getConnectionState(this._channelId) @@ -262,8 +267,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * You must keep the following restrictions in mind when calling this method. * Otherwise, the SDK returns the [`Refused(-5)`]{@link ErrorCode.Refused}: * - This method publishes one stream only to the channel corresponding to the current [`RtcChannel`]{@link RtcChannel} instance. - * - In a Live-Broadcast channel, only a host can call this method. To switch the client role, call [`setClientRole`]{@link RtcChannel.setClientRole} of the current [`RtcChannel`]{@link RtcChannel} instance. - * - You can publish a stream to only one channel at a time. For details, see the advanced guide Join Multiple Channels. + * - In a `LiveBroadcasting` channel, only a host can call this method. To switch the client role, call [`setClientRole`]{@link RtcChannel.setClientRole} of the current [`RtcChannel`]{@link RtcChannel} instance. + * - You can publish a stream to only one channel at a time. For details, see the advanced guide *Join Multiple Channels*. */ publish(): Promise { return AgoraRtcChannelModule.publish(this._channelId) @@ -281,6 +286,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Gets the current call ID. + * + * @returns + * - The current call ID, if the method call succeeds. + * - The empty string "", if the method call fails. + * */ getCallId(): Promise { return AgoraRtcChannelModule.getCallId(this._channelId) @@ -386,7 +396,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * @param uid The ID of the remote user. * @param pan The sound position of the remote user. The value ranges from -1.0 to 1.0: - * - 0.0: The remote sound comes from the front. + * - 0.0: (default) The remote sound comes from the front. * - -1.0: The remote sound comes from the left. * - 1.0: The remote sound comes from the right. * @param gain Gain of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original gain of the remote user). The smaller the value, the less the gain. @@ -404,7 +414,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. - * - This method can only be called by a host in a Live-Broadcast channel. + * - This method can only be called by a host in a `LiveBroadcasting` channel. * - This method adds only one stream HTTP/HTTPS URL address each time it is called. * * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, such as Chinese language characters. @@ -425,7 +435,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. - * - This method can only be called by a broadcaster in a Live-Broadcast channel. + * - This method can only be called by a host in a `LiveBroadcasting` channel. * - This method removes only one stream HTTP/HTTPS URL address each time it is called. * * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. The URL address must not contain special characters, @@ -445,7 +455,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. - * - This method can only be called by a host in a Live-Broadcast channel. + * - This method can only be called by a host in a `LiveBroadcasting` channel. * - Ensure that you call this method before calling the [`addPublishStreamUrl`]{@link RtcChannel.addPublishStreamUrl} method. * * @param transcoding Sets the CDN live audio/video transcoding settings. @@ -468,8 +478,10 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - If the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. * * **Note** + * - Contact support@agora.io before implementing this function. + * - We do not support string user accounts in this API. * - Call this method after joining the channel. - * - This method can only be called by a host in a Live-Broadcast channel. + * - This method can only be called by a host in a `LiveBroadcasting` channel. * - After a successful method call, if you want to call this method again, ensure that you call the [`stopChannelMediaRelay`]{@link RtcChannel.stopChannelMediaRelay} method to quit the current relay. * * @param channelMediaRelayConfiguration The configuration of the media stream relay. @@ -569,7 +581,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * **Note** * - Call this method before the [`joinChannel`]{@link RtcChannel.joinChannel} method. - * - This method applies to the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile only. + * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. * */ registerMediaMetadataObserver(): Promise { @@ -638,13 +650,9 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Injects an online media stream to a Live-Broadcast channel. - * - * If this method call succeeds, the servers pulls the voice or video stream and injects it into a live channel. This applies to scenarios where all audience members in the channel can watch a live show and interact with each other. + * Injects an online media stream to live interactive streaming. * - * **Note** - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. - * - This method can only be called by a host in a Live-Broadcast channel. + * If this method call succeeds, the server pulls the voice or video stream and injects it into a live channel. This applies to scenarios where all audience members in the channel can watch a live show and interact with each other. * * Calling this method triggers the following callbacks: * - The local client: @@ -655,9 +663,13 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - [`UserJoined`]{@link RtcChannelEvents.UserJoined}(uid: 666), if the method call succeeds and the online * media stream is injected into the channel. * - * @param url The URL address to be added to the ongoing live broadcast. Valid protocols are RTMP, HLS, and FLV. + * **Note** + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. + * - This method can only be called by a host in a `LiveBroadcasting` channel. + * + * @param url The URL address to be added to the ongoing live interactive streaming. Valid protocols are RTMP, HLS, and FLV. * - Supported FLV audio codec type: AAC. - * - Supported FLV video codec type: H264(AVC). + * - Supported FLV video codec type: H264 (AVC). * @param config The [`LiveInjectStreamConfig`]{@link LiveInjectStreamConfig} object, which contains the configuration information for the added voice or video stream. * */ @@ -666,11 +678,11 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, } /** - * Removes the injected online media stream from a Live-Broadcast channel. + * Removes the injected online media stream from a `LiveBroadcasting` channel. * * This method removes the URL address added by [`addInjectStreamUrl`]{@link RtcChannel.addInjectStreamUrl}. * - * If you successfully remove the URL address from the Live-Broadcast, the SDK triggers the + * If you successfully remove the URL address from the live interactive streaming, the SDK triggers the * [`UserJoined`]{@link RtcChannelEvents.UserJoined} callback, with the stream uid of 666. * * @param url The URL address to be removed. @@ -686,8 +698,8 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * **Note** * - * Set both the reliable and ordered parameters to true or false. Do not set one as true - * and the other as false. + * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` + * and the other as `false`. * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the * sender within five seconds. * - `true`: The recipients receive the data from the sender within five seconds. If the recipient does @@ -696,6 +708,9 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * @param ordered Determines whether the recipients receive the data stream in the sent order. * - `true`: The recipients receive the data in the sent order. * - `false`: The recipients do not receive the data in the sent order. + * @returns + * - Returns the stream ID, if the method call is successful. + * - < 0: Failure. The error code is related to the integer displayed in [Error Codes]{@link ErrorCode}. */ createDataStream(reliable: boolean, ordered: boolean): Promise { return AgoraRtcChannelModule.createDataStream(this._channelId, reliable, ordered); diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index 992dc70b8..af898a137 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -57,7 +57,7 @@ const RtcEngineEvent = new NativeEventEmitter(AgoraRtcEngineModule); let engine: RtcEngine | undefined; /** - * [`RtcEngine`]{@link RtcEngine} is the main interface class of the Agora SDK. + * [`RtcEngine`]{@link RtcEngine} is the main class of the Agora SDK. */ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterface, RtcVideoInterface, RtcAudioMixingInterface, RtcAudioEffectInterface, RtcVoiceChangerInterface, RtcVoicePositionInterface, RtcPublishStreamInterface, @@ -68,7 +68,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * @ignore */ private _listeners = new Map>(); - + /** + * Gets a created [`RtcEngine`]{@link RtcEngine} instance. + * + * **Note** + * + * Ensure that you have created an `RtcEngine`. Otherwise, the method call fails and the SDK returns an error message. + * @returns + * - The `RtcEngine` instance, if the method call succeeds. + * - Returns an error when it fails to get an `RtcEngine`. + * + */ static instance(): RtcEngine { if (engine) { return engine as RtcEngine; @@ -90,6 +100,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Only users in apps with the same App ID can join the same channel and communicate with each other. * Use an App ID to create only one [`RtcEngine`]{@link RtcEngine} instance. To change your App ID, call [`destroy`]{@link destroy} to destroy the current [`RtcEngine`]{@link RtcEngine} instance, and after [`destroy`]{@link destroy} returns `0`, * call `create` to create an [`RtcEngine`]{@link RtcEngine} instance with the new App ID. + * @returns + * - The `RtcEngine` instance, if the method call succeeds. + * - < 0, if the method call fails. */ static async create(appId: string): Promise { return RtcEngine.createWithAreaCode(appId, IPAreaCode.AREA_GLOBAL) @@ -112,6 +125,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * You can use the bitwise OR operator (|) to specify multiple areas. For details, see {@link IPAreaCode}. * * After specifying the region, the app that integrates the Agora SDK connects to the Agora servers within that region. + * + * @returns + * - The `RtcEngine` instance, if the method call succeeds. + * - < 0, if the method call fails. */ static async createWithAreaCode(appId: string, areaCode: IPAreaCode): Promise { if (engine) return engine; @@ -214,11 +231,11 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Sets the role of a user ([Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only). + * Sets the role of a user ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). * * This method sets the role of a user, such as a host or an audience (default), before joining a channel. * - * This method can be used to switch the user role after a user joins a channel. In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful call of this method triggers the following callbacks: + * This method can be used to switch the user role after a user joins a channel. In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, when a user switches user roles after joining a channel, a successful call of this method triggers the following callbacks: * - The local client: [`ClientRoleChanged`]{@link RtcEngineEvents.ClientRoleChanged}. * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} or [`UserOffline`]{@link RtcEngineEvents.UserOffline} ([`BecomeAudience`]{@link UserOfflineReason.BecomeAudience}). * @@ -239,8 +256,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - The local client: [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. * - * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined}, if the user joining the channel is in the [Communication]{@link ChannelProfile.Communication} profile, - * or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, + * or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * * When the connection between the client and Agora server is interrupted due to poor network conditions, * the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the [`RejoinChannelSuccess`]{@link RtcEngineEvents.RejoinChannelSuccess} callback on the local client. @@ -254,7 +271,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Ensure that the App ID used for creating the token is the same App ID used in the `create` method for creating an [`RtcEngine`]{@link RtcEngine} object. Otherwise, CDN live streaming may fail. * * @param token The token for authentication: - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param channelName The unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: * - All lowercase English letters: a to z. @@ -277,17 +294,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Switches to a different channel. * - * This method allows the audience of a [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} channel to switch to a different channel. + * This method allows the audience of a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel to switch to a different channel. * * After the user successfully switches to another channel, the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callbacks are triggered to * indicate that the user has left the original channel and joined a new one. * * **Note** * - * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} channel only. + * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel only. * * @param token The token for authentication: - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param channelName Unique channel name for the AgoraRTC session in the string format. The string length must be less than 64 bytes. Supported character scopes are: * - All lowercase English letters: a to z. @@ -311,8 +328,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * A successful [`leaveChannel`]{@link leaveChannel} method call triggers the following callbacks: * - The local client: [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel}. * - * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [Communication]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} - * in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. + * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [`Communication`]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} + * in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * * **Note** * - If you call [`destroy`]{@link destroy} immediately after calling [`leaveChannel`]{@link leaveChannel}, the [`leaveChannel`]{@link leaveChannel} process interrupts, and the SDK does not trigger the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} callback. @@ -340,7 +357,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Enables interoperability with the Agora Web SDK ([Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only). + * Enables interoperability with the Agora Web SDK ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). * * **Deprecated** * @@ -348,7 +365,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * * If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. - * Use this method when the channel profile is [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting}. Interoperability with the Agora Web SDK is enabled by default when the channel profile is [Communication]{@link ChannelProfile.Communication}. + * Use this method when the channel profile is [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting}. Interoperability with the Agora Web SDK is enabled by default when the channel profile is [`Communication`]{@link ChannelProfile.Communication}. * @param enabled Sets whether to enable/disable interoperability with the Agora Web SDK: * - `true`: Enable. * - `false`: (Default) Disable. @@ -372,6 +389,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The [`rate`]{@link rate} and [`complain`]{@link complain} methods require the `callId` parameter retrieved from the [`getCallId`]{@link getCallId} method during a call. * `callId` is passed as an argument into the [`rate`]{@link rate} and [`complain`]{@link complain} methods after the call ends. + * + * @returns + * Current call ID. */ getCallId(): Promise { return AgoraRtcEngineModule.getCallId() @@ -440,6 +460,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** + * @ignore * Provides technical preview functionalities or special customizations by configuring the SDK with JSON options. * * The JSON options are not public by default. Agora is working on making commonly used JSON options public in a standard way. @@ -479,7 +500,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * After the user successfully joins the channel, the SDK triggers the following callbacks: * - The local client: [`LocalUserRegistered`]{@link RtcEngineEvents.LocalUserRegistered} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess}. * - * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [Communication]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. + * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * * **Note** * @@ -487,7 +508,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. * If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type. * @param token The token generated at your server: - * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#temptoken). + * - In situations not requiring high security: You can use the temporary token generated at Console. For details, see [Get a temporary token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#get-a-temporary-token). * - In situations requiring high security: Set it as the token generated at your server. For details, see [Generate a token](https://docs.agora.io/en/Agora%20Platform/token?platform=All%20Platforms#generatetoken). * @param channelName The channel name. The maximum length of this parameter is 64 bytes. Supported character scopes are: * - All lowercase English letters: a to z. @@ -741,7 +762,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * - You must call this method before calling [`joinChannel`]{@link joinChannel}. - * - In the [Communication]{@link ChannelProfile.Communication} and [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. + * - In the [`Communication`]{@link ChannelProfile.Communication} and [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. * - In scenarios requiring high-quality audio, we recommend setting profile as [`MusicHighQuality(4)`]{@link AudioProfile.MusicHighQuality} and scenario as [`GameStreaming(3)`]{@link AudioScenario.GameStreaming}. * For example, for music education scenarios. * @@ -916,7 +937,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * - Call this method after calling [`enableVideo`]{@link enableVideo}. - * - This method applies to Android 4.4 or later. + * - On Android,this method applies to Android 4.4 or later. * * @param enabled Sets whether to enable image enhancement: * - `true`: Enable image enhancement. @@ -1032,6 +1053,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * Call this method when you are in a channel. + * + * @returns + * - Returns the current playback position of the audio mixing, if the method call is successful. + * - < 0: Failure. */ getAudioMixingCurrentPosition(): Promise { return AgoraRtcEngineModule.getAudioMixingCurrentPosition(); @@ -1043,6 +1068,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * **Note** * * Call this method when you are in a channel. + * + * @returns + * - Returns the audio mixing duration, if the method call is successful. + * - < 0: Failure. */ getAudioMixingDuration(): Promise { return AgoraRtcEngineModule.getAudioMixingDuration(); @@ -1052,6 +1081,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Gets the audio mixing volume for local playback. * * This method helps troubleshoot audio volume related issues. + * + * @returns + * - Returns the audio mixing volume for local playback, if the method call is successful. The value range is [0,100]. + * - < 0: Failure. */ getAudioMixingPlayoutVolume(): Promise { return AgoraRtcEngineModule.getAudioMixingPlayoutVolume(); @@ -1061,6 +1094,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Gets the audio mixing volume for publishing. * * This method helps troubleshoot audio volume related issues. + * + * @returns + * - Returns the audio mixing volume for publishing, if the method call is successful. The value range is [0,100]. + * - < 0: Failure. */ getAudioMixingPublishVolume(): Promise { return AgoraRtcEngineModule.getAudioMixingPublishVolume(); @@ -1127,15 +1164,15 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - To use this method, ensure that the Android device is v4.2 or later, and the API version is v16 or later. + * - To use this method on Android, ensure that the Android device is v4.2 or later, and the API version is v16 or later. * * - Call this method when you are in the channel, otherwise it may cause issues. * - * - If you want to play an online music file, ensure that the time interval between calling this method is more than 100 ms, or the [`TooFrequentCall = 702`]{@link AudioMixingErrorCode.TooFrequentCall} error occurs. + * - If you want to play an online music file, ensure that the time interval between calling this method is more than 100 ms, or the [`TooFrequentCall(702)`]{@link AudioMixingErrorCode.TooFrequentCall} error occurs. * * - If you want to play an online music file, Agora does not recommend using the redirected URL address. Some Android devices may fail to open a redirected URL address. * - * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns [`CanNotOpen = 701`]{@link AudioMixingErrorCode.CanNotOpen}. + * - If the local audio mixing file does not exist, or if the SDK does not support the file format or cannot access the music file URL, the SDK returns [`CanNotOpen(701)`]{@link AudioMixingErrorCode.CanNotOpen}. * * - If you call this method on an emulator, only the MP3 file format is supported. * @@ -1170,6 +1207,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Gets the volume of the audio effects. * * The value ranges between 0.0 and 100.0. + * + * @returns + * - Returns the volume, if the method call is successful. + * - < 0: Failure. */ getEffectsVolume(): Promise { return AgoraRtcEngineModule.getEffectsVolume(); @@ -1419,7 +1460,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. - * - This method applies to [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only. + * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that the user joins a channel before calling this method. * - This method adds only one stream HTTP/HTTPS URL address each time it is called. * @param url The CDN streaming URL in the RTMP format. The maximum length of this parameter is 1024 bytes. @@ -1441,9 +1482,9 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback. * * **Note** - * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. + * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. - * - This method applies to [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only. + * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - This method removes only one stream RTMP URL address each time it is called. * @param url The RTMP URL address to be removed. The maximum length of this parameter is 1024 bytes. * The URL address must not contain special characters, such as Chinese language characters. @@ -1461,7 +1502,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - This method applies to [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} only. + * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. * - Ensure that you call [`setClientRole`]{@link setClientRole} and set the user role as the host. * - Ensure that you call [`setLiveTranscoding`]{@link setLiveTranscoding} before calling [`addPublishStreamUrl`]{@link addPublishStreamUrl}. @@ -1490,7 +1531,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - We do not support string user accounts in this API. * - Call this method after the [`joinChannel`]{@link joinChannel} method. * - This method takes effect only when you are a [`Broadcaster`]{@link ClientRole.Broadcaster} - * in a [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} channel. + * in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel. * - After a successful method call, if you want to call this method again, ensure that you call [`stopChannelMediaRelay`]{@link stopChannelMediaRelay} to quit the current relay. * * @param channelMediaRelayConfiguration The configuration of the media stream relay. @@ -1540,6 +1581,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Checks whether the speakerphone is enabled. + * + * @returns + * - `true`: The speakerphone is enabled, and the audio plays from the speakerphone. + * - `false`: The speakerphone is not enabled, and the audio plays from devices other than the speakerphone. For example, the headset or earpiece. */ isSpeakerphoneEnabled(): Promise { return AgoraRtcEngineModule.isSpeakerphoneEnabled(); @@ -1554,17 +1599,17 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * joining a channel, call [`setEnableSpeakerphone`]{@link setEnableSpeakerphone}. * * The default audio route for each scenario: - * - In the [Communication]{@link ChannelProfile.Communication} profile: + * - In the [`Communication`]{@link ChannelProfile.Communication} profile: * * - For a voice call, the default audio route is the earpiece. * - For a video call, the default audio route is the speaker. If the user disables the video * using [`disableVideo`]{@link disableVideo}, or [`muteLocalVideoStream`]{@link muteLocalVideoStream} and [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams}, the default audio route automatically switches back to the earpiece. * - * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. * * **Note** * - * - This method applies to the [Communication]{@link ChannelProfile.Communication} profile only. + * - This method applies to the [`Communication`]{@link ChannelProfile.Communication} profile only. * - Call this method before the user joins a channel. * @param defaultToSpeaker Sets the default audio route: * - `true`: Route the audio to the speaker. If the playback device connects to the earpiece or Bluetooth, the audio cannot be routed to the earpiece. @@ -1584,7 +1629,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Ensure that you have successfully called [`joinChannel`]{@link joinChannel} before calling this method. * - * - This method is invalid for audience users in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. + * - This method is invalid for audience users in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * * @param enabled Sets whether to route the audio to the speakerphone or earpiece: * - `true`: Route the audio to the speakerphone. @@ -1740,7 +1785,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Do not call any other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} callback. Otherwise, the callback may be interrupted by other methods and may not execute. * - * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. * - If you call this method to test the last-mile quality, the SDK consumes the bandwidth of a video stream, whose bitrate corresponds to the bitrate you set in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method. * After you join the channel, whether you have called [`disableLastmileTest`]{@link disableLastmileTest} or not, the SDK automatically stops consuming the bandwidth. * @@ -1761,7 +1806,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - After calling this method, call [`stopEchoTest`]{@link stopEchoTest} to end the test. * Otherwise, the app cannot run the next echo test, or call [`joinChannel`]{@link joinChannel}. * - * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, only a host can call this method. + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, only a host can call this method. * @param intervalInSeconds The time interval (s) between when you speak and when the recording plays back. */ startEchoTest(intervalInSeconds: number): Promise { @@ -1785,7 +1830,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with [`enableLastmileTest`]{@link enableLastmileTest}. * - Do not call other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} and [`LastmileProbeResult`]{@link RtcEngineEvents.LastmileProbeResult} callbacks. Otherwise, the callbacks may be interrupted by other methods. - * - In the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. + * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile, a host should not call this method after joining a channel. * * @param config The configurations of the last-mile network probe test. * @@ -1970,7 +2015,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac } /** - * Injects an online media stream to a live interactive streaming channel. + * Injects an online media stream to live interactive streaming. * * If this method call is successful, the server pulls the voice or video stream and injects it into * a live channel. This is applicable to scenarios where all audience members in the channel can watch a live show and interact with each other. @@ -1986,7 +2031,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * **Note** * - * - This method applies to the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile only. + * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - You can inject only one media stream into the channel at the same time. * @@ -2032,6 +2077,8 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the maximum zoom ratio supported by the camera. + * + * @returns The maximum camera zoom factor. */ getCameraMaxZoomFactor(): Promise { return AgoraRtcEngineModule.getCameraMaxZoomFactor(); @@ -2039,6 +2086,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Checks whether the camera auto-face focus function is supported. + * + * @returns + * + * - `true`: The device supports the camera auto-face focus function. + * - `false`: The device does not support the camera auto-face focus function. + * */ isCameraAutoFocusFaceModeSupported(): Promise { return AgoraRtcEngineModule.isCameraAutoFocusFaceModeSupported(); @@ -2046,6 +2099,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Checks whether the camera exposure function is supported. + * + * @returns + * + * - `true`: The device supports the camera exposure function. + * - `false`: The device does not support the camera exposure function. + * */ isCameraExposurePositionSupported(): Promise { return AgoraRtcEngineModule.isCameraExposurePositionSupported(); @@ -2053,6 +2112,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Checks whether the camera manual focus function is supported. + * + * @returns + * + * - `true`: The device supports the camera manual focus function. + * - `false`: The device does not support the camera manual focus function. + * */ isCameraFocusSupported(): Promise { return AgoraRtcEngineModule.isCameraFocusSupported(); @@ -2060,6 +2125,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Checks whether the camera flash function is supported. + * + * @returns + * + * - `true`: The device supports the camera flash function. + * - `false`: The device does not the support camera flash function. + * */ isCameraTorchSupported(): Promise { return AgoraRtcEngineModule.isCameraTorchSupported(); @@ -2067,6 +2138,12 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Checks whether the camera zoom function is supported. + * + * @returns + * + * - `true`: The device supports the camera zoom function. + * - `false`: The device does not support the camera zoom function. + * */ isCameraZoomSupported(): Promise { return AgoraRtcEngineModule.isCameraZoomSupported(); @@ -2173,6 +2250,10 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * @param ordered Sets whether the recipients receive the data stream in the sent order: * - `true`: The recipients receive the data in the sent order. * - `false`: The recipients do not receive the data in the sent order. + * + * @return + * - Returns the stream ID, if the method call is successful. + * - < 0: Failure. The error code is related to the integer displayed in [Error Codes]{@link ErrorCode}. */ createDataStream(reliable: boolean, ordered: boolean): Promise { return AgoraRtcEngineModule.createDataStream(reliable, ordered); @@ -2195,7 +2276,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - Ensure that you have created the data stream using [`createDataStream`]{@link createDataStream} before calling this method. * - * - This method applies only to the [Communication]{@link ChannelProfile.Communication} profile or to hosts in the [Live-Broadcast]{@link ChannelProfile.LiveBroadcasting} profile. + * - This method applies only to the [`Communication`]{@link ChannelProfile.Communication} profile or to hosts in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * @param streamId ID of the sent data stream returned by the [`createDataStream`]{@link createDataStream} method. * @param message Sent data. */ diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index 2807fb708..97ede6d50 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -707,6 +707,10 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the remote audio stream. * + * **Note** + * + * This callback does not work properly when the number of users (in the [`Communication`] profile) or hosts (in the [`LiveBroadcasting`] profile) in the channel exceeds 17. + * * @event RemoteAudioStateChanged */ RemoteAudioStateChanged: RemoteAudioStateCallback @@ -911,7 +915,7 @@ export interface RtcEngineEvents { * The SDK triggers this callback to report the result of the local user calling [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl} or [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl}. * This callback returns the URL and its current streaming state. When the streaming state is [`Failure`]{@link RtmpStreamingState.Failure}, see the errCode parameter for details. * - * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the errCode parameter. + * This callback indicates the state of the RTMP streaming. When exceptions occur, you can troubleshoot issues by referring to the detailed error descriptions in the `errCode` parameter. * * @event RtmpStreamingStateChanged */ @@ -1311,12 +1315,18 @@ export interface RtcChannelEvents { ClientRoleChanged: ClientRoleCallback /** - * Occurs when a remote user (Communication) or a broadcaster (Live-Broadcast) joins the channel. - * - Communication profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users. - * - Live-Broadcast profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel. + * Occurs when a remote user (`Communication`) or a host (`LiveBroadcasting`) joins the channel. + * - `Communication` profile: This callback notifies the app when another user joins the channel. If other users are already in the channel, the SDK also reports to the app on the existing users. + * - `LiveBroadcasting` profile: This callback notifies the app when the host joins the channel. If other hosts are already in the channel, the SDK also reports to the app on the existing hosts. We recommend having at most 17 hosts in a channel. + * + * The SDK triggers this callback under one of the following circumstances: + * - A remote user/host joins the channel by calling [`joinChannel`]{@link RtcChannel.joinChannel}. + * - A remote user switches the user role to the host by calling [`setClientRole`]{@link RtcChannel.setClientRole} after joining the channel. + * - A remote user/host rejoins the channel after a network interruption. + * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcChannel.addInjectStreamUrl}. * * **Note** - * - In the Live-Broadcast profile: + * - In the `LiveBroadcasting` profile: * - The host receives this callback when another host joins the channel. * - The audience in the channel receives this callback when a new host joins the channel. * - When a web app joins the channel, this callback is triggered as long as the web app publishes streams. @@ -1326,11 +1336,11 @@ export interface RtcChannelEvents { UserJoined: UidWithElapsedCallback /** - * Occurs when a remote user (Communication) or a broadcaster (Live Broadcast) leaves the channel. + * Occurs when a remote user (`Communication`) or a host (`LiveBroadcasting`) leaves the channel. * * There are two reasons for users to become offline: - * - Leave the channel: When the user/broadcaster leaves the channel, the user/broadcaster sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel. - * - Go offline: When no data packet of the user or broadcaster is received for a certain period of time (around 20 seconds), the SDK assumes that the user/broadcaster drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. + * - Leave the channel: When the user/host leaves the channel, the user/host sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel. + * - Go offline: When no data packet of the user or host is received for a certain period of time (around 20 seconds), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections, so we recommend using the Agora RTM SDK for reliable offline detection. * * @event UserOffline */ @@ -1419,7 +1429,7 @@ export interface RtcChannelEvents { /** * Occurs when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve. * - * If you call {@link RtcEngine.setLocalPublishFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. + * If you call [`setLocalPublishFallbackOption`]{@link RtcEngine.setLocalPublishFallbackOption} and set `option` as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the locally published stream falls back to audio-only mode due to poor uplink conditions, or when the audio stream switches back to the video after the uplink network condition improves. * * @event LocalPublishFallbackToAudioOnly */ @@ -1457,16 +1467,16 @@ export interface RtcChannelEvents { NetworkQuality: NetworkQualityWithUidCallback /** - * Reports the statistics of the video stream from each remote user/broadcaster. The SDK triggers this callback once every two seconds for each remote user/broadcaster. If a channel includes multiple remote users, the SDK triggers this callback as many times. + * Reports the statistics of the video stream from each remote user/host. The SDK triggers this callback once every two seconds for each remote user/broadcaster. If a channel includes multiple remote users, the SDK triggers this callback as many times. * * @event RemoteVideoStats */ RemoteVideoStats: RemoteVideoStatsCallback /** - * Reports the statistics of the audio stream from each remote user/broadcaster. + * Reports the statistics of the audio stream from each remote user/host. * - * The SDK triggers this callback once every two seconds for each remote user/broadcaster. If a channel includes multiple remote users, the SDK triggers this callback as many times. + * The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. * * Schemes such as FEC (Forward Error Correction) or retransmission counter the frame loss rate. Hence, users may find the overall audio quality acceptable even when the packet loss rate is high. * @@ -1508,7 +1518,7 @@ export interface RtcChannelEvents { /** * Occurs when the local user receives a remote data stream. * - * The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the {@link RtcChannel.sendStreamMessage} method. + * The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the [`sendStreamMessage`]{@link RtcChannel.sendStreamMessage} method. * * @event StreamMessage */ From e575fde2699c720dae9b1a8b3c57bf0568d05573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Fri, 4 Sep 2020 14:15:45 +0800 Subject: [PATCH 7/9] Update based on review comments --- src/RtcLocalView.tsx | 10 +-- src/RtcRemoteView.tsx | 21 ++++- src/src/Classes.ts | 71 +++++----------- src/src/Enums.ts | 140 +++++++++++++++---------------- src/src/RtcChannel.native.ts | 34 ++++---- src/src/RtcEngine.native.ts | 130 ++++++++++++++-------------- src/src/RtcEvents.ts | 66 +++++++-------- src/src/RtcRenderView.native.tsx | 4 +- 8 files changed, 230 insertions(+), 246 deletions(-) diff --git a/src/RtcLocalView.tsx b/src/RtcLocalView.tsx index f9731022e..207506b32 100644 --- a/src/RtcLocalView.tsx +++ b/src/RtcLocalView.tsx @@ -6,9 +6,9 @@ import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps /** * The SurfaceView class. * - * **Note** + * @note * - * SurfaceView only applies to Android. Use UIView on iOS. + * SurfaceView is supported on Android only. Use UIView on iOS. * * @noInheritDoc */ @@ -25,9 +25,9 @@ class SurfaceView extends Component { /** * The TextureView class. * - * **Note** + * @note * - * TextureView only applies to Android. iOS does not support TextureView. + * TextureView is supported on Android only. iOS does not support TextureView. * @noInheritDoc */ class TextureView extends Component { @@ -43,7 +43,7 @@ class TextureView extends Component { } /** - * View for preview local video. + * View for previewing local video. */ export default { SurfaceView, diff --git a/src/RtcRemoteView.tsx b/src/RtcRemoteView.tsx index 43b29ac12..0c61916a3 100644 --- a/src/RtcRemoteView.tsx +++ b/src/RtcRemoteView.tsx @@ -9,7 +9,15 @@ import { RtcUidProps } from "./src/RtcRenderView.native"; - +/** + * The SurfaceView class. + * + * @note + * + * SurfaceView is supported on Android only. Use UIView on iOS. + * + * @noInheritDoc + */ class SurfaceView extends Component { render() { return ( @@ -18,7 +26,14 @@ class SurfaceView extends Component { render() { if (Platform.OS === 'ios') @@ -30,7 +45,7 @@ class TextureView extends Component1280x720 * * - * **Note** + * @note *
    *
  • The value of the dimension does not indicate the orientation mode of the output ratio. For how to set the video orientation, see [`VideoOutputOrientationMode`]{@link VideoOutputOrientationMode}.
  • *
  • Whether 720p+ can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the one listed in the table.
  • @@ -267,7 +265,7 @@ export class VideoEncoderConfiguration { * * * - * **Note** + * @note * * The base bitrate in this table applies to the Communication profile. * The `LiveBroadcasting` profile generally requires a higher bitrate for better video quality. @@ -292,9 +290,7 @@ export class VideoEncoderConfiguration { * Sets the mirror mode of the published local video stream. */ mirrorMode?: VideoMirrorMode - /** - * @ignore - */ + constructor({dimensions, frameRate, minFrameRate, bitrate, minBitrate, orientationMode, degradationPrefer, mirrorMode}: { dimensions?: VideoDimensions, frameRate?: VideoFrameRate, minFrameRate?: VideoFrameRate, bitrate?: number, minBitrate?: number, orientationMode?: VideoOutputOrientationMode, degradationPrefer?: DegradationPreference, mirrorMode?: VideoMirrorMode }) { this.dimensions = dimensions; this.frameRate = frameRate; @@ -329,9 +325,7 @@ export class BeautyOptions { * The default value is 0.1. This parameter adjusts the red saturation level. */ rednessLevel?: number - /** - * @ignore - */ + constructor({lighteningContrastLevel, lighteningLevel, smoothnessLevel, rednessLevel}: { lighteningContrastLevel?: LighteningContrastLevel, lighteningLevel?: number, smoothnessLevel?: number, rednessLevel?: number }) { this.lighteningContrastLevel = lighteningContrastLevel; this.lighteningLevel = lighteningLevel; @@ -364,9 +358,7 @@ export class AgoraImage { * Height of the image on the broadcasting video. */ height: number - /** - * @ignore - */ + constructor(url: string, x: number, y: number, width: number, height: number) { this.url = url; this.x = x; @@ -418,15 +410,13 @@ export class TranscodingUser { * - 4: The audio stream of the broadcaster uses the BL audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. * - 5: The audio stream of the broadcaster uses the BR audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. * - * **Note** + * @note * * Special players are needed if `audioChannel` is not set as 0. * */ audioChannel?: AudioChannel - /** - * @ignore - */ + constructor(uid: number, x: number, y: number, {width, height, zOrder, alpha, audioChannel}: { width?: number, height?: number, zOrder?: number, alpha?: number, audioChannel?: AudioChannel }) { this.uid = uid; this.x = x; @@ -456,9 +446,7 @@ export class Color { * Blue. */ blue: number - /** - * @ignore - */ + constructor(red: number, green: number, blue: number) { this.red = red; this.green = green; @@ -492,7 +480,7 @@ export class LiveTranscoding { */ videoFramerate?: VideoFrameRate /** - * **Deprecated** + * @deprecated * - `true`: Low latency with unassured quality. * - `false`: (Default) High latency with assured quality. */ @@ -550,9 +538,7 @@ export class LiveTranscoding { * An TranscodingUser object managing the user layout configuration in the CDN live stream. Agora supports a maximum of 17 transcoding users in a CDN live stream channel. */ transcodingUsers: TranscodingUser[] - /** - * @ignore - */ + constructor(transcodingUsers: TranscodingUser[], {width, height, videoBitrate, videoFramerate, lowLatency, videoGop, watermark, backgroundImage, audioSampleRate, audioBitrate, audioChannels, audioCodecProfile, videoCodecProfile, backgroundColor, userConfigExtraInfo}: { width?: number, height?: number, videoBitrate?: number, videoFramerate?: VideoFrameRate, lowLatency?: boolean, videoGop?: number, watermark?: AgoraImage, backgroundImage?: AgoraImage, audioSampleRate?: AudioSampleRateType, audioBitrate?: number, audioChannels?: AudioChannel, audioCodecProfile?: AudioCodecProfileType, videoCodecProfile?: VideoCodecProfileType, backgroundColor?: Color, userConfigExtraInfo?: string, }) { this.width = width; this.height = height; @@ -589,9 +575,7 @@ export class ChannelMediaInfo { * The user ID. */ uid: number - /** - * @ignore - */ + constructor(uid: number, {channelName, token}: { channelName?: string, token?: string }) { this.channelName = channelName; this.token = token; @@ -621,9 +605,7 @@ export class ChannelMediaRelayConfiguration { * - If you have enabled the App Certificate, you must use the token generated with the `channelName` and `uid`, and the `uid` must be set as 0. */ destInfos: ChannelMediaInfo[] - /** - * @ignore - */ + constructor(srcInfo: ChannelMediaInfo, destInfos: ChannelMediaInfo[]) { this.srcInfo = srcInfo; this.destInfos = destInfos; @@ -650,9 +632,7 @@ export class LastmileProbeConfig { * The expected maximum receive bitrate in bps in range of [100000,5000000]. */ expectedDownlinkBitrate: number - /** - * @ignore - */ + constructor(probeUplink: boolean, probeDownlink: boolean, expectedUplinkBitrate: number, expectedDownlinkBitrate: number) { this.probeUplink = probeUplink; this.probeDownlink = probeDownlink; @@ -681,9 +661,7 @@ export class Rectangle { * The height (pixels) of the watermark image. */ height: number - /** - * @ignore - */ + constructor(x: number, y: number, width: number, height: number) { this.x = x; this.y = y; @@ -710,9 +688,7 @@ export class WatermarkOptions { * The watermark position in the portrait mode. */ positionInPortraitMode: Rectangle - /** - * @ignore - */ + constructor(positionInLandscapeMode: Rectangle, positionInPortraitMode: Rectangle, visibleInPreview?: boolean) { this.visibleInPreview = visibleInPreview; this.positionInLandscapeMode = positionInLandscapeMode; @@ -763,9 +739,7 @@ export class LiveInjectStreamConfig { * - 5: Five audio channels */ audioChannels?: AudioChannel - /** - * @ignore - */ + constructor({width, height, videoGop, videoFramerate, videoBitrate, audioSampleRate, audioBitrate, audioChannels}: { width?: number, height?: number, videoGop?: number, videoFramerate?: VideoFrameRate, videoBitrate?: number, audioSampleRate?: AudioSampleRateType, audioBitrate?: number, audioChannels?: AudioChannel }) { this.width = width; this.height = height; @@ -790,9 +764,7 @@ export class CameraCapturerConfiguration { * The camera direction. */ cameraDirection: CameraDirection - /** - * @ignore - */ + constructor(preference: CameraCaptureOutputPreference, cameraDirection: CameraDirection) { this.preference = preference; this.cameraDirection = cameraDirection; @@ -815,9 +787,7 @@ export class ChannelMediaOptions { * - `false`: Do not subscribe. */ autoSubscribeVideo: boolean - /** - * @ignore - */ + constructor(autoSubscribeAudio: boolean, autoSubscribeVideo: boolean) { this.autoSubscribeAudio = autoSubscribeAudio; this.autoSubscribeVideo = autoSubscribeVideo; @@ -1147,7 +1117,8 @@ export interface RemoteVideoStats { */ uid: number /** - * **Deprecated** + * @deprecated + * * Time delay (ms). In scenarios where audio and video is synchronized, you can use the value * of `networkTransportDelay` and `jitterBufferDelay` * in [`RemoteAudioStats`]{@link RemoteAudioStats} to know the delay statistics of the remote video. diff --git a/src/src/Enums.ts b/src/src/Enums.ts index 7c9e22c5c..503e43f97 100644 --- a/src/src/Enums.ts +++ b/src/src/Enums.ts @@ -1,6 +1,6 @@ /** * IP areas - * @enum {number} + * */ export enum IPAreaCode { /** @@ -27,7 +27,7 @@ export enum IPAreaCode { /** * Audio codec profile. - * @enum {number} + * */ export enum AudioCodecProfileType { /** @@ -42,7 +42,7 @@ export enum AudioCodecProfileType { /** * Audio equalization band frequency. - * @enum {number} + * */ export enum AudioEqualizationBandFrequency { /** @@ -89,7 +89,7 @@ export enum AudioEqualizationBandFrequency { /** * The error information of the local audio. - * @enum {number} + * */ export enum AudioLocalError { /** @@ -120,7 +120,7 @@ export enum AudioLocalError { /** * The state of the local audio. - * @enum {number} + * */ export enum AudioLocalState { /** @@ -143,7 +143,7 @@ export enum AudioLocalState { /** * The error code of the audio mixing file. - * @enum {number} + * */ export enum AudioMixingErrorCode { /** @@ -166,7 +166,7 @@ export enum AudioMixingErrorCode { /** * The state of the audio mixing file. - * @enum {number} + * */ export enum AudioMixingStateCode { /** @@ -189,7 +189,7 @@ export enum AudioMixingStateCode { /** * Audio output routing. - * @enum {number} + * */ export enum AudioOutputRouting { /** @@ -224,7 +224,7 @@ export enum AudioOutputRouting { /** * Audio profile. - * @enum {number} + * */ export enum AudioProfile { /** @@ -257,7 +257,7 @@ export enum AudioProfile { /** * Use mode of the onRecordAudioFrame callback. - * @enum {number} + * * TODO setPlaybackAudioFrameParameters */ export enum AudioRawFrameOperationMode { @@ -295,7 +295,7 @@ export enum AudioRecordingQuality { /** * The state of the remote audio. - * @enum {number} + * */ export enum AudioRemoteState { /** @@ -330,7 +330,7 @@ export enum AudioRemoteState { /** * The reason of the remote audio state change. - * @enum {number} + * */ export enum AudioRemoteStateReason { /** @@ -369,7 +369,7 @@ export enum AudioRemoteStateReason { /** * The preset local voice reverberation option. - * @enum {number} + * */ export enum AudioReverbPreset { /** @@ -448,7 +448,7 @@ export enum AudioReverbPreset { /** * Audio reverberation type. - * @enum {number} + * */ export enum AudioReverbType { /** @@ -475,7 +475,7 @@ export enum AudioReverbType { /** * Audio sample rate. - * @enum {number} + * */ export enum AudioSampleRateType { /** @@ -494,7 +494,7 @@ export enum AudioSampleRateType { /** * Audio scenario. - * @enum {number} + * */ export enum AudioScenario { /** @@ -525,7 +525,7 @@ export enum AudioScenario { /** * Audio session restriction. - * @enum {number} + * * TODO iOS setAudioSessionOperationRestriction */ export enum AudioSessionOperationRestriction { @@ -553,7 +553,7 @@ export enum AudioSessionOperationRestriction { /** * The preset audio voice configuration used to change the voice effect. - * @enum {number} + * */ export enum AudioVoiceChanger { /** @@ -636,7 +636,7 @@ export enum AudioVoiceChanger { /** * The camera capturer configuration. - * @enum {number} + * */ export enum CameraCaptureOutputPreference { /** @@ -659,7 +659,7 @@ export enum CameraCaptureOutputPreference { /** * The camera direction. - * @enum {number} + * */ export enum CameraDirection { /** @@ -674,7 +674,7 @@ export enum CameraDirection { /** * The error code in AgoraChannelMediaRelayError. - * @enum {number} + * */ export enum ChannelMediaRelayError { /** @@ -731,7 +731,7 @@ export enum ChannelMediaRelayError { /** * The event code in `ChannelMediaRelayEvent`. - * @enum {number} + * */ export enum ChannelMediaRelayEvent { /** @@ -786,7 +786,7 @@ export enum ChannelMediaRelayEvent { /** * The state code in [`ChannelMediaRelayState`]{@link ChannelMediaRelayState}. - * @enum {number} + * */ export enum ChannelMediaRelayState { /** @@ -809,7 +809,7 @@ export enum ChannelMediaRelayState { /** * Channel profile. - * @enum {number} + * */ export enum ChannelProfile { /** @@ -831,7 +831,7 @@ export enum ChannelProfile { /** * Client role in the `LiveBroadcasting` profile. - * @enum {number} + * */ export enum ClientRole { /** @@ -846,7 +846,7 @@ export enum ClientRole { /** * Reasons for the connection state change. - * @enum {number} + * */ export enum ConnectionChangedReason { /** @@ -917,7 +917,7 @@ export enum ConnectionChangedReason { /** * Connection states. - * @enum {number} + * */ export enum ConnectionStateType { /** @@ -963,7 +963,7 @@ export enum ConnectionStateType { /** * The video encoding degradation preference under limited bandwidth. - * @enum {number} + * */ export enum DegradationPreference { /** @@ -1001,7 +1001,7 @@ export enum EncryptionMode { /** * Error codes occur when the SDK encounters an error that cannot be recovered automatically without any app intervention. - * @enum {number} + * */ export enum ErrorCode { /** @@ -1108,7 +1108,7 @@ export enum ErrorCode { InvalidChannelId = 102, /** * 109: The token expired. - * **DEPRECATED** Use [`TokenExpired`]{@link ConnectionChangedReason.TokenExpired} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. + * @deprecated Use [`TokenExpired`]{@link ConnectionChangedReason.TokenExpired} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. * * Possible reasons are: * - Authorized Timestamp expired: The timestamp is represented by the number of seconds elapsed since 1/1/1970. The user can use the token to access the Agora service within five minutes after the token is generated. If the user does not access the Agora service after five minutes, this token is no longer valid. @@ -1118,7 +1118,7 @@ export enum ErrorCode { TokenExpired = 109, /** * 110: The token is invalid. - * **DEPRECATED** Use [`InvalidToken`]{@link ConnectionChangedReason.InvalidToken} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. + * @deprecated Use [`InvalidToken`]{@link ConnectionChangedReason.InvalidToken} in the reason parameter of [`onConnectionStateChanged`]{@link RtcEngineEvents.onConnectionStateChanged}. * * Possible reasons are: * - The App Certificate for the project is enabled in Console, but the user is using the App ID. Once the App Certificate is enabled, the user must use a token. @@ -1226,7 +1226,7 @@ export enum ErrorCode { /** * 1003: Fails to start the camera. * - * **DEPRECATED** Use [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure} in the error parameter of [`LocalVideoStateChanged`]{@link RtcEngineEvents.LocalVideoStateChanged}. + * @deprecated Use [`CaptureFailure`]{@link LocalVideoStreamError.CaptureFailure} in the error parameter of [`LocalVideoStateChanged`]{@link RtcEngineEvents.LocalVideoStateChanged}. * */ StartCamera = 1003, @@ -1333,7 +1333,7 @@ export enum ErrorCode { /** * 1603: Video Device Module: An error occurs in setting the video encoder. * - * **DEPRECATED** + * @deprecated * This error code is deprecated. */ VcmEncoderSetError = 1603, @@ -1341,7 +1341,7 @@ export enum ErrorCode { /** * State of importing an external video stream in a live broadcast. - * @enum {number} + * */ export enum InjectStreamStatus { /** @@ -1392,7 +1392,7 @@ export enum InjectStreamStatus { /** * The state of the probe test result. - * @enum {number} + * */ export enum LastmileProbeResultState { /** @@ -1411,7 +1411,7 @@ export enum LastmileProbeResultState { /** * The lightening contrast level. - * @enum {number} + * */ export enum LighteningContrastLevel { /** @@ -1430,7 +1430,7 @@ export enum LighteningContrastLevel { /** * The detailed error information of the local video. - * @enum {number} + * */ export enum LocalVideoStreamError { /** @@ -1461,7 +1461,7 @@ export enum LocalVideoStreamError { /** * The state of the local video stream. - * @enum {number} + * */ export enum LocalVideoStreamState { /** @@ -1484,7 +1484,7 @@ export enum LocalVideoStreamState { /** * Output log filter level. - * @enum {number} + * */ export enum LogFilter { /** @@ -1515,7 +1515,7 @@ export enum LogFilter { /** * Media device type. - * @enum {number} + * * TODO MacOS AgoraMediaDeviceType */ export enum MediaDeviceType { @@ -1543,7 +1543,7 @@ export enum MediaDeviceType { /** * Media type. - * @enum {number} + * * TODO LiveEngine */ export enum MediaType { @@ -1567,7 +1567,7 @@ export enum MediaType { /** * The metadata type. - * @enum {number} + * * TODO registerMediaMetadataObserver */ export enum MetadataType { @@ -1583,7 +1583,7 @@ export enum MetadataType { /** * Network quality. - * @enum {number} + * */ export enum NetworkQuality { /** @@ -1626,7 +1626,7 @@ export enum NetworkQuality { /** * Network type. - * @enum {number} + * */ export enum NetworkType { /** @@ -1661,7 +1661,7 @@ export enum NetworkType { /** * Default camera position - * @enum {number} + * * TODO AgoraRtcDefaultCamera */ export enum RtcDefaultCameraPosition { @@ -1677,7 +1677,7 @@ export enum RtcDefaultCameraPosition { /** * Lifecycle of the CDN live video stream. - * @enum {number} + * * TODO AgoraPublisherConfiguration */ export enum RtmpStreamLifeCycle { @@ -1693,7 +1693,7 @@ export enum RtmpStreamLifeCycle { /** * The detailed error information for streaming. - * @enum {number} + * */ export enum RtmpStreamingErrorCode { /** @@ -1746,7 +1746,7 @@ export enum RtmpStreamingErrorCode { /** * The RTMP streaming state. - * @enum {number} + * */ export enum RtmpStreamingState { /** @@ -1787,7 +1787,7 @@ export enum RtmpStreamingState { /** * Stream fallback option. - * @enum {number} + * */ export enum StreamFallbackOptions { /** @@ -1810,7 +1810,7 @@ export enum StreamFallbackOptions { /** * Reason for the user being offline. - * @enum {number} + * */ export enum UserOfflineReason { /** @@ -1829,7 +1829,7 @@ export enum UserOfflineReason { /** * The priority of the remote user. - * @enum {number} + * */ export enum UserPriority { /** @@ -1844,7 +1844,7 @@ export enum UserPriority { /** * Video buffer type - * @enum {number} + * * TODO iOS AgoraVideoSourceProtocol AgoraVideoSinkProtocol */ export enum VideoBufferType { @@ -1860,7 +1860,7 @@ export enum VideoBufferType { /** * Self-defined video codec profile. - * @enum {number} + * */ export enum VideoCodecProfileType { /** @@ -1879,7 +1879,7 @@ export enum VideoCodecProfileType { /** * The content hint for screen sharing. - * @enum {number} + * * TODO MacOS setScreenCaptureContentHint * */ @@ -1900,7 +1900,7 @@ export enum VideoContentHint { /** * Video frame rate - * @enum {number} + * */ export enum VideoFrameRate { /** @@ -2104,7 +2104,7 @@ export enum VideoFrameRate { * Agora uses different video codecs for different profiles to optimize the user experience. For example, * the Communication profile prioritizes the smoothness while the LIVE_BROADCASTING profile prioritizes the * video quality (a higher bitrate). Therefore, We recommend setting this parameter as STANDARD_BITRATE = 0. - * @enum {number} + * */ export enum BitRate { /** @@ -2122,7 +2122,7 @@ export enum BitRate { /** * Video mirror mode. - * @enum {number} + * */ export enum VideoMirrorMode { /** @@ -2141,7 +2141,7 @@ export enum VideoMirrorMode { /** * Video output orientation mode. - * @enum {number} + * */ export enum VideoOutputOrientationMode { /** @@ -2168,7 +2168,7 @@ export enum VideoOutputOrientationMode { /** * Video pixel format. - * @enum {number} + * * TODO iOS AgoraVideoSinkProtocol * */ @@ -2189,7 +2189,7 @@ export enum VideoPixelFormat { /** * Quality change of the local video in terms of target frame rate and target bit rate since last count. - * @enum {number} + * */ export enum VideoQualityAdaptIndication { /** @@ -2208,7 +2208,7 @@ export enum VideoQualityAdaptIndication { /** * The state of the remote video. - * @enum {number} + * */ export enum VideoRemoteState { /** @@ -2244,7 +2244,7 @@ export enum VideoRemoteState { /** * The reason of the remote video state change. - * @enum {number} + * */ export enum VideoRemoteStateReason { /** @@ -2291,7 +2291,7 @@ export enum VideoRemoteStateReason { /** * Video display mode. - * @enum {number} + * */ export enum VideoRenderMode { /** @@ -2303,7 +2303,7 @@ export enum VideoRenderMode { */ Fit = 2, /** - * **DEPRECATED** + * @deprecated * 3: This mode is deprecated. * */ @@ -2316,7 +2316,7 @@ export enum VideoRenderMode { /** * Video rotation. - * @enum {number} + * * TODO iOS AgoraVideoSourceProtocol AgoraVideoSinkProtocol */ export enum VideoRotation { @@ -2340,7 +2340,7 @@ export enum VideoRotation { /** * Video stream type. - * @enum {number} + * */ export enum VideoStreamType { /** @@ -2357,7 +2357,7 @@ export enum VideoStreamType { * Warning codes occur when the SDK encounters an error that may be recovered automatically. * These are only notifications, and can generally be ignored. For example, when the SDK loses connection to the server, * the SDK reports the [`OpenChannelTimeout(106)`]{@link WarningCode.OpenChannelTimeout} warning and tries to reconnect automatically. - * @enum {number} + * */ export enum WarningCode { /** @@ -2383,7 +2383,7 @@ export enum WarningCode { /** * 105: The server rejects the request to look up the channel. * The server cannot process this request or the request is illegal. - * **Deprecated** + * @deprecated * * Use [`RejectedByServer(10)`]{@link ConnectionChangedReason.RejectedByServer} in the reason parameter * of [`ConnectionStateChanged`]{@link RtcEngineEvents.ConnectionStateChanged}. @@ -2475,7 +2475,7 @@ export enum WarningCode { /** * The audio channel of the sound. - * @enum {number} + * */ export enum AudioChannel { /** @@ -2506,7 +2506,7 @@ export enum AudioChannel { /** * Video codec types. - * @enum {number} + * */ export enum VideoCodecType { /** diff --git a/src/src/RtcChannel.native.ts b/src/src/RtcChannel.native.ts index 880d88838..9f804776b 100644 --- a/src/src/RtcChannel.native.ts +++ b/src/src/RtcChannel.native.ts @@ -71,7 +71,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * - * **Note** + * @note * - This parameter does not have a default value. You must set it. * - Do not set it as the empty string "". Otherwise, the SDK returns [`Refused(-5)`]{@link ErrorCode.Refused}. * @@ -186,7 +186,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Joins the channel with a user ID. * - * **Note** + * @note * - If you are already in a channel, you cannot rejoin it with the same UID. * - We recommend using different UIDs for different channels. * - If you want to join the same channel from different devices, ensure that the UIDs in all devices are different. @@ -207,7 +207,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Joins a channel with the user account. * - * **Note** + * @note * - If you are already in a channel, you cannot rejoin it with the same user account. * - We recommend using different user accounts for different channels. * - If you want to join the same channel from different devices, ensure that the user accounts in all devices are different. @@ -302,7 +302,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * You can call this method as many times as necessary to adjust the playback volume of different remote * users, or to repeatedly adjust the playback volume of the same remote user. * - * **Note** + * @note * - Call this method after joining a channel. * - The playback volume here refers to the mixed volume of a specified remote user. * - This method can only adjust the playback volume of one specified remote user at a time. @@ -390,7 +390,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. * - * **Note** + * @note * - For this method to work, enable stereo panning for remote users by calling the [`enableSoundPositionIndication`]{@link RtcEngine.enableSoundPositionIndication} method before joining a channel. * - This method requires hardware support. For the best sound positioning, we recommend using a stereo headset. * @@ -411,7 +411,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * This method call triggers the [`RtmpStreamingStateChanged`]{@link RtcChannelEvents.RtmpStreamingStateChanged} * callback on the local client to report the state of adding a local stream to the CDN. * - * **Note** + * @note * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. * - This method can only be called by a host in a `LiveBroadcasting` channel. @@ -433,7 +433,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * This method removes the RTMP URL address (added by [`addPublishStreamUrl`]{@link RtcChannel.addPublishStreamUrl}) from a CDN live stream. * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcChannelEvents.RtmpStreamingStateChanged} callback. * - * **Note** + * @note * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method can only be called by a host in a `LiveBroadcasting` channel. * - This method removes only one stream HTTP/HTTPS URL address each time it is called. @@ -452,7 +452,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * call this method to update the [`LiveTranscoding`]{@link LiveTranscoding} class. If you call this method to set the [`LiveTranscoding`]{@link LiveTranscoding} * class for the first time, the SDK does not trigger the [`TranscodingUpdated`]{@link RtcChannelEvents.TranscodingUpdated} callback. * - * **Note** + * @note * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. * - This method can only be called by a host in a `LiveBroadcasting` channel. @@ -477,7 +477,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * - If the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. * - * **Note** + * @note * - Contact support@agora.io before implementing this function. * - We do not support string user accounts in this API. * - Call this method after joining the channel. @@ -498,7 +498,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback. If the callback reports [`Idle(0)`]{@link ChannelMediaRelayState.Idle} and * [`None(0)`]{@link ChannelMediaRelayError.None}, the host successfully stops the relay. * - * **Note** + * @note * - If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback with * the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerConnectionLost} state code. * You can leave the channel using [`leaveChannel`]{@link RtcChannel.leaveChannel}, and the media stream relay automatically stops. @@ -515,7 +515,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * After a successful method call, the SDK triggers the [`ChannelMediaRelayEvent`]{@link RtcChannelEvents.ChannelMediaRelayEvent} callback with * the [`UpdateDestinationChannel(7)`]{@link ChannelMediaRelayEvent.UpdateDestinationChannel} state code. * - * **Note** + * @note * - Call this method after the [`startChannelMediaRelay`]{@link RtcChannel.startChannelMediaRelay} method to update the destination channel. * - This method supports adding at most four destination channels in the relay. * @@ -560,7 +560,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Use this method with the [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} method. * If a remote video stream experiences the fallback, the SDK ensures the high-priority user gets the best possible stream quality. * - * **Note** + * @note * The Agora SDK supports setting userPriority as high for one user only. * * @param uid The ID of the remote user. @@ -579,7 +579,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * This method enables you to add synchronized metadata in the video stream for more diversified live streaming interactions, * such as sending shopping links, digital coupons, and online quizzes. * - * **Note** + * @note * - Call this method before the [`joinChannel`]{@link RtcChannel.joinChannel} method. * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. * @@ -621,7 +621,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * All users in the same channel must use the same encryption mode and password. * Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. * - * **Note** + * @note * - Do not use this method for CDN streaming. * - Before calling this method, ensure that you have called [`setEncryptionSecret`]{@link RtcChannel.setEncryptionSecret} to enable encryption. * @@ -639,7 +639,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * The encryption password is automatically cleared once a user leaves the channel. * If the encryption password is not specified or set to empty, the encryption functionality is disabled. * - * **Note** + * @note * - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. * - Do not use this method for CDN live streaming. * @@ -663,7 +663,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - [`UserJoined`]{@link RtcChannelEvents.UserJoined}(uid: 666), if the method call succeeds and the online * media stream is injected into the channel. * - * **Note** + * @note * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method can only be called by a host in a `LiveBroadcasting` channel. * @@ -696,7 +696,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * Each user can create up to five data streams during the life cycle of the [`RtcChannel`]{@link RtcChannel} instance. * - * **Note** + * @note * * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` * and the other as `false`. diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index af898a137..80e35c316 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -71,7 +71,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets a created [`RtcEngine`]{@link RtcEngine} instance. * - * **Note** + * @note * * Ensure that you have created an `RtcEngine`. Otherwise, the method call fails and the SDK returns an error message. * @returns @@ -92,7 +92,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Unless otherwise specified, all the methods provided by the [`RtcEngine`]{@link RtcEngine} class are executed asynchronously. Agora recommends calling these methods in the same thread. * - * **Note** + * @note * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`createWithAreaCode`]{@link createWithAreaCode}. The difference between [`createWithAreaCode`]{@link createWithAreaCode} and this method is that [`createWithAreaCode`]{@link createWithAreaCode} enables you to specify the connection area. * - The Agora React Native SDK supports creating only one [`RtcEngine`]{@link RtcEngine} instance for an app. @@ -113,7 +113,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Unless otherwise specified, all the methods provided by the [`RtcEngine`]{@link RtcEngine} class are executed asynchronously. Agora recommends calling these methods in the same thread. * - * **Note** + * @note * * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`create`]{@link create}. The difference between [`create`]{@link create} and this method is that this method enables you to specify the connection area. @@ -144,7 +144,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Once you call this method to destroy the created [`RtcEngine`]{@link RtcEngine} instance, you cannot use any method or callback in the SDK any more. * If you want to use the real-time communication functions again, you must call `create` to create a new [`RtcEngine`]{@link RtcEngine} instance. * - * **Note** + * @note * * - Because [`destroy`]{@link destroy} is a synchronous method and the app cannot move on to another task until the execution completes, * Agora suggests calling this method in a sub-thread to avoid congestion in the main thread. @@ -262,7 +262,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When the connection between the client and Agora server is interrupted due to poor network conditions, * the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the [`RejoinChannelSuccess`]{@link RtcEngineEvents.RejoinChannelSuccess} callback on the local client. * - * **Note** + * @note * * A channel does not accept duplicate uids, such as two users with the same `uid`. If you set `uid` as `0`, the system automatically assigns a uid. * @@ -299,7 +299,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * After the user successfully switches to another channel, the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callbacks are triggered to * indicate that the user has left the original channel and joined a new one. * - * **Note** + * @note * * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel only. * @@ -331,7 +331,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [`Communication`]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} * in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * - * **Note** + * @note * - If you call [`destroy`]{@link destroy} immediately after calling [`leaveChannel`]{@link leaveChannel}, the [`leaveChannel`]{@link leaveChannel} process interrupts, and the SDK does not trigger the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} callback. * * - If you call [`leaveChannel`]{@link leaveChannel} during CDN live streaming, the SDK triggers the [`removeInjectStreamUrl`]{@link removeInjectStreamUrl} method. @@ -359,9 +359,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables interoperability with the Agora Web SDK ([`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only). * - * **Deprecated** - * - * This method is deprecated. The Agora Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. + * @deprecated This method is deprecated. The Agora Native SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. * * * If the channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. @@ -424,7 +422,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable. * - * **Note** + * @note * * Ensure that you call this method immediately after calling the `create` method, otherwise the output log may not be complete. * @@ -502,7 +500,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * - * **Note** + * @note * * To ensure smooth communication, use the same parameter type to identify the user. * For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. @@ -541,7 +539,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The difference between the two is that for the former, the time elapsed between calling the [`joinChannelWithUserAccount`]{@link joinChannelWithUserAccount} method and joining the channel is shorter than the latter. * - * **Note** + * @note * * - Ensure that you set the `userAccount` parameter. Otherwise, this method does not take effect. * - Ensure that the value of the `userAccount` parameter is unique in the channel. @@ -564,7 +562,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the playback volume of all remote users. * - * **Note** + * @note * * - This method adjusts the playback volume which is mixed volume of all remote users. * - To mute the local audio playback, call both this method and [`adjustAudioMixingVolume`]{@link adjustAudioMixingVolume}, and set `volume` as `0`. @@ -597,7 +595,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user. * - * **Note** + * @note * - Call this method after joining a channel. * - The playback volume here refers to the mixed volume of a specified remote user. * - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. @@ -613,7 +611,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Disables the audio module. * - * **Note** + * @note * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * You can call this method either before or after joining a channel. @@ -639,7 +637,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The audio module is enabled by default. * - * **Note** + * @note * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * You can call this method either before or after joining a channel. @@ -692,7 +690,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Once the local audio function is disabled or re-enabled, the SDK triggers the [`LocalAudioStateChanged`]{@link RtcEngineEvents.LocalAudioStateChanged} callback, which reports [`Stopped`]{@link AudioLocalState.Stopped} or [`Recording`]{@link AudioLocalState.Recording}. * The SDK triggers the [`LocalAudioStateChanged`]{@link RtcEngineEvents.LocalAudioStateChanged} callback once the local audio function is disabled or re-enabled. * - * **Note** + * @note * * - This method is different from the [`muteLocalAudioStream`]{@link muteLocalAudioStream} method: * @@ -724,7 +722,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Stops/Resumes sending the local audio stream. * A successful [`muteLocalAudioStream`]{@link muteLocalAudioStream} method call triggers the [`UserMuteAudio`]{@link RtcEngineEvents.UserMuteAudio} callback on the remote client. * - * **Note** + * @note * * - When `muted` is set as ``true``, this method does not disable the microphone and thus does not affect any ongoing recording. * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether to mute the local audio according to the channel profile and user role. @@ -741,7 +739,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving a specified audio stream. * - * **Note** + * @note * * - If you called [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} and set `muted` as `true` to stop receiving all remote video streams, * ensure that the [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} method is called and set `muted` as `false` before calling this method. @@ -759,7 +757,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the audio parameters and application scenarios. * - * **Note** + * @note * * - You must call this method before calling [`joinChannel`]{@link joinChannel}. * - In the [`Communication`]{@link ChannelProfile.Communication} and [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. @@ -779,7 +777,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * You can call this method either before or after joining a channel. * If you call `setDefaultMuteAllRemoteAudioStreams(true)` after joining a channel, you will not receive the audio streams of any subsequent user. * - * **Note** + * @note * * If you want to resume receiving audio streams, call [`muteRemoteAudioStream(false)`]{@link muteRemoteAudioStream}, and specify the ID of the remote user that you want to subscribe to. * To resume audio streams of multiple users, call [`muteRemoteAudioStream`]{@link muteRemoteAudioStream} as many times. @@ -805,7 +803,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * To enable the video mode, call [`enableVideo`]{@link enableVideo}. * - * **Note** + * @note * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * You can call this method either before or after joining a channel. @@ -837,7 +835,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * After the local video capturer is successfully disabled or re-enabled, the SDK triggers the [`UserEnableLocalVideo`]{@link RtcEngineEvents.UserEnableLocalVideo} callback on the remote client. * - * **Note** + * @note * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender: @@ -862,7 +860,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * To disable the video, call the [`disableVideo`]{@link disableVideo} method. * - * **Note** + * @note * * - This method affects the internal engine and can be called after calling the [`leaveChannel`]{@link leaveChannel} method. You can call this method either before or after joining a channel. * @@ -898,7 +896,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * A successful [`muteLocalVideoStream`]{@link muteLocalVideoStream} method call triggers the [`UserMuteVideo`]{@link RtcEngineEvents.UserMuteVideo} callback on the remote client. * - * **Note** + * @note * * - When you set `muted` as `true`, this method does not disable the camera and thus does not affect the retrieval of the local video streams. * This method responds faster than calling [`enableLocalVideo`]{@link enableLocalVideo} and set `muted` as `false`, which controls sending the local video stream. @@ -917,7 +915,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving a specified remote user's video stream. * - * **Note** + * @note * * If you call [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} and set `muted` as `true` to stop receiving all remote video streams, * ensure that the [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} method is called and set `muted` as `false` before calling this method. The [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} method sets all remote streams, while this method sets a specified remote user's stream. @@ -934,7 +932,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables image enhancement and sets the options. * - * **Note** + * @note * * - Call this method after calling [`enableVideo`]{@link enableVideo}. * - On Android,this method applies to Android 4.4 or later. @@ -955,7 +953,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * You can call this method either before or after joining a channel. * If you call `setDefaultMuteAllRemoteVideoStreams(true)` after joining a channel, you will not receive the video stream of any subsequent user. * - * **Note** + * @note * * If you want to resume receiving video streams, call [`muteRemoteVideoStream(false)`]{@link muteRemoteVideoStream}, and specify the ID of the remote user that you want to subscribe to. * To resume receiving video streams of multiple users, call [`muteRemoteVideoStream`]{@link muteRemoteVideoStream} as many times. Calling `setDefaultMuteAllRemoteVideoStreams(false)` resumes receiving video streams of the subsequent users only. @@ -988,7 +986,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Before calling this method, you must call the [`enableVideo`]{@link enableVideo} method to enable the video. * - * **Note** + * @note * * - By default, the local preview enables the mirror mode. * - Once you call this method to start the local video preview, if you leave the channel by calling [`leaveChannel`]{@link leaveChannel}, @@ -1009,7 +1007,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing for local playback. * - * **Note** + * @note * * Call this method when you are in a channel. * @@ -1022,7 +1020,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing for publishing (sending to other users). * - * **Note** + * @note * * Call this method when you are in a channel. * @@ -1035,7 +1033,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing. * - * **Note** + * @note * * - Call this method when you are in a channel. * @@ -1050,7 +1048,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the playback position (ms) of the music file. * - * **Note** + * @note * * Call this method when you are in a channel. * @@ -1065,7 +1063,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the duration (ms) of the music file. * - * **Note** + * @note * * Call this method when you are in a channel. * @@ -1127,7 +1125,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When a local music file is mixed with a local human voice, call this method to * set the pitch of the local music file only. * - * **Note** + * @note * * Call this method after calling [`startAudioMixing`]{@link startAudioMixing}. * @@ -1162,7 +1160,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When the audio mixing file playback finishes, the SDK triggers the [`AudioMixingStateChanged`]{@link RtcEngineEvents.AudioMixingStateChanged} callback and reports [`Stopped`]{@link AudioMixingStateCode.Stopped} on the local client. * * - * **Note** + * @note * * - To use this method on Android, ensure that the Android device is v4.2 or later, and the API version is v16 or later. * @@ -1271,7 +1269,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Supported audio formats: mp3, aac, m4a, 3gp, wav. * - * **Note** + * @note * - This method does not support online audio effect files. * * - To ensure smooth communication, limit the size of the audio effect file. @@ -1326,7 +1324,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops playing a specified audio effect. * - * **Note** + * @note * * If you preloaded the audio effect into the memory through the [`preloadEffect`]{@link preloadEffect} method, * ensure that the `soundID` value is set to the same value as in the [`preloadEffect`]{@link preloadEffect} method. @@ -1348,7 +1346,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice changer option. * - * **Note** + * @note * * Do not use this method together with [`setLocalVoiceReverbPreset`]{@link setLocalVoiceReverbPreset}, or the method called earlier does not take effect. * @@ -1382,7 +1380,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice reverberation. * - * **Note** + * @note * * Adds the [`setLocalVoiceReverbPreset`]{@link setLocalVoiceReverbPreset} method, a more user-friendly method for setting the * local voice reverberation. You can use this method to set the local reverberation effect, @@ -1399,7 +1397,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the preset local voice reverberation effect. * - * **Note** + * @note * * - Do not use this method together with [`setLocalVoiceReverb`]{@link setLocalVoiceReverb}. * @@ -1434,7 +1432,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * position of the remote user, creating a real sense of space. * This method applies to massively multiplayer online games, such as Battle Royale games. * - * **Note** + * @note * * - For this method to work, enable stereo panning for remote users by calling the [`enableSoundPositionIndication`]{@link enableSoundPositionIndication} method before joining a channel. * @@ -1458,7 +1456,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * This method call triggers the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback on the local client to report the state of adding a local stream to the CDN. * - * **Note** + * @note * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that the user joins a channel before calling this method. @@ -1481,7 +1479,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method removes the RTMP URL address (added by [`addPublishStreamUrl`]{@link addPublishStreamUrl}) from a CDN live stream. * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback. * - * **Note** + * @note * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. @@ -1500,7 +1498,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * If you call this method to set the [`LiveTranscoding`]{@link LiveTranscoding} class for the first time, * the SDK does not trigger the [`TranscodingUpdated`]{@link RtcEngineEvents.TranscodingUpdated} callback. * - * **Note** + * @note * * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. @@ -1525,7 +1523,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * If the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. * - * **Note** + * @note * * - Contact sales-us@agora.io before implementing this function. * - We do not support string user accounts in this API. @@ -1548,7 +1546,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback. * If the callback returns [`Idle(0)`]{@link ChannelMediaRelayState.Idle} and [`None(0)`]{@link ChannelMediaRelayError.None}, the host successfully stops the relay. * - * **Note** + * @note * * If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback with the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} * or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerConnectionLost} state code. @@ -1567,7 +1565,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * After a successful method call, the SDK triggers the [`ChannelMediaRelayEvent`]{@link RtcEngineEvents.ChannelMediaRelayEvent} callback with the [`UpdateDestinationChannel(7)`]{@link ChannelMediaRelayEvent.UpdateDestinationChannel} state code. * - * **Note** + * @note * * - Call this method after the [`startChannelMediaRelay`]{@link startChannelMediaRelay} method to update the destination channel. * @@ -1607,7 +1605,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. * - * **Note** + * @note * * - This method applies to the [`Communication`]{@link ChannelProfile.Communication} profile only. * - Call this method before the user joins a channel. @@ -1625,7 +1623,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method sets whether the audio is routed to the speakerphone or earpiece. * After calling this method, the SDK returns the [`AudioRouteChanged`]{@link RtcEngineEvents.AudioRouteChanged} callback to indicate the changes. * - * **Note** + * @note * * - Ensure that you have successfully called [`joinChannel`]{@link joinChannel} before calling this method. * @@ -1717,7 +1715,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When the locally published video stream falls back to audio only or when the audio-only stream * switches back to the video, the SDK triggers the [`LocalPublishFallbackToAudioOnly`]{@link RtcEngineEvents.LocalPublishFallbackToAudioOnly}. * - * **Note** + * @note * * Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only. * @param option Sets the fallback option for the locally published video stream. @@ -1750,7 +1748,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Use this method with the [`setRemoteSubscribeFallbackOption`]{@link setRemoteSubscribeFallbackOption} method. * If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. * - * **Note** + * @note * * The Agora SDK supports setting `userPriority` as high for one user only. * @@ -1779,7 +1777,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Call [`disableLastmileTest`]{@link disableLastmileTest} to disable this test after receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} callback, * and before the user joins a channel or switches the user role. * - * **Note** + * @note * * - Do not use this method with the [`startLastmileProbeTest`]{@link startLastmileProbeTest} method. * @@ -1799,7 +1797,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly. * - * **Note** + * @note * * - Call this method before joining a channel. * @@ -1826,7 +1824,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. * - * **Note** + * @note * * - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with [`enableLastmileTest`]{@link enableLastmileTest}. * - Do not call other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} and [`LastmileProbeResult`]{@link RtcEngineEvents.LastmileProbeResult} callbacks. Otherwise, the callbacks may be interrupted by other methods. @@ -1859,7 +1857,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method enables you to add synchronized metadata in the video stream for more diversified live streaming interactions, * such as sending shopping links, digital coupons, and online quizzes. * - * **Note** + * @note * * Call this method before the [`joinChannel`]{@link joinChannel} method. * @@ -1909,7 +1907,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - When setting the watermark position, the region must be less than the dimensions set in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method. * Otherwise, the watermark image will be cropped. * - * **Note** + * @note * * - Ensure that you have called [`enableVideo`]{@link enableVideo} to enable the video module before calling this method. * @@ -1948,7 +1946,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. * - * **Note** + * @note * * Call [`setEncryptionSecret`]{@link setEncryptionSecret} before calling this method. * @@ -1966,7 +1964,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * The encryption password is automatically cleared once a user leaves the channel. * If the encryption password is not specified or set to empty, the encryption functionality is disabled. * - * **Note** + * @note * * - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. * - Do not use this method for CDN live streaming. @@ -1986,7 +1984,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - .wav: Large file size with high fidelity. * - .aac: Small file size with low fidelity. * - * **Note** + * @note * * - Ensure that the directory to save the recording file exists and is writable. * - This method is usually called after calling [`joinChannel`]{@link joinChannel}. The recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. @@ -2004,7 +2002,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops the audio recording on the client. * - * **Note** + * @note * * You can call this method before calling [`leaveChannel`]{@link leaveChannel}; * else, the recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. @@ -2029,7 +2027,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - The remote client: * - [`UserJoined`]{@link RtcEngineEvents.UserJoined}(uid: 666), if the method call is successful and the online media stream is injected into the channel. * - * **Note** + * @note * * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. @@ -2174,7 +2172,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - If you want better quality for the local video preview, we recommend setting `config` as [`Preview(2)`]{@link CameraCaptureOutputPreference.Preview}. * - * **Note** + * @note * * Call this method before enabling the local camera. That said, you can call this method before calling [`joinChannel`]{@link joinChannel}, [`enableVideo`]{@link enableVideo}, or [`enableLocalVideo`]{@link enableLocalVideo}, depending on which method you use to turn on your local camera. * @@ -2239,7 +2237,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Each user can create up to five data streams during the lifecycle of the [`RtcEngine`]{@link RtcEngine}. * - * **Note** + * @note * * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds: @@ -2272,7 +2270,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * A failed [`sendStreamMessage`]{@link sendStreamMessage} method call triggers the [`StreamMessageError`]{@link RtcEngineEvents.StreamMessageError} callback on the remote client. * - * **Note** + * @note * * - Ensure that you have created the data stream using [`createDataStream`]{@link createDataStream} before calling this method. * diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index 97ede6d50..779fb5918 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -538,7 +538,7 @@ export interface RtcEngineEvents { * - A remote user/host rejoins the channel after a network interruption. * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcEngine.addInjectStreamUrl}. * - * **Note** + * @note * In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: * - The host receives the [`UserJoined`]{@link UserJoined} callback when another host joins the channel. * - The audience in the channel receives the [`UserJoined`]{@link UserJoined} callback when a new host joins the channel. @@ -617,7 +617,7 @@ export interface RtcEngineEvents { * * The SDK triggers two independent `AudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions. * - * **Note** + * @note * - To enable the voice activity detection of the local user, ensure that you set `report_vad(true)` in the [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication} method. * - Calling [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream} affects the SDK's behavior. * - If the local user calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}, the SDK stops triggering the local user's callback. @@ -633,7 +633,7 @@ export interface RtcEngineEvents { * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by * calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. * - * **Note** + * @note * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. * @@ -660,7 +660,7 @@ export interface RtcEngineEvents { /** * Occurs when a remote user stops/resumes sending the video stream. * - * **Deprecated** + * @deprecated * * This callback is deprecated. Use the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters for the same function: * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. @@ -668,7 +668,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the [`muteLocalVideoStream`]{@link RtcEngine.muteLocalVideoStream} method. * - * **Note** + * @note * * This callback is invalid when the number of users or hosts in the channel exceeds 17. * @@ -707,7 +707,7 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the remote audio stream. * - * **Note** + * @note * * This callback does not work properly when the number of users (in the [`Communication`] profile) or hosts (in the [`LiveBroadcasting`] profile) in the channel exceeds 17. * @@ -720,7 +720,7 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the local audio stream, including the state of the audio recording and encoding, and allows you to troubleshoot issues when exceptions occur. * - * **Note** + * @note * * When the state is [`Failed`]{@link AudioLocalState.Failed}, see the error parameter for details. * @@ -792,7 +792,7 @@ export interface RtcEngineEvents { * - The position of the human face in the local video. * - The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face. * - * **Note** + * @note * - If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device. * - The SDK stops triggering this callback when a human face is in close proximity to the screen. * - On Android, the distance value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for accurate calculation. @@ -874,7 +874,7 @@ export interface RtcEngineEvents { /** * Occurs when the audio mixing file playback finishes. * - * **Deprecated** + * @deprecated * * This callback is deprecated. * Use [`AudioMixingStateChanged`]{@link AudioMixingStateChanged} instead. @@ -926,7 +926,7 @@ export interface RtcEngineEvents { * * When the `LiveTranscoding` class in the [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * - * **Note** + * @note * - If you call [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * * @event TranscodingUpdated @@ -993,7 +993,7 @@ export interface RtcEngineEvents { /** * Occurs when the first remote video frame is rendered. * - * **Deprecated** + * @deprecated * * Use [`Starting`]{@link VideoRemoteState.Starting} or [`Decoding`]{@link VideoRemoteState.Decoding} in the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback instead. * @@ -1006,7 +1006,7 @@ export interface RtcEngineEvents { /** * Occurs when the first remote audio frame is received. * - * **Deprecated** + * @deprecated * * Use [`Starting`]{@link AudioRemoteState.Starting} in [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} instead. * @@ -1017,7 +1017,7 @@ export interface RtcEngineEvents { /** * Occurs when the engine receives the first audio frame from a specified remote user. * - * **Deprecated** + * @deprecated * * Use [`Decoding`]{@link VideoRemoteState.Decoding} in [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} instead. * @@ -1036,14 +1036,14 @@ export interface RtcEngineEvents { /** * Occurs when a remote user stops/resumes sending the audio stream. * - * **Deprecated** + * @deprecated * Use the [`RemoteAudioStateChanged`]{@link RemoteAudioStateChanged} callback with the following parameters instead: * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. * * The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream} method. * - * **Note** + * @note * * This callback is invalid when the number of users or hosts in the channel exceeds 17. * @@ -1054,7 +1054,7 @@ export interface RtcEngineEvents { /** * Reports the result of calling [`addPublishStreamUrl`]{@link RtcEngine.addPublishStreamUrl}. * - * **Deprecated** + * @deprecated * * Use [`RtmpStreamingStateChanged`]{@link RtmpStreamingStateChanged} instead. * @@ -1067,7 +1067,7 @@ export interface RtcEngineEvents { /** * Reports the result of calling [`removePublishStreamUrl`]{@link RtcEngine.removePublishStreamUrl}. * - * **Deprecated** + * @deprecated * * Use [`RtmpStreamingStateChanged`]{@link RtmpStreamingStateChanged} instead. * @@ -1080,7 +1080,7 @@ export interface RtcEngineEvents { /** * Reports the transport-layer statistics of each remote audio stream. * - * **Deprecated** + * @deprecated * * This callback is deprecated. Use [`RemoteAudioStats`]{@link RemoteAudioStats} instead. * @@ -1094,7 +1094,7 @@ export interface RtcEngineEvents { /** * Reports the transport-layer statistics of each remote video stream. * - * **Deprecated** + * @deprecated * * This callback is deprecated. Use [`RemoteVideoStats`]{@link RemoteVideoStats} instead. * @@ -1108,7 +1108,7 @@ export interface RtcEngineEvents { /** * Occurs when a remote user enables/disables the video module. * - * **Deprecated** + * @deprecated * This callback is deprecated and replaced by the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters: * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. * - [`Decoding`]{@link VideoRemoteState.Decoding} and [`RemoteUnmuted`]{@link VideoRemoteStateReason.RemoteUnmuted}. @@ -1117,7 +1117,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the remote user enables or disables the video module by calling the [`enableVideo`]{@link RtcEngine.enableVideo} or [`disableVideo`]{@link RtcEngine.disableVideo} method. * - * **Note** + * @note * * This callback is invalid when the number of users or hosts in the channel exceeds 17. * @@ -1128,7 +1128,7 @@ export interface RtcEngineEvents { /** * Occurs when a remote user enables/disables the local video capture function. * - * **Deprecated** + * @deprecated * * This callback is deprecated and replaced by the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback with the following parameters: * - [`Stopped`]{@link VideoRemoteState.Stopped} and [`RemoteMuted`]{@link VideoRemoteStateReason.RemoteMuted}. @@ -1146,7 +1146,7 @@ export interface RtcEngineEvents { /** * Occurs when the first remote video frame is received and decoded. * - * **Deprecated** + * @deprecated * * This callback is deprecated. Use [`Starting`]{@link VideoRemoteState.Starting} or [`Decoding`]{@link VideoRemoteState.Decoding} in the [`RemoteVideoStateChanged`]{@link RemoteVideoStateChanged} callback instead. * @@ -1165,7 +1165,7 @@ export interface RtcEngineEvents { /** * Occurs when the microphone is enabled/disabled. * - * **Deprecated** + * @deprecated * * This callback is deprecated. Use [`Stopped`]{@link AudioLocalState.Stopped} or [`Recording`]{@link AudioLocalState.Recording} in the [`LocalAudioStateChanged`]{@link LocalAudioStateChanged} callback instead. * @@ -1179,7 +1179,7 @@ export interface RtcEngineEvents { /** * Occurs when the connection between the SDK and the server is interrupted. * - * **Deprecated** + * @deprecated * * Use {@link ConnectionStateChanged} instead. * @@ -1200,7 +1200,7 @@ export interface RtcEngineEvents { /** * Occurs when your connection is banned by the Agora Server. * - * **Deprecated** + * @deprecated * * Use [`ConnectionStateChanged`]{@link ConnectionStateChanged} instead. * @@ -1211,7 +1211,7 @@ export interface RtcEngineEvents { /** * Reports the statistics of the audio stream from each remote user/host. * - * **Deprecated** + * @deprecated * * Use [`RemoteAudioStats`]{@link RemoteAudioStats} instead. * @@ -1225,7 +1225,7 @@ export interface RtcEngineEvents { /** * Occurs when the camera is turned on and ready to capture video. * - * **Deprecated** + * @deprecated * * Use [`Capturing`]{@link LocalVideoStreamState.Capturing} in the [`LocalVideoStateChanged`]{@link LocalVideoStateChanged} callback instead. * If the camera fails to turn on, fix the error reported in the [`Error`]{@link Error} callback. @@ -1237,7 +1237,7 @@ export interface RtcEngineEvents { /** * Occurs when the video stops playing. * - * **Deprecated** + * @deprecated * * Use [`Stopped`]{@link LocalVideoStreamState.Stopped} in the [`LocalVideoStateChanged`]{@link LocalVideoStateChanged} callback instead. * The application can use this callback to change the configuration of the view (for example, displaying other pictures in the view) @@ -1325,7 +1325,7 @@ export interface RtcChannelEvents { * - A remote user/host rejoins the channel after a network interruption. * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcChannel.addInjectStreamUrl}. * - * **Note** + * @note * - In the `LiveBroadcasting` profile: * - The host receives this callback when another host joins the channel. * - The audience in the channel receives this callback when a new host joins the channel. @@ -1394,7 +1394,7 @@ export interface RtcChannelEvents { * * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. * - * **Note** + * @note * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback reports the ID of the user with the highest voice volume during a period of time, instead of at the moment. * @@ -1440,7 +1440,7 @@ export interface RtcChannelEvents { * * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves. * - * **Note** + * @note * * Once the remote media stream is switched to the low stream due to poor network conditions, * you can monitor the stream switch between a high and low stream in the [`RemoteVideoStats`]{@link RemoteVideoStats} callback. @@ -1500,7 +1500,7 @@ export interface RtcChannelEvents { * * When the `LiveTranscoding` class in the [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * - * **Note** + * @note * * If you call [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * diff --git a/src/src/RtcRenderView.native.tsx b/src/src/RtcRenderView.native.tsx index b38151e73..313638684 100644 --- a/src/src/RtcRenderView.native.tsx +++ b/src/src/RtcRenderView.native.tsx @@ -37,7 +37,7 @@ export interface RtcSurfaceViewProps { * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * - * **Note** + * @note * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcEngine.joinChannel} method in the `RtcEngine` class. * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel` object. */ @@ -59,7 +59,7 @@ export interface RtcTextureViewProps { * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * - * **Note** + * @note * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcEngine.joinChannel} method in the `RtcEngine` class. * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel` object. */ From 77c475a6226ed3edb633d088ceb3cb9eb9292d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Fri, 4 Sep 2020 14:43:25 +0800 Subject: [PATCH 8/9] Replace @note --- src/RtcLocalView.tsx | 4 +- src/RtcRemoteView.tsx | 4 +- src/src/Classes.ts | 6 +- src/src/RtcChannel.native.ts | 34 ++++----- src/src/RtcEngine.native.ts | 126 +++++++++++++++---------------- src/src/RtcEvents.ts | 28 +++---- src/src/RtcRenderView.native.tsx | 4 +- 7 files changed, 103 insertions(+), 103 deletions(-) diff --git a/src/RtcLocalView.tsx b/src/RtcLocalView.tsx index 207506b32..5c6546e86 100644 --- a/src/RtcLocalView.tsx +++ b/src/RtcLocalView.tsx @@ -6,7 +6,7 @@ import {RtcSurfaceView, RtcSurfaceViewProps, RtcTextureView, RtcTextureViewProps /** * The SurfaceView class. * - * @note + * **Note** * * SurfaceView is supported on Android only. Use UIView on iOS. * @@ -25,7 +25,7 @@ class SurfaceView extends Component { /** * The TextureView class. * - * @note + * **Note** * * TextureView is supported on Android only. iOS does not support TextureView. * @noInheritDoc diff --git a/src/RtcRemoteView.tsx b/src/RtcRemoteView.tsx index 0c61916a3..c06626309 100644 --- a/src/RtcRemoteView.tsx +++ b/src/RtcRemoteView.tsx @@ -12,7 +12,7 @@ import { /** * The SurfaceView class. * - * @note + * **Note** * * SurfaceView is supported on Android only. Use UIView on iOS. * @@ -29,7 +29,7 @@ class SurfaceView extends Component1280x720 *
* - * @note + * **Note** *
    *
  • The value of the dimension does not indicate the orientation mode of the output ratio. For how to set the video orientation, see [`VideoOutputOrientationMode`]{@link VideoOutputOrientationMode}.
  • *
  • Whether 720p+ can be supported depends on the device. If the device cannot support 720p, the frame rate will be lower than the one listed in the table.
  • @@ -265,7 +265,7 @@ export class VideoEncoderConfiguration { * * * - * @note + * **Note** * * The base bitrate in this table applies to the Communication profile. * The `LiveBroadcasting` profile generally requires a higher bitrate for better video quality. @@ -410,7 +410,7 @@ export class TranscodingUser { * - 4: The audio stream of the broadcaster uses the BL audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. * - 5: The audio stream of the broadcaster uses the BR audio channel. If the broadcaster’s upstream uses multiple audio channels, these channels are mixed into mono first. * - * @note + * **Note** * * Special players are needed if `audioChannel` is not set as 0. * diff --git a/src/src/RtcChannel.native.ts b/src/src/RtcChannel.native.ts index 9f804776b..880d88838 100644 --- a/src/src/RtcChannel.native.ts +++ b/src/src/RtcChannel.native.ts @@ -71,7 +71,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * - * @note + * **Note** * - This parameter does not have a default value. You must set it. * - Do not set it as the empty string "". Otherwise, the SDK returns [`Refused(-5)`]{@link ErrorCode.Refused}. * @@ -186,7 +186,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Joins the channel with a user ID. * - * @note + * **Note** * - If you are already in a channel, you cannot rejoin it with the same UID. * - We recommend using different UIDs for different channels. * - If you want to join the same channel from different devices, ensure that the UIDs in all devices are different. @@ -207,7 +207,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, /** * Joins a channel with the user account. * - * @note + * **Note** * - If you are already in a channel, you cannot rejoin it with the same user account. * - We recommend using different user accounts for different channels. * - If you want to join the same channel from different devices, ensure that the user accounts in all devices are different. @@ -302,7 +302,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * You can call this method as many times as necessary to adjust the playback volume of different remote * users, or to repeatedly adjust the playback volume of the same remote user. * - * @note + * **Note** * - Call this method after joining a channel. * - The playback volume here refers to the mixed volume of a specified remote user. * - This method can only adjust the playback volume of one specified remote user at a time. @@ -390,7 +390,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games. * - * @note + * **Note** * - For this method to work, enable stereo panning for remote users by calling the [`enableSoundPositionIndication`]{@link RtcEngine.enableSoundPositionIndication} method before joining a channel. * - This method requires hardware support. For the best sound positioning, we recommend using a stereo headset. * @@ -411,7 +411,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * This method call triggers the [`RtmpStreamingStateChanged`]{@link RtcChannelEvents.RtmpStreamingStateChanged} * callback on the local client to report the state of adding a local stream to the CDN. * - * @note + * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. * - This method can only be called by a host in a `LiveBroadcasting` channel. @@ -433,7 +433,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * This method removes the RTMP URL address (added by [`addPublishStreamUrl`]{@link RtcChannel.addPublishStreamUrl}) from a CDN live stream. * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcChannelEvents.RtmpStreamingStateChanged} callback. * - * @note + * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method can only be called by a host in a `LiveBroadcasting` channel. * - This method removes only one stream HTTP/HTTPS URL address each time it is called. @@ -452,7 +452,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * call this method to update the [`LiveTranscoding`]{@link LiveTranscoding} class. If you call this method to set the [`LiveTranscoding`]{@link LiveTranscoding} * class for the first time, the SDK does not trigger the [`TranscodingUpdated`]{@link RtcChannelEvents.TranscodingUpdated} callback. * - * @note + * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. * - This method can only be called by a host in a `LiveBroadcasting` channel. @@ -477,7 +477,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * - If the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. * - * @note + * **Note** * - Contact support@agora.io before implementing this function. * - We do not support string user accounts in this API. * - Call this method after joining the channel. @@ -498,7 +498,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback. If the callback reports [`Idle(0)`]{@link ChannelMediaRelayState.Idle} and * [`None(0)`]{@link ChannelMediaRelayError.None}, the host successfully stops the relay. * - * @note + * **Note** * - If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcChannelEvents.ChannelMediaRelayStateChanged} callback with * the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerConnectionLost} state code. * You can leave the channel using [`leaveChannel`]{@link RtcChannel.leaveChannel}, and the media stream relay automatically stops. @@ -515,7 +515,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * After a successful method call, the SDK triggers the [`ChannelMediaRelayEvent`]{@link RtcChannelEvents.ChannelMediaRelayEvent} callback with * the [`UpdateDestinationChannel(7)`]{@link ChannelMediaRelayEvent.UpdateDestinationChannel} state code. * - * @note + * **Note** * - Call this method after the [`startChannelMediaRelay`]{@link RtcChannel.startChannelMediaRelay} method to update the destination channel. * - This method supports adding at most four destination channels in the relay. * @@ -560,7 +560,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * Use this method with the [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} method. * If a remote video stream experiences the fallback, the SDK ensures the high-priority user gets the best possible stream quality. * - * @note + * **Note** * The Agora SDK supports setting userPriority as high for one user only. * * @param uid The ID of the remote user. @@ -579,7 +579,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * This method enables you to add synchronized metadata in the video stream for more diversified live streaming interactions, * such as sending shopping links, digital coupons, and online quizzes. * - * @note + * **Note** * - Call this method before the [`joinChannel`]{@link RtcChannel.joinChannel} method. * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. * @@ -621,7 +621,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * All users in the same channel must use the same encryption mode and password. * Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. * - * @note + * **Note** * - Do not use this method for CDN streaming. * - Before calling this method, ensure that you have called [`setEncryptionSecret`]{@link RtcChannel.setEncryptionSecret} to enable encryption. * @@ -639,7 +639,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * The encryption password is automatically cleared once a user leaves the channel. * If the encryption password is not specified or set to empty, the encryption functionality is disabled. * - * @note + * **Note** * - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. * - Do not use this method for CDN live streaming. * @@ -663,7 +663,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * - [`UserJoined`]{@link RtcChannelEvents.UserJoined}(uid: 666), if the method call succeeds and the online * media stream is injected into the channel. * - * @note + * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method can only be called by a host in a `LiveBroadcasting` channel. * @@ -696,7 +696,7 @@ export default class RtcChannel implements RtcAudioInterface, RtcVideoInterface, * * Each user can create up to five data streams during the life cycle of the [`RtcChannel`]{@link RtcChannel} instance. * - * @note + * **Note** * * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` * and the other as `false`. diff --git a/src/src/RtcEngine.native.ts b/src/src/RtcEngine.native.ts index 80e35c316..0ae10a218 100644 --- a/src/src/RtcEngine.native.ts +++ b/src/src/RtcEngine.native.ts @@ -71,7 +71,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets a created [`RtcEngine`]{@link RtcEngine} instance. * - * @note + * **Note** * * Ensure that you have created an `RtcEngine`. Otherwise, the method call fails and the SDK returns an error message. * @returns @@ -92,7 +92,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Unless otherwise specified, all the methods provided by the [`RtcEngine`]{@link RtcEngine} class are executed asynchronously. Agora recommends calling these methods in the same thread. * - * @note + * **Note** * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`createWithAreaCode`]{@link createWithAreaCode}. The difference between [`createWithAreaCode`]{@link createWithAreaCode} and this method is that [`createWithAreaCode`]{@link createWithAreaCode} enables you to specify the connection area. * - The Agora React Native SDK supports creating only one [`RtcEngine`]{@link RtcEngine} instance for an app. @@ -113,7 +113,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Unless otherwise specified, all the methods provided by the [`RtcEngine`]{@link RtcEngine} class are executed asynchronously. Agora recommends calling these methods in the same thread. * - * @note + * **Note** * * - You must create an [`RtcEngine`]{@link RtcEngine} instance before calling any other method. * - You can create an [`RtcEngine`]{@link RtcEngine} instance either by calling this method or by calling [`create`]{@link create}. The difference between [`create`]{@link create} and this method is that this method enables you to specify the connection area. @@ -144,7 +144,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Once you call this method to destroy the created [`RtcEngine`]{@link RtcEngine} instance, you cannot use any method or callback in the SDK any more. * If you want to use the real-time communication functions again, you must call `create` to create a new [`RtcEngine`]{@link RtcEngine} instance. * - * @note + * **Note** * * - Because [`destroy`]{@link destroy} is a synchronous method and the app cannot move on to another task until the execution completes, * Agora suggests calling this method in a sub-thread to avoid congestion in the main thread. @@ -262,7 +262,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When the connection between the client and Agora server is interrupted due to poor network conditions, * the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the [`RejoinChannelSuccess`]{@link RtcEngineEvents.RejoinChannelSuccess} callback on the local client. * - * @note + * **Note** * * A channel does not accept duplicate uids, such as two users with the same `uid`. If you set `uid` as `0`, the system automatically assigns a uid. * @@ -299,7 +299,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * After the user successfully switches to another channel, the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} and [`JoinChannelSuccess`]{@link RtcEngineEvents.JoinChannelSuccess} callbacks are triggered to * indicate that the user has left the original channel and joined a new one. * - * @note + * **Note** * * This method applies to the [`Audience`]{@link ClientRole.Audience} role in a [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} channel only. * @@ -331,7 +331,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - The remote client: [`UserOffline`]{@link RtcEngineEvents.UserOffline}, if the user leaving the channel is in the [`Communication`]{@link ChannelProfile.Communication} channel, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} * in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * - * @note + * **Note** * - If you call [`destroy`]{@link destroy} immediately after calling [`leaveChannel`]{@link leaveChannel}, the [`leaveChannel`]{@link leaveChannel} process interrupts, and the SDK does not trigger the [`LeaveChannel`]{@link RtcEngineEvents.LeaveChannel} callback. * * - If you call [`leaveChannel`]{@link leaveChannel} during CDN live streaming, the SDK triggers the [`removeInjectStreamUrl`]{@link removeInjectStreamUrl} method. @@ -422,7 +422,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The log file records all log data for the SDK’s operation. Ensure that the directory for the log file exists and is writable. * - * @note + * **Note** * * Ensure that you call this method immediately after calling the `create` method, otherwise the output log may not be complete. * @@ -500,7 +500,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - The remote client: [`UserJoined`]{@link RtcEngineEvents.UserJoined} and [`UserInfoUpdated`]{@link RtcEngineEvents.UserInfoUpdated}, if the user joining the channel is in the [`Communication`]{@link ChannelProfile.Communication} profile, or is a [`Broadcaster`]{@link ClientRole.Broadcaster} in the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile. * - * @note + * **Note** * * To ensure smooth communication, use the same parameter type to identify the user. * For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. @@ -539,7 +539,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The difference between the two is that for the former, the time elapsed between calling the [`joinChannelWithUserAccount`]{@link joinChannelWithUserAccount} method and joining the channel is shorter than the latter. * - * @note + * **Note** * * - Ensure that you set the `userAccount` parameter. Otherwise, this method does not take effect. * - Ensure that the value of the `userAccount` parameter is unique in the channel. @@ -562,7 +562,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the playback volume of all remote users. * - * @note + * **Note** * * - This method adjusts the playback volume which is mixed volume of all remote users. * - To mute the local audio playback, call both this method and [`adjustAudioMixingVolume`]{@link adjustAudioMixingVolume}, and set `volume` as `0`. @@ -595,7 +595,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * You can call this method as many times as necessary to adjust the playback volume of different remote users, or to repeatedly adjust the playback volume of the same remote user. * - * @note + * **Note** * - Call this method after joining a channel. * - The playback volume here refers to the mixed volume of a specified remote user. * - This method can only adjust the playback volume of one specified remote user at a time. To adjust the playback volume of different remote users, call the method as many times, once for each remote user. @@ -611,7 +611,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Disables the audio module. * - * @note + * **Note** * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * You can call this method either before or after joining a channel. @@ -637,7 +637,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * The audio module is enabled by default. * - * @note + * **Note** * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * You can call this method either before or after joining a channel. @@ -690,7 +690,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Once the local audio function is disabled or re-enabled, the SDK triggers the [`LocalAudioStateChanged`]{@link RtcEngineEvents.LocalAudioStateChanged} callback, which reports [`Stopped`]{@link AudioLocalState.Stopped} or [`Recording`]{@link AudioLocalState.Recording}. * The SDK triggers the [`LocalAudioStateChanged`]{@link RtcEngineEvents.LocalAudioStateChanged} callback once the local audio function is disabled or re-enabled. * - * @note + * **Note** * * - This method is different from the [`muteLocalAudioStream`]{@link muteLocalAudioStream} method: * @@ -722,7 +722,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Stops/Resumes sending the local audio stream. * A successful [`muteLocalAudioStream`]{@link muteLocalAudioStream} method call triggers the [`UserMuteAudio`]{@link RtcEngineEvents.UserMuteAudio} callback on the remote client. * - * @note + * **Note** * * - When `muted` is set as ``true``, this method does not disable the microphone and thus does not affect any ongoing recording. * - If you call [`setChannelProfile`]{@link setChannelProfile} after this method, the SDK resets whether to mute the local audio according to the channel profile and user role. @@ -739,7 +739,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving a specified audio stream. * - * @note + * **Note** * * - If you called [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} and set `muted` as `true` to stop receiving all remote video streams, * ensure that the [`muteAllRemoteAudioStreams`]{@link muteAllRemoteAudioStreams} method is called and set `muted` as `false` before calling this method. @@ -757,7 +757,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the audio parameters and application scenarios. * - * @note + * **Note** * * - You must call this method before calling [`joinChannel`]{@link joinChannel}. * - In the [`Communication`]{@link ChannelProfile.Communication} and [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profiles, the bitrates may be different from your settings due to network self-adaptation. @@ -777,7 +777,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * You can call this method either before or after joining a channel. * If you call `setDefaultMuteAllRemoteAudioStreams(true)` after joining a channel, you will not receive the audio streams of any subsequent user. * - * @note + * **Note** * * If you want to resume receiving audio streams, call [`muteRemoteAudioStream(false)`]{@link muteRemoteAudioStream}, and specify the ID of the remote user that you want to subscribe to. * To resume audio streams of multiple users, call [`muteRemoteAudioStream`]{@link muteRemoteAudioStream} as many times. @@ -803,7 +803,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * To enable the video mode, call [`enableVideo`]{@link enableVideo}. * - * @note + * **Note** * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * You can call this method either before or after joining a channel. @@ -835,7 +835,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * After the local video capturer is successfully disabled or re-enabled, the SDK triggers the [`UserEnableLocalVideo`]{@link RtcEngineEvents.UserEnableLocalVideo} callback on the remote client. * - * @note + * **Note** * * - This method affects the internal engine and can be called after calling [`leaveChannel`]{@link leaveChannel}. * @param enabled Sets whether to disable/re-enable the local video, including the capturer, renderer, and sender: @@ -860,7 +860,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * To disable the video, call the [`disableVideo`]{@link disableVideo} method. * - * @note + * **Note** * * - This method affects the internal engine and can be called after calling the [`leaveChannel`]{@link leaveChannel} method. You can call this method either before or after joining a channel. * @@ -896,7 +896,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * A successful [`muteLocalVideoStream`]{@link muteLocalVideoStream} method call triggers the [`UserMuteVideo`]{@link RtcEngineEvents.UserMuteVideo} callback on the remote client. * - * @note + * **Note** * * - When you set `muted` as `true`, this method does not disable the camera and thus does not affect the retrieval of the local video streams. * This method responds faster than calling [`enableLocalVideo`]{@link enableLocalVideo} and set `muted` as `false`, which controls sending the local video stream. @@ -915,7 +915,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops/Resumes receiving a specified remote user's video stream. * - * @note + * **Note** * * If you call [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} and set `muted` as `true` to stop receiving all remote video streams, * ensure that the [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} method is called and set `muted` as `false` before calling this method. The [`muteAllRemoteVideoStreams`]{@link muteAllRemoteVideoStreams} method sets all remote streams, while this method sets a specified remote user's stream. @@ -932,7 +932,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Enables/Disables image enhancement and sets the options. * - * @note + * **Note** * * - Call this method after calling [`enableVideo`]{@link enableVideo}. * - On Android,this method applies to Android 4.4 or later. @@ -953,7 +953,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * You can call this method either before or after joining a channel. * If you call `setDefaultMuteAllRemoteVideoStreams(true)` after joining a channel, you will not receive the video stream of any subsequent user. * - * @note + * **Note** * * If you want to resume receiving video streams, call [`muteRemoteVideoStream(false)`]{@link muteRemoteVideoStream}, and specify the ID of the remote user that you want to subscribe to. * To resume receiving video streams of multiple users, call [`muteRemoteVideoStream`]{@link muteRemoteVideoStream} as many times. Calling `setDefaultMuteAllRemoteVideoStreams(false)` resumes receiving video streams of the subsequent users only. @@ -986,7 +986,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Before calling this method, you must call the [`enableVideo`]{@link enableVideo} method to enable the video. * - * @note + * **Note** * * - By default, the local preview enables the mirror mode. * - Once you call this method to start the local video preview, if you leave the channel by calling [`leaveChannel`]{@link leaveChannel}, @@ -1007,7 +1007,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing for local playback. * - * @note + * **Note** * * Call this method when you are in a channel. * @@ -1020,7 +1020,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing for publishing (sending to other users). * - * @note + * **Note** * * Call this method when you are in a channel. * @@ -1033,7 +1033,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Adjusts the volume of audio mixing. * - * @note + * **Note** * * - Call this method when you are in a channel. * @@ -1048,7 +1048,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the playback position (ms) of the music file. * - * @note + * **Note** * * Call this method when you are in a channel. * @@ -1063,7 +1063,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Gets the duration (ms) of the music file. * - * @note + * **Note** * * Call this method when you are in a channel. * @@ -1125,7 +1125,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When a local music file is mixed with a local human voice, call this method to * set the pitch of the local music file only. * - * @note + * **Note** * * Call this method after calling [`startAudioMixing`]{@link startAudioMixing}. * @@ -1160,7 +1160,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When the audio mixing file playback finishes, the SDK triggers the [`AudioMixingStateChanged`]{@link RtcEngineEvents.AudioMixingStateChanged} callback and reports [`Stopped`]{@link AudioMixingStateCode.Stopped} on the local client. * * - * @note + * **Note** * * - To use this method on Android, ensure that the Android device is v4.2 or later, and the API version is v16 or later. * @@ -1269,7 +1269,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Supported audio formats: mp3, aac, m4a, 3gp, wav. * - * @note + * **Note** * - This method does not support online audio effect files. * * - To ensure smooth communication, limit the size of the audio effect file. @@ -1324,7 +1324,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops playing a specified audio effect. * - * @note + * **Note** * * If you preloaded the audio effect into the memory through the [`preloadEffect`]{@link preloadEffect} method, * ensure that the `soundID` value is set to the same value as in the [`preloadEffect`]{@link preloadEffect} method. @@ -1346,7 +1346,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice changer option. * - * @note + * **Note** * * Do not use this method together with [`setLocalVoiceReverbPreset`]{@link setLocalVoiceReverbPreset}, or the method called earlier does not take effect. * @@ -1380,7 +1380,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the local voice reverberation. * - * @note + * **Note** * * Adds the [`setLocalVoiceReverbPreset`]{@link setLocalVoiceReverbPreset} method, a more user-friendly method for setting the * local voice reverberation. You can use this method to set the local reverberation effect, @@ -1397,7 +1397,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Sets the preset local voice reverberation effect. * - * @note + * **Note** * * - Do not use this method together with [`setLocalVoiceReverb`]{@link setLocalVoiceReverb}. * @@ -1432,7 +1432,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * position of the remote user, creating a real sense of space. * This method applies to massively multiplayer online games, such as Battle Royale games. * - * @note + * **Note** * * - For this method to work, enable stereo panning for remote users by calling the [`enableSoundPositionIndication`]{@link enableSoundPositionIndication} method before joining a channel. * @@ -1456,7 +1456,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * This method call triggers the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback on the local client to report the state of adding a local stream to the CDN. * - * @note + * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that the user joins a channel before calling this method. @@ -1479,7 +1479,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method removes the RTMP URL address (added by [`addPublishStreamUrl`]{@link addPublishStreamUrl}) from a CDN live stream. * The SDK reports the result of this method call in the [`RtmpStreamingStateChanged`]{@link RtcEngineEvents.RtmpStreamingStateChanged} callback. * - * @note + * **Note** * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. * - Ensure that the user joins a channel before calling this method. * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. @@ -1498,7 +1498,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * If you call this method to set the [`LiveTranscoding`]{@link LiveTranscoding} class for the first time, * the SDK does not trigger the [`TranscodingUpdated`]{@link RtcEngineEvents.TranscodingUpdated} callback. * - * @note + * **Note** * * - This method applies to [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} only. * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in Push Streams to CDN. @@ -1523,7 +1523,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * If the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback returns [`Failure(3)`]{@link ChannelMediaRelayState.Failure}, an exception occurs during the media stream relay. * - * @note + * **Note** * * - Contact sales-us@agora.io before implementing this function. * - We do not support string user accounts in this API. @@ -1546,7 +1546,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * After a successful method call, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback. * If the callback returns [`Idle(0)`]{@link ChannelMediaRelayState.Idle} and [`None(0)`]{@link ChannelMediaRelayError.None}, the host successfully stops the relay. * - * @note + * **Note** * * If the method call fails, the SDK triggers the [`ChannelMediaRelayStateChanged`]{@link RtcEngineEvents.ChannelMediaRelayStateChanged} callback with the [`ServerNoResponse(2)`]{@link ChannelMediaRelayError.ServerNoResponse} * or [`ServerConnectionLost(8)`]{@link ChannelMediaRelayError.ServerConnectionLost} state code. @@ -1565,7 +1565,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * After a successful method call, the SDK triggers the [`ChannelMediaRelayEvent`]{@link RtcEngineEvents.ChannelMediaRelayEvent} callback with the [`UpdateDestinationChannel(7)`]{@link ChannelMediaRelayEvent.UpdateDestinationChannel} state code. * - * @note + * **Note** * * - Call this method after the [`startChannelMediaRelay`]{@link startChannelMediaRelay} method to update the destination channel. * @@ -1605,7 +1605,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: The default audio route is the speaker. * - * @note + * **Note** * * - This method applies to the [`Communication`]{@link ChannelProfile.Communication} profile only. * - Call this method before the user joins a channel. @@ -1623,7 +1623,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method sets whether the audio is routed to the speakerphone or earpiece. * After calling this method, the SDK returns the [`AudioRouteChanged`]{@link RtcEngineEvents.AudioRouteChanged} callback to indicate the changes. * - * @note + * **Note** * * - Ensure that you have successfully called [`joinChannel`]{@link joinChannel} before calling this method. * @@ -1715,7 +1715,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * When the locally published video stream falls back to audio only or when the audio-only stream * switches back to the video, the SDK triggers the [`LocalPublishFallbackToAudioOnly`]{@link RtcEngineEvents.LocalPublishFallbackToAudioOnly}. * - * @note + * **Note** * * Agora does not recommend using this method for CDN live streaming, because the remote CDN live user will have a noticeable lag when the locally published video stream falls back to audio only. * @param option Sets the fallback option for the locally published video stream. @@ -1748,7 +1748,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Use this method with the [`setRemoteSubscribeFallbackOption`]{@link setRemoteSubscribeFallbackOption} method. * If the fallback function is enabled for a subscribed stream, the SDK ensures the high-priority user gets the best possible stream quality. * - * @note + * **Note** * * The Agora SDK supports setting `userPriority` as high for one user only. * @@ -1777,7 +1777,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * Call [`disableLastmileTest`]{@link disableLastmileTest} to disable this test after receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} callback, * and before the user joins a channel or switches the user role. * - * @note + * **Note** * * - Do not use this method with the [`startLastmileProbeTest`]{@link startLastmileProbeTest} method. * @@ -1797,7 +1797,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * In the audio call test, you record your voice. If the recording plays back within the set time interval, the audio devices and the network connection are working properly. * - * @note + * **Note** * * - Call this method before joining a channel. * @@ -1824,7 +1824,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Call this method to check the uplink network quality before users join a channel or before an audience switches to a host. * - * @note + * **Note** * * - This method consumes extra network traffic and may affect communication quality. We do not recommend calling this method together with [`enableLastmileTest`]{@link enableLastmileTest}. * - Do not call other methods before receiving the [`LastmileQuality`]{@link RtcEngineEvents.LastmileQuality} and [`LastmileProbeResult`]{@link RtcEngineEvents.LastmileProbeResult} callbacks. Otherwise, the callbacks may be interrupted by other methods. @@ -1857,7 +1857,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * This method enables you to add synchronized metadata in the video stream for more diversified live streaming interactions, * such as sending shopping links, digital coupons, and online quizzes. * - * @note + * **Note** * * Call this method before the [`joinChannel`]{@link joinChannel} method. * @@ -1907,7 +1907,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - When setting the watermark position, the region must be less than the dimensions set in the [`setVideoEncoderConfiguration`]{@link setVideoEncoderConfiguration} method. * Otherwise, the watermark image will be cropped. * - * @note + * **Note** * * - Ensure that you have called [`enableVideo`]{@link enableVideo} to enable the video module before calling this method. * @@ -1946,7 +1946,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. * - * @note + * **Note** * * Call [`setEncryptionSecret`]{@link setEncryptionSecret} before calling this method. * @@ -1964,7 +1964,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * The encryption password is automatically cleared once a user leaves the channel. * If the encryption password is not specified or set to empty, the encryption functionality is disabled. * - * @note + * **Note** * * - For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption. * - Do not use this method for CDN live streaming. @@ -1984,7 +1984,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - .wav: Large file size with high fidelity. * - .aac: Small file size with low fidelity. * - * @note + * **Note** * * - Ensure that the directory to save the recording file exists and is writable. * - This method is usually called after calling [`joinChannel`]{@link joinChannel}. The recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. @@ -2002,7 +2002,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac /** * Stops the audio recording on the client. * - * @note + * **Note** * * You can call this method before calling [`leaveChannel`]{@link leaveChannel}; * else, the recording automatically stops when you call [`leaveChannel`]{@link leaveChannel}. @@ -2027,7 +2027,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * - The remote client: * - [`UserJoined`]{@link RtcEngineEvents.UserJoined}(uid: 666), if the method call is successful and the online media stream is injected into the channel. * - * @note + * **Note** * * - This method applies to the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile only. * - Ensure that you enable the RTMP Converter service before using this function. See Prerequisites in *Push Streams to CDN*. @@ -2172,7 +2172,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * - If you want better quality for the local video preview, we recommend setting `config` as [`Preview(2)`]{@link CameraCaptureOutputPreference.Preview}. * - * @note + * **Note** * * Call this method before enabling the local camera. That said, you can call this method before calling [`joinChannel`]{@link joinChannel}, [`enableVideo`]{@link enableVideo}, or [`enableLocalVideo`]{@link enableLocalVideo}, depending on which method you use to turn on your local camera. * @@ -2237,7 +2237,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * Each user can create up to five data streams during the lifecycle of the [`RtcEngine`]{@link RtcEngine}. * - * @note + * **Note** * * Set both the `reliable` and `ordered` parameters to `true` or `false`. Do not set one as `true` and the other as `false`. * @param reliable Sets whether the recipients are guaranteed to receive the data stream from the sender within five seconds: @@ -2270,7 +2270,7 @@ export default class RtcEngine implements RtcUserInfoInterface, RtcAudioInterfac * * A failed [`sendStreamMessage`]{@link sendStreamMessage} method call triggers the [`StreamMessageError`]{@link RtcEngineEvents.StreamMessageError} callback on the remote client. * - * @note + * **Note** * * - Ensure that you have created the data stream using [`createDataStream`]{@link createDataStream} before calling this method. * diff --git a/src/src/RtcEvents.ts b/src/src/RtcEvents.ts index 779fb5918..11c71c78f 100644 --- a/src/src/RtcEvents.ts +++ b/src/src/RtcEvents.ts @@ -538,7 +538,7 @@ export interface RtcEngineEvents { * - A remote user/host rejoins the channel after a network interruption. * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcEngine.addInjectStreamUrl}. * - * @note + * **Note** * In the [`LiveBroadcasting`]{@link ChannelProfile.LiveBroadcasting} profile: * - The host receives the [`UserJoined`]{@link UserJoined} callback when another host joins the channel. * - The audience in the channel receives the [`UserJoined`]{@link UserJoined} callback when a new host joins the channel. @@ -617,7 +617,7 @@ export interface RtcEngineEvents { * * The SDK triggers two independent `AudioVolumeIndication` callbacks at one time, which separately report the volume information of the local user and all the remote speakers. For more information, see the detailed parameter descriptions. * - * @note + * **Note** * - To enable the voice activity detection of the local user, ensure that you set `report_vad(true)` in the [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication} method. * - Calling [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream} affects the SDK's behavior. * - If the local user calls [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream}, the SDK stops triggering the local user's callback. @@ -633,7 +633,7 @@ export interface RtcEngineEvents { * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by * calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. * - * @note + * **Note** * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback returns the user ID of the user with the highest voice volume during a period of time, instead of at the moment. * @@ -668,7 +668,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the remote user stops or resumes sending the video stream by calling the [`muteLocalVideoStream`]{@link RtcEngine.muteLocalVideoStream} method. * - * @note + * **Note** * * This callback is invalid when the number of users or hosts in the channel exceeds 17. * @@ -707,7 +707,7 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the remote audio stream. * - * @note + * **Note** * * This callback does not work properly when the number of users (in the [`Communication`] profile) or hosts (in the [`LiveBroadcasting`] profile) in the channel exceeds 17. * @@ -720,7 +720,7 @@ export interface RtcEngineEvents { * * This callback indicates the state change of the local audio stream, including the state of the audio recording and encoding, and allows you to troubleshoot issues when exceptions occur. * - * @note + * **Note** * * When the state is [`Failed`]{@link AudioLocalState.Failed}, see the error parameter for details. * @@ -792,7 +792,7 @@ export interface RtcEngineEvents { * - The position of the human face in the local video. * - The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face. * - * @note + * **Note** * - If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device. * - The SDK stops triggering this callback when a human face is in close proximity to the screen. * - On Android, the distance value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for accurate calculation. @@ -926,7 +926,7 @@ export interface RtcEngineEvents { * * When the `LiveTranscoding` class in the [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * - * @note + * **Note** * - If you call [`setLiveTranscoding`]{@link RtcEngine.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * * @event TranscodingUpdated @@ -1043,7 +1043,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the remote user stops or resumes sending the audio stream by calling the [`muteLocalAudioStream`]{@link RtcEngine.muteLocalAudioStream} method. * - * @note + * **Note** * * This callback is invalid when the number of users or hosts in the channel exceeds 17. * @@ -1117,7 +1117,7 @@ export interface RtcEngineEvents { * * The SDK triggers this callback when the remote user enables or disables the video module by calling the [`enableVideo`]{@link RtcEngine.enableVideo} or [`disableVideo`]{@link RtcEngine.disableVideo} method. * - * @note + * **Note** * * This callback is invalid when the number of users or hosts in the channel exceeds 17. * @@ -1325,7 +1325,7 @@ export interface RtcChannelEvents { * - A remote user/host rejoins the channel after a network interruption. * - The host injects an online media stream into the channel by calling [`addInjectStreamUrl`]{@link RtcChannel.addInjectStreamUrl}. * - * @note + * **Note** * - In the `LiveBroadcasting` profile: * - The host receives this callback when another host joins the channel. * - The audience in the channel receives this callback when a new host joins the channel. @@ -1394,7 +1394,7 @@ export interface RtcChannelEvents { * * This callback reports the speaker with the highest accumulative volume during a certain period. If the user enables the audio volume indication by calling [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}, this callback returns the uid of the active speaker whose voice is detected by the audio volume detection module of the SDK. * - * @note + * **Note** * - To receive this callback, you need to call [`enableAudioVolumeIndication`]{@link RtcEngine.enableAudioVolumeIndication}. * - This callback reports the ID of the user with the highest voice volume during a period of time, instead of at the moment. * @@ -1440,7 +1440,7 @@ export interface RtcChannelEvents { * * If you call [`setRemoteSubscribeFallbackOption`]{@link RtcEngine.setRemoteSubscribeFallbackOption} and set option as [`AudioOnly`]{@link StreamFallbackOptions.AudioOnly}, this callback is triggered when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the uplink network condition improves. * - * @note + * **Note** * * Once the remote media stream is switched to the low stream due to poor network conditions, * you can monitor the stream switch between a high and low stream in the [`RemoteVideoStats`]{@link RemoteVideoStats} callback. @@ -1500,7 +1500,7 @@ export interface RtcChannelEvents { * * When the `LiveTranscoding` class in the [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} method updates, the SDK triggers this callback to report the update information. * - * @note + * **Note** * * If you call [`setLiveTranscoding`]{@link RtcChannel.setLiveTranscoding} to set the `LiveTranscoding` class for the first time, the SDK does not trigger this callback. * diff --git a/src/src/RtcRenderView.native.tsx b/src/src/RtcRenderView.native.tsx index 313638684..b38151e73 100644 --- a/src/src/RtcRenderView.native.tsx +++ b/src/src/RtcRenderView.native.tsx @@ -37,7 +37,7 @@ export interface RtcSurfaceViewProps { * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * - * @note + * **Note** * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcEngine.joinChannel} method in the `RtcEngine` class. * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel` object. */ @@ -59,7 +59,7 @@ export interface RtcTextureViewProps { * - The space character. * - Punctuation characters and other symbols, including: "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", " {", "}", "|", "~", ",". * - * @note + * **Note** * - The default value is the empty string "". Use the default value if the user joins the channel using the [`joinChannel`]{@link RtcEngine.joinChannel} method in the `RtcEngine` class. * - If the user joins the channel using the [`joinChannel`]{@link RtcChannel.joinChannel} method in the `RtcChannel` class, set this parameter as the `channelId` of the `RtcChannel` object. */ From 9159ba1518310e873cabe5f1a86b157e6713d0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=A9=B7?= Date: Fri, 4 Sep 2020 15:11:02 +0800 Subject: [PATCH 9/9] remove @enum --- src/src/Enums.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/src/Enums.ts b/src/src/Enums.ts index 503e43f97..e82f9b1f6 100644 --- a/src/src/Enums.ts +++ b/src/src/Enums.ts @@ -981,8 +981,8 @@ export enum DegradationPreference { } /** - * Encryption mode - * @enum {string} + * Encryption mode. + * */ export enum EncryptionMode { /**