Keine Beschreibung

RtcEngine.native.d.ts 41KB

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