|
@@ -291,6 +291,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
291
|
291
|
private final static String AGNetworkTypeChanged = "networkTypeChanged";
|
292
|
292
|
private final static String AGFirstRemoteAudioDecoded = "firstRemoteAudioDecoded";
|
293
|
293
|
private final static String AGMediaMetaDataReceived = "mediaMetaDataReceived";
|
|
294
|
+ private final static String AGLocalVideoChanged = "localVideoChanged";
|
294
|
295
|
private final static String AGRemoteVideoStateChanged = "remoteVideoStateChanged";
|
295
|
296
|
private final static String AGLocalPublishFallbackToAudioOnly = "localPublishFallbackToAudioOnly";
|
296
|
297
|
private final static String AGRemoteSubscribeFallbackToAudioOnly = "remoteSubscribeFallbackToAudioOnly";
|
|
@@ -309,10 +310,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
309
|
310
|
private final static String AGAudioTransportStatsOfUid = "audioTransportStatsOfUid";
|
310
|
311
|
private final static String AGVideoTransportStatsOfUid = "videoTransportStatsOfUid";
|
311
|
312
|
|
312
|
|
- private final static String AGLocalAudioMixingFinish = "localAudioMixingFinish";
|
313
|
313
|
private final static String AGRemoteAudioMixingStart = "remoteAudioMixingStart";
|
314
|
314
|
private final static String AGRemoteAudioMixingFinish = "remoteAudioMixingFinish";
|
315
|
315
|
private final static String AGAudioEffectFinish = "audioEffectFinish";
|
|
316
|
+ private final static String AGAudioMixingStateChanged = "audioMixingStateChanged";
|
316
|
317
|
|
317
|
318
|
private final static String AGStreamPublished = "streamPublished";
|
318
|
319
|
private final static String AGStreamUnpublish = "streamUnpublish";
|
|
@@ -594,18 +595,6 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
594
|
595
|
});
|
595
|
596
|
}
|
596
|
597
|
|
597
|
|
-// @Override
|
598
|
|
-// public void onVideoStopped() {
|
599
|
|
-// runOnUiThread(new Runnable() {
|
600
|
|
-// @Override
|
601
|
|
-// public void run() {
|
602
|
|
-// WritableMap map = Arguments.createMap();
|
603
|
|
-// map.putString("message", "VideoStopped");
|
604
|
|
-// sendEvent(getReactApplicationContext(), AGVideoStopped, map);
|
605
|
|
-// }
|
606
|
|
-// });
|
607
|
|
-// }
|
608
|
|
-
|
609
|
598
|
@Override
|
610
|
599
|
public void onFirstLocalVideoFrame(final int width, final int height, final int elapsed) {
|
611
|
600
|
runOnUiThread(new Runnable() {
|
|
@@ -809,18 +798,6 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
809
|
798
|
});
|
810
|
799
|
}
|
811
|
800
|
|
812
|
|
- @Override
|
813
|
|
- public void onCameraReady() {
|
814
|
|
- runOnUiThread(new Runnable() {
|
815
|
|
- @Override
|
816
|
|
- public void run() {
|
817
|
|
- WritableMap map = Arguments.createMap();
|
818
|
|
- map.putString("message", "CameraDidReady");
|
819
|
|
- sendEvent(getReactApplicationContext(), AGCameraReady, map);
|
820
|
|
- }
|
821
|
|
- });
|
822
|
|
- }
|
823
|
|
-
|
824
|
801
|
@Override
|
825
|
802
|
public void onCameraFocusAreaChanged(final Rect rect) {
|
826
|
803
|
runOnUiThread(new Runnable() {
|
|
@@ -890,6 +867,8 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
890
|
867
|
statsMap.putInt("userCount", stats.users);
|
891
|
868
|
statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
|
892
|
869
|
statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
|
|
870
|
+ statsMap.putInt("txPacketLossRate", stats.txPacketLossRate);
|
|
871
|
+ statsMap.putInt("rxPacketLossRate", stats.rxPacketLossRate);
|
893
|
872
|
|
894
|
873
|
WritableMap map = Arguments.createMap();
|
895
|
874
|
map.putMap("stats", statsMap);
|
|
@@ -1002,13 +981,14 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1002
|
981
|
}
|
1003
|
982
|
|
1004
|
983
|
@Override
|
1005
|
|
- public void onAudioMixingFinished() {
|
|
984
|
+ public void onAudioMixingStateChanged(final int state, final int errorCode) {
|
1006
|
985
|
runOnUiThread(new Runnable() {
|
1007
|
986
|
@Override
|
1008
|
987
|
public void run() {
|
1009
|
988
|
WritableMap map = Arguments.createMap();
|
1010
|
|
- map.putString("message", "LocalAudioMixingSucceedFinish");
|
1011
|
|
- sendEvent(getReactApplicationContext(), AGLocalAudioMixingFinish, map);
|
|
989
|
+ map.putInt("state", state);
|
|
990
|
+ map.putInt("errorCode", errorCode);
|
|
991
|
+ sendEvent(getReactApplicationContext(), AGAudioMixingStateChanged, map);
|
1012
|
992
|
}
|
1013
|
993
|
});
|
1014
|
994
|
}
|
|
@@ -1146,6 +1126,20 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1146
|
1126
|
}
|
1147
|
1127
|
});
|
1148
|
1128
|
}
|
|
1129
|
+
|
|
1130
|
+ @Override
|
|
1131
|
+ public void onLocalVideoStateChanged(final int localVideoState, final int error) {
|
|
1132
|
+ super.onLocalVideoStateChanged(localVideoState, error);
|
|
1133
|
+ runOnUiThread(new Runnable() {
|
|
1134
|
+ @Override
|
|
1135
|
+ public void run() {
|
|
1136
|
+ WritableMap map = Arguments.createMap();
|
|
1137
|
+ map.putString("message", "LocalVideoChanged");
|
|
1138
|
+ map.putInt("state", localVideoState);
|
|
1139
|
+ sendEvent(getReactApplicationContext(), AGLocalVideoChanged, map);
|
|
1140
|
+ }
|
|
1141
|
+ });
|
|
1142
|
+ }
|
1149
|
1143
|
};
|
1150
|
1144
|
|
1151
|
1145
|
@ReactMethod
|
|
@@ -1769,7 +1763,8 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1769
|
1763
|
int res = AgoraManager.getInstance().mRtcEngine.getAudioMixingPlayoutVolume();
|
1770
|
1764
|
if (res < 0) throw new ReactNativeAgoraException("getAudioMixingPlayoutVolume Failed", res);
|
1771
|
1765
|
WritableMap map = Arguments.createMap();
|
1772
|
|
- map.putString("volume", Integer.toString(res));
|
|
1766
|
+ map.putBoolean("success", true);
|
|
1767
|
+ map.putInt("value", res);
|
1773
|
1768
|
promise.resolve(map);
|
1774
|
1769
|
} catch (Exception e) {
|
1775
|
1770
|
promise.reject("-1", e);
|