|
@@ -36,6 +36,7 @@ import io.agora.rtc.video.CameraCapturerConfiguration;
|
36
|
36
|
import io.agora.rtc.video.VideoEncoderConfiguration;
|
37
|
37
|
|
38
|
38
|
import static com.facebook.react.bridge.UiThreadUtil.runOnUiThread;
|
|
39
|
+import static com.syan.agora.AgoraConst.*;
|
39
|
40
|
|
40
|
41
|
public class AgoraModule extends ReactContextBaseJavaModule {
|
41
|
42
|
|
|
@@ -259,74 +260,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
259
|
260
|
return constants;
|
260
|
261
|
}
|
261
|
262
|
|
262
|
|
- private final static String AGWarning = "warning";
|
263
|
|
- private final static String AGError = "error";
|
264
|
|
- private final static String AGApiCallExecute = "apiCallExecute";
|
265
|
|
- private final static String AGJoinChannelSuccess = "joinChannelSuccess";
|
266
|
|
- private final static String AGRejoinChannelSuccess = "rejoinChannelSuccess";
|
267
|
|
- private final static String AGLeaveChannel = "leaveChannel";
|
268
|
|
- private final static String AGClientRoleChanged = "clientRoleChanged";
|
269
|
|
- private final static String AGUserJoined = "userJoined";
|
270
|
|
- private final static String AGUserOffline = "userOffline";
|
271
|
|
- private final static String AGConnectionStateChanged = "connectionStateChanged";
|
272
|
|
- private final static String AGConnectionLost = "connectionLost";
|
273
|
|
- private final static String AGTokenPrivilegeWillExpire = "tokenPrivilegeWillExpire";
|
274
|
|
- private final static String AGRequestToken = "requestToken";
|
275
|
|
-
|
276
|
|
- private final static String AGMicrophoneEnabled = "microphoneEnabled";
|
277
|
|
- private final static String AGAudioVolumeIndication = "audioVolumeIndication";
|
278
|
|
- private final static String AGActiveSpeaker = "activeSpeaker";
|
279
|
|
- private final static String AGFirstLocalAudioFrame = "firstLocalAudioFrame";
|
280
|
|
- private final static String AGFirstRemoteAudioFrame = "firstRemoteAudioFrame";
|
281
|
|
- private final static String AGVideoStopped = "videoStopped";
|
282
|
|
- private final static String AGFirstLocalVideoFrame = "firstLocalVideoFrame";
|
283
|
|
- private final static String AGFirstRemoteVideoDecoded = "firstRemoteVideoDecoded";
|
284
|
|
- private final static String AGFirstRemoteVideoFrame = "firstRemoteVideoFrame";
|
285
|
|
- private final static String AGUserMuteAudio = "userMuteAudio";
|
286
|
|
- private final static String AGUserMuteVideo = "userMuteVideo";
|
287
|
|
- private final static String AGUserEnableVideo = "userEnableVideo";
|
288
|
|
- private final static String AGUserEnableLocalVideo = "userEnableLocalVideo";
|
289
|
|
- private final static String AGVideoSizeChanged = "videoSizeChanged";
|
290
|
|
- private final static String AGRtmpStreamingStateChanged = "rtmpStreamingStateChanged";
|
291
|
|
- private final static String AGNetworkTypeChanged = "networkTypeChanged";
|
292
|
|
- private final static String AGFirstRemoteAudioDecoded = "firstRemoteAudioDecoded";
|
293
|
|
- private final static String AGMediaMetaDataReceived = "mediaMetaDataReceived";
|
294
|
|
- private final static String AGLocalVideoChanged = "localVideoChanged";
|
295
|
|
- private final static String AGRemoteVideoStateChanged = "remoteVideoStateChanged";
|
296
|
|
- private final static String AGLocalPublishFallbackToAudioOnly = "localPublishFallbackToAudioOnly";
|
297
|
|
- private final static String AGRemoteSubscribeFallbackToAudioOnly = "remoteSubscribeFallbackToAudioOnly";
|
298
|
|
-
|
299
|
|
- private final static String AGAudioRouteChanged = "audioRouteChanged";
|
300
|
|
- private final static String AGCameraReady = "cameraReady";
|
301
|
|
- private final static String AGCameraFocusAreaChanged = "cameraFocusAreaChanged";
|
302
|
|
- private final static String AGCameraExposureAreaChanged = "cameraExposureAreaChanged";
|
303
|
|
-
|
304
|
|
- private final static String AGRtcStats = "rtcStats";
|
305
|
|
- private final static String AGLastmileQuality = "lastmileQuality";
|
306
|
|
- private final static String AGNetworkQuality = "networkQuality";
|
307
|
|
- private final static String AGLocalVideoStats = "localVideoStats";
|
308
|
|
- private final static String AGRemoteVideoStats = "remoteVideoStats";
|
309
|
|
- private final static String AGRemoteAudioStats = "remoteAudioStats";
|
310
|
|
- private final static String AGAudioTransportStatsOfUid = "audioTransportStatsOfUid";
|
311
|
|
- private final static String AGVideoTransportStatsOfUid = "videoTransportStatsOfUid";
|
312
|
|
-
|
313
|
|
- private final static String AGRemoteAudioMixingStart = "remoteAudioMixingStart";
|
314
|
|
- private final static String AGRemoteAudioMixingFinish = "remoteAudioMixingFinish";
|
315
|
|
- private final static String AGAudioEffectFinish = "audioEffectFinish";
|
316
|
|
- private final static String AGAudioMixingStateChanged = "audioMixingStateChanged";
|
317
|
|
-
|
318
|
|
- private final static String AGStreamPublished = "streamPublished";
|
319
|
|
- private final static String AGStreamUnpublish = "streamUnpublish";
|
320
|
|
- private final static String AGTranscodingUpdate = "transcodingUpdate";
|
321
|
|
-
|
322
|
|
- private final static String AGStreamInjectedStatus = "streamInjectedStatus";
|
323
|
|
-
|
324
|
|
- private final static String AGReceiveStreamMessage = "receiveStreamMessage";
|
325
|
|
- private final static String AGOccurStreamMessageError = "occurStreamMessageError";
|
326
|
|
-
|
327
|
|
- private final static String AGMediaEngineLoaded = "mediaEngineLoaded";
|
328
|
|
- private final static String AGMediaEngineStartCall = "mediaEngineStartCall";
|
329
|
|
- private final static String AGLastmileProbeResult = "lastmileProbeTestResult";
|
|
263
|
+
|
330
|
264
|
// private final static String AGIntervalTest = "startEchoTestWithInterval";
|
331
|
265
|
|
332
|
266
|
private MediaObserver mediaObserver = null;
|
|
@@ -2742,8 +2676,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2742
|
2676
|
private void sendEvent(ReactContext reactContext,
|
2743
|
2677
|
String eventName,
|
2744
|
2678
|
@Nullable WritableMap params) {
|
|
2679
|
+ StringBuffer agoraEvtName = new StringBuffer(AG_PREFIX);
|
|
2680
|
+ agoraEvtName.append(eventName);
|
2745
|
2681
|
reactContext
|
2746
|
2682
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
2747
|
|
- .emit(eventName, params);
|
|
2683
|
+ .emit(agoraEvtName.toString(), params);
|
2748
|
2684
|
}
|
2749
|
2685
|
}
|