No Description

types.d.ts 8.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. showLocalVideo: boolean;
  126. remoteUid: number;
  127. zOrderMediaOverlay: boolean;
  128. [key: string]: any;
  129. }
  130. export interface DataStreamOption {
  131. streamId: number;
  132. ordered: boolean;
  133. reliable: boolean;
  134. }
  135. export interface AudioMixingOption {
  136. filepath: String;
  137. loopback: boolean;
  138. replace: boolean;
  139. cycle: number;
  140. }
  141. export interface PlayEffectOption {
  142. soundId: number;
  143. filepath: String;
  144. loopcount: number;
  145. pitch: number;
  146. pan: number;
  147. gain: number;
  148. publish: boolean;
  149. }
  150. export interface AudioFrameOption {
  151. sampleRate: number;
  152. channel: number;
  153. mode: number;
  154. samplesPerCall: number;
  155. }
  156. export interface MixedAudioFrameOption {
  157. sampleRate: number;
  158. samplesPerCall: number;
  159. }
  160. export interface ImageOption {
  161. url: String;
  162. height: number;
  163. width: number;
  164. x: number;
  165. y: number;
  166. }
  167. export interface VideoStreamOption {
  168. uid: number;
  169. streamType: number;
  170. }
  171. export interface DefaultVideoStreamOption {
  172. streamType: number;
  173. }
  174. export interface InjectStreamOption {
  175. url: String;
  176. config: {
  177. size: {
  178. width: number;
  179. height: number;
  180. };
  181. videoGop: number;
  182. videoBitrate: number;
  183. videoFramerate: number;
  184. audioBitrate: number;
  185. audioSampleRate: number;
  186. audioChannels: number;
  187. };
  188. }
  189. export interface RemoveInjectStreamOption {
  190. url: String;
  191. }
  192. export interface PublishStreamOption {
  193. url: String;
  194. enable: boolean;
  195. }
  196. export interface RemovePublishStreamOption {
  197. url: String;
  198. }
  199. export interface PositionOption {
  200. x: number;
  201. y: number;
  202. }
  203. /**
  204. * BeautyOption is setBeautyEffectOptions's option parameter
  205. * @property lighteningContrastLevel: integer | lightening contrast level and the value ranges is low: 0, normal: 1, high: 2
  206. * @property lighteningLevel: float | brightness level and the value ranges between 0.0 (original) and 1.0.
  207. * @property smoothnessLevel: float | The sharpness level. The value ranges between 0.0 (original) and 1.0. This parameter is usually used to remove blemishes.
  208. * @property rednessLevel: float | The redness level. The value ranges between 0.0 (original) and 1.0. This parameter adjusts the red saturation level.
  209. */
  210. export interface BeautyOption {
  211. lighteningContrastLevel: number;
  212. lighteningLevel: number;
  213. smoothnessLevel: number;
  214. rednessLevel: number;
  215. }
  216. /**
  217. * LastmileProbeConfig is startLastmileProbeTest's config parameter
  218. * @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.
  219. * @property probeDownlink: boolean | sets whether or not to probe the downlink network. true: enables the probe test. false: disables the probe test.
  220. * @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.
  221. * @property expectedDownlinkBitrate: integer | The expected maximum receiving bitrate (Kbps) of the local user. The value ranges between 100 and 5000.
  222. */
  223. export interface LastmileProbeConfig {
  224. probeUplink: boolean;
  225. probeDownlink: boolean;
  226. expectedUplinkBitrate: number;
  227. expectedDownlinkBitrate: number;
  228. }
  229. /**
  230. * CameraCapturerConfiguration is setCameraCapturerConfiguration's config parameter
  231. * @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."]
  232. */
  233. export interface CameraCapturerConfiguration {
  234. preference: number;
  235. }