説明なし

RtcEngine.native.d.ts 44KB

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