|
@@ -1110,6 +1110,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1110
|
1110
|
AgoraManager.getInstance().init(getReactApplicationContext(), mRtcEventHandler, options);
|
1111
|
1111
|
appId = options.getString("appid");
|
1112
|
1112
|
rtcEngine = AgoraManager.getInstance().mRtcEngine;
|
|
1113
|
+ rtcEngine.setParameters("{\"rtc.log_filter\": 65535}");
|
1113
|
1114
|
}
|
1114
|
1115
|
|
1115
|
1116
|
@ReactMethod
|
|
@@ -1254,34 +1255,36 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1254
|
1255
|
RtcEngine.destroy();
|
1255
|
1256
|
}
|
1256
|
1257
|
|
1257
|
|
-
|
1258
|
|
-
|
1259
|
1258
|
@ReactMethod
|
1260
|
1259
|
public void startChannelMediaRelay(ReadableMap options, Promise promise) {
|
1261
|
1260
|
ChannelMediaRelayConfiguration config = new ChannelMediaRelayConfiguration();
|
1262
|
|
- ReadableMap srcOption = options.getMap("src");
|
1263
|
1261
|
ChannelMediaInfo src = config.getSrcChannelMediaInfo();
|
1264
|
|
- if (srcOption.hasKey("token")) {
|
1265
|
|
- src.token = srcOption.getString("token");
|
1266
|
|
- }
|
1267
|
|
- if (srcOption.hasKey("channelName")) {
|
1268
|
|
- src.channelName = srcOption.getString("channelName");
|
1269
|
|
- }
|
1270
|
|
- ReadableMap dstMediaInfo = options.getMap("dst");
|
1271
|
|
- String dstChannelName = null;
|
1272
|
|
- Integer dstUid = 0;
|
1273
|
|
- String dstToken = null;
|
1274
|
|
- if (dstMediaInfo.hasKey("token")) {
|
1275
|
|
- dstToken = options.getString("token");
|
1276
|
|
- }
|
1277
|
|
- if (dstMediaInfo.hasKey("channelName")) {
|
1278
|
|
- dstChannelName = options.getString("channelName");
|
|
1262
|
+ if (options.hasKey("src")) {
|
|
1263
|
+ ReadableMap srcOption = options.getMap("src");
|
|
1264
|
+ if (srcOption.hasKey("token")) {
|
|
1265
|
+ src.token = srcOption.getString("token");
|
|
1266
|
+ }
|
|
1267
|
+ if (srcOption.hasKey("channelName")) {
|
|
1268
|
+ src.channelName = srcOption.getString("channelName");
|
|
1269
|
+ }
|
1279
|
1270
|
}
|
1280
|
|
- if (dstMediaInfo.hasKey("uid")) {
|
1281
|
|
- dstUid = options.getInt("uid");
|
|
1271
|
+ ReadableArray dstMediaInfo = options.getArray("channels");
|
|
1272
|
+ for (int i = 0; i < dstMediaInfo.size(); i++) {
|
|
1273
|
+ ReadableMap dst = dstMediaInfo.getMap(i);
|
|
1274
|
+ String channelName = null;
|
|
1275
|
+ String token = null;
|
|
1276
|
+ Integer uid = 0;
|
|
1277
|
+ if (dst.hasKey("token")) {
|
|
1278
|
+ token = token;
|
|
1279
|
+ }
|
|
1280
|
+ if (dst.hasKey("channelName")) {
|
|
1281
|
+ channelName = dst.getString("channelName");
|
|
1282
|
+ }
|
|
1283
|
+ if (dst.hasKey("uid")) {
|
|
1284
|
+ uid = dst.getInt("uid");
|
|
1285
|
+ }
|
|
1286
|
+ config.setDestChannelInfo(channelName, new ChannelMediaInfo(channelName, token, uid));
|
1282
|
1287
|
}
|
1283
|
|
- ChannelMediaInfo dest = new ChannelMediaInfo(dstChannelName, dstToken, dstUid);
|
1284
|
|
- config.setDestChannelInfo(dest.channelName, dest);
|
1285
|
1288
|
Integer res = AgoraManager.getInstance().mRtcEngine.startChannelMediaRelay(config);
|
1286
|
1289
|
if (res == 0) {
|
1287
|
1290
|
promise.resolve(null);
|
|
@@ -1291,31 +1294,64 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1291
|
1294
|
}
|
1292
|
1295
|
|
1293
|
1296
|
@ReactMethod
|
1294
|
|
- public void updateChannelMediaRelay(ReadableMap options, Promise promise) {
|
|
1297
|
+ public void removeChannelMediaRelay(ReadableMap options, Promise promise) {
|
1295
|
1298
|
ChannelMediaRelayConfiguration config = new ChannelMediaRelayConfiguration();
|
1296
|
|
- ReadableMap srcOption = options.getMap("src");
|
1297
|
1299
|
ChannelMediaInfo src = config.getSrcChannelMediaInfo();
|
1298
|
|
- if (srcOption.hasKey("token")) {
|
1299
|
|
- src.token = srcOption.getString("token");
|
|
1300
|
+ if (options.hasKey("src")) {
|
|
1301
|
+ ReadableMap srcOption = options.getMap("src");
|
|
1302
|
+ if (srcOption.hasKey("token")) {
|
|
1303
|
+ src.token = srcOption.getString("token");
|
|
1304
|
+ }
|
|
1305
|
+ if (srcOption.hasKey("channelName")) {
|
|
1306
|
+ src.channelName = srcOption.getString("channelName");
|
|
1307
|
+ }
|
1300
|
1308
|
}
|
1301
|
|
- if (srcOption.hasKey("channelName")) {
|
1302
|
|
- src.channelName = srcOption.getString("channelName");
|
|
1309
|
+ ReadableArray dstMediaInfo = options.getArray("channels");
|
|
1310
|
+ for (int i = 0; i < dstMediaInfo.size(); i++) {
|
|
1311
|
+ ReadableMap dst = dstMediaInfo.getMap(i);
|
|
1312
|
+ if (dst.hasKey("channelName")) {
|
|
1313
|
+ channelName = dst.getString("channelName");
|
|
1314
|
+ config.removeDestChannelInfo(channelName);
|
|
1315
|
+ }
|
1303
|
1316
|
}
|
1304
|
|
- ReadableMap dstMediaInfo = options.getMap("dst");
|
1305
|
|
- String dstChannelName = null;
|
1306
|
|
- Integer dstUid = 0;
|
1307
|
|
- String dstToken = null;
|
1308
|
|
- if (dstMediaInfo.hasKey("token")) {
|
1309
|
|
- dstToken = options.getString("token");
|
|
1317
|
+ Integer res = AgoraManager.getInstance().mRtcEngine.updateChannelMediaRelay(config);
|
|
1318
|
+ if (res == 0) {
|
|
1319
|
+ promise.resolve(null);
|
|
1320
|
+ } else {
|
|
1321
|
+ promise.reject("-1", res.toString());
|
1310
|
1322
|
}
|
1311
|
|
- if (dstMediaInfo.hasKey("channelName")) {
|
1312
|
|
- dstChannelName = options.getString("channelName");
|
|
1323
|
+ }
|
|
1324
|
+
|
|
1325
|
+ @ReactMethod
|
|
1326
|
+ public void updateChannelMediaRelay(ReadableMap options, Promise promise) {
|
|
1327
|
+ ChannelMediaRelayConfiguration config = new ChannelMediaRelayConfiguration();
|
|
1328
|
+ ChannelMediaInfo src = config.getSrcChannelMediaInfo();
|
|
1329
|
+ if (options.hasKey("src")) {
|
|
1330
|
+ ReadableMap srcOption = options.getMap("src");
|
|
1331
|
+ if (srcOption.hasKey("token")) {
|
|
1332
|
+ src.token = srcOption.getString("token");
|
|
1333
|
+ }
|
|
1334
|
+ if (srcOption.hasKey("channelName")) {
|
|
1335
|
+ src.channelName = srcOption.getString("channelName");
|
|
1336
|
+ }
|
1313
|
1337
|
}
|
1314
|
|
- if (dstMediaInfo.hasKey("uid")) {
|
1315
|
|
- dstUid = options.getInt("uid");
|
|
1338
|
+ ReadableArray dstMediaInfo = options.getArray("channels");
|
|
1339
|
+ for (int i = 0; i < dstMediaInfo.size(); i++) {
|
|
1340
|
+ ReadableMap dst = dstMediaInfo.getMap(i);
|
|
1341
|
+ String channelName = null;
|
|
1342
|
+ String token = null;
|
|
1343
|
+ Integer uid = 0;
|
|
1344
|
+ if (dst.hasKey("token")) {
|
|
1345
|
+ token = token;
|
|
1346
|
+ }
|
|
1347
|
+ if (dst.hasKey("channelName")) {
|
|
1348
|
+ channelName = dst.getString("channelName");
|
|
1349
|
+ }
|
|
1350
|
+ if (dst.hasKey("uid")) {
|
|
1351
|
+ uid = dst.getInt("uid");
|
|
1352
|
+ }
|
|
1353
|
+ config.setDestChannelInfo(src.channelName, new ChannelMediaInfo(channelName, token, uid));
|
1316
|
1354
|
}
|
1317
|
|
- ChannelMediaInfo dest = new ChannelMediaInfo(dstChannelName, dstToken, dstUid);
|
1318
|
|
- config.setDestChannelInfo(dest.channelName, dest);
|
1319
|
1355
|
Integer res = AgoraManager.getInstance().mRtcEngine.updateChannelMediaRelay(config);
|
1320
|
1356
|
if (res == 0) {
|
1321
|
1357
|
promise.resolve(null);
|
|
@@ -1325,8 +1361,13 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1325
|
1361
|
}
|
1326
|
1362
|
|
1327
|
1363
|
@ReactMethod
|
1328
|
|
- public void stopChannelMediaRelay() {
|
1329
|
|
- AgoraManager.getInstance().mRtcEngine.stopChannelMediaRelay();
|
|
1364
|
+ public void stopChannelMediaRelay(Promise promise) {
|
|
1365
|
+ Integer res = AgoraManager.getInstance().mRtcEngine.stopChannelMediaRelay();
|
|
1366
|
+ if (res == 0) {
|
|
1367
|
+ promise.resolve(null);
|
|
1368
|
+ } else {
|
|
1369
|
+ promise.reject("-1", res.toString());
|
|
1370
|
+ }
|
1330
|
1371
|
}
|
1331
|
1372
|
|
1332
|
1373
|
@ReactMethod
|
|
@@ -1475,9 +1516,9 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1475
|
1516
|
@ReactMethod
|
1476
|
1517
|
public void setCameraFocusPositionInPreview(ReadableMap options, Promise promise) {
|
1477
|
1518
|
Integer res = AgoraManager.getInstance().mRtcEngine.setCameraFocusPositionInPreview(
|
1478
|
|
- (float)options.getDouble("x"),
|
1479
|
|
- (float)options.getDouble("y")
|
1480
|
|
- );
|
|
1519
|
+ (float)options.getDouble("x"),
|
|
1520
|
+ (float)options.getDouble("y")
|
|
1521
|
+ );
|
1481
|
1522
|
if (res == 0) {
|
1482
|
1523
|
promise.resolve(null);
|
1483
|
1524
|
} else {
|
|
@@ -1650,10 +1691,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1650
|
1691
|
@ReactMethod
|
1651
|
1692
|
public void createDataStream(ReadableMap options, Promise promise) {
|
1652
|
1693
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1653
|
|
- .createDataStream(
|
1654
|
|
- options.getBoolean("ordered"),
|
1655
|
|
- options.getBoolean("reliable")
|
1656
|
|
- );
|
|
1694
|
+ .createDataStream(
|
|
1695
|
+ options.getBoolean("ordered"),
|
|
1696
|
+ options.getBoolean("reliable")
|
|
1697
|
+ );
|
1657
|
1698
|
if (res == 0) {
|
1658
|
1699
|
promise.resolve(null);
|
1659
|
1700
|
} else {
|
|
@@ -1721,10 +1762,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1721
|
1762
|
@ReactMethod
|
1722
|
1763
|
public void startAudioMixing(ReadableMap options, Promise promise) {
|
1723
|
1764
|
Integer res = AgoraManager.getInstance().mRtcEngine.startAudioMixing(
|
1724
|
|
- options.getString("filepath"),
|
1725
|
|
- options.getBoolean("loopback"),
|
1726
|
|
- options.getBoolean("replace"),
|
1727
|
|
- options.getInt("cycle")
|
|
1765
|
+ options.getString("filepath"),
|
|
1766
|
+ options.getBoolean("loopback"),
|
|
1767
|
+ options.getBoolean("replace"),
|
|
1768
|
+ options.getInt("cycle")
|
1728
|
1769
|
);
|
1729
|
1770
|
if (res == 0) {
|
1730
|
1771
|
promise.resolve(null);
|
|
@@ -1846,10 +1887,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1846
|
1887
|
@ReactMethod
|
1847
|
1888
|
public void startAudioRecording(ReadableMap options, Promise promise) {
|
1848
|
1889
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1849
|
|
- .startAudioRecording(
|
1850
|
|
- options.getString("filepath"),
|
1851
|
|
- options.getInt("quality")
|
1852
|
|
- );
|
|
1890
|
+ .startAudioRecording(
|
|
1891
|
+ options.getString("filepath"),
|
|
1892
|
+ options.getInt("quality")
|
|
1893
|
+ );
|
1853
|
1894
|
if (res == 0) {
|
1854
|
1895
|
promise.resolve(null);
|
1855
|
1896
|
} else {
|
|
@@ -1860,7 +1901,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1860
|
1901
|
@ReactMethod
|
1861
|
1902
|
public void stopAudioRecording(Promise promise) {
|
1862
|
1903
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1863
|
|
- .stopAudioRecording();
|
|
1904
|
+ .stopAudioRecording();
|
1864
|
1905
|
if (res == 0) {
|
1865
|
1906
|
promise.resolve(null);
|
1866
|
1907
|
} else {
|
|
@@ -1871,7 +1912,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1871
|
1912
|
@ReactMethod
|
1872
|
1913
|
public void stopEchoTest(Promise promise) {
|
1873
|
1914
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1874
|
|
- .stopEchoTest();
|
|
1915
|
+ .stopEchoTest();
|
1875
|
1916
|
if (res == 0) {
|
1876
|
1917
|
promise.resolve(null);
|
1877
|
1918
|
} else {
|
|
@@ -1882,7 +1923,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1882
|
1923
|
@ReactMethod
|
1883
|
1924
|
public void enableLastmileTest(Promise promise) {
|
1884
|
1925
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1885
|
|
- .enableLastmileTest();
|
|
1926
|
+ .enableLastmileTest();
|
1886
|
1927
|
if (res == 0) {
|
1887
|
1928
|
promise.resolve(null);
|
1888
|
1929
|
} else {
|
|
@@ -1893,7 +1934,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1893
|
1934
|
@ReactMethod
|
1894
|
1935
|
public void disableLastmileTest(Promise promise) {
|
1895
|
1936
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1896
|
|
- .disableLastmileTest();
|
|
1937
|
+ .disableLastmileTest();
|
1897
|
1938
|
if (res == 0) {
|
1898
|
1939
|
promise.resolve(null);
|
1899
|
1940
|
} else {
|
|
@@ -1904,12 +1945,12 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1904
|
1945
|
@ReactMethod
|
1905
|
1946
|
public void setRecordingAudioFrameParameters(ReadableMap options, Promise promise) {
|
1906
|
1947
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1907
|
|
- .setRecordingAudioFrameParameters(
|
1908
|
|
- options.getInt("sampleRate"),
|
1909
|
|
- options.getInt("channel"),
|
1910
|
|
- options.getInt("mode"),
|
1911
|
|
- options.getInt("samplesPerCall")
|
1912
|
|
- );
|
|
1948
|
+ .setRecordingAudioFrameParameters(
|
|
1949
|
+ options.getInt("sampleRate"),
|
|
1950
|
+ options.getInt("channel"),
|
|
1951
|
+ options.getInt("mode"),
|
|
1952
|
+ options.getInt("samplesPerCall")
|
|
1953
|
+ );
|
1913
|
1954
|
if (res == 0) {
|
1914
|
1955
|
promise.resolve(null);
|
1915
|
1956
|
} else {
|
|
@@ -1920,12 +1961,12 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1920
|
1961
|
@ReactMethod
|
1921
|
1962
|
public void setPlaybackAudioFrameParameters(ReadableMap options, Promise promise) {
|
1922
|
1963
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1923
|
|
- .setPlaybackAudioFrameParameters(
|
1924
|
|
- options.getInt("sampleRate"),
|
1925
|
|
- options.getInt("channel"),
|
1926
|
|
- options.getInt("mode"),
|
1927
|
|
- options.getInt("samplesPerCall")
|
1928
|
|
- );
|
|
1964
|
+ .setPlaybackAudioFrameParameters(
|
|
1965
|
+ options.getInt("sampleRate"),
|
|
1966
|
+ options.getInt("channel"),
|
|
1967
|
+ options.getInt("mode"),
|
|
1968
|
+ options.getInt("samplesPerCall")
|
|
1969
|
+ );
|
1929
|
1970
|
if (res == 0) {
|
1930
|
1971
|
promise.resolve(null);
|
1931
|
1972
|
} else {
|
|
@@ -1936,10 +1977,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1936
|
1977
|
@ReactMethod
|
1937
|
1978
|
public void setMixedAudioFrameParameters(WritableMap options, Promise promise) {
|
1938
|
1979
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1939
|
|
- .setMixedAudioFrameParameters(
|
1940
|
|
- options.getInt("sampleRate"),
|
1941
|
|
- options.getInt("samplesPerCall")
|
1942
|
|
- );
|
|
1980
|
+ .setMixedAudioFrameParameters(
|
|
1981
|
+ options.getInt("sampleRate"),
|
|
1982
|
+ options.getInt("samplesPerCall")
|
|
1983
|
+ );
|
1943
|
1984
|
if (res == 0) {
|
1944
|
1985
|
promise.resolve(null);
|
1945
|
1986
|
} else {
|
|
@@ -1960,7 +2001,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1960
|
2001
|
@ReactMethod
|
1961
|
2002
|
public void addVideoWatermark(ReadableMap options, Promise promise) {
|
1962
|
2003
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1963
|
|
- .addVideoWatermark(createAgoraImage(options));
|
|
2004
|
+ .addVideoWatermark(createAgoraImage(options));
|
1964
|
2005
|
if (res == 0) {
|
1965
|
2006
|
promise.resolve(null);
|
1966
|
2007
|
} else {
|
|
@@ -1971,7 +2012,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1971
|
2012
|
@ReactMethod
|
1972
|
2013
|
public void clearVideoWatermarks(Promise promise) {
|
1973
|
2014
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1974
|
|
- .clearVideoWatermarks();
|
|
2015
|
+ .clearVideoWatermarks();
|
1975
|
2016
|
if (res == 0) {
|
1976
|
2017
|
promise.resolve(null);
|
1977
|
2018
|
} else {
|
|
@@ -1982,7 +2023,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1982
|
2023
|
@ReactMethod
|
1983
|
2024
|
public void setLocalPublishFallbackOption(int option, Promise promise) {
|
1984
|
2025
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1985
|
|
- .setLocalPublishFallbackOption(option);
|
|
2026
|
+ .setLocalPublishFallbackOption(option);
|
1986
|
2027
|
if (res == 0) {
|
1987
|
2028
|
promise.resolve(null);
|
1988
|
2029
|
} else {
|
|
@@ -1993,7 +2034,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
1993
|
2034
|
@ReactMethod
|
1994
|
2035
|
public void setRemoteSubscribeFallbackOption(int option, Promise promise) {
|
1995
|
2036
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
1996
|
|
- .setRemoteSubscribeFallbackOption(option);
|
|
2037
|
+ .setRemoteSubscribeFallbackOption(option);
|
1997
|
2038
|
if (res == 0) {
|
1998
|
2039
|
promise.resolve(null);
|
1999
|
2040
|
} else {
|
|
@@ -2004,7 +2045,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2004
|
2045
|
@ReactMethod
|
2005
|
2046
|
public void enableDualStreamMode(boolean enabled, Promise promise) {
|
2006
|
2047
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
2007
|
|
- .enableDualStreamMode(enabled);
|
|
2048
|
+ .enableDualStreamMode(enabled);
|
2008
|
2049
|
if (res == 0) {
|
2009
|
2050
|
promise.resolve(null);
|
2010
|
2051
|
} else {
|
|
@@ -2016,10 +2057,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2016
|
2057
|
@ReactMethod
|
2017
|
2058
|
public void setRemoteVideoStreamType(ReadableMap options, Promise promise) {
|
2018
|
2059
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
2019
|
|
- .setRemoteVideoStreamType(
|
2020
|
|
- options.getInt("uid"),
|
2021
|
|
- options.getInt("streamType")
|
2022
|
|
- );
|
|
2060
|
+ .setRemoteVideoStreamType(
|
|
2061
|
+ options.getInt("uid"),
|
|
2062
|
+ options.getInt("streamType")
|
|
2063
|
+ );
|
2023
|
2064
|
if (res == 0) {
|
2024
|
2065
|
promise.resolve(null);
|
2025
|
2066
|
} else {
|
|
@@ -2030,9 +2071,9 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2030
|
2071
|
@ReactMethod
|
2031
|
2072
|
public void setRemoteDefaultVideoStreamType(ReadableMap options, Promise promise) {
|
2032
|
2073
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
2033
|
|
- .setRemoteDefaultVideoStreamType(
|
2034
|
|
- options.getInt("streamType")
|
2035
|
|
- );
|
|
2074
|
+ .setRemoteDefaultVideoStreamType(
|
|
2075
|
+ options.getInt("streamType")
|
|
2076
|
+ );
|
2036
|
2077
|
if (res == 0) {
|
2037
|
2078
|
promise.resolve(null);
|
2038
|
2079
|
} else {
|
|
@@ -2182,7 +2223,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2182
|
2223
|
@ReactMethod
|
2183
|
2224
|
public void removeInjectStreamUrl(ReadableMap options, Promise promise) {
|
2184
|
2225
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
2185
|
|
- .removeInjectStreamUrl(options.getString("url"));
|
|
2226
|
+ .removeInjectStreamUrl(options.getString("url"));
|
2186
|
2227
|
if (res == 0) {
|
2187
|
2228
|
promise.resolve(null);
|
2188
|
2229
|
} else {
|
|
@@ -2193,10 +2234,10 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2193
|
2234
|
@ReactMethod
|
2194
|
2235
|
public void addPublishStreamUrl(ReadableMap options, Promise promise) {
|
2195
|
2236
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
2196
|
|
- .addPublishStreamUrl(
|
2197
|
|
- options.getString("url"),
|
2198
|
|
- options.getBoolean("enable")
|
2199
|
|
- );
|
|
2237
|
+ .addPublishStreamUrl(
|
|
2238
|
+ options.getString("url"),
|
|
2239
|
+ options.getBoolean("enable")
|
|
2240
|
+ );
|
2200
|
2241
|
if (res == 0) {
|
2201
|
2242
|
promise.resolve(null);
|
2202
|
2243
|
} else {
|
|
@@ -2207,7 +2248,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2207
|
2248
|
@ReactMethod
|
2208
|
2249
|
public void removePublishStreamUrl(ReadableMap options, Promise promise) {
|
2209
|
2250
|
Integer res = AgoraManager.getInstance().mRtcEngine
|
2210
|
|
- .removePublishStreamUrl(options.getString("url"));
|
|
2251
|
+ .removePublishStreamUrl(options.getString("url"));
|
2211
|
2252
|
if (res == 0) {
|
2212
|
2253
|
promise.resolve(null);
|
2213
|
2254
|
} else {
|
|
@@ -2339,13 +2380,13 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
2339
|
2380
|
public void playEffect(ReadableMap options, Promise promise) {
|
2340
|
2381
|
IAudioEffectManager manager = AgoraManager.getInstance().mRtcEngine.getAudioEffectManager();
|
2341
|
2382
|
Integer res = manager.playEffect(
|
2342
|
|
- options.getInt("soundid"),
|
2343
|
|
- options.getString("filepath"),
|
2344
|
|
- options.getInt("loopcount"),
|
2345
|
|
- options.getDouble("pitch"),
|
2346
|
|
- options.getDouble("pan"),
|
2347
|
|
- options.getDouble("gain"),
|
2348
|
|
- options.getBoolean("publish")
|
|
2383
|
+ options.getInt("soundid"),
|
|
2384
|
+ options.getString("filepath"),
|
|
2385
|
+ options.getInt("loopcount"),
|
|
2386
|
+ options.getDouble("pitch"),
|
|
2387
|
+ options.getDouble("pan"),
|
|
2388
|
+ options.getDouble("gain"),
|
|
2389
|
+ options.getBoolean("publish")
|
2349
|
2390
|
);
|
2350
|
2391
|
if (res == 0) {
|
2351
|
2392
|
promise.resolve(null);
|