Sin descripción

RtcEngine.native.d.ts 44KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  1. import { Option, Callback, AgoraUserInfo, AudioMixingOption, PlayEffectOption, AudioRecordingOption, AudioFrameOption, MixedAudioFrameOption, ImageOption, VideoStreamOption, DefaultVideoStreamOption, InjectStreamOption, RemoveInjectStreamOption, PublishStreamOption, RemovePublishStreamOption, LiveTranscodingOption, PositionOption, BeautyOption, LastmileProbeConfig, CameraCapturerConfiguration } from "./types";
  2. /**
  3. * RtcEngine is the javascript object for control agora native sdk through react native bridge.
  4. *
  5. * You can use the RtcEngine methods to create {@link init}
  6. *
  7. * Other methods of the RtcEngine object serve for agora native sdk and set up error logging.
  8. */
  9. declare class RtcEngine {
  10. /**
  11. * @ignore AG_PREFIX
  12. */
  13. private static readonly AG_PREFIX;
  14. /**
  15. * Creates a RtcEngine Object internal.
  16. *
  17. * This method creates and start event observer. You should call this method once.
  18. * @example `RtcEngine.init(option)`
  19. * @param options Defines the property of the client, see {@link Option} for details.
  20. */
  21. static init(options: Option): void;
  22. /**
  23. * join specified channel
  24. *
  25. * This method joins and begin rendering the video stream. when join succeeds.
  26. * Otherwise, it will invoke error by the event
  27. * @param channelName
  28. * @param uid
  29. * @param token
  30. * @param info
  31. */
  32. static joinChannel(channelName: string, uid?: number, token?: string, info?: Object): Promise<any>;
  33. /**
  34. * Registers a user account.
  35. *
  36. * 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 `on("localUserRegistered", callback)` on the local client, reporting the user ID and user account of the local user.
  37. * To join a channel with a user account, you can choose either of the following:
  38. * Call the {@link registerLocalUserAccount} method to create a user account, and then the {@link joinChannelWithUserAccount} method to join the channel.
  39. * Call the {@link joinChannelWithUserAccount} method to join the channel.
  40. *
  41. * @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.
  42. *
  43. * @param userAccount
  44. * @returns Promise<any>
  45. */
  46. static registerLocalUserAccount(userAccount: string): Promise<any>;
  47. /**
  48. * Joins the channel with a user account.
  49. *
  50. * After the user successfully joins the channel, the SDK triggers the following callbacks:
  51. *
  52. * The local client: `on("localUserRegistered", callback)` and `on("joinChannelSuccess", callback)`.
  53. * The remote client: `on("userJoined", callback)` and `on("userInfoUpdated", callback)`, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile.
  54. *
  55. * @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.
  56. *
  57. * @param channelName
  58. * @param userAccount
  59. * @param token
  60. * @returns Promise<any>
  61. */
  62. static joinChannelWithUserAccount(channelName: string, userAccount: string, token: string): Promise<any>;
  63. /**
  64. * Gets the user information by passing in the user account.
  65. *
  66. * After receiving the "userInfoUpdated" callback, you can call this method to get the user ID of the remote user from the {@link AgoraUserInfo} object by passing in the userAccount.
  67. * @param uid
  68. * @returns Promise<{@link AgoraUserInfo}>
  69. */
  70. static getUserInfoByUid(uid: number): Promise<AgoraUserInfo>;
  71. /**
  72. * Gets the user information by passing in the user account.
  73. *
  74. * After receiving the "userInfoUpdated" callback, you can call this method to get the user ID of the remote user from the {@link AgoraUserInfo} object by passing in the userAccount.
  75. * @param userAccount
  76. * @returns Promise<{@link AgoraUserInfo}>
  77. */
  78. static getUserInfoByUserAccount(userAccount: string): Promise<AgoraUserInfo>;
  79. /**
  80. * add event listener
  81. *
  82. * This method subscribes specified eventType and run listener. You should call this method at first.
  83. *
  84. * @event listener
  85. *
  86. * ---
  87. * name | description | usage |
  88. * error | occurs when emit error | on("error", evt) |
  89. * warning | occurs when emit warning | on("warning", evt) |
  90. * messageReceived | occurs when message received | on("messageReceived", evt) |
  91. * localInvitationReceivedByPeer | occurs when local inviation received by peer | on("localInvitationReceivedByPeer", evt) |
  92. * localInvitationAccepted | occurs when local invitation accepted | on("localInvitationAccepted", evt) |
  93. * localInvitationRefused | occurs when local invitation refused | on("localInvitationRefused", evt) |
  94. * localInvitationCanceled | occurs when local invitation canceled | on("localInvitationCanceled", evt) |
  95. * localInvitationFailure | occurs when local invitation failure | on("localInvitationFailure", evt) |
  96. * remoteInvitationFailure | occurs when remote invitation failure | on("remoteInvitationFailure", evt) |
  97. * remoteInvitationReceived | occurs when remote invitation received | on("remoteInvitationReceived", evt) |
  98. * remoteInvitationAccepted | occurs when remote invitation accepted | on("remoteInvitationAccepted", evt) |
  99. * remoteInvitationRefused | occurs when remote invitation refused | on("remoteInvitationRefused", evt) |
  100. * remoteInvitationCanceled | occurs when remote invitation canceled | on("remoteInvitationCanceled", evt) |
  101. * channelMessageReceived | occurs when received channel message | on("channelMessageReceived", evt) |
  102. * channelMemberJoined | occurs when some one joined in the subscribed channel | on("channelMemberJoined", evt) |
  103. * channelMemberLeft | occurs when sone one left from u subscribed channel | on("channelMemberLeft", evt) |
  104. * tokenExpired | occurs when token has expired | on("tokenExpired", evt) |
  105. * apiCallExecute | occurs when apiCallExecute emit, this event is api call monitor | on("apiCallExecute", evt) |
  106. * joinChannelSuccess | occurs when joinChannel success | on("joinChannelSuccess", evt) |
  107. * rejoinChannelSuccess | occurs when rejoinChannel success | on("rejoinChannelSuccess", evt) |
  108. * leaveChannel | occurs when leaveChannel success | on("leaveChannel", evt) |
  109. * clientRoleChanged | occurs when setClientRole changed | on("clientRoleChanged", evt) |
  110. * userJoined | occurs when remote user joined | on("userJoined", evt) |
  111. * userOffline | this event occurs when remote user offline in rtc mode, this events only occurs host user offline in live mode | on("userOffline", evt) |
  112. * connectionStateChanged | occurs when sdk connection changed state | on("connectionStateChanged", evt) |
  113. * connectionLost | occurs when sdk connection lost | on("connectionLost", evt) |
  114. * tokenPrivilegeWillExpire | occurs when token will expire | on("tokenPrivilegeWillExpire", evt) |
  115. * requestToken | occurs when token expired | on("requestToken") |
  116. * microphoneEnabled | occurs when microphone enable state changed | on("microphoneEnabled", evt) |
  117. * audioVolumeIndication | occurs when audio volume indication changed | on("audioVolumeIndication", evt) |
  118. * activeSpeaker | occurs when detect active speaker | on("activeSpeaker", evt) |
  119. * firstLocalAudioFrame | occurs when sent first audio frame on local | on("firstLocalAudioFrame", evt) |
  120. * firstRemoteAudioFrame | occurs when received first audio frame from remote side | on("firstRemoteAudioFrame", evt) |
  121. * firstRemoteAudioDecoded | occurs when first remote audio decoded | on("firstRemoteAudioDecoded", evt) |
  122. * firstLocalVideoFrame | occurs when sent first video frame on local | on("firstLocalVideoFrame", evt) |
  123. * firstRemoteVideoDecoded | occurs when received first video frame from remote side decoded | on("firstRemoteVideoDecoded", evt) |
  124. * firstRemoteVideoFrame | occurs when received first video frame from remote side | on("firstRemoteVideoFrame", evt) |
  125. * userMuteAudio | occurs when user mute audio | on("userMuteAudio", evt) |
  126. * userMuteVideo | occurs when user mute video | on("userMuteVideo", evt) |
  127. * userEnableVideo | occurs when remote side's user change video enable state | on("userEnableVideo", evt) |
  128. * userEnableLocalVideo | occurs when user change video enable state on local | on("userEnableLocalVideo", evt) |
  129. * videoSizeChanged | occurs when change local or remote side video size or rotation | on("videoSizeChanged", evt) |
  130. * remoteVideoStateChanged | occurs when remote video state has any changed | on("remoteVideoStateChanged", evt) |
  131. * localPublishFallbackToAudioOnly | occurs when published stream from local side fallback to audio stream | on("localPublishFallbackToAudioOnly", evt) |
  132. * remoteSubscribeFallbackToAudioOnly | occurs when subscribed side's stream fallback to audio stream | on("remoteSubscribeFallbackToAudioOnly", evt) |
  133. * audioRouteChanged | occurs when local audio route changed | on("audioRouteChanged", evt) |
  134. * cameraFocusAreaChanged | occurs when a camera focus area changed | on("cameraFocusAreaChanged", evt) |
  135. * cameraExposureAreaChanged | occurs when a camera exposure area changed | on("cameraExposureAreaChanged", evt) |
  136. * rtcStats | occurs when reports the statistics of the current call session once every two seconds. | on("rtcStats", evt) |
  137. * lastmileQuality | occurs when reports the last mile network quality of the local user once every two seconds before the user joins a channel.| on("lastmileQuality", evt) |
  138. * networkQuality | occurs when reports the last mile network quality of each user in the channel once every two seconds.| on("networkQuality", evt) |
  139. * localVideoStats | occurs when reports local video statistics | on("localVideoStats", evt) |
  140. * remoteVideoStats | occurs when reports remote video statistics| on("remoteVideoStats", evt) |
  141. * remoteAudioStats | occurs when reports remote audio statistics| on("remoteAudioStats", evt) |
  142. * audioTransportStatsOfUid | occurs when reports transport-layer statistics of each remote audio stream. | on("audioTransportStatsOfUid", evt) |
  143. * videoTransportStatsOfUid | occurs when reports transport-layer statistics of each remote video stream.| on("videoTransportStatsOfUid", evt) |
  144. * audioEffectFinish | occurs when the local audio effect playback finishes. | on("audioEffectFinish", evt) |
  145. * streamPublished | occurs when addPublishStreamUrl success| on("streamPublished", evt) |
  146. * streamUnpublish | occurs when removePublishStreamUrl success| on("streamUnpublish", evt) |
  147. * transcodingUpdate | occurs when the cdn live streaming settings are updated | on("transcodingUpdate", evt) |
  148. * streamInjectedStatus | occurs when report the status of online injecting stream to a live broadcast | on("streamInjectedStatus", evt) |
  149. * mediaEngineLoaded | occurs when the media engine loaded | on("mediaEngineLoaded", evt) |
  150. * mediaEngineStartCall | occurs when the media engine call starts | on("mediaEngineStartCall", evt) |
  151. * startEchoTestWithInterval | occurs when startEchoTestWithInterval success | on("startEchoTestWithInterval", evt) |
  152. * audioMixingStateChanged | occurs when reports the local audio mixing state changed | on("audioMixingStateChanged", evt) |
  153. * lastmileProbeTestResult | occurs when reports the last-mile network probe result.| on("lastmileProbeTestResult", evt) |
  154. * rtmpStreamingStateChanged | occurs when reports the rtmp injecting stream state changed | on("rtmpStreamingStateChanged", evt) |
  155. * localVideoChanged | occurs when the local video changed | on("localVideoChanged", evt) |
  156. * networkTypeChanged | occurs when the device network type changed | on("networkTypeChanged", evt) |
  157. * mediaMetaDataReceived | occurs when you received media meta data from the remote side through sendMediaData | on("mediaMetaDataReceived", evt) |
  158. * localUserRegistered | occurs when you register user account success | on("localUserRegistered", evt) |
  159. * userInfoUpdated | occurs when you peer side using user account join channel | on("userInfoUpdated", evt) |
  160. * ---
  161. *
  162. * @param eventType
  163. * @param listener
  164. * @return any
  165. */
  166. static on(eventType: string, listener: (...args: any[]) => any): any;
  167. /**
  168. * @deprecated removeAllListeners
  169. */
  170. static removeAllListeners(): void;
  171. /**
  172. * @deprecated off
  173. * @param mode
  174. */
  175. static off(evt: any): void;
  176. /**
  177. * renew token
  178. *
  179. * This method renews a new token.
  180. * @param token
  181. */
  182. static renewToken(token: string): any;
  183. /**
  184. * enable websdk interoperability
  185. *
  186. * This method used to enable websdk interoperability, so that it can connect with agora websdk apps.
  187. *
  188. * @param enabled
  189. * @return Promise<{success, value}>
  190. */
  191. static enableWebSdkInteroperability(enabled: boolean): Promise<any>;
  192. /**
  193. * get agora native sdk connection state
  194. *
  195. * This method gets agora native sdk connection state
  196. * @return Promise<{state: (connection state)}>
  197. */
  198. static getConnectionState(): Promise<any>;
  199. /**
  200. * change the client role
  201. *
  202. * This method changes the client of role.
  203. * @param role (audience: 0, host: 1)
  204. */
  205. static setClientRole(role: number): Promise<any>;
  206. /**
  207. * leave channel
  208. *
  209. * This method leaves the joined channel, then your video view will not render ever.
  210. * You should call it, when you dont need render video stream.
  211. *
  212. * @return Promise<null>
  213. */
  214. static leaveChannel(): Promise<any>;
  215. /**
  216. * destroy
  217. *
  218. * This method stops event subscribe and destroy the RtcEngine instance's.
  219. * You should call it, when you want to destroy the engine.
  220. *
  221. * @return void
  222. */
  223. static destroy(): any;
  224. /**
  225. * set local video render mode
  226. *
  227. * This method calls native sdk render mode for local video.
  228. * @param mode
  229. * @return Promise<any>
  230. */
  231. static setLocalRenderMode(mode: number): Promise<any>;
  232. /**
  233. * set the specified remote video render mode
  234. *
  235. * This method calls native sdk render mode for the specified remote video.
  236. *
  237. * @param uid
  238. * @param mode
  239. * @return Promise<any>
  240. */
  241. static setRemoteRenderMode(uid: number, mode: number): Promise<any>;
  242. /**
  243. * start video preview
  244. *
  245. * This method start video preview for video.
  246. * @return Promise<any>
  247. */
  248. static startPreview(): Promise<any>;
  249. /**
  250. * stop video preview
  251. *
  252. * This method stops video preview for video.
  253. * @return Promise<any>
  254. */
  255. static stopPreview(): Promise<any>;
  256. /**
  257. * set enable speaker phone
  258. *
  259. * This method set the speaker phone enable or disable by pass boolean parameter.
  260. * @param enabled
  261. * @return Promise<any>
  262. */
  263. static setEnableSpeakerphone(enabled: boolean): Promise<any>;
  264. /**
  265. * set default audio speaker
  266. *
  267. * This method set the default audio speaker enable or disable by pass boolean parameter.
  268. * @param enabled
  269. * @return Promise<any>
  270. */
  271. static setDefaultAudioRouteToSpeakerphone(enabled: boolean): Promise<any>;
  272. /**
  273. * set default mute all remote audio streams
  274. *
  275. * This method set default mute all remote audio streams enable or not by pass boolean parameter.
  276. * @param enabled
  277. * @return Promise<any>
  278. */
  279. static setDefaultMuteAllRemoteAudioStreams(enabled: boolean): Promise<any>;
  280. /**
  281. * enable video
  282. *
  283. * This method enables video.
  284. * @return Promise<any>
  285. */
  286. static enableVideo(): Promise<any>;
  287. /**
  288. * disable video
  289. *
  290. * This method disables video.
  291. * @return Promise<any>
  292. */
  293. static disableVideo(): Promise<any>;
  294. /**
  295. * enable local video
  296. *
  297. * This method enables the local video by the boolean parameter.
  298. * @param enabled
  299. * @return Promise<any>
  300. */
  301. static enableLocalVideo(enabled: boolean): Promise<any>;
  302. /**
  303. * mute local video stream
  304. *
  305. * This method mutes video stream by the boolean parameter.
  306. * @param muted
  307. * @return Promise<any>
  308. */
  309. static muteLocalVideoStream(muted: boolean): Promise<any>;
  310. /**
  311. * mute all remote video streams
  312. *
  313. * This method mutes all remote streams by the boolean parameter.
  314. * @param muted
  315. * @return Promise<any>
  316. */
  317. static muteAllRemoteVideoStreams(muted: boolean): Promise<any>;
  318. /**
  319. * @ignore Uint32ToInt32
  320. */
  321. private static Uint32ToInt32;
  322. /**
  323. * @ignore Int32ToUint32
  324. */
  325. private static Int32ToUint32;
  326. /**
  327. * mute specified remote video stream.
  328. *
  329. * This method mutes remote video stream by the number of uid and boolean parameter.
  330. * @param uid
  331. * @param muted
  332. * @return Promise<any>
  333. */
  334. static muteRemoteVideoStream(uid: number, muted: boolean): Promise<any>;
  335. /**
  336. * set default mute all remote video stream
  337. *
  338. * This method mutes all remote video stream default by the boolean parameter.
  339. * @param muted
  340. * @return Promise<any>
  341. */
  342. static setDefaultMuteAllRemoteVideoStreams(muted: boolean): Promise<any>;
  343. /**
  344. * enable audio
  345. *
  346. * This method enables audio
  347. * @return Promise<any>
  348. */
  349. static enableAudio(): Promise<any>;
  350. /**
  351. * disable audio
  352. *
  353. * This method disables audio
  354. * @return Promise<any>
  355. */
  356. static disableAudio(): Promise<any>;
  357. /**
  358. * enable local audio
  359. *
  360. * This method enables local audio by the boolean parameter.
  361. * @param enabled
  362. * @return Promise<any>
  363. */
  364. static enableLocalAudio(enabled: boolean): Promise<any>;
  365. /**
  366. * mute local audio stream
  367. *
  368. * This method mutes the local audio stream by muted.
  369. * @param muted
  370. * @return Promise<any>
  371. */
  372. static disableLocalAudio(muted: boolean): Promise<any>;
  373. /**
  374. * mute all remote audio streams
  375. *
  376. * This method mutes all remote audio streams by muted
  377. * @param muted boolean
  378. * @return Promise<any>
  379. */
  380. static muteAllRemoteAudioStreams(muted: boolean): Promise<any>;
  381. /**
  382. * mute specified remote audio stream by muted
  383. *
  384. * This method mutes specified remote audio stream by number uid and boolean muted.
  385. * @param uid
  386. * @param muted
  387. * @return Promise<any>
  388. */
  389. static muteRemoteAudioStream(uid: number, muted: boolean): Promise<any>;
  390. /**
  391. * adjust recording signal volume
  392. *
  393. * This method adjusts recording your signal by volume.
  394. * @param volume
  395. * @return Promise<any>
  396. */
  397. static adjustRecordingSignalVolume(volume: number): Promise<any>;
  398. /**
  399. * adjust playback signal volume
  400. *
  401. * This method adjusts playback signal by volume.
  402. * @param volume
  403. * @return Promise<any>
  404. */
  405. static adjustPlaybackSignalVolume(volume: number): Promise<any>;
  406. /**
  407. * enable audio volume indication
  408. *
  409. * This method enables audio volume by interval and smooth
  410. * @param interval
  411. * @param smooth
  412. * @return Promise<any>
  413. */
  414. static enableAudioVolumeIndication(interval: number, smooth: number): Promise<any>;
  415. /**
  416. * check for mobile phone speaker enabled
  417. *
  418. * This method checks the phone speaker is enabled
  419. * @param callback
  420. * @return any
  421. */
  422. static isSpeakerphoneEnabled(callback: Callback<any>): any;
  423. /**
  424. * enable in-ear monitor
  425. *
  426. * This method enables in-ear monitoring by boolean parameter enabled
  427. *
  428. * @param enabled
  429. * @return Promise<any>
  430. */
  431. static enableInEarMonitoring(enabled: boolean): Promise<any>;
  432. /**
  433. * set in-ear monitoring volume
  434. *
  435. * This method sets the in-ear-monitoring volume by number parameter volume
  436. *
  437. * @param volume
  438. * @return Promise<any>
  439. */
  440. static setInEarMonitoringVolume(volume: number): Promise<any>;
  441. /**
  442. * set local voice pitch
  443. *
  444. * This method sets the local voice pitch by float parameter pitch
  445. *
  446. * @param pitch
  447. * @return Promise<any>
  448. */
  449. static setLocalVoicePitch(pitch: number): Promise<any>;
  450. /**
  451. * set local voice equalization
  452. *
  453. * This method set local video equalization of band frequency by enum band number and number of gain
  454. *
  455. * @param band
  456. * @param gain
  457. * @return Promise<any>
  458. */
  459. static setLocalVoiceEqualization(band: number, gain: number): void;
  460. /**
  461. * set local voice reverb
  462. *
  463. * This method sets local voice by reverb and value
  464. * @param reverb
  465. * @param value
  466. */
  467. static setLocalVoiceReverb(reverb: number, value: number): void;
  468. /**
  469. * start audio mixing
  470. *
  471. * This method will start audio mixing by option config
  472. *
  473. * @param options {@link AudioMixingOption}
  474. */
  475. static startAudioMixing(options: AudioMixingOption): void;
  476. /**
  477. * stop audio mixing
  478. *
  479. * This methods stops for audio mixing.
  480. */
  481. static stopAudioMixing(): void;
  482. /**
  483. * pause audio mixing
  484. *
  485. * This method pauses for audio mixing.
  486. */
  487. static pauseAudioMixing(): void;
  488. /**
  489. * resume audio mixing
  490. *
  491. * This method resumes for audio mixing.
  492. */
  493. static resumeAudioMixing(): void;
  494. /**
  495. * adjust audio mixing volume
  496. *
  497. * This method adjusts audio mixing volume by the volume number parameter
  498. * @param volume
  499. */
  500. static adjustAudioMixingVolume(volume: number): void;
  501. /**
  502. * adjust audio mixing playout volume
  503. *
  504. * This method adjusts audio mixing playout by the volume parameter
  505. * @param volume
  506. */
  507. static adjustAudioMixingPlayoutVolume(volume: number): void;
  508. /**
  509. * adjust audio mixing publish volume
  510. *
  511. * This method adjusts audio mixing publish by the volume paraemter
  512. * @param volume
  513. */
  514. static adjustAudioMixingPublishVolume(volume: number): void;
  515. /**
  516. * get audio mixing duration
  517. *
  518. * This method gets the audio mixing duration
  519. * @return Promise<{success, value}>
  520. */
  521. static getAudioMixingDuration(): Promise<any>;
  522. /**
  523. * get audio mixing current position
  524. *
  525. * This method gets audio mixing current position value.
  526. * @return Promise<{success, value}>
  527. */
  528. static getAudioMixingCurrentPosition(): Promise<any>;
  529. /**
  530. * set audio mixing position
  531. *
  532. * This method sets audio mixing position by the parameter pos
  533. * @param pos
  534. */
  535. static setAudioMixingPosition(pos: number): Promise<any>;
  536. /**
  537. * get effects of volume
  538. *
  539. * This methods get audio mixing effects volume value.
  540. * @return Promise<{success, value}>
  541. */
  542. static getEffectsVolume(): Promise<any>;
  543. /**
  544. * set effects volume
  545. *
  546. * This methods set audio mixing effects volume by float parameter.
  547. * @param volume
  548. * @return Promise<{success, value}>
  549. */
  550. static setEffectsVolume(volume: number): Promise<any>;
  551. /**
  552. * set volume for playing effects.
  553. *
  554. * This methods set for playing audio mixing effects
  555. * @return Promise<{success, value}>
  556. */
  557. static setVolumeOfEffect(volume: number): Promise<any>;
  558. /**
  559. * play specified effect for audio mixing
  560. *
  561. * This methos plays the specified effect of audio mixing file by option config.
  562. * @param options {@link PlayEffectOption}
  563. * @return Promise<{success, value}>
  564. */
  565. static playEffect(options: PlayEffectOption): Promise<any>;
  566. /**
  567. * stop play effect for audio mixing
  568. *
  569. * This methods stops the specified effect for audio mixing file by soundId.
  570. * @param sounid
  571. * @return Promise<{success, value}>
  572. */
  573. static stopEffect(soundId: number): Promise<any>;
  574. /**
  575. * stop play all for effect audio mixing.
  576. *
  577. * This methods stops all effect audio mixing.
  578. * @return Promise<{success, value}>
  579. */
  580. static stopAllEffects(): Promise<any>;
  581. /**
  582. * preload effect for audio mixing file.
  583. *
  584. * This methods preloads the specified audio mixing file to memory by the soundId
  585. * @param soundId
  586. * @param filePath
  587. * @return Promise<{success, value}>
  588. */
  589. static preloadEffect(soundId: number, filePath: string): Promise<any>;
  590. /**
  591. * unload effect
  592. *
  593. * This methods unload the already loaded audio mixing file from memory by the soundId.
  594. * @param soundId
  595. * @return Promise<{success, value}>
  596. */
  597. static unloadEffect(soundId: number): Promise<any>;
  598. /**
  599. * pause the specified effect for audio mixing by soundId
  600. *
  601. * This method pauses the specified effect for audio mixing by soundId.
  602. * @param soundId
  603. * @return Promise<{success, value}>
  604. */
  605. static pauseEffect(soundId: number): Promise<any>;
  606. /**
  607. * pause all effects for audio mixing
  608. *
  609. * This method pause all effects for audio mixing.
  610. * @param soundId
  611. * @return Promise<{success, value}>
  612. */
  613. static pauseAllEffects(): Promise<any>;
  614. /**
  615. * resume audio mixing effect by the specified soundId
  616. *
  617. * This method resumes audio mixing effect by the specified soundId
  618. * @param soundId
  619. * @return Promise<{success, value}>
  620. */
  621. static resumeEffect(soundId: number): Promise<any>;
  622. /**
  623. * resume all audio mixing effects.
  624. *
  625. * This method resumes all audio mixing effects.
  626. * @return Promise<{success, value}>
  627. */
  628. static resumeAllEffects(): Promise<any>;
  629. /**
  630. * start audio recording by quality
  631. *
  632. * This method start audio recording by quality config
  633. * @param options {@link AudioRecordingOption}
  634. * @return Promise<{success, value}>
  635. */
  636. static startAudioRecording(options: AudioRecordingOption): Promise<any>;
  637. /**
  638. * stop audio recording
  639. *
  640. * This method stops audio recording.
  641. * @return Promise<{success, value}>
  642. */
  643. static stopAudioRecording(): Promise<any>;
  644. /**
  645. * set audio session operation restriction
  646. *
  647. * The SDK and the app can both configure the audio session by default. The app may occasionally use other apps or third-party components to manipulate the audio session and restrict the SDK from doing so. This method allows the app to restrict the SDK’s manipulation of the audio session.
  648. * You can call this method at any time to return the control of the audio sessions to the SDK.
  649. * This method restricts the SDK’s manipulation of the audio session. Any operation to the audio session relies solely on the app, other apps, or third-party components.
  650. * @notice iOS support only
  651. */
  652. static setAudioSessionOperationRestriction(): void;
  653. /**
  654. * @deprecated startEchoTest
  655. * startEchoTest
  656. */
  657. /**
  658. * @deprecated isCameraAutoFocusFaceModeSupported
  659. * @deprecated isCameraExposurePositionSupported
  660. * @deprecated isCameraFocusSupported
  661. * @deprecated isCameraTorchSupported
  662. * @deprecated isCameraZoomSupported
  663. * instead use {@method getCameraInfo}
  664. */
  665. /**
  666. * stop echo test
  667. *
  668. * This method stop launched an audio call test.
  669. * @return Promise<{success, value}>
  670. */
  671. static stopEchoTest(): Promise<any>;
  672. /**
  673. * enable lastmile test
  674. *
  675. * This method enables the network connection qualit test.
  676. *
  677. * @return Promise<{success, value}>
  678. */
  679. static enableLastmileTest(): Promise<any>;
  680. /**
  681. * disable lastmile test
  682. *
  683. * This method disable the network connection qualit test.
  684. *
  685. * @return Promise<{success, value}>
  686. */
  687. static disableLastmileTest(): Promise<any>;
  688. /**
  689. * set recording audio frame parameters
  690. *
  691. * This method Sets the audio recording format for the audioFrame callback.
  692. *
  693. * @param options {@link RecordingAudioFrameOption}
  694. * @return Promise<{success, value}>
  695. */
  696. static setRecordingAudioFrameParameters(options: AudioFrameOption): Promise<any>;
  697. /**
  698. * set playback audio frame parameters
  699. *
  700. * This method Sets the audio frame format for the playbackFrame callback.
  701. *
  702. * @param options {@link AudioFrameOption}
  703. * @return Promise<{success, value}>
  704. */
  705. static setPlaybackAudioFrameParameters(options: AudioFrameOption): Promise<any>;
  706. /**
  707. * set mixed audio frame parameters
  708. *
  709. * This method Sets the audio frame format for the mixedAudioFrame callback.
  710. *
  711. * @param options {@link MixedAudioFrameOption}
  712. * @return Promise<{success, value}>
  713. */
  714. static setMixedAudioFrameParameters(options: MixedAudioFrameOption): Promise<any>;
  715. /**
  716. * add video watermark
  717. *
  718. * This method adds video watermark to the local video.
  719. *
  720. * @param options {@link ImageOption}
  721. * @return Promise<{success, value}>
  722. */
  723. static addVideoWatermark(options: ImageOption): Promise<any>;
  724. /**
  725. * clear video watermarks
  726. *
  727. * This method removes the watermark image from the video stream added by addVideoWatermark.
  728. *
  729. * @return Promise<{success, value}>
  730. */
  731. static clearVideoWatermarks(): Promise<any>;
  732. /**
  733. * set local publish fallback
  734. *
  735. * This method sets the fallback option for the locally published video stream based on the network conditions.
  736. *
  737. * @param option {0, 1, 2} [more details](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_constants.html#a3e453c93766e783a7e5eca05b1776238)
  738. * @return Promise<{success, value}>
  739. */
  740. static setLocalPublishFallbackOption(option: number): Promise<any>;
  741. /**
  742. * set remote publish fallback
  743. *
  744. * This method sets the fallback option for the remotely subscribed video stream based on the network conditions.
  745. *
  746. * @param option {0, 1, 2} [more details](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_constants.html#a3e453c93766e783a7e5eca05b1776238)
  747. * @return Promise<{success, value}>
  748. */
  749. static setRemoteSubscribeFallbackOption(option: number): Promise<any>;
  750. /**
  751. * enable dual stream mode
  752. *
  753. * This method enables the dual stream by parameter mode.
  754. *
  755. * @param enabled
  756. * @return Promise<{success, value}>
  757. */
  758. static enableDualStreamMode(enabled: boolean): Promise<any>;
  759. /**
  760. * set remote video stream type
  761. *
  762. * This method sets the remote video stream type by uid and streamType.
  763. *
  764. * @param options {@link VideoStreamOption}
  765. * @return Promise<{success, value}>
  766. */
  767. static setRemoteVideoStreamType(options: VideoStreamOption): Promise<any>;
  768. /**
  769. * set remote default video stream type
  770. *
  771. * This method sets the default video stream type.
  772. *
  773. * @param options {@link DefaultVideoStreamOption}
  774. * @return Promise<{success, value}>
  775. */
  776. static setRemoteDefaultVideoStreamType(options: DefaultVideoStreamOption): Promise<any>;
  777. /**
  778. * add inject stream url
  779. *
  780. * This method injects an online media stream to a live broadcast.
  781. *
  782. * @param options {@link InjectStreamOption}
  783. * @return Promise<{success, value}>
  784. */
  785. static addInjectStreamUrl(options: InjectStreamOption): Promise<any>;
  786. /**
  787. * remove inject stream url
  788. *
  789. * This method removes stream by addInjectsStreamUrl.
  790. *
  791. * @param options {@link RemoveInjectStreamOption}
  792. * @return Promise<{success, value}>
  793. */
  794. static removeInjectStreamUrl(options: RemoveInjectStreamOption): Promise<any>;
  795. /**
  796. * @deprecated sendMessage
  797. * sendMessage
  798. */
  799. static sendMessage(): Promise<any>;
  800. /**
  801. * @deprecated createDataStream
  802. * createDataStream
  803. */
  804. /**
  805. * @deprecated setupLocalVideo
  806. * setupLocalVideo
  807. */
  808. /**
  809. * @deprecated setupRemoteVideo
  810. * setupRemoteVideo
  811. */
  812. /**
  813. * @deprecated setVideoQualityParameters
  814. * setVideoQualityParameters
  815. */
  816. /**
  817. * set local video mirror mode
  818. *
  819. * This method sets local video mirror mode
  820. *
  821. * @param mode
  822. * @return Promise<{success, value}>
  823. */
  824. static setLocalVideoMirrorMode(mode: number): Promise<any>;
  825. /**
  826. * switch camera
  827. *
  828. * This method switches camera between front and rear.
  829. *
  830. * @return Promise<{success, value}>
  831. */
  832. static switchCamera(): Promise<any>;
  833. /**
  834. * set camera zoom ratio
  835. *
  836. * This method sets the camera zoom ratio.
  837. *
  838. * @param zoomFactor
  839. * @return Promise<{success, value}>
  840. */
  841. static setCameraZoomFactor(zoomFactor: number): Promise<any>;
  842. /**
  843. * get camera max zoom ratio
  844. *
  845. * This method gets the camera maximum zoom ratio.
  846. *
  847. * @notice Android Only
  848. * @return Promise<{success, value}>
  849. */
  850. static getCameraMaxZoomFactor(): Promise<any>;
  851. /**
  852. * set camera focus position in preview
  853. *
  854. * This method sets the mannual focus position.
  855. *
  856. * @param options {@link PositionOption}
  857. * @return Promise<{success, value}>
  858. */
  859. static setCameraFocusPositionInPreview(options: PositionOption): Promise<any>;
  860. /**
  861. * set camera exposure position
  862. *
  863. * This method sets the mannual exposure position.
  864. *
  865. * @param options {@link PositionOption}
  866. * @return Promise<{success, value}>
  867. */
  868. static setCameraExposurePosition(options: PositionOption): Promise<any>;
  869. /**
  870. * set camera torch on
  871. *
  872. * This method enables the camera flash function.
  873. *
  874. * @param enabled
  875. * @return Promise<{success, value}>
  876. */
  877. static setCameraTorchOn(enabled: boolean): Promise<any>;
  878. /**
  879. * set enable auto focus face mode
  880. *
  881. * This method enables auto-focus face mode function.
  882. *
  883. * @param enabled boolean
  884. * @return Promise<{success, value}>
  885. */
  886. static setCameraAutoFocusFaceModeEnabled(enabled: boolean): Promise<any>;
  887. /**
  888. * get call id
  889. *
  890. * This method is used to get call id.
  891. *
  892. * @return Promise<{success, value}>
  893. */
  894. static getCallId(): Promise<any>;
  895. /**
  896. * set log file and log filter
  897. *
  898. * This method sets the log file generated path and specified the log level.
  899. *
  900. * @param filePath string
  901. * @param level enum
  902. * @param maxfileSize integer (KB)
  903. * @return Promise<{success, value}>
  904. */
  905. static setLog(filePath: string, level: number, maxfileSize: number): Promise<any>;
  906. /**
  907. * add publish stream url
  908. *
  909. * This method add publish stream by option.
  910. *
  911. * @param options {@link PublishStreamOption}
  912. * @return Promise<{success, value}>
  913. */
  914. static addPublishStreamUrl(options: PublishStreamOption): Promise<any>;
  915. /**
  916. * remove publish stream url
  917. *
  918. * This method remove publish stream by options.
  919. *
  920. * @param options {@link RemovePublishStreamOption}
  921. * @return Promise<{success, value}>
  922. */
  923. static removePublishStreamUrl(options: RemovePublishStreamOption): Promise<any>;
  924. /**
  925. * set live transcoding
  926. *
  927. * This method sets the video layout and audio settings for CDN live.
  928. *
  929. * @param options {@link LiveTranscoding}
  930. * @return Promise<{success, value}>
  931. */
  932. static setLiveTranscoding(options: LiveTranscodingOption): Promise<any>;
  933. /**
  934. * get sdk version
  935. *
  936. * This method gets the sdk version details and passed it into callback function
  937. *
  938. * @param callback to handle resolve from getSdkVersion
  939. * @param errorHandler to handle reject error from getSdkVersion
  940. * @return any
  941. */
  942. static getSdkVersion(callback: Callback<any>, errorHandler?: Callback<any>): any;
  943. /**
  944. * mute local audio stream
  945. *
  946. * This method sends/stops sending the local audio.
  947. *
  948. * @param enabled
  949. * @return Promise<any>
  950. */
  951. static muteLocalAudioStream(enabled: boolean): Promise<any>;
  952. /**
  953. * video pre-process/post-process
  954. *
  955. * This method enables/disables image enhancement and sets the options.
  956. *
  957. * @param enable boolean
  958. * @param options {@link BeautyOptions}
  959. * @return Promise<any>
  960. */
  961. static setBeautyEffectOptions(enabled: boolean, options: BeautyOption): Promise<any>;
  962. /**
  963. * set local voice change
  964. *
  965. * This method changes local speaker voice with voiceChanger
  966. *
  967. * @param voiceChanger integer
  968. * @voiceChanger value ranges [
  969. * 0: "The original voice",
  970. * 1: "An old man’s voice",
  971. * 2: "A little boy’s voice.",
  972. * 3: "A little girl’s voice.",
  973. * 4: "TBD",
  974. * 5: "Ethereal vocal effects.",
  975. * 6: "Hulk’s voice."
  976. * ]
  977. * @return Promise<any>
  978. */
  979. static setLocalVoiceChanger(voiceChanger: number): Promise<any>;
  980. /**
  981. * set the preset local voice reverberation effect.
  982. *
  983. * This method sets the preset local voice reverberation effect.
  984. *
  985. * @param preset integer
  986. * @return Promise<any>
  987. */
  988. static setLocalVoiceReverbPreset(preset: number): Promise<any>;
  989. /**
  990. * control stereo panning for remote users
  991. *
  992. * This method enables/disables stereo panning for remote users.
  993. *
  994. * @param enabled boolean
  995. * @return Promise<any>
  996. */
  997. static enableSoundPositionIndication(enabled: boolean): Promise<any>;
  998. /**
  999. * set the sound position of a remote user
  1000. *
  1001. * This method sets the sound position of a remote user by uid
  1002. *
  1003. * @param uid number | The ID of the remote user
  1004. * @param pan float | The sound position of the remote user. The value ranges from -1.0 to 1.0
  1005. * @pan
  1006. * 0.0: the remote sound comes from the front.
  1007. * -1.0: the remote sound comes from the left.
  1008. * 1.0: the remote sound comes from the right.
  1009. * @param gain float | 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.
  1010. * @return Promise<any>
  1011. */
  1012. static setRemoteVoicePosition(uid: number, pan: number, gain: number): Promise<any>;
  1013. /**
  1014. * start the lastmile probe test
  1015. *
  1016. * This method start 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).
  1017. *
  1018. * @param config LastmileProbeConfig {@link LastmileProbeConfig}
  1019. *
  1020. * event 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.
  1021. * event 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.
  1022. * @return Promise<any>
  1023. */
  1024. static startLastmileProbeTest(config: LastmileProbeConfig): Promise<any>;
  1025. /**
  1026. * stop the lastmile probe test
  1027. *
  1028. * This method stop the lastmile probe test.
  1029. *
  1030. * @return Promise<any>
  1031. */
  1032. static stopLastmileProbeTest(): Promise<any>;
  1033. /**
  1034. * sets the priority of a remote user's media stream.
  1035. *
  1036. * note: 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.
  1037. *
  1038. * This method sets the priority of a remote user's media stream.
  1039. * @param uid number
  1040. * @param userPriority number | The value range is [50 is "user's priority is high", 100 is "the default user's priority is normal"]
  1041. *
  1042. * @return Promise<any>
  1043. */
  1044. static setRemoteUserPriority(uid: number, userPriority: number): Promise<any>;
  1045. /**
  1046. * start an audio call test.
  1047. *
  1048. * note:
  1049. * Call this method before joining a channel.
  1050. * 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.
  1051. * In the Live-broadcast profile, only a host can call this method.
  1052. * This method will start an audio call test with interval parameter.
  1053. * 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.
  1054. *
  1055. * @param interval number
  1056. *
  1057. * @return Promise<any>
  1058. */
  1059. static startEchoTestWithInterval(interval: number): Promise<any>;
  1060. /**
  1061. * set the camera capture preference.
  1062. *
  1063. * note:
  1064. * 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 capture preference:
  1065. * 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 CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE(1) to avoid such problems.
  1066. * If you do not need local video preview or are willing to sacrifice preview quality, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PERFORMANCE(1) to optimize CPU and RAM usage.
  1067. * If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW(2).
  1068. *
  1069. * This method will set the camera capture preference.
  1070. *
  1071. * @param config {@link CameraCapturerConfiguration}
  1072. *
  1073. * @return Promise<any>
  1074. */
  1075. static setCameraCapturerConfiguration(config: CameraCapturerConfiguration): Promise<any>;
  1076. /**
  1077. * Gets the audio mixing volume for local playback.
  1078. *
  1079. * note:
  1080. * This method helps troubleshoot audio volume related issues.
  1081. *
  1082. * @return Promise<any>
  1083. */
  1084. static getAudioMixingPlayoutVolume(): Promise<any>;
  1085. /**
  1086. * Gets the audio mixing volume for publishing.
  1087. *
  1088. * note:
  1089. * This method helps troubleshoot audio volume related issues.
  1090. *
  1091. * @return Promise<any>
  1092. */
  1093. static getAudioMixingPublishVolume(): Promise<any>;
  1094. /**
  1095. * sendMediaData for media observer.
  1096. *
  1097. * note:
  1098. * This method needs you invoke registerMediaMetadataObserver success first and you could send media data through interval media observer feature.
  1099. * The data have limit length is 1024 bytes, if you pass data length bigger than limit it will failed.
  1100. * @param data String: 1024 bytes limit
  1101. * @return Promise<any>
  1102. */
  1103. static sendMediaData(data: String): Promise<any>;
  1104. /**
  1105. * Registers the metadata observer.
  1106. *
  1107. * note:
  1108. * This method only work in live mode
  1109. * 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.
  1110. * This method trigger 'mediaMetaDataReceived' event, here is example:
  1111. * ```javascript
  1112. * RtcEngine.on("mediaMetaDataReceived", (data) => {
  1113. * console.log("mediaMetaDataReceived", data);
  1114. * })
  1115. * ```
  1116. * @return Promise<any>
  1117. */
  1118. static registerMediaMetadataObserver(): Promise<any>;
  1119. /**
  1120. * Get local device camera support info
  1121. *
  1122. * note:
  1123. * This method returns your current device camera support info.
  1124. * ```javascript
  1125. * RtcEngine.getCameraInfo().then(info => {
  1126. * console.log("your currrent camera", info);
  1127. * })
  1128. * ```
  1129. * @return Promise{cameraSupportInfo}>
  1130. */
  1131. static getCameraInfo(): Promise<any>;
  1132. }
  1133. export default RtcEngine;