123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- const tslib_1 = require("tslib");
- const react_native_1 = require("react-native");
- const { Agora } = react_native_1.NativeModules;
- const AgoraEventEmitter = new react_native_1.NativeEventEmitter(Agora);
- /**
- * RtcEngine is the javascript object for control agora native sdk through react native bridge.
- *
- * You can use the RtcEngine methods to create {@link init}
- *
- * Other methods of the RtcEngine object serve for agora native sdk and set up error logging.
- */
- class RtcEngine {
- /**
- * Creates a RtcEngine Object internal.
- *
- * This method creates and start event observer. You should call this method once.
- * @example `RtcEngine.init(option)`
- * @param options Defines the property of the client, see {@link Option} for details.
- */
- static init(options) {
- Agora.init(options);
- }
- /**
- * join specified channel
- *
- * This method joins and begin rendering the video stream. when join succeeds.
- * Otherwise, it will invoke error by the event
- * @param channelName
- * @param uid
- * @param token
- * @param info
- */
- static joinChannel(channelName, uid, token, info) {
- return Agora.joinChannel({ channelName, uid, token, info });
- }
- /**
- * Registers a user account.
- *
- * Once registered, the user account can be used to identify the local user when the user joins the channel. After the user successfully registers a user account, the SDK triggers the `on("localUserRegistered", callback)` on the local client, reporting the user ID and user account of the local user.
- * To join a channel with a user account, you can choose either of the following:
- * Call the {@link registerLocalUserAccount} method to create a user account, and then the {@link joinChannelWithUserAccount} method to join the channel.
- * Call the {@link joinChannelWithUserAccount} method to join the channel.
- *
- * @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type.
- *
- * @param userAccount
- * @returns Promise<any>
- */
- static registerLocalUserAccount(userAccount) {
- return Agora.registerLocalUserAccount({ userAccount });
- }
- /**
- * Joins the channel with a user account.
- *
- * After the user successfully joins the channel, the SDK triggers the following callbacks:
- *
- * The local client: `on("localUserRegistered", callback)` and `on("joinChannelSuccess", callback)`.
- * The remote client: `on("userJoined", callback)` and `on("userInfoUpdated", callback)`, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile.
- *
- * @note To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the uid of the user is set to the same parameter type.
- *
- * @param channelName
- * @param userAccount
- * @param token
- * @returns Promise<any>
- */
- static joinChannelWithUserAccount(channelName, userAccount, token) {
- return Agora.joinChannelWithUserAccount({ channelName, userAccount, token });
- }
- /**
- * Gets the user information by passing in the user account.
- *
- * After receiving the "userInfoUpdated" callback, you can call this method to get the user ID of the remote user from the {@link AgoraUserInfo} object by passing in the userAccount.
- * @param uid
- * @returns Promise<{@link AgoraUserInfo}>
- */
- static getUserInfoByUid(uid) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- if (react_native_1.Platform.OS === 'android') {
- const _uid = this.Uint32ToInt32(uid);
- let result = yield Agora.getUserInfoByUid(_uid);
- result.uid = this.Int32ToUint32(result.uid);
- return result;
- }
- return Agora.getUserInfoByUid(uid);
- });
- }
- /**
- * Gets the user information by passing in the user account.
- *
- * After receiving the "userInfoUpdated" callback, you can call this method to get the user ID of the remote user from the {@link AgoraUserInfo} object by passing in the userAccount.
- * @param userAccount
- * @returns Promise<{@link AgoraUserInfo}>
- */
- static getUserInfoByUserAccount(userAccount) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- if (react_native_1.Platform.OS === 'android') {
- let result = yield Agora.getUserInfoByUserAccount(userAccount);
- result.uid = this.Int32ToUint32(result.uid);
- return result;
- }
- return Agora.getUserInfoByUserAccount(userAccount);
- });
- }
- /**
- * add event listener
- *
- * This method subscribes specified eventType and run listener. You should call this method at first.
- *
- * @event listener
- *
- * ---
- * name | description | usage |
- * error | occurs when emit error | on("error", evt) |
- * warning | occurs when emit warning | on("warning", evt) |
- * messageReceived | occurs when message received | on("messageReceived", evt) |
- * localInvitationReceivedByPeer | occurs when local inviation received by peer | on("localInvitationReceivedByPeer", evt) |
- * localInvitationAccepted | occurs when local invitation accepted | on("localInvitationAccepted", evt) |
- * localInvitationRefused | occurs when local invitation refused | on("localInvitationRefused", evt) |
- * localInvitationCanceled | occurs when local invitation canceled | on("localInvitationCanceled", evt) |
- * localInvitationFailure | occurs when local invitation failure | on("localInvitationFailure", evt) |
- * remoteInvitationFailure | occurs when remote invitation failure | on("remoteInvitationFailure", evt) |
- * remoteInvitationReceived | occurs when remote invitation received | on("remoteInvitationReceived", evt) |
- * remoteInvitationAccepted | occurs when remote invitation accepted | on("remoteInvitationAccepted", evt) |
- * remoteInvitationRefused | occurs when remote invitation refused | on("remoteInvitationRefused", evt) |
- * remoteInvitationCanceled | occurs when remote invitation canceled | on("remoteInvitationCanceled", evt) |
- * channelMessageReceived | occurs when received channel message | on("channelMessageReceived", evt) |
- * channelMemberJoined | occurs when some one joined in the subscribed channel | on("channelMemberJoined", evt) |
- * channelMemberLeft | occurs when sone one left from u subscribed channel | on("channelMemberLeft", evt) |
- * tokenExpired | occurs when token has expired | on("tokenExpired", evt) |
- * apiCallExecute | occurs when apiCallExecute emit, this event is api call monitor | on("apiCallExecute", evt) |
- * joinChannelSuccess | occurs when joinChannel success | on("joinChannelSuccess", evt) |
- * rejoinChannelSuccess | occurs when rejoinChannel success | on("rejoinChannelSuccess", evt) |
- * leaveChannel | occurs when leaveChannel success | on("leaveChannel", evt) |
- * clientRoleChanged | occurs when setClientRole changed | on("clientRoleChanged", evt) |
- * userJoined | occurs when remote user joined | on("userJoined", evt) |
- * userOffline | this event occurs when remote user offline in rtc mode, this events only occurs host user offline in live mode | on("userOffline", evt) |
- * connectionStateChanged | occurs when sdk connection changed state | on("connectionStateChanged", evt) |
- * connectionLost | occurs when sdk connection lost | on("connectionLost", evt) |
- * tokenPrivilegeWillExpire | occurs when token will expire | on("tokenPrivilegeWillExpire", evt) |
- * requestToken | occurs when token expired | on("requestToken") |
- * microphoneEnabled | occurs when microphone enable state changed | on("microphoneEnabled", evt) |
- * audioVolumeIndication | occurs when audio volume indication changed | on("audioVolumeIndication", evt) |
- * activeSpeaker | occurs when detect active speaker | on("activeSpeaker", evt) |
- * firstLocalAudioFrame | occurs when sent first audio frame on local | on("firstLocalAudioFrame", evt) |
- * firstRemoteAudioFrame | occurs when received first audio frame from remote side | on("firstRemoteAudioFrame", evt) |
- * firstRemoteAudioDecoded | occurs when first remote audio decoded | on("firstRemoteAudioDecoded", evt) |
- * firstLocalVideoFrame | occurs when sent first video frame on local | on("firstLocalVideoFrame", evt) |
- * firstRemoteVideoDecoded | occurs when received first video frame from remote side decoded | on("firstRemoteVideoDecoded", evt) |
- * firstRemoteVideoFrame | occurs when received first video frame from remote side | on("firstRemoteVideoFrame", evt) |
- * userMuteAudio | occurs when user mute audio | on("userMuteAudio", evt) |
- * userMuteVideo | occurs when user mute video | on("userMuteVideo", evt) |
- * userEnableVideo | occurs when remote side's user change video enable state | on("userEnableVideo", evt) |
- * userEnableLocalVideo | occurs when user change video enable state on local | on("userEnableLocalVideo", evt) |
- * videoSizeChanged | occurs when change local or remote side video size or rotation | on("videoSizeChanged", evt) |
- * remoteVideoStateChanged | occurs when remote video state has any changed | on("remoteVideoStateChanged", evt) |
- * localPublishFallbackToAudioOnly | occurs when published stream from local side fallback to audio stream | on("localPublishFallbackToAudioOnly", evt) |
- * remoteSubscribeFallbackToAudioOnly | occurs when subscribed side's stream fallback to audio stream | on("remoteSubscribeFallbackToAudioOnly", evt) |
- * audioRouteChanged | occurs when local audio route changed | on("audioRouteChanged", evt) |
- * cameraFocusAreaChanged | occurs when a camera focus area changed | on("cameraFocusAreaChanged", evt) |
- * cameraExposureAreaChanged | occurs when a camera exposure area changed | on("cameraExposureAreaChanged", evt) |
- * rtcStats | occurs when reports the statistics of the current call session once every two seconds. | on("rtcStats", evt) |
- * 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) |
- * networkQuality | occurs when reports the last mile network quality of each user in the channel once every two seconds.| on("networkQuality", evt) |
- * localVideoStats | occurs when reports local video statistics | on("localVideoStats", evt) |
- * remoteVideoStats | occurs when reports remote video statistics| on("remoteVideoStats", evt) |
- * remoteAudioStats | occurs when reports remote audio statistics| on("remoteAudioStats", evt) |
- * audioTransportStatsOfUid | occurs when reports transport-layer statistics of each remote audio stream. | on("audioTransportStatsOfUid", evt) |
- * videoTransportStatsOfUid | occurs when reports transport-layer statistics of each remote video stream.| on("videoTransportStatsOfUid", evt) |
- * audioEffectFinish | occurs when the local audio effect playback finishes. | on("audioEffectFinish", evt) |
- * streamPublished | occurs when addPublishStreamUrl success| on("streamPublished", evt) |
- * streamUnpublish | occurs when removePublishStreamUrl success| on("streamUnpublish", evt) |
- * transcodingUpdate | occurs when the cdn live streaming settings are updated | on("transcodingUpdate", evt) |
- * streamInjectedStatus | occurs when report the status of online injecting stream to a live broadcast | on("streamInjectedStatus", evt) |
- * mediaEngineLoaded | occurs when the media engine loaded | on("mediaEngineLoaded", evt) |
- * mediaEngineStartCall | occurs when the media engine call starts | on("mediaEngineStartCall", evt) |
- * startEchoTestWithInterval | occurs when startEchoTestWithInterval success | on("startEchoTestWithInterval", evt) |
- * audioMixingStateChanged | occurs when reports the local audio mixing state changed | on("audioMixingStateChanged", evt) |
- * lastmileProbeTestResult | occurs when reports the last-mile network probe result.| on("lastmileProbeTestResult", evt) |
- * rtmpStreamingStateChanged | occurs when reports the rtmp injecting stream state changed | on("rtmpStreamingStateChanged", evt) |
- * localVideoChanged | occurs when the local video changed | on("localVideoChanged", evt) |
- * networkTypeChanged | occurs when the device network type changed | on("networkTypeChanged", evt) |
- * mediaMetaDataReceived | occurs when you received media meta data from the remote side through sendMediaData | on("mediaMetaDataReceived", evt) |
- * localUserRegistered | occurs when you register user account success | on("localUserRegistered", evt) |
- * userInfoUpdated | occurs when you peer side using user account join channel | on("userInfoUpdated", evt) |
- * ---
- *
- * @param eventType
- * @param listener
- * @return any
- */
- static on(eventType, listener) {
- // convert int32 to uint32
- if ([
- 'joinChannelSuccess',
- 'rejoinChannelSuccess',
- 'userJoined',
- 'userOffline',
- 'occurStreamMessageError',
- 'receiveStreamMessage',
- 'activeSpeaker',
- 'firstRemoteAudioFrame',
- 'firstRemoteVideoDecoded',
- 'firstRemoteVideoFrame',
- 'userMuteAudio',
- 'userMuteVideo',
- 'userEnableVideo',
- 'userEnableLocalVideo',
- 'videoSizeChanged',
- 'firstRemoteAudioDecoded',
- 'remoteVideoStateChanged',
- 'remoteSubscribeFallbackToAudioOnly',
- 'networkQuality',
- 'streamInjectedStatus',
- 'localUserRegistered'
- ].indexOf(eventType) != -1) {
- AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
- args.uid = this.Int32ToUint32(args.uid);
- // convert int32 streamId to uint32
- if (args.streamId) {
- args.streamId = this.Int32ToUint32(args.streamId);
- }
- listener(args);
- });
- return;
- }
- if (['userInfoUpdated'].indexOf(eventType) != -1) {
- AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
- args.uid = this.Int32ToUint32(args.uid);
- args.peer.uid = this.Int32ToUint32(args.peer.uid);
- listener(args);
- });
- return;
- }
- if (['audioVolumeIndication'].indexOf(eventType) != -1) {
- AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
- args.speakers.map((speaker) => {
- const uid = this.Int32ToUint32(speaker.uid);
- return Object.assign({}, speaker, { uid });
- });
- listener(args);
- });
- return;
- }
- if ([
- 'remoteAudioStats',
- 'remoteVideoStats',
- 'audioTransportStatsOfUid',
- 'videoTransportStatsOfUid',
- ].indexOf(eventType) != -1) {
- AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
- args.stats.uid = this.Int32ToUint32(args.stats.uid);
- listener(args);
- });
- return;
- }
- AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, listener);
- }
- /**
- * @deprecated removeAllListeners
- */
- static removeAllListeners() {
- console.warn("removeAllListeners method already deprecated");
- }
- /**
- * @deprecated off
- * @param mode
- */
- static off(evt) {
- console.warn("off method already deprecated");
- }
- /**
- * renew token
- *
- * This method renews a new token.
- * @param token
- */
- static renewToken(token) {
- return Agora.renewToken(token);
- }
- /**
- * enable websdk interoperability
- *
- * This method used to enable websdk interoperability, so that it can connect with agora websdk apps.
- *
- * @param enabled
- * @return Promise<{success, value}>
- */
- static enableWebSdkInteroperability(enabled) {
- return Agora.enableWebSdkInteroperability(enabled);
- }
- /**
- * get agora native sdk connection state
- *
- * This method gets agora native sdk connection state
- * @return Promise<{state: (connection state)}>
- */
- static getConnectionState() {
- return Agora.getConnectionState();
- }
- /**
- * change the client role
- *
- * This method changes the client of role.
- * @param role (audience: 0, host: 1)
- */
- static setClientRole(role) {
- return Agora.setClientRole(role);
- }
- /**
- * leave channel
- *
- * This method leaves the joined channel, then your video view will not render ever.
- * You should call it, when you dont need render video stream.
- *
- * @return Promise<null>
- */
- static leaveChannel() {
- return Agora.leaveChannel();
- }
- /**
- * destroy
- *
- * This method stops event subscribe and destroy the RtcEngine instance's.
- * You should call it, when you want to destroy the engine.
- *
- * @return void
- */
- static destroy() {
- return Agora.destroy();
- }
- /**
- * set local video render mode
- *
- * This method calls native sdk render mode for local video.
- * @param mode
- * @return Promise<any>
- */
- static setLocalRenderMode(mode) {
- return Agora.setLocalRenderMode(mode);
- }
- /**
- * set the specified remote video render mode
- *
- * This method calls native sdk render mode for the specified remote video.
- *
- * @param uid
- * @param mode
- * @return Promise<any>
- */
- static setRemoteRenderMode(uid, mode) {
- let uint32 = react_native_1.Platform.OS === 'android' ? this.Uint32ToInt32(uid) : uid;
- return Agora.setRemoteRenderMode(uint32, mode);
- }
- /**
- * start video preview
- *
- * This method start video preview for video.
- * @return Promise<any>
- */
- static startPreview() {
- return Agora.startPreview();
- }
- /**
- * stop video preview
- *
- * This method stops video preview for video.
- * @return Promise<any>
- */
- static stopPreview() {
- return Agora.stopPreview();
- }
- /**
- * set enable speaker phone
- *
- * This method set the speaker phone enable or disable by pass boolean parameter.
- * @param enabled
- * @return Promise<any>
- */
- static setEnableSpeakerphone(enabled) {
- return Agora.setEnableSpeakerphone(enabled);
- }
- /**
- * set default audio speaker
- *
- * This method set the default audio speaker enable or disable by pass boolean parameter.
- * @param enabled
- * @return Promise<any>
- */
- static setDefaultAudioRouteToSpeakerphone(enabled) {
- return Agora.setDefaultAudioRouteToSpeakerphone(enabled);
- }
- /**
- * set default mute all remote audio streams
- *
- * This method set default mute all remote audio streams enable or not by pass boolean parameter.
- * @param enabled
- * @return Promise<any>
- */
- static setDefaultMuteAllRemoteAudioStreams(enabled) {
- return Agora.setDefaultMuteAllRemoteAudioStreams(enabled);
- }
- /**
- * enable video
- *
- * This method enables video.
- * @return Promise<any>
- */
- static enableVideo() {
- return Agora.enableVideo();
- }
- /**
- * disable video
- *
- * This method disables video.
- * @return Promise<any>
- */
- static disableVideo() {
- return Agora.disableVideo();
- }
- /**
- * enable local video
- *
- * This method enables the local video by the boolean parameter.
- * @param enabled
- * @return Promise<any>
- */
- static enableLocalVideo(enabled) {
- return Agora.enableLocalVideo(enabled);
- }
- /**
- * mute local video stream
- *
- * This method mutes video stream by the boolean parameter.
- * @param muted
- * @return Promise<any>
- */
- static muteLocalVideoStream(muted) {
- return Agora.muteLocalVideoStream(muted);
- }
- /**
- * mute all remote video streams
- *
- * This method mutes all remote streams by the boolean parameter.
- * @param muted
- * @return Promise<any>
- */
- static muteAllRemoteVideoStreams(muted) {
- return Agora.muteAllRemoteVideoStreams(muted);
- }
- /**
- * @ignore Uint32ToInt32
- */
- static Uint32ToInt32(num) {
- const int32 = new Int32Array(1);
- int32[0] = num;
- return int32[0];
- }
- /**
- * @ignore Int32ToUint32
- */
- static Int32ToUint32(num) {
- const uint32 = new Uint32Array(1);
- uint32[0] = num;
- return uint32[0];
- }
- /**
- * mute specified remote video stream.
- *
- * This method mutes remote video stream by the number of uid and boolean parameter.
- * @param uid
- * @param muted
- * @return Promise<any>
- */
- static muteRemoteVideoStream(uid, muted) {
- let uint32 = react_native_1.Platform.OS === 'android' ? this.Uint32ToInt32(uid) : uid;
- return Agora.muteRemoteVideoStream(uint32, muted);
- }
- /**
- * set default mute all remote video stream
- *
- * This method mutes all remote video stream default by the boolean parameter.
- * @param muted
- * @return Promise<any>
- */
- static setDefaultMuteAllRemoteVideoStreams(muted) {
- return Agora.setDefaultMuteAllRemoteVideoStreams(muted);
- }
- /**
- * enable audio
- *
- * This method enables audio
- * @return Promise<any>
- */
- static enableAudio() {
- return Agora.enableAudio();
- }
- /**
- * disable audio
- *
- * This method disables audio
- * @return Promise<any>
- */
- static disableAudio() {
- return Agora.disableAudio();
- }
- /**
- * enable local audio
- *
- * This method enables local audio by the boolean parameter.
- * @param enabled
- * @return Promise<any>
- */
- static enableLocalAudio(enabled) {
- return Agora.enableLocalAudio(enabled);
- }
- /**
- * mute local audio stream
- *
- * This method mutes the local audio stream by muted.
- * @param muted
- * @return Promise<any>
- */
- static disableLocalAudio(muted) {
- return Agora.disableLocalAudio(muted);
- }
- /**
- * mute all remote audio streams
- *
- * This method mutes all remote audio streams by muted
- * @param muted boolean
- * @return Promise<any>
- */
- static muteAllRemoteAudioStreams(muted) {
- return Agora.muteAllRemoteAudioStreams(muted);
- }
- /**
- * mute specified remote audio stream by muted
- *
- * This method mutes specified remote audio stream by number uid and boolean muted.
- * @param uid
- * @param muted
- * @return Promise<any>
- */
- static muteRemoteAudioStream(uid, muted) {
- let uint32 = react_native_1.Platform.OS === 'android' ? this.Uint32ToInt32(uid) : uid;
- return Agora.muteRemoteAudioStream(uint32, muted);
- }
- /**
- * adjust recording signal volume
- *
- * This method adjusts recording your signal by volume.
- * @param volume
- * @return Promise<any>
- */
- static adjustRecordingSignalVolume(volume) {
- return Agora.adjustRecordingSignalVolume(volume);
- }
- /**
- * adjust playback signal volume
- *
- * This method adjusts playback signal by volume.
- * @param volume
- * @return Promise<any>
- */
- static adjustPlaybackSignalVolume(volume) {
- return Agora.adjustPlaybackSignalVolume(volume);
- }
- /**
- * enable audio volume indication
- *
- * This method enables audio volume by interval and smooth
- * @param interval
- * @param smooth
- * @return Promise<any>
- */
- static enableAudioVolumeIndication(interval, smooth) {
- return Agora.enableAudioVolumeIndication(interval, smooth);
- }
- /**
- * check for mobile phone speaker enabled
- *
- * This method checks the phone speaker is enabled
- * @param callback
- * @return any
- */
- static methodisSpeakerphoneEnabled(callback) {
- return Agora.methodisSpeakerphoneEnabled(callback);
- }
- /**
- * enable in-ear monitor
- *
- * This method enables in-ear monitoring by boolean parameter enabled
- *
- * @param enabled
- * @return Promise<any>
- */
- static enableInEarMonitoring(enabled) {
- return Agora.enableInEarMonitoring(enabled);
- }
- /**
- * set in-ear monitoring volume
- *
- * This method sets the in-ear-monitoring volume by number parameter volume
- *
- * @param volume
- * @return Promise<any>
- */
- static setInEarMonitoringVolume(volume) {
- return Agora.setInEarMonitoringVolume(volume);
- }
- /**
- * set local voice pitch
- *
- * This method sets the local voice pitch by float parameter pitch
- *
- * @param pitch
- * @return Promise<any>
- */
- static setLocalVoicePitch(pitch) {
- return Agora.setLocalVoicePitch(pitch);
- }
- /**
- * set local voice equalization
- *
- * This method set local video equalization of band frequency by enum band number and number of gain
- *
- * @param band
- * @param gain
- * @return Promise<any>
- */
- static setLocalVoiceEqualization(band, gain) {
- Agora.setLocalVoiceEqualization(band, gain);
- }
- /**
- * set local voice reverb
- *
- * This method sets local voice by reverb and value
- * @param reverb
- * @param value
- */
- static setLocalVoiceReverb(reverb, value) {
- Agora.setLocalVoiceReverb(reverb, value);
- }
- /**
- * start audio mixing
- *
- * This method will start audio mixing by option config
- *
- * @param options {@link AudioMixingOption}
- */
- static startAudioMixing(options) {
- Agora.startAudioMixing(options);
- }
- /**
- * stop audio mixing
- *
- * This methods stops for audio mixing.
- */
- static stopAudioMixing() {
- Agora.stopAudioMixing();
- }
- /**
- * pause audio mixing
- *
- * This method pauses for audio mixing.
- */
- static pauseAudioMixing() {
- Agora.pauseAudioMixing();
- }
- /**
- * resume audio mixing
- *
- * This method resumes for audio mixing.
- */
- static resumeAudioMixing() {
- Agora.resumeAudioMixing();
- }
- /**
- * adjust audio mixing volume
- *
- * This method adjusts audio mixing volume by the volume number parameter
- * @param volume
- */
- static adjustAudioMixingVolume(volume) {
- Agora.adjustAudioMixingVolume(volume);
- }
- /**
- * adjust audio mixing playout volume
- *
- * This method adjusts audio mixing playout by the volume parameter
- * @param volume
- */
- static adjustAudioMixingPlayoutVolume(volume) {
- Agora.adjustAudioMixingPlayoutVolume(volume);
- }
- /**
- * adjust audio mixing publish volume
- *
- * This method adjusts audio mixing publish by the volume paraemter
- * @param volume
- */
- static adjustAudioMixingPublishVolume(volume) {
- Agora.adjustAudioMixingPublishVolume(volume);
- }
- /**
- * get audio mixing duration
- *
- * This method gets the audio mixing duration
- * @return Promise<{success, value}>
- */
- static getAudioMixingDuration() {
- return Agora.getAudioMixingDuration();
- }
- /**
- * get audio mixing current position
- *
- * This method gets audio mixing current position value.
- * @return Promise<{success, value}>
- */
- static getAudioMixingCurrentPosition() {
- return Agora.getAudioMixingCurrentPosition();
- }
- /**
- * set audio mixing position
- *
- * This method sets audio mixing position by the parameter pos
- * @param pos
- */
- static setAudioMixingPosition(pos) {
- return Agora.setAudioMixingPosition(pos);
- }
- /**
- * get effects of volume
- *
- * This methods get audio mixing effects volume value.
- * @return Promise<{success, value}>
- */
- static getEffectsVolume() {
- return Agora.getEffectsVolume();
- }
- /**
- * set effects volume
- *
- * This methods set audio mixing effects volume by float parameter.
- * @param volume
- * @return Promise<{success, value}>
- */
- static setEffectsVolume(volume) {
- return Agora.setEffectsVolume(volume);
- }
- /**
- * set volume for playing effects.
- *
- * This methods set for playing audio mixing effects
- * @return Promise<{success, value}>
- */
- static setVolumeOfEffect(volume) {
- return Agora.setVolumeOfEffect(volume);
- }
- /**
- * play specified effect for audio mixing
- *
- * This methos plays the specified effect of audio mixing file by option config.
- * @param options {@link PlayEffectOption}
- * @return Promise<{success, value}>
- */
- static playEffect(options) {
- return Agora.playEffect(options);
- }
- /**
- * stop play effect for audio mixing
- *
- * This methods stops the specified effect for audio mixing file by soundid.
- * @param sounid
- * @return Promise<{success, value}>
- */
- static stopEffect(soundId) {
- return Agora.stopEffect(soundId);
- }
- /**
- * stop play all for effect audio mixing.
- *
- * This methods stops all effect audio mixing.
- * @return Promise<{success, value}>
- */
- static stopAllEffects() {
- return Agora.stopAllEffects();
- }
- /**
- * preload effect for audio mixing file.
- *
- * This methods preloads the specified audio mixing file to memory by the soundid
- * @param soundid
- * @param filepath
- * @return Promise<{success, value}>
- */
- static preloadEffect(soundId, filepath) {
- return Agora.preloadEffect(soundId, filepath);
- }
- /**
- * unload effect
- *
- * This methods unload the already loaded audio mixing file from memory by the soundid.
- * @param soundid
- * @return Promise<{success, value}>
- */
- static unloadEffect(soundId) {
- return Agora.unloadEffect(soundId);
- }
- /**
- * pause the specified effect for audio mixing by soundid
- *
- * This method pauses the specified effect for audio mixing by soundid.
- * @param soundid
- * @return Promise<{success, value}>
- */
- static pauseEffect(soundId) {
- return Agora.pauseEffect(soundId);
- }
- /**
- * pause all effects for audio mixing
- *
- * This method pause all effects for audio mixing.
- * @param soundid
- * @return Promise<{success, value}>
- */
- static pauseAllEffects() {
- return Agora.pauseAllEffects();
- }
- /**
- * resume audio mixing effect by the specified soundid
- *
- * This method resumes audio mixing effect by the specified soundid
- * @param soundid
- * @return Promise<{success, value}>
- */
- static resumeEffect(soundId) {
- return Agora.resumeEffect(soundId);
- }
- /**
- * resume all audio mixing effects.
- *
- * This method resumes all audio mixing effects.
- * @return Promise<{success, value}>
- */
- static resumeAllEffects() {
- return Agora.resumeAllEffects();
- }
- /**
- * start audio recording by quality
- *
- * This method start audio recording by quality config
- * @param options {@link AudioRecordingOption}
- * @return Promise<{success, value}>
- */
- static startAudioRecording(options) {
- return Agora.startAudioRecording(options);
- }
- /**
- * stop audio recording
- *
- * This method stops audio recording.
- * @return Promise<{success, value}>
- */
- static stopAudioRecording() {
- return Agora.stopAudioRecording();
- }
- /**
- * set audio session operation restriction
- *
- * 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.
- * You can call this method at any time to return the control of the audio sessions to the SDK.
- * 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.
- * @notice iOS support only
- */
- static setAudioSessionOperationRestriction() {
- if (react_native_1.Platform.OS != 'ios')
- throw Error(`setAudioSessionOperationRestriction is not support on your platform. Please check the details in react-native-agora docs`);
- Agora.setAudioSessionOperationRestriction();
- }
- /**
- * @deprecated startEchoTest
- * startEchoTest
- */
- /**
- * @deprecated isCameraAutoFocusFaceModeSupported
- * @deprecated isCameraExposurePositionSupported
- * @deprecated isCameraFocusSupported
- * @deprecated isCameraTorchSupported
- * @deprecated isCameraZoomSupported
- * instead use {@method getCameraInfo}
- */
- /**
- * stop echo test
- *
- * This method stop launched an audio call test.
- * @return Promise<{success, value}>
- */
- static stopEchoTest() {
- return Agora.stopEchoTest();
- }
- /**
- * enable lastmile test
- *
- * This method enables the network connection qualit test.
- *
- * @return Promise<{success, value}>
- */
- static enableLastmileTest() {
- return Agora.enableLastmileTest();
- }
- /**
- * disable lastmile test
- *
- * This method disable the network connection qualit test.
- *
- * @return Promise<{success, value}>
- */
- static disableLastmileTest() {
- return Agora.disableLastmileTest();
- }
- /**
- * set recording audio frame parameters
- *
- * This method Sets the audio recording format for the audioFrame callback.
- *
- * @param options {@link RecordingAudioFrameOption}
- * @return Promise<{success, value}>
- */
- static setRecordingAudioFrameParameters(options) {
- return Agora.setRecordingAudioFrameParameters(options);
- }
- /**
- * set playback audio frame parameters
- *
- * This method Sets the audio frame format for the playbackFrame callback.
- *
- * @param options {@link AudioFrameOption}
- * @return Promise<{success, value}>
- */
- static setPlaybackAudioFrameParameters(options) {
- return Agora.setPlaybackAudioFrameParameters(options);
- }
- /**
- * set mixed audio frame parameters
- *
- * This method Sets the audio frame format for the mixedAudioFrame callback.
- *
- * @param options {@link MixedAudioFrameOption}
- * @return Promise<{success, value}>
- */
- static setMixedAudioFrameParameters(options) {
- return Agora.setMixedAudioFrameParameters(options);
- }
- /**
- * add video watermark
- *
- * This method adds video watermark to the local video.
- *
- * @param options {@link ImageOption}
- * @return Promise<{success, value}>
- */
- static addVideoWatermark(options) {
- return Agora.addVideoWatermark(options);
- }
- /**
- * clear video watermarks
- *
- * This method removes the watermark image from the video stream added by addVideoWatermark.
- *
- * @return Promise<{success, value}>
- */
- static removclearVideoWatermarkse() {
- return Agora.clearVideoWatermarks();
- }
- /**
- * set local publish fallback
- *
- * This method sets the fallback option for the locally published video stream based on the network conditions.
- *
- * @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)
- * @return Promise<{success, value}>
- */
- static setLocalPublishFallbackOption(option) {
- return Agora.setLocalPublishFallbackOption(option);
- }
- /**
- * set remote publish fallback
- *
- * This method sets the fallback option for the remotely subscribed video stream based on the network conditions.
- *
- * @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)
- * @return Promise<{success, value}>
- */
- static setRemoteSubscribeFallbackOption(option) {
- return Agora.setRemoteSubscribeFallbackOption(option);
- }
- /**
- * enable dual stream mode
- *
- * This method enables the dual stream by parameter mode.
- *
- * @param enabled
- * @return Promise<{success, value}>
- */
- static enableDualStreamMode(enabled) {
- return Agora.enableDualStreamMode(enabled);
- }
- /**
- * set remote video stream type
- *
- * This method sets the remote video stream type by uid and streamType.
- *
- * @param options {@link VideoStreamOption}
- * @return Promise<{success, value}>
- */
- static setRemoteVideoStreamType(options) {
- return Agora.setRemoteVideoStreamType(options);
- }
- /**
- * set remote default video stream type
- *
- * This method sets the default video stream type.
- *
- * @param options {@link DefaultVideoStreamOption}
- * @return Promise<{success, value}>
- */
- static setRemoteDefaultVideoStreamType(options) {
- return Agora.setRemoteDefaultVideoStreamType(options);
- }
- /**
- * add inject stream url
- *
- * This method injects an online media stream to a live broadcast.
- *
- * @param options {@link InjectStreamOption}
- * @return Promise<{success, value}>
- */
- static addInjectStreamUrl(options) {
- return Agora.addInjectStreamUrl(options);
- }
- /**
- * remove inject stream url
- *
- * This method removes stream by addInjectsStreamUrl.
- *
- * @param options {@link RemoveInjectStreamOption}
- * @return Promise<{success, value}>
- */
- static removeInjectStreamUrl(options) {
- return Agora.removeInjectStreamUrl(options);
- }
- /**
- * @deprecated sendMessage
- * sendMessage
- */
- static sendMessage() {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- return console.warn("sendMessage already deprecated");
- });
- }
- /**
- * @deprecated createDataStream
- * createDataStream
- */
- /**
- * @deprecated setupLocalVideo
- * setupLocalVideo
- */
- /**
- * @deprecated setupRemoteVideo
- * setupRemoteVideo
- */
- /**
- * @deprecated setVideoQualityParameters
- * setVideoQualityParameters
- */
- /**
- * set local video mirror mode
- *
- * This method sets local video mirror mode
- *
- * @param mode
- * @return Promise<{success, value}>
- */
- static setLocalVideoMirrorMode(mode) {
- return Agora.setLocalVideoMirrorMode(mode);
- }
- /**
- * switch camera
- *
- * This method switches camera between front and rear.
- *
- * @return Promise<{success, value}>
- */
- static switchCamera() {
- return Agora.switchCamera();
- }
- /**
- * set camera zoom ratio
- *
- * This method sets the camera zoom ratio.
- *
- * @param zoomFactor
- * @return Promise<{success, value}>
- */
- static setCameraZoomFactor(zoomFactor) {
- return Agora.setCameraZoomFactor(zoomFactor);
- }
- /**
- * get camera max zoom ratio
- *
- * This method gets the camera maximum zoom ratio.
- *
- * @notice Android Only
- * @return Promise<{success, value}>
- */
- static getCameraMaxZoomFactor() {
- return Agora.getCameraMaxZoomFactor();
- }
- /**
- * set camera focus position in preview
- *
- * This method sets the mannual focus position.
- *
- * @param options {@link PositionOption}
- * @return Promise<{success, value}>
- */
- static setCameraFocusPositionInPreview(options) {
- return Agora.setCameraFocusPositionInPreview(options);
- }
- /**
- * set camera exposure position
- *
- * This method sets the mannual exposure position.
- *
- * @param options {@link PositionOption}
- * @return Promise<{success, value}>
- */
- static setCameraExposurePosition(options) {
- return Agora.setCameraExposurePosition(options);
- }
- /**
- * set camera torch on
- *
- * This method enables the camera flash function.
- *
- * @param enabled
- * @return Promise<{success, value}>
- */
- static setCameraTorchOn(enabled) {
- return Agora.setCameraTorchOn(enabled);
- }
- /**
- * set enable auto focus face mode
- *
- * This method enables auto-focus face mode function.
- *
- * @param enabled boolean
- * @return Promise<{success, value}>
- */
- static setCameraAutoFocusFaceModeEnabled(enabled) {
- return Agora.setCameraAutoFocusFaceModeEnabled(enabled);
- }
- /**
- * get call id
- *
- * This method is used to get call id.
- *
- * @return Promise<{success, value}>
- */
- static getCallId() {
- return Agora.getCallId();
- }
- /**
- * set log file and log filter
- *
- * This method sets the log file generated path and specified the log level.
- *
- * @param filepath string
- * @param level enum
- * @param maxfileSize integer (KB)
- * @return Promise<{success, value}>
- */
- static setLog(filepath, level, maxfileSize) {
- return Agora.setLog(filepath, level, maxfileSize);
- }
- /**
- * add publish stream url
- *
- * This method add publish stream by option.
- *
- * @param options {@link PublishStreamOption}
- * @return Promise<{success, value}>
- */
- static addPublishStreamUrl(options) {
- return Agora.addPublishStreamUrl(options);
- }
- /**
- * remove publish stream url
- *
- * This method remove publish stream by options.
- *
- * @param options {@link RemovePublishStreamOption}
- * @return Promise<{success, value}>
- */
- static removePublishStreamUrl(options) {
- return Agora.removePublishStreamUrl(options);
- }
- /**
- * set live transcoding
- *
- * This method sets the video layout and audio settings for CDN live.
- *
- * @param options {@link LiveTranscoding}
- * @return Promise<{success, value}>
- */
- static setLiveTranscoding(options) {
- return Agora.setLiveTranscoding(options);
- }
- /**
- * get sdk version
- *
- * This method gets the sdk version details and passed it into callback function
- *
- * @param callback to handle resolve from getSdkVersion
- * @param errorHandler to handle reject error from getSdkVersion
- * @return any
- */
- static getSdkVersion(callback, errorHandler) {
- return Agora.getSdkVersion().then(callback).catch(errorHandler);
- }
- /**
- * mute local audio stream
- *
- * This method sends/stops sending the local audio.
- *
- * @param enabled
- * @return Promise<any>
- */
- static muteLocalAudioStream(enabled) {
- return Agora.muteLocalAudioStream(enabled);
- }
- /**
- * video pre-process/post-process
- *
- * This method enables/disables image enhancement and sets the options.
- *
- * @param enable boolean
- * @param options {@link BeautyOptions}
- * @return Promise<any>
- */
- static setBeautyEffectOptions(enabled, options) {
- return Agora.setBeautyEffectOptions(enabled, options);
- }
- /**
- * set local voice change
- *
- * This method changes local speaker voice with voiceChanger
- *
- * @param voiceChanger integer
- * @voiceChanger value ranges [
- * 0: "The original voice",
- * 1: "An old man’s voice",
- * 2: "A little boy’s voice.",
- * 3: "A little girl’s voice.",
- * 4: "TBD",
- * 5: "Ethereal vocal effects.",
- * 6: "Hulk’s voice."
- * ]
- * @return Promise<any>
- */
- static setLocalVoiceChanger(voiceChanger) {
- return Agora.setLocalVoiceChanger(voiceChanger);
- }
- /**
- * set the preset local voice reverberation effect.
- *
- * This method sets the preset local voice reverberation effect.
- *
- * @param preset integer
- * @return Promise<any>
- */
- static setLocalVoiceReverbPreset(preset) {
- return Agora.setLocalVoiceReverbPreset(preset);
- }
- /**
- * control stereo panning for remote users
- *
- * This method enables/disables stereo panning for remote users.
- *
- * @param enabled boolean
- * @return Promise<any>
- */
- static enableSoundPositionIndication(enabled) {
- return Agora.enableSoundPositionIndication(enabled);
- }
- /**
- * set the sound position of a remote user
- *
- * This method sets the sound position of a remote user by uid
- *
- * @param uid number | The ID of the remote user
- * @param pan float | The sound position of the remote user. The value ranges from -1.0 to 1.0
- * @pan
- * 0.0: the remote sound comes from the front.
- * -1.0: the remote sound comes from the left.
- * 1.0: the remote sound comes from the right.
- * @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.
- * @return Promise<any>
- */
- static setRemoteVoicePosition(uid, pan, gain) {
- let uint32 = react_native_1.Platform.OS === 'android' ? this.Uint32ToInt32(uid) : uid;
- return Agora.setRemoteVoicePosition(uint32, pan, gain);
- }
- /**
- * start the lastmile probe test
- *
- * 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).
- *
- * @param config LastmileProbeConfig {@link LastmileProbeConfig}
- *
- * 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.
- * 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.
- * @return Promise<any>
- */
- static startLastmileProbeTest(config) {
- return Agora.startLastmileProbeTest(config);
- }
- /**
- * stop the lastmile probe test
- *
- * This method stop the lastmile probe test.
- *
- * @return Promise<any>
- */
- static stopLastmileProbeTest() {
- return Agora.stopLastmileProbeTest();
- }
- /**
- * sets the priority of a remote user's media stream.
- *
- * 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.
- *
- * This method sets the priority of a remote user's media stream.
- * @param uid number
- * @param userPriority number | The value range is [50 is "user's priority is hgih", 100 is "the default user's priority is normal"]
- *
- * @return Promise<any>
- */
- static setRemoteUserPriority(uid, userPrority) {
- let uint32 = react_native_1.Platform.OS === 'android' ? this.Uint32ToInt32(uid) : uid;
- return Agora.setRemoteUserPriority(uint32, userPrority);
- }
- /**
- * start an audio call test.
- *
- * note:
- * Call this method before joining a channel.
- * 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.
- * In the Live-broadcast profile, only a host can call this method.
- * This method will start an audio call test with interval parameter.
- * 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.
- *
- * @param interval number
- *
- * @return Promise<any>
- */
- static startEchoTestWithInterval(interval) {
- return Agora.startEchoTestWithInterval(interval);
- }
- /**
- * set the camera capture preference.
- *
- * note:
- * 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:
- * 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.
- * 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.
- * If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW(2).
- *
- * This method will set the camera capture preference.
- *
- * @param config {@link CameraCapturerConfiguration}
- *
- * @return Promise<any>
- */
- static setCameraCapturerConfiguration(config) {
- return Agora.setCameraCapturerConfiguration(config);
- }
- /**
- * Gets the audio mixing volume for local playback.
- *
- * note:
- * This method helps troubleshoot audio volume related issues.
- *
- * @return Promise<any>
- */
- static getAudioMixingPlayoutVolume() {
- return Agora.getAudioMixingPlayoutVolume();
- }
- /**
- * Gets the audio mixing volume for publishing.
- *
- * note:
- * This method helps troubleshoot audio volume related issues.
- *
- * @return Promise<any>
- */
- static getAudioMixingPublishVolume() {
- return Agora.getAudioMixingPublishVolume();
- }
- /**
- * sendMediaData for media observer.
- *
- * note:
- * This method needs you invoke registerMediaMetadataObserver success first and you could send media data through interval media observer feature.
- * The data have limit length is 1024 bytes, if you pass data length bigger than limit it will failed.
- * @param data String: 1024 bytes limit
- * @return Promise<any>
- */
- static sendMediaData(data) {
- return Agora.sendMediaData(data);
- }
- /**
- * Registers the metadata observer.
- *
- * note:
- * This method only work in live mode
- * 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.
- * This method trigger 'mediaMetaDataReceived' event, here is example:
- * ```javascript
- * RtcEngine.on("mediaMetaDataReceived", (data) => {
- * console.log("mediaMetaDataReceived", data);
- * })
- * ```
- * @return Promise<any>
- */
- static registerMediaMetadataObserver() {
- return Agora.registerMediaMetadataObserver();
- }
- /**
- * Get local device camera support info
- *
- * note:
- * This method returns your current device camera support info.
- * ```javascript
- * RtcEngine.getCameraInfo().then(info => {
- * console.log("your currrent camera", info);
- * })
- * ```
- * @return Promise{cameraSupportInfo}>
- */
- static getCameraInfo() {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- return Agora.getCameraInfo();
- });
- }
- }
- /**
- * @ignore AG_PREFIX
- */
- RtcEngine.AG_PREFIX = 'ag_rtc';
- exports.default = RtcEngine;
- //# sourceMappingURL=RtcEngine.native.js.map
|