No Description

RtcEngine.native.d.ts 41KB

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