Geen omschrijving

RtcEngine.native.d.ts 44KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130
  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. * mute specified remote video stream.
  324. *
  325. * This method mutes remote video stream by the number of uid and boolean parameter.
  326. * @param uid
  327. * @param muted
  328. * @return Promise<any>
  329. */
  330. static muteRemoteVideoStream(uid: number, muted: boolean): Promise<any>;
  331. /**
  332. * set default mute all remote video stream
  333. *
  334. * This method mutes all remote video stream default by the boolean parameter.
  335. * @param muted
  336. * @return Promise<any>
  337. */
  338. static setDefaultMuteAllRemoteVideoStreams(muted: boolean): Promise<any>;
  339. /**
  340. * enable audio
  341. *
  342. * This method enables audio
  343. * @return Promise<any>
  344. */
  345. static enableAudio(): Promise<any>;
  346. /**
  347. * disable audio
  348. *
  349. * This method disables audio
  350. * @return Promise<any>
  351. */
  352. static disableAudio(): Promise<any>;
  353. /**
  354. * enable local audio
  355. *
  356. * This method enables local audio by the boolean parameter.
  357. * @param enabled
  358. * @return Promise<any>
  359. */
  360. static enableLocalAudio(enabled: boolean): Promise<any>;
  361. /**
  362. * mute local audio stream
  363. *
  364. * This method mutes the local audio stream by muted.
  365. * @param muted
  366. * @return Promise<any>
  367. */
  368. static disableLocalAudio(muted: boolean): Promise<any>;
  369. /**
  370. * mute all remote audio streams
  371. *
  372. * This method mutes all remote audio streams by muted
  373. * @param muted boolean
  374. * @return Promise<any>
  375. */
  376. static muteAllRemoteAudioStreams(muted: boolean): Promise<any>;
  377. /**
  378. * mute specified remote audio stream by muted
  379. *
  380. * This method mutes specified remote audio stream by number uid and boolean muted.
  381. * @param uid
  382. * @param muted
  383. * @return Promise<any>
  384. */
  385. static muteRemoteAudioStream(uid: number, muted: boolean): Promise<any>;
  386. /**
  387. * adjust recording signal volume
  388. *
  389. * This method adjusts recording your signal by volume.
  390. * @param volume
  391. * @return Promise<any>
  392. */
  393. static adjustRecordingSignalVolume(volume: number): Promise<any>;
  394. /**
  395. * adjust playback signal volume
  396. *
  397. * This method adjusts playback signal by volume.
  398. * @param volume
  399. * @return Promise<any>
  400. */
  401. static adjustPlaybackSignalVolume(volume: number): Promise<any>;
  402. /**
  403. * enable audio volume indication
  404. *
  405. * This method enables audio volume by interval and smooth
  406. * @param interval
  407. * @param smooth
  408. * @return Promise<any>
  409. */
  410. static enableAudioVolumeIndication(interval: number, smooth: number): Promise<any>;
  411. /**
  412. * check for mobile phone speaker enabled
  413. *
  414. * This method checks the phone speaker is enabled
  415. * @param callback
  416. * @return any
  417. */
  418. static methodisSpeakerphoneEnabled(callback: Callback<any>): any;
  419. /**
  420. * enable in-ear monitor
  421. *
  422. * This method enables in-ear monitoring by boolean parameter enabled
  423. *
  424. * @param enabled
  425. * @return Promise<any>
  426. */
  427. static enableInEarMonitoring(enabled: boolean): Promise<any>;
  428. /**
  429. * set in-ear monitoring volume
  430. *
  431. * This method sets the in-ear-monitoring volume by number parameter volume
  432. *
  433. * @param volume
  434. * @return Promise<any>
  435. */
  436. static setInEarMonitoringVolume(volume: number): Promise<any>;
  437. /**
  438. * set local voice pitch
  439. *
  440. * This method sets the local voice pitch by float parameter pitch
  441. *
  442. * @param pitch
  443. * @return Promise<any>
  444. */
  445. static setLocalVoicePitch(pitch: number): Promise<any>;
  446. /**
  447. * set local voice equalization
  448. *
  449. * This method set local video equalization of band frequency by enum band number and number of gain
  450. *
  451. * @param band
  452. * @param gain
  453. * @return Promise<any>
  454. */
  455. static setLocalVoiceEqualization(band: number, gain: number): void;
  456. /**
  457. * set local voice reverb
  458. *
  459. * This method sets local voice by reverb and value
  460. * @param reverb
  461. * @param value
  462. */
  463. static setLocalVoiceReverb(reverb: number, value: number): void;
  464. /**
  465. * start audio mixing
  466. *
  467. * This method will start audio mixing by option config
  468. *
  469. * @param options {@link AudioMixingOption}
  470. */
  471. static startAudioMixing(options: AudioMixingOption): void;
  472. /**
  473. * stop audio mixing
  474. *
  475. * This methods stops for audio mixing.
  476. */
  477. static stopAudioMixing(): void;
  478. /**
  479. * pause audio mixing
  480. *
  481. * This method pauses for audio mixing.
  482. */
  483. static pauseAudioMixing(): void;
  484. /**
  485. * resume audio mixing
  486. *
  487. * This method resumes for audio mixing.
  488. */
  489. static resumeAudioMixing(): void;
  490. /**
  491. * adjust audio mixing volume
  492. *
  493. * This method adjusts audio mixing volume by the volume number parameter
  494. * @param volume
  495. */
  496. static adjustAudioMixingVolume(volume: number): void;
  497. /**
  498. * adjust audio mixing playout volume
  499. *
  500. * This method adjusts audio mixing playout by the volume parameter
  501. * @param volume
  502. */
  503. static adjustAudioMixingPlayoutVolume(volume: number): void;
  504. /**
  505. * adjust audio mixing publish volume
  506. *
  507. * This method adjusts audio mixing publish by the volume paraemter
  508. * @param volume
  509. */
  510. static adjustAudioMixingPublishVolume(volume: number): void;
  511. /**
  512. * get audio mixing duration
  513. *
  514. * This method gets the audio mixing duration
  515. * @return Promise<{success, value}>
  516. */
  517. static getAudioMixingDuration(): Promise<any>;
  518. /**
  519. * get audio mixing current position
  520. *
  521. * This method gets audio mixing current position value.
  522. * @return Promise<{success, value}>
  523. */
  524. static getAudioMixingCurrentPosition(): Promise<any>;
  525. /**
  526. * set audio mixing position
  527. *
  528. * This method sets audio mixing position by the parameter pos
  529. * @param pos
  530. */
  531. static setAudioMixingPosition(pos: number): Promise<any>;
  532. /**
  533. * get effects of volume
  534. *
  535. * This methods get audio mixing effects volume value.
  536. * @return Promise<{success, value}>
  537. */
  538. static getEffectsVolume(): Promise<any>;
  539. /**
  540. * set effects volume
  541. *
  542. * This methods set audio mixing effects volume by float parameter.
  543. * @param volume
  544. * @return Promise<{success, value}>
  545. */
  546. static setEffectsVolume(volume: number): Promise<any>;
  547. /**
  548. * set volume for playing effects.
  549. *
  550. * This methods set for playing audio mixing effects
  551. * @return Promise<{success, value}>
  552. */
  553. static setVolumeOfEffect(volume: number): Promise<any>;
  554. /**
  555. * play specified effect for audio mixing
  556. *
  557. * This methos plays the specified effect of audio mixing file by option config.
  558. * @param options {@link PlayEffectOption}
  559. * @return Promise<{success, value}>
  560. */
  561. static playEffect(options: PlayEffectOption): Promise<any>;
  562. /**
  563. * stop play effect for audio mixing
  564. *
  565. * This methods stops the specified effect for audio mixing file by soundid.
  566. * @param sounid
  567. * @return Promise<{success, value}>
  568. */
  569. static stopEffect(soundId: number): Promise<any>;
  570. /**
  571. * stop play all for effect audio mixing.
  572. *
  573. * This methods stops all effect audio mixing.
  574. * @return Promise<{success, value}>
  575. */
  576. static stopAllEffects(): Promise<any>;
  577. /**
  578. * preload effect for audio mixing file.
  579. *
  580. * This methods preloads the specified audio mixing file to memory by the soundid
  581. * @param soundid
  582. * @param filepath
  583. * @return Promise<{success, value}>
  584. */
  585. static preloadEffect(soundId: number, filepath: string): Promise<any>;
  586. /**
  587. * unload effect
  588. *
  589. * This methods unload the already loaded audio mixing file from memory by the soundid.
  590. * @param soundid
  591. * @return Promise<{success, value}>
  592. */
  593. static unloadEffect(soundId: number): Promise<any>;
  594. /**
  595. * pause the specified effect for audio mixing by soundid
  596. *
  597. * This method pauses the specified effect for audio mixing by soundid.
  598. * @param soundid
  599. * @return Promise<{success, value}>
  600. */
  601. static pauseEffect(soundId: number): Promise<any>;
  602. /**
  603. * pause all effects for audio mixing
  604. *
  605. * This method pause all effects for audio mixing.
  606. * @param soundid
  607. * @return Promise<{success, value}>
  608. */
  609. static pauseAllEffects(): Promise<any>;
  610. /**
  611. * resume audio mixing effect by the specified soundid
  612. *
  613. * This method resumes audio mixing effect by the specified soundid
  614. * @param soundid
  615. * @return Promise<{success, value}>
  616. */
  617. static resumeEffect(soundId: number): Promise<any>;
  618. /**
  619. * resume all audio mixing effects.
  620. *
  621. * This method resumes all audio mixing effects.
  622. * @return Promise<{success, value}>
  623. */
  624. static resumeAllEffects(): Promise<any>;
  625. /**
  626. * start audio recording by quality
  627. *
  628. * This method start audio recording by quality config
  629. * @param options {@link AudioRecordingOption}
  630. * @return Promise<{success, value}>
  631. */
  632. static startAudioRecording(options: AudioRecordingOption): Promise<any>;
  633. /**
  634. * stop audio recording
  635. *
  636. * This method stops audio recording.
  637. * @return Promise<{success, value}>
  638. */
  639. static stopAudioRecording(): Promise<any>;
  640. /**
  641. * set audio session operation restriction
  642. *
  643. * 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.
  644. * You can call this method at any time to return the control of the audio sessions to the SDK.
  645. * 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.
  646. * @notice iOS support only
  647. */
  648. static setAudioSessionOperationRestriction(): void;
  649. /**
  650. * @deprecated startEchoTest
  651. * startEchoTest
  652. */
  653. /**
  654. * @deprecated isCameraAutoFocusFaceModeSupported
  655. * @deprecated isCameraExposurePositionSupported
  656. * @deprecated isCameraFocusSupported
  657. * @deprecated isCameraTorchSupported
  658. * @deprecated isCameraZoomSupported
  659. * instead use {@method getCameraInfo}
  660. */
  661. /**
  662. * stop echo test
  663. *
  664. * This method stop launched an audio call test.
  665. * @return Promise<{success, value}>
  666. */
  667. static stopEchoTest(): Promise<any>;
  668. /**
  669. * enable lastmile test
  670. *
  671. * This method enables the network connection qualit test.
  672. *
  673. * @return Promise<{success, value}>
  674. */
  675. static enableLastmileTest(): Promise<any>;
  676. /**
  677. * disable lastmile test
  678. *
  679. * This method disable the network connection qualit test.
  680. *
  681. * @return Promise<{success, value}>
  682. */
  683. static disableLastmileTest(): Promise<any>;
  684. /**
  685. * set recording audio frame parameters
  686. *
  687. * This method Sets the audio recording format for the audioFrame callback.
  688. *
  689. * @param options {@link RecordingAudioFrameOption}
  690. * @return Promise<{success, value}>
  691. */
  692. static setRecordingAudioFrameParameters(options: AudioFrameOption): Promise<any>;
  693. /**
  694. * set playback audio frame parameters
  695. *
  696. * This method Sets the audio frame format for the playbackFrame callback.
  697. *
  698. * @param options {@link AudioFrameOption}
  699. * @return Promise<{success, value}>
  700. */
  701. static setPlaybackAudioFrameParameters(options: AudioFrameOption): Promise<any>;
  702. /**
  703. * set mixed audio frame parameters
  704. *
  705. * This method Sets the audio frame format for the mixedAudioFrame callback.
  706. *
  707. * @param options {@link MixedAudioFrameOption}
  708. * @return Promise<{success, value}>
  709. */
  710. static setMixedAudioFrameParameters(options: MixedAudioFrameOption): Promise<any>;
  711. /**
  712. * add video watermark
  713. *
  714. * This method adds video watermark to the local video.
  715. *
  716. * @param options {@link ImageOption}
  717. * @return Promise<{success, value}>
  718. */
  719. static addVideoWatermark(options: ImageOption): Promise<any>;
  720. /**
  721. * clear video watermarks
  722. *
  723. * This method removes the watermark image from the video stream added by addVideoWatermark.
  724. *
  725. * @return Promise<{success, value}>
  726. */
  727. static removclearVideoWatermarkse(): Promise<any>;
  728. /**
  729. * set local publish fallback
  730. *
  731. * This method sets the fallback option for the locally published video stream based on the network conditions.
  732. *
  733. * @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)
  734. * @return Promise<{success, value}>
  735. */
  736. static setLocalPublishFallbackOption(option: number): Promise<any>;
  737. /**
  738. * set remote publish fallback
  739. *
  740. * This method sets the fallback option for the remotely subscribed video stream based on the network conditions.
  741. *
  742. * @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)
  743. * @return Promise<{success, value}>
  744. */
  745. static setRemoteSubscribeFallbackOption(option: number): Promise<any>;
  746. /**
  747. * enable dual stream mode
  748. *
  749. * This method enables the dual stream by parameter mode.
  750. *
  751. * @param enabled
  752. * @return Promise<{success, value}>
  753. */
  754. static enableDualStreamMode(enabled: boolean): Promise<any>;
  755. /**
  756. * set remote video stream type
  757. *
  758. * This method sets the remote video stream type by uid and streamType.
  759. *
  760. * @param options {@link VideoStreamOption}
  761. * @return Promise<{success, value}>
  762. */
  763. static setRemoteVideoStreamType(options: VideoStreamOption): Promise<any>;
  764. /**
  765. * set remote default video stream type
  766. *
  767. * This method sets the default video stream type.
  768. *
  769. * @param options {@link DefaultVideoStreamOption}
  770. * @return Promise<{success, value}>
  771. */
  772. static setRemoteDefaultVideoStreamType(options: DefaultVideoStreamOption): Promise<any>;
  773. /**
  774. * add inject stream url
  775. *
  776. * This method injects an online media stream to a live broadcast.
  777. *
  778. * @param options {@link InjectStreamOption}
  779. * @return Promise<{success, value}>
  780. */
  781. static addInjectStreamUrl(options: InjectStreamOption): Promise<any>;
  782. /**
  783. * remove inject stream url
  784. *
  785. * This method removes stream by addInjectsStreamUrl.
  786. *
  787. * @param options {@link RemoveInjectStreamOption}
  788. * @return Promise<{success, value}>
  789. */
  790. static removeInjectStreamUrl(options: RemoveInjectStreamOption): Promise<any>;
  791. /**
  792. * @deprecated sendMessage
  793. * sendMessage
  794. */
  795. static sendMessage(): Promise<any>;
  796. /**
  797. * @deprecated createDataStream
  798. * createDataStream
  799. */
  800. /**
  801. * @deprecated setupLocalVideo
  802. * setupLocalVideo
  803. */
  804. /**
  805. * @deprecated setupRemoteVideo
  806. * setupRemoteVideo
  807. */
  808. /**
  809. * @deprecated setVideoQualityParameters
  810. * setVideoQualityParameters
  811. */
  812. /**
  813. * set local video mirror mode
  814. *
  815. * This method sets local video mirror mode
  816. *
  817. * @param mode
  818. * @return Promise<{success, value}>
  819. */
  820. static setLocalVideoMirrorMode(mode: number): Promise<any>;
  821. /**
  822. * switch camera
  823. *
  824. * This method switches camera between front and rear.
  825. *
  826. * @return Promise<{success, value}>
  827. */
  828. static switchCamera(): Promise<any>;
  829. /**
  830. * set camera zoom ratio
  831. *
  832. * This method sets the camera zoom ratio.
  833. *
  834. * @param zoomFactor
  835. * @return Promise<{success, value}>
  836. */
  837. static setCameraZoomFactor(zoomFactor: number): Promise<any>;
  838. /**
  839. * get camera max zoom ratio
  840. *
  841. * This method gets the camera maximum zoom ratio.
  842. *
  843. * @notice Android Only
  844. * @return Promise<{success, value}>
  845. */
  846. static getCameraMaxZoomFactor(): Promise<any>;
  847. /**
  848. * set camera focus position in preview
  849. *
  850. * This method sets the mannual focus position.
  851. *
  852. * @param options {@link PositionOption}
  853. * @return Promise<{success, value}>
  854. */
  855. static setCameraFocusPositionInPreview(options: PositionOption): Promise<any>;
  856. /**
  857. * set camera exposure position
  858. *
  859. * This method sets the mannual exposure position.
  860. *
  861. * @param options {@link PositionOption}
  862. * @return Promise<{success, value}>
  863. */
  864. static setCameraExposurePosition(options: PositionOption): Promise<any>;
  865. /**
  866. * set camera torch on
  867. *
  868. * This method enables the camera flash function.
  869. *
  870. * @param enabled
  871. * @return Promise<{success, value}>
  872. */
  873. static setCameraTorchOn(enabled: boolean): Promise<any>;
  874. /**
  875. * set enable auto focus face mode
  876. *
  877. * This method enables auto-focus face mode function.
  878. *
  879. * @param enabled boolean
  880. * @return Promise<{success, value}>
  881. */
  882. static setCameraAutoFocusFaceModeEnabled(enabled: boolean): Promise<any>;
  883. /**
  884. * get call id
  885. *
  886. * This method is used to get call id.
  887. *
  888. * @return Promise<{success, value}>
  889. */
  890. static getCallId(): Promise<any>;
  891. /**
  892. * set log file and log filter
  893. *
  894. * This method sets the log file generated path and specified the log level.
  895. *
  896. * @param filepath string
  897. * @param level enum
  898. * @param maxfileSize integer (KB)
  899. * @return Promise<{success, value}>
  900. */
  901. static setLog(filepath: string, level: number, maxfileSize: number): Promise<any>;
  902. /**
  903. * add publish stream url
  904. *
  905. * This method add publish stream by option.
  906. *
  907. * @param options {@link PublishStreamOption}
  908. * @return Promise<{success, value}>
  909. */
  910. static addPublishStreamUrl(options: PublishStreamOption): Promise<any>;
  911. /**
  912. * remove publish stream url
  913. *
  914. * This method remove publish stream by options.
  915. *
  916. * @param options {@link RemovePublishStreamOption}
  917. * @return Promise<{success, value}>
  918. */
  919. static removePublishStreamUrl(options: RemovePublishStreamOption): Promise<any>;
  920. /**
  921. * set live transcoding
  922. *
  923. * This method sets the video layout and audio settings for CDN live.
  924. *
  925. * @param options {@link LiveTranscoding}
  926. * @return Promise<{success, value}>
  927. */
  928. static setLiveTranscoding(options: LiveTranscodingOption): Promise<any>;
  929. /**
  930. * get sdk version
  931. *
  932. * This method gets the sdk version details and passed it into callback function
  933. *
  934. * @param callback to handle resolve from getSdkVersion
  935. * @param errorHandler to handle reject error from getSdkVersion
  936. * @return any
  937. */
  938. static getSdkVersion(callback: Callback<any>, errorHandler?: Callback<any>): any;
  939. /**
  940. * mute local audio stream
  941. *
  942. * This method sends/stops sending the local audio.
  943. *
  944. * @param enabled
  945. * @return Promise<any>
  946. */
  947. static muteLocalAudioStream(enabled: boolean): Promise<any>;
  948. /**
  949. * video pre-process/post-process
  950. *
  951. * This method enables/disables image enhancement and sets the options.
  952. *
  953. * @param enable boolean
  954. * @param options {@link BeautyOptions}
  955. * @return Promise<any>
  956. */
  957. static setBeautyEffectOptions(enabled: boolean, options: BeautyOption): Promise<any>;
  958. /**
  959. * set local voice change
  960. *
  961. * This method changes local speaker voice with voiceChanger
  962. *
  963. * @param voiceChanger integer
  964. * @voiceChanger value ranges [
  965. * 0: "The original voice",
  966. * 1: "An old man’s voice",
  967. * 2: "A little boy’s voice.",
  968. * 3: "A little girl’s voice.",
  969. * 4: "TBD",
  970. * 5: "Ethereal vocal effects.",
  971. * 6: "Hulk’s voice."
  972. * ]
  973. * @return Promise<any>
  974. */
  975. static setLocalVoiceChanger(voiceChanger: number): Promise<any>;
  976. /**
  977. * set the preset local voice reverberation effect.
  978. *
  979. * This method sets the preset local voice reverberation effect.
  980. *
  981. * @param preset integer
  982. * @return Promise<any>
  983. */
  984. static setLocalVoiceReverbPreset(preset: number): Promise<any>;
  985. /**
  986. * control stereo panning for remote users
  987. *
  988. * This method enables/disables stereo panning for remote users.
  989. *
  990. * @param enabled boolean
  991. * @return Promise<any>
  992. */
  993. static enableSoundPositionIndication(enabled: boolean): Promise<any>;
  994. /**
  995. * set the sound position of a remote user
  996. *
  997. * This method sets the sound position of a remote user by uid
  998. *
  999. * @param uid number | The ID of the remote user
  1000. * @param pan float | The sound position of the remote user. The value ranges from -1.0 to 1.0
  1001. * @pan
  1002. * 0.0: the remote sound comes from the front.
  1003. * -1.0: the remote sound comes from the left.
  1004. * 1.0: the remote sound comes from the right.
  1005. * @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.
  1006. * @return Promise<any>
  1007. */
  1008. static setRemoteVoicePosition(uid: number, pan: number, gain: number): Promise<any>;
  1009. /**
  1010. * start the lastmile probe test
  1011. *
  1012. * 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).
  1013. *
  1014. * @param config LastmileProbeConfig {@link LastmileProbeConfig}
  1015. *
  1016. * 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.
  1017. * 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.
  1018. * @return Promise<any>
  1019. */
  1020. static startLastmileProbeTest(config: LastmileProbeConfig): Promise<any>;
  1021. /**
  1022. * stop the lastmile probe test
  1023. *
  1024. * This method stop the lastmile probe test.
  1025. *
  1026. * @return Promise<any>
  1027. */
  1028. static stopLastmileProbeTest(): Promise<any>;
  1029. /**
  1030. * sets the priority of a remote user's media stream.
  1031. *
  1032. * 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.
  1033. *
  1034. * This method sets the priority of a remote user's media stream.
  1035. * @param uid number
  1036. * @param userPriority number | The value range is [50 is "user's priority is hgih", 100 is "the default user's priority is normal"]
  1037. *
  1038. * @return Promise<any>
  1039. */
  1040. static setRemoteUserPriority(uid: number, userPrority: number): Promise<any>;
  1041. /**
  1042. * start an audio call test.
  1043. *
  1044. * note:
  1045. * Call this method before joining a channel.
  1046. * 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.
  1047. * In the Live-broadcast profile, only a host can call this method.
  1048. * This method will start an audio call test with interval parameter.
  1049. * 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.
  1050. *
  1051. * @param interval number
  1052. *
  1053. * @return Promise<any>
  1054. */
  1055. static startEchoTestWithInterval(interval: number): Promise<any>;
  1056. /**
  1057. * set the camera capture preference.
  1058. *
  1059. * note:
  1060. * 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:
  1061. * 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.
  1062. * 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.
  1063. * If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW(2).
  1064. *
  1065. * This method will set the camera capture preference.
  1066. *
  1067. * @param config {@link CameraCapturerConfiguration}
  1068. *
  1069. * @return Promise<any>
  1070. */
  1071. static setCameraCapturerConfiguration(config: CameraCapturerConfiguration): Promise<any>;
  1072. /**
  1073. * Gets the audio mixing volume for local playback.
  1074. *
  1075. * note:
  1076. * This method helps troubleshoot audio volume related issues.
  1077. *
  1078. * @return Promise<any>
  1079. */
  1080. static getAudioMixingPlayoutVolume(): Promise<any>;
  1081. /**
  1082. * Gets the audio mixing volume for publishing.
  1083. *
  1084. * note:
  1085. * This method helps troubleshoot audio volume related issues.
  1086. *
  1087. * @return Promise<any>
  1088. */
  1089. static getAudioMixingPublishVolume(): Promise<any>;
  1090. /**
  1091. * sendMediaData for media observer.
  1092. *
  1093. * note:
  1094. * This method needs you invoke registerMediaMetadataObserver success first and you could send media data through interval media observer feature.
  1095. * The data have limit length is 1024 bytes, if you pass data length bigger than limit it will failed.
  1096. * @param data String: 1024 bytes limit
  1097. * @return Promise<any>
  1098. */
  1099. static sendMediaData(data: String): Promise<any>;
  1100. /**
  1101. * Registers the metadata observer.
  1102. *
  1103. * note:
  1104. * This method only work in live mode
  1105. * 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.
  1106. * This method trigger 'mediaMetaDataReceived' event, here is example:
  1107. * ```javascript
  1108. * RtcEngine.on("mediaMetaDataReceived", (data) => {
  1109. * console.log("mediaMetaDataReceived", data);
  1110. * })
  1111. * ```
  1112. * @return Promise<any>
  1113. */
  1114. static registerMediaMetadataObserver(): Promise<any>;
  1115. /**
  1116. * Get local device camera support info
  1117. *
  1118. * note:
  1119. * This method returns your current device camera support info.
  1120. * ```javascript
  1121. * RtcEngine.getCameraInfo().then(info => {
  1122. * console.log("your currrent camera", info);
  1123. * })
  1124. * ```
  1125. * @return Promise{cameraSupportInfo}>
  1126. */
  1127. static getCameraInfo(): Promise<any>;
  1128. }
  1129. export default RtcEngine;