Brak opisu

RtcEngine.native.d.ts 34KB

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