설명 없음

RtcEngine.native.d.ts 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  1. import { Option, Callback, AudioMixingOption, PlayEffectOption, AudioRecordingOption, AudioFrameOption, MixedAudioFrameOption, ImageOption, VideoStreamOption, DefaultVideoStreamOption, InjectStreamOption, RemoveInjectStreamOption, PublishStreamOption, RemovePublishStreamOption, LiveTranscodingOption, PositionOption, BeautyOption, LastmileProbeConfig, CameraCapturerConfiguration } from "./types";
  2. /**
  3. * RtcEngine is the javascript object for control agora native sdk through react native bridge.
  4. *
  5. * You can use the RtcEngine methods to create {@link init}
  6. *
  7. * Other methods of the RtcEngine object serve for agora native sdk and set up error logging.
  8. */
  9. declare class RtcEngine {
  10. private static readonly AG_PREFIX;
  11. /**
  12. * Creates a RtcEngine Object internal.
  13. *
  14. * This method creates and start event observer. You should call this method once.
  15. * @example `RtcEngine.init(option)`
  16. * @param options Defines the property of the client, see {@link Option} for details.
  17. */
  18. static init(options: Option): void;
  19. /**
  20. * join specified channel
  21. *
  22. * This method joins and begin rendering the video stream. when join succeeds.
  23. * Otherwise, it will invoke error by the event
  24. * @param channelName
  25. * @param uid
  26. * @param token
  27. * @param info
  28. */
  29. static joinChannel(channelName: string, uid?: number, token?: string, info?: Object): void;
  30. /**
  31. * add event listener
  32. *
  33. * This method subscribes specified eventType and run listener. You should call this method at first.
  34. * @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. * check for mobile phone speaker enabled
  247. *
  248. * This method checks the phone speaker is enabled
  249. * @param callback
  250. */
  251. static methodisSpeakerphoneEnabled(callback: Callback<any>): void;
  252. /**
  253. * enable in-ear monitor
  254. *
  255. * This method enables in-ear monitoring by boolean parameter enabled
  256. *
  257. * @param enabled
  258. */
  259. static enableInEarMonitoring(enabled: boolean): void;
  260. /**
  261. * set in-ear monitoring volume
  262. *
  263. * This method sets the in-ear-monitoring volume by number parameter volume
  264. *
  265. * @param volume
  266. */
  267. static setInEarMonitoringVolume(volume: number): void;
  268. /**
  269. * set local voice pitch
  270. *
  271. * This method sets the local voice pitch by float parameter pitch
  272. *
  273. * @param pitch
  274. */
  275. static setLocalVoicePitch(pitch: number): void;
  276. /**
  277. * set local voice equalization
  278. *
  279. * This method set local video equalization of band frequency by enum band number and number of gain
  280. *
  281. * @param band
  282. * @param gain
  283. */
  284. static setLocalVoiceEqualization(band: number, gain: number): void;
  285. /**
  286. * set local voice reverb
  287. *
  288. * This method sets local voice by reverb and value
  289. * @param reverb
  290. * @param value
  291. */
  292. static setLocalVoiceReverb(reverb: number, value: number): void;
  293. /**
  294. * start audio mixing
  295. *
  296. * This method will start audio mixing by option config
  297. *
  298. * @param options {@link AudioMixingOption}
  299. */
  300. static startAudioMixing(options: AudioMixingOption): void;
  301. /**
  302. * stop audio mixing
  303. *
  304. * This methods stops for audio mixing.
  305. */
  306. static stopAudioMixing(): void;
  307. /**
  308. * pause audio mixing
  309. *
  310. * This method pauses for audio mixing.
  311. */
  312. static pauseAudioMixing(): void;
  313. /**
  314. * resume audio mixing
  315. *
  316. * This method resumes for audio mixing.
  317. */
  318. static resumeAudioMixing(): void;
  319. /**
  320. * adjust audio mixing volume
  321. *
  322. * This method adjusts audio mixing volume by the volume number parameter
  323. * @param volume
  324. */
  325. static adjustAudioMixingVolume(volume: number): void;
  326. /**
  327. * adjust audio mixing playout volume
  328. *
  329. * This method adjusts audio mixing playout by the volume parameter
  330. * @param volume
  331. */
  332. static adjustAudioMixingPlayoutVolume(volume: number): void;
  333. /**
  334. * adjust audio mixing publish volume
  335. *
  336. * This method adjusts audio mixing publish by the volume paraemter
  337. * @param volume
  338. */
  339. static adjustAudioMixingPublishVolume(volume: number): void;
  340. /**
  341. * get audio mixing duration
  342. *
  343. * This method gets the audio mixing duration
  344. * @returns Promise<{success, value}>
  345. */
  346. static getAudioMixingDuration(): Promise<any>;
  347. /**
  348. * get audio mixing current position
  349. *
  350. * This method gets audio mixing current position value.
  351. * @returns Promise<{success, value}>
  352. */
  353. static getAudioMixingCurrentPosition(): Promise<any>;
  354. /**
  355. * set audio mixing position
  356. *
  357. * This method sets audio mixing position by the parameter pos
  358. * @param pos
  359. */
  360. static setAudioMixingPosition(pos: number): Promise<any>;
  361. /**
  362. * get effects of volume
  363. *
  364. * This methods get audio mixing effects volume value.
  365. * @returns Promise<{success, value}>
  366. */
  367. static getEffectsVolume(): Promise<any>;
  368. /**
  369. * set effects volume
  370. *
  371. * This methods set audio mixing effects volume by float parameter.
  372. * @param volume
  373. * @returns Promise<{success, value}>
  374. */
  375. static setEffectsVolume(volume: number): Promise<any>;
  376. /**
  377. * set volume for playing effects.
  378. *
  379. * This methods set for playing audio mixing effects
  380. * @returns Promise<{success, value}>
  381. */
  382. static setVolumeOfEffect(volume: number): Promise<any>;
  383. /**
  384. * play specified effect for audio mixing
  385. *
  386. * This methos plays the specified effect of audio mixing file by option config.
  387. * @param options {@link PlayEffectOption}
  388. * @returns Promise<{success, value}>
  389. */
  390. static playEffect(options: PlayEffectOption): Promise<any>;
  391. /**
  392. * stop play effect for audio mixing
  393. *
  394. * This methods stops the specified effect for audio mixing file by soundid.
  395. * @param sounid
  396. * @returns Promise<{success, value}>
  397. */
  398. static stopEffect(soundId: number): Promise<any>;
  399. /**
  400. * stop play all for effect audio mixing.
  401. *
  402. * This methods stops all effect audio mixing.
  403. * @returns Promise<{success, value}>
  404. */
  405. static stopAllEffects(): Promise<any>;
  406. /**
  407. * preload effect for audio mixing file.
  408. *
  409. * This methods preloads the specified audio mixing file to memory by the soundid
  410. * @param soundid
  411. * @param filepath
  412. * @returns Promise<{success, value}>
  413. */
  414. static preloadEffect(soundId: number, filepath: string): Promise<any>;
  415. /**
  416. * unload effect
  417. *
  418. * This methods unload the already loaded audio mixing file from memory by the soundid.
  419. * @param soundid
  420. * @returns Promise<{success, value}>
  421. */
  422. static unloadEffect(soundId: number): Promise<any>;
  423. /**
  424. * pause the specified effect for audio mixing by soundid
  425. *
  426. * This method pauses the specified effect for audio mixing by soundid.
  427. * @param soundid
  428. * @returns Promise<{success, value}>
  429. */
  430. static pauseEffect(soundId: number): Promise<any>;
  431. /**
  432. * pause all effects for audio mixing
  433. *
  434. * This method pause all effects for audio mixing.
  435. * @param soundid
  436. * @returns Promise<{success, value}>
  437. */
  438. static pauseAllEffects(): Promise<any>;
  439. /**
  440. * resume audio mixing effect by the specified soundid
  441. *
  442. * This method resumes audio mixing effect by the specified soundid
  443. * @param soundid
  444. * @returns Promise<{success, value}>
  445. */
  446. static resumeEffect(soundId: number): Promise<any>;
  447. /**
  448. * resume all audio mixing effects.
  449. *
  450. * This method resumes all audio mixing effects.
  451. * @returns Promise<{success, value}>
  452. */
  453. static resumeAllEffects(): Promise<any>;
  454. /**
  455. * start audio recording by quality
  456. *
  457. * This method start audio recording by quality config
  458. * @param options {@link AudioRecordingOption}
  459. * @returns Promise<{success, value}>
  460. */
  461. static startAudioRecording(options: AudioRecordingOption): Promise<any>;
  462. /**
  463. * stop audio recording
  464. *
  465. * This method stops audio recording.
  466. * @returns Promise<{success, value}>
  467. */
  468. static stopAudioRecording(): Promise<any>;
  469. /**
  470. * set audio session operation restriction
  471. *
  472. * 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.
  473. * You can call this method at any time to return the control of the audio sessions to the SDK.
  474. * 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.
  475. * @notice iOS support only
  476. */
  477. static setAudioSessionOperationRestriction(): void;
  478. /**
  479. * @deprecated startEchoTest
  480. * startEchoTest
  481. */
  482. /**
  483. * stop echo test
  484. *
  485. * This method stop launched an audio call test.
  486. * @returns Promise<{success, value}>
  487. */
  488. static stopEchoTest(): Promise<any>;
  489. /**
  490. * enable lastmile test
  491. *
  492. * This method enables the network connection qualit test.
  493. *
  494. * @returns Promise<{success, value}>
  495. */
  496. static enableLastmileTest(): Promise<any>;
  497. /**
  498. * disable lastmile test
  499. *
  500. * This method disable the network connection qualit test.
  501. *
  502. * @returns Promise<{success, value}>
  503. */
  504. static disableLastmileTest(): Promise<any>;
  505. /**
  506. * set recording audio frame parameters
  507. *
  508. * This method Sets the audio recording format for the audioFrame callback.
  509. *
  510. * @param options {@link RecordingAudioFrameOption}
  511. * @returns Promise<{success, value}>
  512. */
  513. static setRecordingAudioFrameParameters(options: AudioFrameOption): Promise<any>;
  514. /**
  515. * set playback audio frame parameters
  516. *
  517. * This method Sets the audio frame format for the playbackFrame callback.
  518. *
  519. * @param options {@link AudioFrameOption}
  520. * @returns Promise<{success, value}>
  521. */
  522. static setPlaybackAudioFrameParameters(options: AudioFrameOption): Promise<any>;
  523. /**
  524. * set mixed audio frame parameters
  525. *
  526. * This method Sets the audio frame format for the mixedAudioFrame callback.
  527. *
  528. * @param options {@link MixedAudioFrameOption}
  529. * @returns Promise<{success, value}>
  530. */
  531. static setMixedAudioFrameParameters(options: MixedAudioFrameOption): Promise<any>;
  532. /**
  533. * add video watermark
  534. *
  535. * This method adds video watermark to the local video.
  536. *
  537. * @param options {@link ImageOption}
  538. * @returns Promise<{success, value}>
  539. */
  540. static addVideoWatermark(options: ImageOption): Promise<any>;
  541. /**
  542. * clear video watermarks
  543. *
  544. * This method removes the watermark image from the video stream added by addVideoWatermark.
  545. *
  546. * @returns Promise<{success, value}>
  547. */
  548. static removclearVideoWatermarkse(): Promise<any>;
  549. /**
  550. * set local publish fallback
  551. *
  552. * This method sets the fallback option for the locally published video stream based on the network conditions.
  553. *
  554. * @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)
  555. * @returns Promise<{success, value}>
  556. */
  557. static setLocalPublishFallbackOption(option: number): Promise<any>;
  558. /**
  559. * set remote publish fallback
  560. *
  561. * This method sets the fallback option for the remotely subscribed video stream based on the network conditions.
  562. *
  563. * @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)
  564. * @returns Promise<{success, value}>
  565. */
  566. static setRemoteSubscribeFallbackOption(option: number): Promise<any>;
  567. /**
  568. * enable dual stream mode
  569. *
  570. * This method enables the dual stream by parameter mode.
  571. *
  572. * @param enabled
  573. * @returns Promise<{success, value}>
  574. */
  575. static enableDualStreamMode(enabled: boolean): Promise<any>;
  576. /**
  577. * set remote video stream type
  578. *
  579. * This method sets the remote video stream type by uid and streamType.
  580. *
  581. * @param options {@link VideoStreamOption}
  582. * @returns Promise<{success, value}>
  583. */
  584. static setRemoteVideoStreamType(options: VideoStreamOption): Promise<any>;
  585. /**
  586. * set remote default video stream type
  587. *
  588. * This method sets the default video stream type.
  589. *
  590. * @param options {@link DefaultVideoStreamOption}
  591. * @returns Promise<{success, value}>
  592. */
  593. static setRemoteDefaultVideoStreamType(options: DefaultVideoStreamOption): Promise<any>;
  594. /**
  595. * add inject stream url
  596. *
  597. * This method injects an online media stream to a live broadcast.
  598. *
  599. * @param options {@link InjectStreamOption}
  600. * @returns Promise<{success, value}>
  601. */
  602. static addInjectStreamUrl(options: InjectStreamOption): Promise<any>;
  603. /**
  604. * remove inject stream url
  605. *
  606. * This method removes stream by addInjectsStreamUrl.
  607. *
  608. * @param options {@link RemoveInjectStreamOption}
  609. * @returns Promise<{success, value}>
  610. */
  611. static removeInjectStreamUrl(options: RemoveInjectStreamOption): Promise<any>;
  612. /**
  613. * @deprecated sendMessage
  614. * sendMessage
  615. */
  616. /**
  617. * @deprecated createDataStream
  618. * createDataStream
  619. */
  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. * add publish stream url
  764. *
  765. * This method add publish stream by option.
  766. *
  767. * @param options {@link PublishStreamOption}
  768. * @returns Promise<{success, value}>
  769. */
  770. static addPublishStreamUrl(options: PublishStreamOption): Promise<any>;
  771. /**
  772. * remove publish stream url
  773. *
  774. * This method remove publish stream by options.
  775. *
  776. * @param options {@link RemovePublishStreamOption}
  777. * @returns Promise<{success, value}>
  778. */
  779. static removePublishStreamUrl(options: RemovePublishStreamOption): Promise<any>;
  780. /**
  781. * set live transcoding
  782. *
  783. * This method sets the video layout and audio settings for CDN live.
  784. *
  785. * @param options {@link LiveTranscoding}
  786. * @returns Promise<{success, value}>
  787. */
  788. static setLiveTranscoding(options: LiveTranscodingOption): Promise<any>;
  789. /**
  790. * get sdk version
  791. *
  792. * This method gets the sdk version details and passed it into callback function
  793. *
  794. * @param callback to handle resolve from getSdkVersion
  795. * @param errorHandler to handle reject error from getSdkVersion
  796. */
  797. static getSdkVersion(callback: Callback<any>, errorHandler?: Callback<any>): any;
  798. /**
  799. * mute local audio stream
  800. *
  801. * This method sends/stops sending the local audio.
  802. *
  803. * @param enabled
  804. */
  805. static muteLocalAudioStream(enabled: boolean): void;
  806. /**
  807. * video pre-process/post-process
  808. *
  809. * This method enables/disables image enhancement and sets the options.
  810. *
  811. * @param enable boolean
  812. * @param options {@link BeautyOptions}
  813. * @returns Promise<{success, value}>
  814. */
  815. static setBeautyEffectOptions(enabled: boolean, options: BeautyOption): Promise<any>;
  816. /**
  817. * set local voice change
  818. *
  819. * This method changes local speaker voice with voiceChanger
  820. *
  821. * @param voiceChanger integer
  822. * @voiceChanger value ranges [
  823. * 0: "The original voice",
  824. * 1: "An old man’s voice",
  825. * 2: "A little boy’s voice.",
  826. * 3: "A little girl’s voice.",
  827. * 4: "TBD",
  828. * 5: "Ethereal vocal effects.",
  829. * 6: "Hulk’s voice."
  830. * ]
  831. * @returns Promise<{success, value}>
  832. */
  833. static setLocalVoiceChanger(voiceChanger: number): Promise<any>;
  834. /**
  835. * set the preset local voice reverberation effect.
  836. *
  837. * This method sets the preset local voice reverberation effect.
  838. *
  839. * @param preset integer
  840. * @returns Promise<{success, value}>
  841. */
  842. static setLocalVoiceReverbPreset(preset: number): Promise<any>;
  843. /**
  844. * control stereo panning for remote users
  845. *
  846. * This method enables/disables stereo panning for remote users.
  847. *
  848. * @param enabled boolean
  849. * @returns Promise<{success, value}>
  850. */
  851. static enableSoundPositionIndication(enabled: boolean): Promise<any>;
  852. /**
  853. * set the sound position of a remote user
  854. *
  855. * This method sets the sound position of a remote user by uid
  856. *
  857. * @param uid number | The ID of the remote user
  858. * @param pan float | The sound position of the remote user. The value ranges from -1.0 to 1.0
  859. * @pan
  860. * 0.0: the remote sound comes from the front.
  861. * -1.0: the remote sound comes from the left.
  862. * 1.0: the remote sound comes from the right.
  863. * @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.
  864. * @returns Promise<{success, value}>
  865. */
  866. static setRemoteVoicePosition(uid: number, pan: number, gain: number): Promise<any>;
  867. /**
  868. * start the lastmile probe test
  869. *
  870. * 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).
  871. *
  872. * @param config LastmileProbeConfig {@link LastmileProbeConfig}
  873. *
  874. * @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.
  875. * @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.
  876. * @returns Promise<{success, value}>
  877. */
  878. static startLastmileProbeTest(config: LastmileProbeConfig): Promise<any>;
  879. /**
  880. * stop the lastmile probe test
  881. *
  882. * This method stop the lastmile probe test.
  883. *
  884. * @returns Promise<{success, value}>
  885. */
  886. static stopLastmileProbeTest(): Promise<any>;
  887. /**
  888. * sets the priority of a remote user's media stream.
  889. *
  890. * 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.
  891. *
  892. * This method sets the priority of a remote user's media stream.
  893. * @param uid number
  894. * @param userPriority number | The value range is [50 is "user's priority is hgih", 100 is "the default user's priority is normal"]
  895. *
  896. * @returns Promise<{success, value}>
  897. */
  898. static setRemoteUserPriority(uid: number, userPrority: number): Promise<any>;
  899. /**
  900. * start an audio call test.
  901. *
  902. * note:
  903. * Call this method before joining a channel.
  904. * 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.
  905. * In the Live-broadcast profile, only a host can call this method.
  906. * This method will start an audio call test with interval parameter.
  907. * 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.
  908. *
  909. * @param interval number
  910. *
  911. * @returns Promise<{success, value}>
  912. */
  913. static startEchoTestWithInterval(interval: number): Promise<any>;
  914. /**
  915. * set the camera capture preference.
  916. *
  917. * note:
  918. * 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:
  919. * 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.
  920. * 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.
  921. * If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW(2).
  922. *
  923. * This method will set the camera capture preference.
  924. *
  925. * @param config {@link CameraCapturerConfiguration}
  926. *
  927. * @returns Promise<{success, value}>
  928. */
  929. static setCameraCapturerConfiguration(config: CameraCapturerConfiguration): Promise<any>;
  930. /**
  931. * Gets the audio mixing volume for local playback.
  932. *
  933. * note:
  934. * This method helps troubleshoot audio volume related issues.
  935. *
  936. * @returns Promise{<success, value}>
  937. */
  938. static getAudioMixingPlayoutVolume(): Promise<any>;
  939. /**
  940. * Gets the audio mixing volume for publishing.
  941. *
  942. * note:
  943. * This method helps troubleshoot audio volume related issues.
  944. *
  945. * @returns Promise{<success, value}>
  946. */
  947. static getAudioMixingPublishVolume(): Promise<any>;
  948. /**
  949. * sendMediaData for media observer.
  950. *
  951. * note:
  952. * This method needs you invoke registerMediaMetadataObserver success first and you could send media data through interval media observer feature.
  953. * The data have limit length is 1024 bytes, if you pass data length bigger than limit it will failed.
  954. * @param data String: 1024 bytes limit
  955. * @returns Promise<{success}>
  956. */
  957. static sendMediaData(data: String): Promise<any>;
  958. /**
  959. * Registers the metadata observer.
  960. *
  961. * note:
  962. * This method only work in live mode
  963. * 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.
  964. * This method trigger 'mediaMetaDataReceived' event, here is example:
  965. * ```javascript
  966. * RtcEngine.on("mediaMetaDataReceived", (data) => {
  967. * console.log("mediaMetaDataReceived", data);
  968. * })
  969. * ```
  970. * @returns Promise{<success, value}>
  971. */
  972. static registerMediaMetadataObserver(): Promise<any>;
  973. /**
  974. * Get local device camera support info
  975. *
  976. * note:
  977. * This method returns your current device camera support info.
  978. * ```javascript
  979. * RtcEngine.getCameraInfo().then(info => {
  980. * console.log("your currrent camera", info);
  981. * })
  982. * ```
  983. * @returns Promise{cameraSupportInfo}>
  984. */
  985. static getCameraInfo(): Promise<any>;
  986. }
  987. export default RtcEngine;