No Description

types.d.ts 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. import { ViewProps } from 'react-native';
  2. /**
  3. * VideoEncoderConfig details
  4. * @property width: number | The encoder video's width
  5. * @property height: number | The encoder video's height
  6. * @property bitrate: number | The encoder video's bitrate
  7. * @property frameRate: number | The frameRate of encoder video
  8. * @property orientationMode: number | The video orientation mode of the video
  9. * @orientationMode value range is [0 is "mode adapative", 1 is "mode fixed landscape", 2 is "mode fixed portrait"]
  10. */
  11. export interface VideoEncoderConfig {
  12. width: number;
  13. height: number;
  14. bitrate: number;
  15. frameRate: number;
  16. orientationMode: number;
  17. }
  18. /**
  19. * Option is work for init method
  20. * @property: string appid Sets the appid
  21. * @property: number channelProfile Sets the channel mode. 0 is communication mode, 1 is broadcasting mode
  22. * @property: {@link VideoEncoderConfig} sets video encoding config
  23. * @property: mode is optional sets only enable video / audio, 0 is audio mode, 1 is video mode
  24. * @property: clientRole is only work in live mode, 1 is host, 2 is audience
  25. * @property: dualStream is optional parameter only for enable for detail see {@link https://docs.agora.io/en/Video/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/enableDualStreamMode:}
  26. * @property: audioProfile {@link https://docs.agora.io/en/Video/API%20Reference/oc/Constants/AgoraAudioProfile.html}
  27. * @property: audioScenario {@link https://docs.agora.io/en/Video/API%20Reference/oc/Constants/AgoraAudioScenario.html}
  28. */
  29. export interface Option {
  30. appid: String;
  31. channelProfile: number;
  32. videoEncoderConfig: VideoEncoderConfig;
  33. dualStream: boolean;
  34. mode: number;
  35. clientRole: number;
  36. audioProfile: number;
  37. audioScenario: number;
  38. beauty?: BeautyOption;
  39. voice?: VoiceDecorator;
  40. }
  41. /**
  42. * VoiceDecorator is decorate local audio voice
  43. *
  44. * @property type: string | the range values ['changer' | 'reverbPreset'] This property is the identifier for audio voice decorator
  45. * @property value: number | the value for voice parameter option.
  46. * type 'reverbPreset' range values: [0 is "off", 1 is "popular", 2 is "rnb", 3 is "rock", 4 is "hiphop", 5 is "vocal concert", 6 is "KTV", 7 is "studio"]
  47. * type 'changer' range values: [0 is "off", 1 is "old man", 2 is "baby boy", 3 is "baby girl", 4 is "zhubajie", 5 is "ethereal", 6 is "hulk"]
  48. */
  49. export interface VoiceDecorator {
  50. type: string;
  51. value: number;
  52. }
  53. export interface PublisherConfig {
  54. width: number;
  55. height: number;
  56. framerate: number;
  57. bitrate: number;
  58. defaultLayout: number;
  59. lifeCycle: number;
  60. pubishUrl: string;
  61. rawStreamUrl: string;
  62. extraInfo: String;
  63. owner: boolean;
  64. }
  65. export interface BackgroundImage {
  66. url: string;
  67. x: number;
  68. y: number;
  69. width: number;
  70. height: number;
  71. }
  72. export interface Rect {
  73. x: number;
  74. y: number;
  75. width: number;
  76. height: number;
  77. }
  78. export interface Size {
  79. width: number;
  80. height: number;
  81. }
  82. export interface TranscodingUser {
  83. uid: number;
  84. zOrder: number;
  85. rect: Rect;
  86. alpha: number;
  87. audioChannel: number;
  88. }
  89. export interface Color {
  90. red: number;
  91. green: number;
  92. blue: number;
  93. alpha: number;
  94. }
  95. export interface LiveTranscodingOption {
  96. size: Size;
  97. videoBitrate: number;
  98. videoFramerate: number;
  99. lowLatency: boolean;
  100. videoGop: number;
  101. videoCodecProfile: number;
  102. transcodingUsers: Array<TranscodingUser>;
  103. transcodingExtraInfo: string;
  104. watermark: BackgroundImage;
  105. backgroundImage: BackgroundImage;
  106. backgroundColor: Color;
  107. audioSampleRate: number;
  108. audioBitrate: number;
  109. audioChannels: number;
  110. }
  111. export interface VideoOption {
  112. uid: number;
  113. renderMode: number;
  114. reactTag: number;
  115. }
  116. export interface AudioRecordingOption {
  117. filepath: String;
  118. quality: number;
  119. }
  120. export declare type Callback<T> = (err: any, data: any) => T;
  121. export declare type Nullable<T> = T | null | undefined;
  122. export declare type String = Nullable<string>;
  123. export declare type Number = Nullable<number> | 0;
  124. export interface AgoraViewProps extends ViewProps {
  125. mode: number;
  126. showLocalVideo: boolean;
  127. remoteUid: number;
  128. zOrderMediaOverlay: boolean;
  129. [key: string]: any;
  130. }
  131. export interface DataStreamOption {
  132. streamId: number;
  133. ordered: boolean;
  134. reliable: boolean;
  135. }
  136. export interface AudioMixingOption {
  137. filepath: String;
  138. loopback: boolean;
  139. replace: boolean;
  140. cycle: number;
  141. }
  142. export interface PlayEffectOption {
  143. soundId: number;
  144. filepath: String;
  145. loopcount: number;
  146. pitch: number;
  147. pan: number;
  148. gain: number;
  149. publish: boolean;
  150. }
  151. export interface AudioFrameOption {
  152. sampleRate: number;
  153. channel: number;
  154. mode: number;
  155. samplesPerCall: number;
  156. }
  157. export interface MixedAudioFrameOption {
  158. sampleRate: number;
  159. samplesPerCall: number;
  160. }
  161. export interface ImageOption {
  162. url: String;
  163. height: number;
  164. width: number;
  165. x: number;
  166. y: number;
  167. }
  168. export interface VideoStreamOption {
  169. uid: number;
  170. streamType: number;
  171. }
  172. export interface DefaultVideoStreamOption {
  173. streamType: number;
  174. }
  175. export interface InjectStreamOption {
  176. url: String;
  177. config: {
  178. size: {
  179. width: number;
  180. height: number;
  181. };
  182. videoGop: number;
  183. videoBitrate: number;
  184. videoFramerate: number;
  185. audioBitrate: number;
  186. audioSampleRate: number;
  187. audioChannels: number;
  188. };
  189. }
  190. export interface RemoveInjectStreamOption {
  191. url: String;
  192. }
  193. export interface PublishStreamOption {
  194. url: String;
  195. enable: boolean;
  196. }
  197. export interface RemovePublishStreamOption {
  198. url: String;
  199. }
  200. export interface PositionOption {
  201. x: number;
  202. y: number;
  203. }
  204. /**
  205. * BeautyOption is setBeautyEffectOptions's option parameter
  206. * @property lighteningContrastLevel: integer | lightening contrast level and the value ranges is low: 0, normal: 1, high: 2
  207. * @property lighteningLevel: float | brightness level and the value ranges between 0.0 (original) and 1.0.
  208. * @property smoothnessLevel: float | The sharpness level. The value ranges between 0.0 (original) and 1.0. This parameter is usually used to remove blemishes.
  209. * @property rednessLevel: float | The redness level. The value ranges between 0.0 (original) and 1.0. This parameter adjusts the red saturation level.
  210. */
  211. export interface BeautyOption {
  212. lighteningContrastLevel: number;
  213. lighteningLevel: number;
  214. smoothnessLevel: number;
  215. rednessLevel: number;
  216. }
  217. /**
  218. * LastmileProbeConfig is startLastmileProbeTest's config parameter
  219. * @property probeUplink: boolean | sets whether or not to test the uplink networks. some users, for example, the audience in a Live-broadcast channel, do not need such a test. true: enables the probe test. false: disables the probe test.
  220. * @property probeDownlink: boolean | sets whether or not to probe the downlink network. true: enables the probe test. false: disables the probe test.
  221. * @property expectedUplinkBitrate: integer | The expected maximum sending bitrate (Kbps) of the local user. The value ranges between 100 and 5000. We recommend setting this parameter according to the bitrate value set by setVideoEncoderConfiguration.
  222. * @property expectedDownlinkBitrate: integer | The expected maximum receiving bitrate (Kbps) of the local user. The value ranges between 100 and 5000.
  223. */
  224. export interface LastmileProbeConfig {
  225. probeUplink: boolean;
  226. probeDownlink: boolean;
  227. expectedUplinkBitrate: number;
  228. expectedDownlinkBitrate: number;
  229. }
  230. /**
  231. * CameraCapturerConfiguration is setCameraCapturerConfiguration's config parameter
  232. * @property preference: number | The Camera capture preference and the value range is [0 is "(default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality.", 1 is "prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration.", 2 is "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."]
  233. */
  234. export interface CameraCapturerConfiguration {
  235. preference: number;
  236. }