No Description

types.d.ts 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. import { View, ViewProps } from 'react-native';
  2. declare module "IAgora";
  3. export interface VideoEncoderConfig {
  4. width: number,
  5. height: number,
  6. bitrate: number,
  7. frameRate: number,
  8. orientationMode: number,
  9. }
  10. export interface Option {
  11. appid: String,
  12. videoProfile: number
  13. channelProfile: number,
  14. videoEncoderConfig: VideoEncoderConfig,
  15. clientRole: number,
  16. audioProfile: number,
  17. audioScenario: number
  18. }
  19. export interface PublisherConfig {
  20. width: number,
  21. height: number,
  22. framerate: number,
  23. bitrate: number,
  24. defaultLayout: number,
  25. lifeCycle: number,
  26. pubishUrl: string,
  27. rawStreamUrl: string,
  28. extraInfo: String,
  29. owner: boolean
  30. }
  31. export interface BackgroundImage {
  32. url: string,
  33. x: number,
  34. y: number,
  35. width: number,
  36. height: number
  37. }
  38. export interface Rect {
  39. x: number,
  40. y: number,
  41. width: number,
  42. height: number
  43. }
  44. export interface Size {
  45. width: number,
  46. height: number
  47. }
  48. export interface TranscodingUser {
  49. uid: number,
  50. zOrder: number,
  51. rect: Rect,
  52. alpha: number,
  53. audioChannel: number
  54. }
  55. export interface Color {
  56. red: number,
  57. green: number,
  58. blue: number,
  59. alpha: number
  60. }
  61. export interface LiveTranscoding {
  62. size: Size,
  63. videoBitrate: number,
  64. videoFramerate: number,
  65. lowLatency: boolean,
  66. videoGop: number,
  67. videoCodecProfile: number,
  68. transcodingUsers: Array<TranscodingUser>,
  69. transcodingExtraInfo: string,
  70. watermark: BackgroundImage,
  71. backgroundImage: BackgroundImage,
  72. backgroundColor: Color,
  73. audioSampleRate: number,
  74. audioBitrate: number,
  75. audioChannels: number,
  76. }
  77. export interface VideoOption {
  78. uid: Number,
  79. renderMode: number,
  80. reactTag: number
  81. }
  82. export interface EventScheduler {
  83. onWarning: Function,
  84. onError: Function,
  85. onJoinChannelSuccess: Function,
  86. onRejoinChannelSuccess: Function,
  87. onLeaveChannel: Function,
  88. onClientRoleChanged: Function,
  89. onUserJoined: Function,
  90. onUserOffline: Function,
  91. onConnectionStateChanged: Function,
  92. onConnectionInterrupted?: Function,
  93. onConnectionLost: Function,
  94. onConnectionBanned: Function,
  95. onApiCallExecuted: Function,
  96. onTokenPrivilegeWillExpire: Function,
  97. onRequestToken: Function,
  98. onMicrophoneEnabled: Function,
  99. onAudioVolumeIndication: Function,
  100. onActiveSpeaker: Function,
  101. onFirstLocalAudioFrame: Function,
  102. onFirstRemoteAudioFrame: Function,
  103. onVideoStopped: Function,
  104. onFirstLocalVideoFrame: Function,
  105. onFirstRemoteVideoDecoded: Function,
  106. onFirstRemoteVideoFrame: Function,
  107. onUserMuteAudio: Function,
  108. onUserMuteVideo: Function,
  109. onUserEnableVideo: Function,
  110. onUserEnableLocalVideo: Function,
  111. onVideoSizeChanged: Function,
  112. onRemoteVideoStateChanged: Function,
  113. onLocalPublishFallbackToAudioOnly: Function,
  114. onRemoteSubscribeFallbackToAudioOnly: Function,
  115. onAudioRouteChanged: Function,
  116. onCameraReady: Function,
  117. onCameraFocusAreaChanged: Function,
  118. onCameraExposureAreaChanged: Function,
  119. onAudioQuality: Function,
  120. onRtcStats: Function,
  121. onLastmileQuality: Function,
  122. onNetworkQuality: Function,
  123. onLocalVideoStats: Function,
  124. onRemoteVideoStats: Function,
  125. onRemoteAudioStats: Function,
  126. onLocalVideoStat: Function,
  127. onRemoteVideoStat: Function,
  128. onRemoteAudioTransportStats: Function,
  129. onRemoteVideoTransportStats: Function,
  130. onAudioMixingFinished: Function,
  131. onAudioEffectFinished: Function,
  132. onStreamPublished: Function,
  133. onStreamUnpublished: Function,
  134. onTranscodingUpdated: Function,
  135. onStreamInjectedStatus: Function,
  136. onStreamMessage: Function,
  137. onStreamMessageError: Function,
  138. onMediaEngineLoadSuccess: Function,
  139. onMediaEngineStartCallSuccess: Function,
  140. // onWarning: Function,
  141. // onError: Function,
  142. // onJoinChannelSuccess: Function,
  143. // onRejoinChannelSuccess: Function,
  144. // onLeaveChannel: Function,
  145. // onApiCallExecute: Function,
  146. // onClientRoleChanged: Function,
  147. // onUserJoined: Function,
  148. // onUserOffline: Function,
  149. // onConnectionStateChanged: Function,
  150. // onConnectionInterrupted: Function,
  151. // onTokenPrivilegeWillExpire: Function,
  152. // onRequestToken: Function,
  153. // DidMicrophoneEnabled: Function,
  154. // ReportAudioVolumeIndicationOfSpeakers: Function,
  155. // ActiveSpeaker: Function,
  156. // FirstLocalAudioFrame: Function,
  157. // FirstRemoteAudioFrameOfUid: Function,
  158. // VideoDidStop: Function,
  159. // FirstLocalVideoFrameWithSize: Function,
  160. // FirstRemoteVideoDecodedOfUid: Function,
  161. // FirstRemoteVideoFrameOfUid: Function,
  162. // DidAudioMuted: Function,
  163. // DidVideoMuted: Function,
  164. // DidVideoEnabled: Function,
  165. // DidLocalVideoEnabled: Function,
  166. // VideoSizeChangedOfUid: Function,
  167. // RemoteVideoStateChangedOfUid: Function,
  168. // DidLocalPublishFallbackToAudioOnly: Function,
  169. // DidRemoteSubscribeFallbackToAudioOnly: Function,
  170. // DeviceTypeStateChanged: Function,
  171. // DidAudioRouteChanged: Function,
  172. // CameraDidReady: Function,
  173. // CameraFocusDidChangedToRect: Function,
  174. // CameraExposureDidChangedToRect: Function,
  175. // ReportRtcStats: Function,
  176. // LastmileQuality: Function,
  177. // NetworkQuality: Function,
  178. // LocalVideoStats: Function,
  179. // RemoteVideoStats: Function,
  180. // RemoteAudioStats: Function,
  181. // AudioTransportStatsOfUid: Function,
  182. // VideoTransportStatsOfUid: Function,
  183. // LocalAudioMixingDidFinish: Function,
  184. // RemoteAudioMixingDidStart: Function,
  185. // RemoteAudioMixingDidFinish: Function,
  186. // DidAudioEffectFinish: Function,
  187. // StreamPublished: Function,
  188. // StreamUnpublish: Function,
  189. // TranscodingUpdated: Function,
  190. // StreamInjectedStatus: Function,
  191. // ReceiveStreamMessage: Function,
  192. // DidOccurStreamMessageError: Function,
  193. // MediaEngineDidLoaded: Function,
  194. // MediaEngineDidStartCall: Function,
  195. // ConnectionDidInterrupted: Function,
  196. // ConnectionDidBanned: Function,
  197. // AudioQualityOfUi: Function
  198. }
  199. export type Callback<T> = (err: any, data: any) => T;
  200. export type Nullable<T> = T | null | undefined;
  201. export type String = Nullable<string>;
  202. export type Number = Nullable<number> | 0;
  203. export interface AgoraViewProps extends ViewProps {
  204. showLocalVideo: boolean,
  205. remoteUid: Number,
  206. zOrderMediaOverlay: boolean,
  207. [key:string]: any;
  208. }