Няма описание

RtcEngine.native.d.ts 44KB

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