No Description

RtcEngine.native.d.ts 33KB

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