|
@@ -46,18 +46,20 @@ Either way, then link with:
|
46
|
46
|
|
47
|
47
|
[Agora.io API DOCS](https://docs.agora.io/en/Video/API%20Reference/java/index.html)
|
48
|
48
|
|
49
|
|
-##### RtcEngine方法
|
|
49
|
+##### RtcEngine Methods
|
50
|
50
|
|
51
|
51
|
| Property | Arguments | Description |
|
52
|
52
|
| -------------------------------- | ---------------------------------------- | ------------------------------------- |
|
53
|
|
-| init | [Option](#Option) | create and initialize AgoraRtcEngine instance
|
54
|
|
-| Promise<any> joinChannel | String channelName, Number uid | join channel|
|
55
|
|
-| eventEmitter | [Events](#Events) | registe event emitters|
|
56
|
|
-| removeEmitter | void | remove event emitter |
|
|
53
|
+| init | [Option](#Option) | create and initialize AgoraRtcEngine instance, notice: invoke this method, it will start subscribe events |
|
|
54
|
+| Promise<any> joinChannel | String channelName, Number uid, String? token, String? extraInfo | join channel|
|
|
55
|
+| on | [Events](#Events), Handler: Function | addEventListener for native module events |
|
|
56
|
+| off | [Events](#Events) | removeEventListeners for native module events |
|
|
57
|
+| removeAllListeners | void | remove all event listeners |
|
|
58
|
+| destroy | void | destroy AgoraRtcEngine instance |
|
|
59
|
+| getSdkVersion | Function: callback | get sdk version |
|
57
|
60
|
| Promise<any> enableLastmileTest | void | enable network quality test |
|
58
|
61
|
| Promise<any> disableLastmileTest | void | disable network quality test |
|
59
|
62
|
| Promise<any> leaveChannel | void | quit channel |
|
60
|
|
-| destroy | void | destroy AgoraRtcEngine instance |
|
61
|
63
|
| setupLocalVideo | Number: uid, Number: renderMode, Number: reactTag | setup local video |
|
62
|
64
|
| setupRemoteVideo | Number: uid, Number: renderMode, Number: reactTag | setup remote video |
|
63
|
65
|
| startPreview | void | open video preview |
|
|
@@ -70,9 +72,9 @@ Either way, then link with:
|
70
|
72
|
| enableVideo | void | enable video |
|
71
|
73
|
| disableVideo | void | disable video |
|
72
|
74
|
| setEnableSpeakerphone | Boolean: enabled | set enable speaker phone |
|
73
|
|
-| setCameraAutoFocusFaceModeEnabled | Boolean: enabled | set camera auto focus face mode |
|
|
75
|
+| Promise<any> setCameraAutoFocusFaceModeEnabled | Boolean: enabled | set camera auto focus face mode |
|
74
|
76
|
| setDefaultAudioRouteToSpeakerphone | Boolean: enabled | set default audio route to speaker phone |
|
75
|
|
-| setCameraTorchOn | Boolean: enabled | set camera torch on |
|
|
77
|
+| Promise<any> setCameraTorchOn | Boolean: enabled | set camera torch on |
|
76
|
78
|
| muteLocalAudioStream | Boolean: enabled | mute/unmute local audio |
|
77
|
79
|
| muteRemoteAudioStream | Number: uid, Boolean: enabled | mute/unmute remote audio by uid |
|
78
|
80
|
| muteAllRemoteAudioStreams | Boolean: enabled | mute/unmute all remote audio |
|
|
@@ -80,10 +82,82 @@ Either way, then link with:
|
80
|
82
|
| enableLocalVideo | Boolean: enabled | set enabled status to local video |
|
81
|
83
|
| muteAllRemoteVideoStreams | void | mute/unmute all remote videos |
|
82
|
84
|
| muteRemoteVideoStream | Number: uid, Boolean: enabled | mute/unmute remote video by uid |
|
83
|
|
-| getSdkVersion | Function: callback | get sdk version |
|
84
|
|
-| createDataStream | Boolean: reliable, Boolean: ordered | createDataStream |
|
85
|
|
-| sendStreamMessage | Number: streamId, String data | send data with uid |
|
86
|
|
-
|
|
85
|
+| Promise<any> createDataStream | Boolean: reliable, Boolean: ordered | createDataStream |
|
|
86
|
+| Promise<any> renewToken | String: token | renew token |
|
|
87
|
+| Promise<any> getConnectionState | void | return connection state |
|
|
88
|
+| setClientRole | Number: role(1: host, 2: audience) | change client role |
|
|
89
|
+| enableAudio | void | enable audio |
|
|
90
|
+| disableAudio | void | disable audio |
|
|
91
|
+| enableLocalAudio | Boolean: enable | enable/disable local audio |
|
|
92
|
+| muteLocalAudioStream | Boolean: mute | enable/disable local audio stream |
|
|
93
|
+| muteAllRemoteAudioStreams | Boolean: mute | enable/disable all remote audio streams |
|
|
94
|
+| muteRemoteAudioStream | Number: uid, Boolean: mute | mute/unmute remote audio stream by uid |
|
|
95
|
+| adjustRecordingSignalVolume | Number: volume | Adjusts the recording volume. |
|
|
96
|
+| adjustPlaybackSignalVolume | Number: volume | Adjusts the playback volume. |
|
|
97
|
+| enableAudioVolumeIndication | Number: interval, Number: smooth | Enables the onAudioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume. |
|
|
98
|
+| Promise<any> startAudioRecording | {filePath: String, quality: int} | start audio recording |
|
|
99
|
+| Promise<any> stopAudioRecoding | void | stop audio recording |
|
|
100
|
+| methodisSpeakerphoneEnabled | void | Checks whether the speakerphone is enabled.|| enableInEarMonitoring | Boolean: enabled | enable/disable in-ear monitoring |
|
|
101
|
+| setInEarMonitoringVolume | Number: volume | Sets the volume of the in-ear monitor. |
|
|
102
|
+| setLocalVoicePitch | Number(double): pitch | Changes the voice pitch of the local speaker. |
|
|
103
|
+| setLocalVoiceEqualization | Number: bandFrequency, Number: bandGain | Sets the local voice equalization effect. |
|
|
104
|
+| setLocalVoiceReverb | Number: reverbKey, Number: value | Sets the local voice reverberation.|
|
|
105
|
+| startAudioMixing | {filepath: String, loopback: Boolean, replace: Boolean, cycle: Int} | [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#ac56ceea1a143a4898382bce10b04df09)
|
|
106
|
+ & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/startAudioMixing:loopback:replace:cycle:) |
|
|
107
|
+ | stopAudioMixing | void | stop audio mixing |
|
|
108
|
+ | pauseAudioMixing | void | [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#ab2d4fb72ec3031f59da72b55857e0da7) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/pauseAudioMixing) |
|
|
109
|
+ | resumeAudioMixing | void | resume audio mixing |
|
|
110
|
+ | adjustAudioMixingVolume | Number: volume | adjust audio mixing volume, call this method when you are in a channel |
|
|
111
|
+ | adjustAudioMixingPlayoutVolume | Number: volume | adjust audio mixing playout volume, call this method when you are in a channel |
|
|
112
|
+ | adjustAudioMixingPublishVolume | Number: volume | Adjusts the volume of audio mixing for publishing (sending to other users). call this method when you are in a channel. |
|
|
113
|
+ | Promise<any> getAudioMixingDuration | void | Gets the duration (ms) of the music file. Call this method when you are in a channel. |
|
|
114
|
+ | Promise<any> getAudioMixingCurrentPosition | void | Gets the playback position (ms) of the music file. Call this method when you are in a channel. |
|
|
115
|
+ | Promise<any> setAudioMixingPosition | Number: pos | Sets the playback position (ms) of the music file to a different starting position (the default plays from the beginning). |
|
|
116
|
+ | Promise<any> getEffectsVolume | void | Retrieves the volume of the audio effects. |
|
|
117
|
+ | Promise<any> setEffectsVolume | Number(double): volume | Sets the volume of the audio effects. |
|
|
118
|
+ | Promise<any> setVolumeOfEffect | Number: soundId, Number(double): volume | Sets the volume of a specified audio effect. |
|
|
119
|
+ | Promise<any> playEffect | {soundId: Number, filePath: String, loopCount: Number, pitch: Number(double), gain: Boolean, publish: Boolean} | Plays a specified audio effect. [android](https://docs.agora.io/en/Video/API%20Reference/java/interfaceio_1_1agora_1_1rtc_1_1_i_audio_effect_manager.html#a6fd330db3e3e5735f7f8d5c36bc3fea1) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/playEffect:filePath:loopCount:pitch:pan:gain:publish:) |
|
|
120
|
+ | Promise<any> stopEffect | Number: soundId | Stops playing a specified audio effect. |
|
|
121
|
+ | Promise<any> stopAllEffects | void | Stops all playing audio effects. |
|
|
122
|
+ | Promise<any> preloadEffect | Number: soundid, String: filepath | Preloads a specified audio effect file into the memory. Supported audio formats: mp3, aac, m4a, 3gp, wav.|
|
|
123
|
+ | Promise<any> unloadEffect | Number: soundId | Releases a specified preloaded audio effect from the memory. |
|
|
124
|
+ | Promise<any> pauseEffect | Number: soundId | Pauses a specified audio effect. |
|
|
125
|
+ | Promise<any> pauseAllEffects | void | Pauses all audio effects. |
|
|
126
|
+ | Promise<any> resumeEffect | void | Resumes playing a specified audio effect. |
|
|
127
|
+ | Promise<any> resumeAllEffects | void | Resumes playing all audio effects. |
|
|
128
|
+ | setAudioSessionOperationRestriction | void | [ios only](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setAudioSessionOperationRestriction:) |
|
|
129
|
+ | Promise<any> startEchoTest | void | Starts an audio call test. |
|
|
130
|
+ | Promise<any> stopEchoTest | void | Stop the audio call test. |
|
|
131
|
+ | Promise<any> setRecordingAudioFrameParameters | {sampleRate: Number, channel: Number, mode: Number, samplesPerCall: Number } | Sets the audio recording format for the RecordFrame callback. |
|
|
132
|
+ | Promise<any> setPlaybackAudioFrameParameters | {sampleRate: Number, channel: Number, mode: Number, samplesPerCall: Number } | Sets the audio playback format for the onPlaybackFrame callback. |
|
|
133
|
+ | Promise<any> addVideoWatermark | {url: String, x: Number, y: Number, width: Number, height: Number } | add video watermark |
|
|
134
|
+ | clearVideoWatermarks | void | remove the watermark image from the video stream added by addVideoWatermark |
|
|
135
|
+ | setLocalPublishFallbackOption | Number: [option(0, 1, 2)](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_constants.html#a3e453c93766e783a7e5eca05b1776238)| [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#ac8c08e79844a4e62e0670553484cbe90) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setLocalPublishFallbackOption:) |
|
|
136
|
+ | setRemoteSubscribeFallbackOption | Number: [option (0, 1, 2)](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_constants.html#a3e453c93766e783a7e5eca05b1776238)| [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#af64301ea1788dad0561aa678f3fe6ad3) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setRemoteSubscribeFallbackOption:) |
|
|
137
|
+ | Promise<any> enableDualStreamMode | Boolean: enabled | Enables/disables dual-stream mode. |
|
|
138
|
+ | setRemoteVideoStreamType | { uid: Number, streamType: Number } | Sets the video stream type of the remotely subscribed video stream. |
|
|
139
|
+ | setRemoteDefaultVideoStreamType | { streamType: Number } | Sets the default video stream type of the remotely subscribed video stream. |
|
|
140
|
+ | Promise<any> addInjectStreamUrl | [InjectionStream](#InjectionStream) | Injects an online media stream to a live broadcast. |
|
|
141
|
+ | Promise<any> removePublishStreamUrl | String: url | Removes a CDN live stream URL address. |
|
|
142
|
+ | Promise<any> setVideoQualityParameters | Boolean: quality |
|
|
143
|
+Sets the preference option for the video quality (Live broadcast only). |
|
|
144
|
+ | Promise<any> setLocalVideoMirrorMode | Number: mode | Sets the local video mirror mode. |
|
|
145
|
+ | Promise<any> switchCamera | void | Switches between front and rear cameras. |
|
|
146
|
+ | Promise<any> isCameraZoomSupported | void | Checks whether the camera zoom function is supported. |
|
|
147
|
+ | Promise<any> isCameraTorchSupported | void | Checks whether the camera flash function is supported. |
|
|
148
|
+ | Promise<any> isCameraFocusSupported | void | Checks whether the camera manual focus function is supported. |
|
|
149
|
+ | Promise<any> isCameraExposurePositionSupported | void |Checks whether the camera exposure function is supported. |
|
|
150
|
+ | Promise<any> isCameraAutoFocusFaceModeSupported | void | Checks whether the camera face auto-focus function is supported. |
|
|
151
|
+ | Promise<any> setCameraZoomFactor | Number(float): zoomFactor | Sets the camera zoom ratio. |
|
|
152
|
+ | Promise<any> getCameraMaxZoomFactor | void | Gets the maximum zoom ratio of the camera.[android only](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a1084b42001cc5c008d58ec938fc0b7f3) |
|
|
153
|
+ | Promise<any> setCameraFocusPositionInPreview | {x: Number(double), y: Number(double) } | Sets the camera manual focus position.|
|
|
154
|
+ | Promise<any> setCameraExposurePosition | {x: Number(double), y: Number(double) } | Sets the camera exposure position.|
|
|
155
|
+ | Promise<any> setCameraTorchOn | Boolean isOn | Enables the camera flash function. |
|
|
156
|
+ | Promise<any> setCameraAutoFocusFaceModeEnabled | Boolean enabled | Enables the camera auto-face focus function. |
|
|
157
|
+ | Promise<any> getCallId | void | getcalll id |
|
|
158
|
+ | Promise<any> setLog | filePath: String, level: Number | specifies an SDK output log file. |
|
|
159
|
+ | addPublishStreamUrl | { url: String, enabled: Boolean } | Adds a CDN live stream URL address. it must be invoked after invoking setLiveTranscoding |
|
|
160
|
+ | removePublishStreamUrl | { url: String } | Removes a CDN live stream URL address. |
|
87
|
161
|
|
88
|
162
|
#### Option
|
89
|
163
|
```typescript
|
|
@@ -126,6 +200,25 @@ export interface LiveTranscoding {
|
126
|
200
|
}
|
127
|
201
|
```
|
128
|
202
|
|
|
203
|
+
|
|
204
|
+#### InjectionStream
|
|
205
|
+```typescript
|
|
206
|
+export interface InjectionStream {
|
|
207
|
+ config: {
|
|
208
|
+ size: {
|
|
209
|
+ width: Number,
|
|
210
|
+ height: Number,
|
|
211
|
+ },
|
|
212
|
+ videoGop: Number,
|
|
213
|
+ videoBitrate: Number,
|
|
214
|
+ audioBitrate: Number,
|
|
215
|
+ audioSampleRate: Number,
|
|
216
|
+ videoFrameRate: Number
|
|
217
|
+ audioChannels: Number
|
|
218
|
+ }
|
|
219
|
+}
|
|
220
|
+```
|
|
221
|
+
|
129
|
222
|
#### Events
|
130
|
223
|
|
131
|
224
|
```javascript
|