No Description

RtcEngine.native.js 45KB

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