浏览代码

feat. support 2.4.0.1 ios

matrixbirds 5 年前
父节点
当前提交
0d95ccb33a
共有 8 个文件被更改,包括 736 次插入85 次删除
  1. 1
    1
      android/build.gradle
  2. 4
    0
      ios/RCTAgora/AgoraConst.h
  3. 346
    72
      ios/RCTAgora/RCTAgora.m
  4. 146
    2
      lib/RtcEngine.native.js
  5. 1
    1
      lib/RtcEngine.native.js.map
  6. 1
    1
      react-native-agora.podspec
  7. 175
    7
      src/RtcEngine.native.ts
  8. 62
    1
      src/types.d.ts

+ 1
- 1
android/build.gradle 查看文件

@@ -61,7 +61,7 @@ dependencies {
61 61
     def androidSupportVersion = rootProject.hasProperty("androidSupportVersion")  ? rootProject.androidSupportVersion : DEFAULT_ANDROID_SUPPORT_VERSION
62 62
     // from internet
63 63
     implementation "com.android.support:appcompat-v7:$androidSupportVersion"
64
-    implementation "io.agora.rtc:full-sdk:2.3.3"
64
+    implementation "io.agora.rtc:full-sdk:2.4.0"
65 65
     // from node_modules
66 66
     implementation "com.facebook.react:react-native:+"
67 67
 }

+ 4
- 0
ios/RCTAgora/AgoraConst.h 查看文件

@@ -73,6 +73,10 @@ static NSString *AGOccurStreamMessageError = @"occurStreamMessageError";
73 73
 static NSString *AGMediaEngineLoaded = @"mediaEngineLoaded";
74 74
 static NSString *AGMediaEngineStartCall = @"mediaEngineStartCall";
75 75
 
76
+static NSString *AGIntervalTest = @"startEchoTestWithInterval";
77
+static NSString *AGAudioMixingStateChanged = @"audioMixingStateChanged";
78
+static NSString *AGLastmileProbeTestResult = @"lastmileProbeTestResult";
79
+
76 80
 typedef NS_ENUM(NSInteger, AgoraModeType) {
77 81
   AgoraAudioMode,
78 82
   AgoraVideoMode

+ 346
- 72
ios/RCTAgora/RCTAgora.m 查看文件

@@ -177,6 +177,24 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
177 177
      [self.rtcEngine enableAudio];
178 178
    }
179 179
   
180
+  if ([options objectForKey:@"beauty"]) {
181
+    AgoraBeautyOptions *beautyOption = [[AgoraBeautyOptions alloc] init];
182
+    beautyOption.lighteningContrastLevel = [options[@"beauty"][@"lighteningContrastLevel"] integerValue];
183
+    beautyOption.lighteningLevel = [options[@"beauty"][@"lighteningLevel"] floatValue];
184
+    beautyOption.smoothnessLevel = [options[@"beauty"][@"smoothnessLevel"] floatValue];
185
+    beautyOption.rednessLevel = [options[@"beauty"][@"rednessLevel"] floatValue];
186
+      [self.rtcEngine setBeautyEffectOptions:true options:beautyOption];
187
+  }
188
+  if ([options objectForKey:@"voice"]) {
189
+    NSInteger voiceValue = [options[@"voice"][@"value"] integerValue];
190
+    NSString *voiceType = options[@"voice"][@"type"];
191
+    if ([voiceType isEqualToString: @"changer"]) {
192
+      [self.rtcEngine setLocalVoiceChanger:(AgoraAudioVoiceChanger)voiceValue];
193
+    }
194
+    if ([voiceType isEqualToString: @"reverbPreset"]) {
195
+      [self.rtcEngine setLocalVoiceReverbPreset:(AgoraAudioReverbPreset)voiceValue];
196
+    }
197
+  }
180 198
    if (options[@"secret"] != nil) {
181 199
      [self.rtcEngine setEncryptionSecret:[options[@"secret"] stringValue]];
182 200
      if (options[@"secretMode"] != nil) {
@@ -184,7 +202,7 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
184 202
      }
185 203
    }
186 204
      
187
-   AgoraVideoEncoderConfiguration *video_encoder_config = [[AgoraVideoEncoderConfiguration new] initWithWidth:[options[@"videoEncoderConfig"][@"width"] integerValue] height:[options[@"videoEncoderConfig"][@"height"] integerValue] frameRate:(AgoraVideoFrameRate)[options[@"videoEncoderConfig"][@"frameRate"] integerValue] bitrate:[options[@"videoEncoderConfig"][@"bitrate"] integerValue] orientationMode: (AgoraVideoOutputOrientationMode)[options[@"videoEncoderConfig"][@"orientationMode"] integerValue]];
205
+   AgoraVideoEncoderConfiguration *video_encoder_config = [[AgoraVideoEncoderConfiguration new] initWithWidth:[options[@"videoEncoderConfig"][@"width"] integerValue] height:[options[@"videoEncoderConfig"][@"height"] integerValue] frameRate:[options[@"videoEncoderConfig"][@"frameRate"] integerValue] bitrate:[options[@"videoEncoderConfig"][@"bitrate"] integerValue] orientationMode: (AgoraVideoOutputOrientationMode)[options[@"videoEncoderConfig"][@"orientationMode"] integerValue]];
188 206
    [self.rtcEngine setVideoEncoderConfiguration:video_encoder_config];
189 207
    [self.rtcEngine setClientRole:(AgoraClientRole)[options[@"clientRole"] integerValue]];
190 208
    [self.rtcEngine setAudioProfile:(AgoraAudioProfile)[options[@"audioProfile"] integerValue]
@@ -431,19 +449,41 @@ RCT_EXPORT_METHOD(enableAudioVolumeIndication: (NSInteger) interval smooth:(NSIn
431 449
   [self.rtcEngine enableAudioVolumeIndication:interval smooth:smooth];
432 450
 }
433 451
 
434
-// create data stream
435
-RCT_EXPORT_METHOD(createDataStream
452
+RCT_EXPORT_METHOD(sendMessage
436 453
                   :(NSDictionary *)options
437 454
                   resolve:(RCTPromiseResolveBlock)resolve
438 455
                   reject:(RCTPromiseRejectBlock)reject) {
439
-  NSInteger streamId = 0;
440
-  if (options[@"streamId"] != nil) {
441
-    streamId = [options[@"streamId"] integerValue];
456
+  NSInteger uid = 0;
457
+  if (options[@"streamID"] != nil) {
458
+    uid = [options[@"streamID"] integerValue];
459
+  }
460
+  NSInteger streamID = [self.rtcEngine createDataStream:&uid reliable:[options[@"reliable"] boolValue] ordered:[options[@"ordered"] boolValue]];
461
+  if (streamID < 0) {
462
+    reject(@"131001", @"createDataStream failed", [self makeNSError:@{
463
+                                                                      @"code": @(131001),
464
+                                                                      @"message":@{
465
+                                                                        @"success": @(NO),
466
+                                                                        @"value":[NSNumber numberWithInteger:uid]
467
+                                                                        }
468
+                                                                    }]);
469
+  }
470
+  NSString *dataStr = options[@"data"];
471
+  NSData *data = [dataStr dataUsingEncoding:NSUTF8StringEncoding];
472
+  NSInteger res = [self.rtcEngine sendStreamMessage:uid data:data];
473
+  if (res == 0) {
474
+    resolve(@{@"success": @(YES), @"streamID": @(uid)});
475
+  } else {
476
+    reject(@"131001", @"sendStreamMessage failed", [self makeNSError:@{
477
+                                                                       @"code": @(131001),
478
+                                                                       @"message":@{
479
+                                                                         @"success": @(NO),
480
+                                                                         @"value":[NSNumber numberWithInteger:res]
481
+                                                                         }
482
+                                                                     }]);
442 483
   }
443
-  [self.rtcEngine createDataStream:streamId reliable:[options[@"reliable"] boolValue] ordered:[options[@"ordered"] boolValue]];
444
-  resolve(@[[NSNumber numberWithInteger:streamId]]);
445 484
 }
446 485
 
486
+
447 487
 // is speaker phone enabled
448 488
 RCT_EXPORT_METHOD(methodisSpeakerphoneEnabled:(RCTResponseSenderBlock)callback) {
449 489
   callback(@[@{@"status": @([self.rtcEngine isSpeakerphoneEnabled])}]);
@@ -971,32 +1011,33 @@ RCT_EXPORT_METHOD(setAudioSessionOperationRestriction
971 1011
   [self.rtcEngine setAudioSessionOperationRestriction:restrictionType];
972 1012
 }
973 1013
 
1014
+// deprecated
974 1015
 // gateway test start echo
975
-RCT_EXPORT_METHOD(startEchoTest
976
-                  :(RCTPromiseResolveBlock)resolve
977
-                  reject:(RCTPromiseRejectBlock)reject) {
978
-  NSInteger res = [self.rtcEngine startEchoTest:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
979
-    _block(@{
980
-             @"channel": channel,
981
-             @"uid": @(uid),
982
-             @"elapsed": @(elapsed)
983
-             });
984
-  }];
985
-  if (res != 0) {
986
-    reject(@"131019", @"startEchoTest failed", [self makeNSError:@{
987
-                                                                   @"code": @(131019),
988
-                                                                   @"message":@{
989
-                                                                       @"success": @(NO),
990
-                                                                       @"value":@(res)
991
-                                                                       }
992
-                                                                   }]);
993
-  } else {
994
-    resolve(@{
995
-              @"success": @(YES),
996
-              @"value": @(res)
997
-              });
998
-  }
999
-}
1016
+//RCT_EXPORT_METHOD(startEchoTest
1017
+//                  :(RCTPromiseResolveBlock)resolve
1018
+//                  reject:(RCTPromiseRejectBlock)reject) {
1019
+//  NSInteger res = [self.rtcEngine startEchoTest:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
1020
+//    _block(@{
1021
+//             @"channel": channel,
1022
+//             @"uid": @(uid),
1023
+//             @"elapsed": @(elapsed)
1024
+//             });
1025
+//  }];
1026
+//  if (res != 0) {
1027
+//    reject(@"131019", @"startEchoTest failed", [self makeNSError:@{
1028
+//                                                                   @"code": @(131019),
1029
+//                                                                   @"message":@{
1030
+//                                                                       @"success": @(NO),
1031
+//                                                                       @"value":@(res)
1032
+//                                                                       }
1033
+//                                                                   }]);
1034
+//  } else {
1035
+//    resolve(@{
1036
+//              @"success": @(YES),
1037
+//              @"value": @(res)
1038
+//              });
1039
+//  }
1040
+//}
1000 1041
 
1001 1042
 // gateway test stop echo
1002 1043
 RCT_EXPORT_METHOD(stopEchoTest
@@ -1346,24 +1387,25 @@ RCT_EXPORT_METHOD(removeInjectStreamUrl
1346 1387
   }
1347 1388
 }
1348 1389
 
1390
+// deprecated
1349 1391
 // set video quality
1350
-RCT_EXPORT_METHOD(setVideoQualityParameters
1351
-                  :(BOOL) quality
1352
-                  resolve:(RCTPromiseResolveBlock)resolve
1353
-                  reject:(RCTPromiseRejectBlock)reject) {
1354
-  NSInteger res = [self.rtcEngine setVideoQualityParameters:quality];
1355
-  if (res == 0) {
1356
-    resolve(@{@"success": @(YES)});
1357
-  } else {
1358
-    reject(@"131033", @"setVideoQualityParameters failed", [self makeNSError:@{
1359
-                                                                               @"code": @(131033),
1360
-                                                                               @"message":@{
1361
-                                                                                   @"success": @(NO),
1362
-                                                                                   @"value":[NSNumber numberWithInteger:res]
1363
-                                                                                   }
1364
-                                                                               }]);
1365
-  }
1366
-}
1392
+//RCT_EXPORT_METHOD(setVideoQualityParameters
1393
+//                  :(BOOL) quality
1394
+//                  resolve:(RCTPromiseResolveBlock)resolve
1395
+//                  reject:(RCTPromiseRejectBlock)reject) {
1396
+//  NSInteger res = [self.rtcEngine setVideoQualityParameters:quality];
1397
+//  if (res == 0) {
1398
+//    resolve(@{@"success": @(YES)});
1399
+//  } else {
1400
+//    reject(@"131033", @"setVideoQualityParameters failed", [self makeNSError:@{
1401
+//                                                                               @"code": @(131033),
1402
+//                                                                               @"message":@{
1403
+//                                                                                   @"success": @(NO),
1404
+//                                                                                   @"value":[NSNumber numberWithInteger:res]
1405
+//                                                                                   }
1406
+//                                                                               }]);
1407
+//  }
1408
+//}
1367 1409
 
1368 1410
 // set local video mirror mode
1369 1411
 RCT_EXPORT_METHOD(setLocalVideoMirrorMode
@@ -1532,10 +1574,27 @@ RCT_EXPORT_METHOD(getCallId
1532 1574
 // setLogFile and setLogFilter
1533 1575
 RCT_EXPORT_METHOD(setLog
1534 1576
                   :(NSString *)filePath
1535
-                  level:(NSUInteger)level
1577
+                    level:(NSUInteger)level
1578
+                    size:(NSUInteger)size
1536 1579
                   resolve:(RCTPromiseResolveBlock)resolve
1537 1580
                   reject:(RCTPromiseRejectBlock)reject) {
1538
-  int res = [self.rtcEngine setLogFilter:level];
1581
+  int res = [self.rtcEngine setLogFileSize:size];
1582
+  if (res != 0) {
1583
+    reject(@"131036", @"setLogFileSize failed", [self makeNSError:@{
1584
+                                                                  @"code": @(131036),
1585
+                                                                  @"message":@{
1586
+                                                                      @"success": @(NO),
1587
+                                                                      @"value":[NSNumber numberWithInteger:res]
1588
+                                                                      }
1589
+                                                                  }]);
1590
+  } else {
1591
+    resolve(@{
1592
+              @"success": @(YES),
1593
+              @"value": @(res)
1594
+              });
1595
+  }
1596
+  
1597
+  res = [self.rtcEngine setLogFilter:level];
1539 1598
   if (res != 0) {
1540 1599
     reject(@"131036", @"setLogFilter failed", [self makeNSError:@{
1541 1600
                                                                   @"code": @(131036),
@@ -1567,26 +1626,6 @@ RCT_EXPORT_METHOD(setLog
1567 1626
   }
1568 1627
 }
1569 1628
 
1570
-// set
1571
-
1572
-// send stream message
1573
-RCT_EXPORT_METHOD(sendStreamMessage:(NSInteger)streamId data:(NSData*)data
1574
-                  resolve:(RCTPromiseResolveBlock)resolve
1575
-                  reject:(RCTPromiseRejectBlock)reject) {
1576
-  NSInteger res = [self.rtcEngine sendStreamMessage:(streamId) data:data];
1577
-  if (res == 0) {
1578
-    resolve(@{@"success": @(YES)});
1579
-  } else {
1580
-    reject(@"131001", @"sendStreamMessage failed", [self makeNSError:@{
1581
-                                                                       @"code": @(131001),
1582
-                                                                       @"message":@{
1583
-                                                                           @"success": @(NO),
1584
-                                                                           @"value":[NSNumber numberWithInteger:res]
1585
-                                                                           }
1586
-                                                                       }]);
1587
-  }
1588
-}
1589
-
1590 1629
 // get sdk version
1591 1630
 RCT_EXPORT_METHOD(getSdkVersion
1592 1631
                   :(RCTPromiseResolveBlock) resolve
@@ -1675,6 +1714,210 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1675 1714
   [self.rtcEngine setLiveTranscoding:transcoding];
1676 1715
 }
1677 1716
 
1717
+RCT_EXPORT_METHOD(setBeautyEffectOptions:(bool) enabled
1718
+                  options:(NSDictionary *)options
1719
+                  resolve:(RCTPromiseResolveBlock)resolve
1720
+                  reject:(RCTPromiseRejectBlock)reject) {
1721
+  int res = [self.rtcEngine setBeautyEffectOptions:enabled options:options];
1722
+  if (res != 0) {
1723
+    reject(@"131037", @"setBeautyEffectOptions failed", [self makeNSError:@{
1724
+                                                                @"code": @(131037),
1725
+                                                                @"message":@{
1726
+                                                                    @"success": @(NO),
1727
+                                                                    @"value":[NSNumber numberWithInteger:res]
1728
+                                                                    }
1729
+                                                                }]);
1730
+  } else {
1731
+    resolve(@{
1732
+              @"success": @(YES),
1733
+              @"value": @(res)
1734
+              });
1735
+  }
1736
+}
1737
+
1738
+RCT_EXPORT_METHOD(setLocalVoiceChanger:(NSInteger) voiceChanger
1739
+                  resolve:(RCTPromiseResolveBlock)resolve
1740
+                  reject:(RCTPromiseRejectBlock)reject) {
1741
+  int res = [self.rtcEngine setLocalVoiceChanger:(AgoraAudioVoiceChanger)voiceChanger];
1742
+  if (res != 0) {
1743
+    reject(@"131037", @"setBeautyEffectOptions failed", [self makeNSError:@{
1744
+                                                                            @"code": @(131037),
1745
+                                                                            @"message":@{
1746
+                                                                                @"success": @(NO),
1747
+                                                                                @"value":[NSNumber numberWithInteger:res]
1748
+                                                                                }
1749
+                                                                            }]);
1750
+  } else {
1751
+    resolve(@{
1752
+              @"success": @(YES),
1753
+              @"value": @(res)
1754
+              });
1755
+  }
1756
+}
1757
+
1758
+RCT_EXPORT_METHOD(setLocalVoiceReverbPreset:(NSInteger) reverbPreset
1759
+                  resolve:(RCTPromiseResolveBlock)resolve
1760
+                  reject:(RCTPromiseRejectBlock)reject) {
1761
+  int res = [self.rtcEngine setLocalVoiceReverbPreset:(AgoraAudioReverbPreset)reverbPreset];
1762
+  if (res != 0) {
1763
+    reject(@"131037", @"setLocalVoiceReverbPreset failed", [self makeNSError:@{
1764
+                                                                            @"code": @(131037),
1765
+                                                                            @"message":@{
1766
+                                                                                @"success": @(NO),
1767
+                                                                                @"value":[NSNumber numberWithInteger:res]
1768
+                                                                                }
1769
+                                                                            }]);
1770
+  } else {
1771
+    resolve(@{
1772
+              @"success": @(YES),
1773
+              @"value": @(res)
1774
+              });
1775
+  }
1776
+}
1777
+
1778
+RCT_EXPORT_METHOD(enableSoundPositionIndication:(bool) enabled
1779
+                  resolve:(RCTPromiseResolveBlock)resolve
1780
+                  reject:(RCTPromiseRejectBlock)reject) {
1781
+  int res = [self.rtcEngine enableSoundPositionIndication:enabled];
1782
+  if (res != 0) {
1783
+    reject(@"131037", @"enableSoundPositionIndication failed", [self makeNSError:@{
1784
+                                                                               @"code": @(131037),
1785
+                                                                               @"message":@{
1786
+                                                                                   @"success": @(NO),
1787
+                                                                                   @"value":[NSNumber numberWithInteger:res]
1788
+                                                                                   }
1789
+                                                                               }]);
1790
+  } else {
1791
+    resolve(@{
1792
+              @"success": @(YES),
1793
+              @"value": @(res)
1794
+              });
1795
+  }
1796
+}
1797
+
1798
+RCT_EXPORT_METHOD(setRemoteVoicePosition:(NSInteger) uid
1799
+                  pan:(float)pan
1800
+                  gain:(float)gain
1801
+                  resolve:(RCTPromiseResolveBlock)resolve
1802
+                  reject:(RCTPromiseRejectBlock)reject) {
1803
+  int res = [self.rtcEngine setRemoteVoicePosition:uid pan:pan gain: gain];
1804
+  if (res != 0) {
1805
+    reject(@"131037", @"setRemoteVoicePosition failed", [self makeNSError:@{
1806
+                                                                                   @"code": @(131037),
1807
+                                                                                   @"message":@{
1808
+                                                                                       @"success": @(NO),
1809
+                                                                                       @"value":[NSNumber numberWithInteger:res]
1810
+                                                                                       }
1811
+                                                                                   }]);
1812
+  } else {
1813
+    resolve(@{
1814
+              @"success": @(YES),
1815
+              @"value": @(res)
1816
+              });
1817
+  }
1818
+}
1819
+
1820
+RCT_EXPORT_METHOD(startLastmileProbeTest:(NSDictionary*)config
1821
+                  resolve:(RCTPromiseResolveBlock)resolve
1822
+                  reject:(RCTPromiseRejectBlock)reject) {
1823
+  AgoraLastmileProbeConfig* probeConfig = [[AgoraLastmileProbeConfig alloc] init];
1824
+  probeConfig.probeUplink = [config[@"probeUplink"] boolValue];
1825
+  probeConfig.probeDownlink = [config[@"probeDownlink"] boolValue];
1826
+  probeConfig.expectedUplinkBitrate = [config[@"expectedUplinkBitrate"] integerValue];
1827
+  probeConfig.expectedDownlinkBitrate = [config[@"expectedDownlinkBitrate"] integerValue];
1828
+
1829
+  int res = [self.rtcEngine startLastmileProbeTest:probeConfig];
1830
+  if (res != 0) {
1831
+    reject(@"131037", @"startLastmileProbeTest failed", [self makeNSError:@{
1832
+                                                                            @"code": @(131037),
1833
+                                                                            @"message":@{
1834
+                                                                                @"success": @(NO),
1835
+                                                                                @"value":[NSNumber numberWithInteger:res]
1836
+                                                                                }
1837
+                                                                            }]);
1838
+  } else {
1839
+    resolve(@{
1840
+              @"success": @(YES),
1841
+              @"value": @(res)
1842
+              });
1843
+  }
1844
+}
1845
+
1846
+
1847
+RCT_EXPORT_METHOD(setRemoteUserPriority:(NSUInteger)uid
1848
+                  userPriority:(NSInteger)userPriority
1849
+                  resolve:(RCTPromiseResolveBlock)resolve
1850
+                  reject:(RCTPromiseRejectBlock)reject) {
1851
+ 
1852
+  int res = [self.rtcEngine setRemoteUserPriority:uid type:(AgoraUserPriority)userPriority];
1853
+  if (res != 0) {
1854
+    reject(@"131037", @"setRemoteUserPriority failed", [self makeNSError:@{
1855
+                                                                            @"code": @(131037),
1856
+                                                                            @"message":@{
1857
+                                                                                @"success": @(NO),
1858
+                                                                                @"value":[NSNumber numberWithInteger:res]
1859
+                                                                                }
1860
+                                                                            }]);
1861
+  } else {
1862
+    resolve(@{
1863
+              @"success": @(YES),
1864
+              @"value": @(res)
1865
+              });
1866
+  }
1867
+}
1868
+
1869
+RCT_EXPORT_METHOD(startEchoTestWithInterval:(NSInteger)interval
1870
+                  resolve:(RCTPromiseResolveBlock)resolve
1871
+                  reject:(RCTPromiseRejectBlock)reject) {
1872
+  
1873
+  int res = [self.rtcEngine startEchoTestWithInterval:interval successBlock:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
1874
+    [self sendEvent:AGIntervalTest params:@{
1875
+                                            @"message": @"StartEchoTestWithInterval",
1876
+                                            @"channel": channel,
1877
+                                            @"uid": @(uid),
1878
+                                            @"elapsed": @(elapsed),
1879
+                                            }];
1880
+  }];
1881
+  if (res != 0) {
1882
+    reject(@"131037", @"startEchoTestWithInterval failed", [self makeNSError:@{
1883
+                                                                           @"code": @(131037),
1884
+                                                                           @"message":@{
1885
+                                                                               @"success": @(NO),
1886
+                                                                               @"value":[NSNumber numberWithInteger:res]
1887
+                                                                               }
1888
+                                                                           }]);
1889
+  } else {
1890
+    resolve(@{
1891
+              @"success": @(YES),
1892
+              @"value": @(res)
1893
+              });
1894
+  }
1895
+}
1896
+
1897
+RCT_EXPORT_METHOD(setCameraCapturerConfiguration:(NSDictionary *)config
1898
+                  resolve:(RCTPromiseResolveBlock)resolve
1899
+                  reject:(RCTPromiseRejectBlock)reject) {
1900
+  
1901
+  AgoraCameraCapturerConfiguration* configuration = [[AgoraCameraCapturerConfiguration alloc] init];
1902
+  configuration.preference = [config[@"preference"] integerValue];
1903
+  
1904
+  int res = [self.rtcEngine setCameraCapturerConfiguration:configuration];
1905
+  if (res != 0) {
1906
+    reject(@"131037", @"setCameraCapturerConfiguration failed", [self makeNSError:@{
1907
+                                                                               @"code": @(131037),
1908
+                                                                               @"message":@{
1909
+                                                                                   @"success": @(NO),
1910
+                                                                                   @"value":[NSNumber numberWithInteger:res]
1911
+                                                                                   }
1912
+                                                                               }]);
1913
+  } else {
1914
+    resolve(@{
1915
+              @"success": @(YES),
1916
+              @"value": @(res)
1917
+              });
1918
+  }
1919
+}
1920
+
1678 1921
 - (NSArray<NSString *> *)supportedEvents {
1679 1922
   return @[
1680 1923
            AGWarning,
@@ -1739,6 +1982,9 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
1739 1982
            
1740 1983
            AGMediaEngineLoaded,
1741 1984
            AGMediaEngineStartCall,
1985
+           AGIntervalTest,
1986
+           AGAudioMixingStateChanged,
1987
+           AGLastmileProbeTestResult
1742 1988
            ];
1743 1989
 }
1744 1990
 
@@ -2178,4 +2424,32 @@ RCT_EXPORT_METHOD(setLiveTranscoding:(NSDictionary *)options) {
2178 2424
                                                    }];
2179 2425
 }
2180 2426
 
2427
+- (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine localAudioMixingStateDidChanged:(AgoraAudioMixingStateCode)state errorCode:(AgoraAudioMixingErrorCode)errorCode {
2428
+  [self sendEvent:AGAudioMixingStateChanged params:@{
2429
+                                                     @"message": @"AudioMixingStateChanged",
2430
+                                                     @"state": @(state),
2431
+                                                     @"errorCode": @(errorCode)
2432
+                                                     }];
2433
+}
2434
+
2435
+- (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine lastmileProbeTestResult:(AgoraLastmileProbeResult *_Nonnull)result {
2436
+  [self sendEvent:AGLastmileProbeTestResult params:@{
2437
+                                                     @"message":@"LastmileProbeTestResult",
2438
+                                                     @"result": @{
2439
+                                                         @"state": @(result.state),
2440
+                                                         @"rtt": @(result.rtt),
2441
+                                                         @"uplinkReport": @{
2442
+                                                             @"packetLossRate": @(result.uplinkReport.packetLossRate),
2443
+                                                             @"jitter": @(result.uplinkReport.jitter),
2444
+                                                             @"availableBandwidth": @(result.uplinkReport.availableBandwidth),
2445
+                                                             },
2446
+                                                         @"downlinkReport": @{
2447
+                                                             @"packetLossRate": @(result.downlinkReport.packetLossRate),
2448
+                                                             @"jitter": @(result.downlinkReport.jitter),
2449
+                                                             @"availableBandwidth": @(result.downlinkReport.availableBandwidth),
2450
+                                                             }
2451
+                                                         }
2452
+                                                     }];
2453
+}
2454
+
2181 2455
 @end

+ 146
- 2
lib/RtcEngine.native.js 查看文件

@@ -1006,8 +1006,8 @@ class RtcEngine {
1006 1006
      * @param data
1007 1007
      * @returns Promise<{success, value}>
1008 1008
      */
1009
-    static sendStreamMessage(uid, data) {
1010
-        return Agora.sendStreamMessage(uid, data);
1009
+    static sendMessage(streamID, data, reliable, ordered) {
1010
+        return Agora.sendMessage({ streamID, data, reliable, ordered });
1011 1011
     }
1012 1012
     /**
1013 1013
      * add publish stream url
@@ -1063,6 +1063,150 @@ class RtcEngine {
1063 1063
     static muteLocalAudioStream(enabled) {
1064 1064
         Agora.muteLocalAudioStream(enabled);
1065 1065
     }
1066
+    /**
1067
+     * video pre-process/post-process
1068
+     *
1069
+     * This method enables/disables image enhancement and sets the options.
1070
+     *
1071
+     * @param enable boolean
1072
+     * @param options {@link BeautyOptions}
1073
+     * @returns operate result boolean
1074
+     */
1075
+    static setBeautyEffectOptions(enabled, options) {
1076
+        return Agora.setBeautyEffectOptions(enabled, options);
1077
+    }
1078
+    /**
1079
+     * set local voice change
1080
+     *
1081
+     * This method changes local speaker voice with voiceChanger
1082
+     *
1083
+     * @param voiceChanger integer
1084
+     * @voiceChanger value ranges [
1085
+     *          0: "The original voice",
1086
+     *          1: "An old man’s voice",
1087
+     *          2: "A little boy’s voice.",
1088
+     *          3: "A little girl’s voice.",
1089
+     *          4: "TBD",
1090
+     *          5: "Ethereal vocal effects.",
1091
+     *          6: "Hulk’s voice."
1092
+     *      ]
1093
+     * @returns result boolean
1094
+     */
1095
+    static setLocalVoiceChanger(voiceChanger) {
1096
+        return Agora.setLocalVoiceChanger(voiceChanger);
1097
+    }
1098
+    /**
1099
+     * set the preset local voice reverberation effect.
1100
+     *
1101
+     * This method sets the preset local voice reverberation effect.
1102
+     *
1103
+     * @param preset integer
1104
+     * @returns result boolean
1105
+     */
1106
+    static setLocalVoiceReverbPreset(preset) {
1107
+        return Agora.setLocalVoiceReverbPreset(preset);
1108
+    }
1109
+    /**
1110
+     * control stereo panning for remote users
1111
+     *
1112
+     * This method enables/disables stereo panning for remote users.
1113
+     *
1114
+     * @param enabled boolean
1115
+     * @returns result boolean
1116
+     */
1117
+    static enableSoundPositionIndication(enabled) {
1118
+        return Agora.enableSoundPositionIndication(enabled);
1119
+    }
1120
+    /**
1121
+     * set the sound position of a remote user
1122
+     *
1123
+     * This method sets the sound position of a remote user by uid
1124
+     *
1125
+     * @param uid number | The ID of the remote user
1126
+     * @param pan float | The sound position of the remote user. The value ranges from -1.0 to 1.0
1127
+     * @pan
1128
+     *  0.0: the remote sound comes from the front.
1129
+     *  -1.0: the remote sound comes from the left.
1130
+     *  1.0: the remote sound comes from the right.
1131
+     * @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.
1132
+     * @returns result boolean
1133
+     */
1134
+    static setRemoteVoicePosition(uid, pan, gain) {
1135
+        return Agora.setRemoteVoicePosition(uid, pan, gain);
1136
+    }
1137
+    /**
1138
+     * start the lastmile probe test
1139
+     *
1140
+     * 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).
1141
+     *
1142
+     * @param config LastmileProbeConfig {@link LastmileProbeConfig}
1143
+     *
1144
+     * @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.
1145
+     * @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.
1146
+     * @returns result boolean
1147
+     */
1148
+    static startLastmileProbeTest(config) {
1149
+        return Agora.startLastmileProbeTest(config);
1150
+    }
1151
+    /**
1152
+     * stop the lastmile probe test
1153
+     *
1154
+     * This method stop the lastmile probe test.
1155
+     *
1156
+     * @returns result boolean
1157
+     */
1158
+    static stopLastmileProbeTest() {
1159
+        return Agora.stopLastmileProbeTest();
1160
+    }
1161
+    /**
1162
+     * sets the priority of a remote user's media stream.
1163
+     *
1164
+     * 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.
1165
+     *
1166
+     * This method sets the priority of a remote user's media stream.
1167
+     * @param uid number
1168
+     * @param userPriority number | The value range is  [50 is "user's priority is hgih", 100 is "the default user's priority is normal"]
1169
+     *
1170
+     * @returns result boolean
1171
+     */
1172
+    static setRemoteUserPriority(uid, userPrority) {
1173
+        return Agora.setRemoteUserPriority(uid, userPrority);
1174
+    }
1175
+    /**
1176
+     * start an audio call test.
1177
+     *
1178
+     * note:
1179
+     *   Call this method before joining a channel.
1180
+     *   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.
1181
+     *   In the Live-broadcast profile, only a host can call this method.
1182
+     * This method will start an audio call test with interval parameter.
1183
+     * 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.
1184
+     *
1185
+     * @param interval number
1186
+     *
1187
+     * @returns result boolean
1188
+     */
1189
+    static startEchoTestWithInterval(interval) {
1190
+        return Agora.startEchoTestWithInterval(interval);
1191
+    }
1192
+    /**
1193
+     * set the camera capture preference.
1194
+     *
1195
+     * note:
1196
+     *  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:
1197
+     *  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.
1198
+     *  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.
1199
+     *  If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW(2).
1200
+     *
1201
+     * This method will set the camera capture preference.
1202
+     *
1203
+     * @param config {@link CameraCapturerConfiguration}
1204
+     *
1205
+     * @returns result boolean
1206
+     */
1207
+    static setCameraCapturerConfiguration(config) {
1208
+        return Agora.setCameraCapturerConfiguration(config);
1209
+    }
1066 1210
 }
1067 1211
 RtcEngine.eventTypes = new Set();
1068 1212
 exports.default = RtcEngine;

+ 1
- 1
lib/RtcEngine.native.js.map
文件差异内容过多而无法显示
查看文件


+ 1
- 1
react-native-agora.podspec 查看文件

@@ -93,7 +93,7 @@ Pod::Spec.new do |s|
93 93
       "$(SDKROOT)../../ios/Pods"
94 94
     ]
95 95
   }
96
-  s.dependency "AgoraRtcEngine_iOS", "2.3.3"
96
+  s.dependency "AgoraRtcEngine_iOS", "2.4.0.1"
97 97
   s.dependency 'React'
98 98
 
99 99
 end

+ 175
- 7
src/RtcEngine.native.ts 查看文件

@@ -21,7 +21,10 @@ import {
21 21
     PublishStreamOption,
22 22
     RemovePublishStreamOption,
23 23
     LiveTranscodingOption,
24
-    PositionOption
24
+    PositionOption,
25
+    BeautyOption,
26
+    LastmileProbeConfig,
27
+    CameraCapturerConfiguration
25 28
 } from "./types.d";
26 29
 
27 30
 
@@ -1119,12 +1122,13 @@ class RtcEngine {
1119 1122
      * 
1120 1123
      * This method sets the log file generated path and specified the log level.
1121 1124
      *
1122
-     * @param filepath
1123
-     * @param level
1125
+     * @param filepath string
1126
+     * @param level enum
1127
+     * @param maxfileSize integer (KB)
1124 1128
      * @returns Promise<{success, value}>
1125 1129
      */
1126
-    public static setLog(filepath: string, level: number): Promise<any> {
1127
-        return Agora.setLog(filepath, level)
1130
+    public static setLog(filepath: string, level: number, maxfileSize: number): Promise<any> {
1131
+        return Agora.setLog(filepath, level, maxfileSize)
1128 1132
     }
1129 1133
     
1130 1134
     /**
@@ -1136,8 +1140,8 @@ class RtcEngine {
1136 1140
      * @param data 
1137 1141
      * @returns Promise<{success, value}>
1138 1142
      */
1139
-    public static sendStreamMessage(uid: number, data: any): Promise<any> {
1140
-        return Agora.sendStreamMessage(uid, data);
1143
+    public static sendMessage(streamID: number, data: any, reliable: boolean, ordered: boolean): Promise<any> {
1144
+        return Agora.sendMessage({streamID, data, reliable, ordered});
1141 1145
     }
1142 1146
 
1143 1147
     /**
@@ -1199,6 +1203,170 @@ class RtcEngine {
1199 1203
      public static muteLocalAudioStream(enabled: boolean) {
1200 1204
         Agora.muteLocalAudioStream(enabled);
1201 1205
      }
1206
+
1207
+    /**
1208
+     * video pre-process/post-process
1209
+     * 
1210
+     * This method enables/disables image enhancement and sets the options.
1211
+     * 
1212
+     * @param enable boolean
1213
+     * @param options {@link BeautyOptions}
1214
+     * @returns Promise<{success, value}>
1215
+     */
1216
+    static setBeautyEffectOptions(enabled: boolean, options: BeautyOption): Promise<any> {
1217
+        return Agora.setBeautyEffectOptions(enabled, options);
1218
+    }
1219
+
1220
+    /**
1221
+     * set local voice change
1222
+     * 
1223
+     * This method changes local speaker voice with voiceChanger
1224
+     * 
1225
+     * @param voiceChanger integer
1226
+     * @voiceChanger value ranges [
1227
+     *          0: "The original voice",
1228
+     *          1: "An old man’s voice",
1229
+     *          2: "A little boy’s voice.",
1230
+     *          3: "A little girl’s voice.",
1231
+     *          4: "TBD",
1232
+     *          5: "Ethereal vocal effects.",
1233
+     *          6: "Hulk’s voice."
1234
+     *      ]
1235
+     * @returns Promise<{success, value}>
1236
+     */
1237
+    static setLocalVoiceChanger(voiceChanger: number): Promise<any> {
1238
+        return Agora.setLocalVoiceChanger(voiceChanger);
1239
+    }
1240
+
1241
+    /**
1242
+     * set the preset local voice reverberation effect.
1243
+     * 
1244
+     * This method sets the preset local voice reverberation effect.
1245
+     * 
1246
+     * @param preset integer
1247
+     * @returns Promise<{success, value}>
1248
+     */
1249
+    static setLocalVoiceReverbPreset(preset: number): Promise<any> {
1250
+        return Agora.setLocalVoiceReverbPreset(preset);
1251
+    }
1252
+
1253
+    /**
1254
+     * control stereo panning for remote users
1255
+     * 
1256
+     * This method enables/disables stereo panning for remote users.
1257
+     * 
1258
+     * @param enabled boolean
1259
+     * @returns Promise<{success, value}>
1260
+     */
1261
+    static enableSoundPositionIndication(enabled: boolean): Promise<any> {
1262
+        return Agora.enableSoundPositionIndication(enabled);
1263
+    }
1264
+
1265
+    /**
1266
+     * set the sound position of a remote user
1267
+     * 
1268
+     * This method sets the sound position of a remote user by uid
1269
+     * 
1270
+     * @param uid number | The ID of the remote user
1271
+     * @param pan float | The sound position of the remote user. The value ranges from -1.0 to 1.0
1272
+     * @pan 
1273
+     *  0.0: the remote sound comes from the front.
1274
+     *  -1.0: the remote sound comes from the left.
1275
+     *  1.0: the remote sound comes from the right.
1276
+     * @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.
1277
+     * @returns Promise<{success, value}>
1278
+     */
1279
+    static setRemoteVoicePosition(uid: number, pan: number, gain: number): Promise<any> {
1280
+        return Agora.setRemoteVoicePosition(uid, pan, gain)
1281
+    }
1282
+
1283
+    /**
1284
+     * start the lastmile probe test
1285
+     *
1286
+     * 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).
1287
+     * 
1288
+     * @param config LastmileProbeConfig {@link LastmileProbeConfig}
1289
+     * 
1290
+     * @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.
1291
+     * @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.
1292
+     * @returns Promise<{success, value}>
1293
+     */
1294
+    static startLastmileProbeTest(config: LastmileProbeConfig): Promise<any> {
1295
+        return Agora.startLastmileProbeTest(config);
1296
+    }
1297
+
1298
+    /**
1299
+     * stop the lastmile probe test
1300
+     *
1301
+     * This method stop the lastmile probe test.
1302
+     * 
1303
+     * @returns Promise<{success, value}>
1304
+     */
1305
+    static stopLastmileProbeTest(): Promise<any> {
1306
+        return Agora.stopLastmileProbeTest();
1307
+    }
1308
+
1309
+    /**
1310
+     * sets the priority of a remote user's media stream.
1311
+     * 
1312
+     * 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.
1313
+     * 
1314
+     * This method sets the priority of a remote user's media stream.
1315
+     * @param uid number
1316
+     * @param userPriority number | The value range is  [50 is "user's priority is hgih", 100 is "the default user's priority is normal"]
1317
+     * 
1318
+     * @returns Promise<{success, value}>
1319
+     */
1320
+    static setRemoteUserPriority(uid: number, userPrority: number): Promise<any> {
1321
+        return Agora.setRemoteUserPriority(uid, userPrority);
1322
+    }
1323
+
1324
+    /**
1325
+     * start an audio call test.
1326
+     * 
1327
+     * note:
1328
+     *   Call this method before joining a channel.
1329
+     *   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.
1330
+     *   In the Live-broadcast profile, only a host can call this method.
1331
+     * This method will start an audio call test with interval parameter.
1332
+     * 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.
1333
+     * 
1334
+     * @param interval number
1335
+     * 
1336
+     * @returns Promise<{success, value}>
1337
+     */
1338
+    static startEchoTestWithInterval(interval: number): Promise<any> {
1339
+        return Agora.startEchoTestWithInterval(interval)
1340
+    }
1341
+
1342
+    /**
1343
+     * set the camera capture preference.
1344
+     *
1345
+     * note:
1346
+     *  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:
1347
+     *  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.
1348
+     *  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.
1349
+     *  If you want better quality for the local video preview, we recommend setting config as CAPTURER_OUTPUT_PREFERENCE_PREVIEW(2).
1350
+     * 
1351
+     * This method will set the camera capture preference.
1352
+     * 
1353
+     * @param config {@link CameraCapturerConfiguration}
1354
+     * 
1355
+     * @returns Promise<{success, value}>
1356
+     */
1357
+    static setCameraCapturerConfiguration(config: CameraCapturerConfiguration): Promise<any> {
1358
+        return Agora.setCameraCapturerConfiguration(config);
1359
+    }
1360
+
1361
+    /**
1362
+     * set the log file size (KB).
1363
+     * TODO: setLogFileSize
1364
+     * This method will set the log file size
1365
+     */
1366
+
1367
+
1368
+    
1369
+
1202 1370
 }
1203 1371
 
1204 1372
 

+ 62
- 1
src/types.d.ts 查看文件

@@ -2,6 +2,15 @@ import { View, ViewProps } from 'react-native';
2 2
 
3 3
 declare module "IAgora"
4 4
 
5
+/**
6
+ * VideoEncoderConfig details
7
+ * @property width: number | The encoder video's width
8
+ * @property height: number | The encoder video's height
9
+ * @property bitrate: number | The encoder video's bitrate
10
+ * @property frameRate: number | The frameRate of encoder video
11
+ * @property orientationMode: number | The video orientation mode of the video
12
+ * @orientationMode value range is [0 is "mode adapative", 1 is "mode fixed landscape", 2 is "mode fixed portrait"]
13
+ */
5 14
 export interface VideoEncoderConfig {
6 15
   width: number,
7 16
   height: number,
@@ -29,7 +38,22 @@ export interface Option {
29 38
   mode: number,
30 39
   clientRole: number,
31 40
   audioProfile: number,
32
-  audioScenario: number
41
+  audioScenario: number,
42
+  beauty?: BeautyOption,
43
+  voice?: VoiceDecorator,
44
+}
45
+
46
+/**
47
+ * VoiceDecorator is decorate local audio voice
48
+ * 
49
+ * @property type: string | the range values ['changer' | 'reverbPreset'] This property is the identifier for audio voice decorator 
50
+ * @property value: number | the value for voice parameter option.
51
+ * type 'reverbPreset' range values: [0 is "off", 1 is "popular", 2 is "rnb", 3 is "rock", 4 is "hiphop", 5 is "vocal concert", 6 is "KTV", 7 is "studio"]
52
+ * type 'changer' range values: [0 is "off", 1 is "old man", 2 is "baby boy", 3 is "baby girl", 4 is "zhubajie", 5 is "ethereal", 6 is "hulk"]
53
+ */
54
+export interface VoiceDecorator {
55
+  type: string,
56
+  value: number
33 57
 }
34 58
 
35 59
 export interface PublisherConfig {
@@ -206,4 +230,41 @@ export interface RemovePublishStreamOption {
206 230
 export interface PositionOption {
207 231
   x: number,
208 232
   y: number
233
+}
234
+
235
+/**
236
+ * BeautyOption is setBeautyEffectOptions's option parameter
237
+ * @property lighteningContrastLevel: integer | lightening contrast level and the value ranges is low: 0, normal: 1, high: 2
238
+ * @property lighteningLevel: float | brightness level and the value ranges between 0.0 (original) and 1.0.
239
+ * @property smoothnessLevel: float | The sharpness level. The value ranges between 0.0 (original) and 1.0. This parameter is usually used to remove blemishes.
240
+ * @property rednessLevel: float | The redness level. The value ranges between 0.0 (original) and 1.0. This parameter adjusts the red saturation level.
241
+ */
242
+export interface BeautyOption {
243
+  lighteningContrastLevel: number,
244
+  lighteningLevel: number,
245
+  smoothnessLevel: number,
246
+  rednessLevel: number,
247
+}
248
+
249
+/**
250
+ * LastmileProbeConfig is startLastmileProbeTest's config parameter
251
+ * @property probeUplink: boolean | sets whether or not to test the uplink networks. some users, for example, the audience in a Live-broadcast channel, do not need such a test. true: enables the probe test. false: disables the probe test.
252
+ * @property probeDownlink: boolean | sets whether or not to probe the downlink network. true: enables the probe test. false: disables the probe test.
253
+ * @property expectedUplinkBitrate: integer | The expected maximum sending bitrate (Kbps) of the local user. The value ranges between 100 and 5000. We recommend setting this parameter according to the bitrate value set by setVideoEncoderConfiguration.
254
+ * @property expectedDownlinkBitrate: integer | The expected maximum receiving bitrate (Kbps) of the local user. The value ranges between 100 and 5000.
255
+ */
256
+export interface LastmileProbeConfig {
257
+  probeUplink: boolean,
258
+  probeDownlink: boolean,
259
+  expectedUplinkBitrate: number,
260
+  expectedDownlinkBitrate: number
261
+}
262
+
263
+
264
+/**
265
+ * CameraCapturerConfiguration is setCameraCapturerConfiguration's config parameter
266
+ * @property preference: number | The Camera capture preference and the value range is [0 is "(default) self-adapts the camera output parameters to the system performance and network conditions to balance CPU consumption and video preview quality.", 1 is "prioritizes the system performance. The SDK chooses the dimension and frame rate of the local camera capture closest to those set by setVideoEncoderConfiguration.", 2 is "prioritizes the local preview quality. The SDK chooses higher camera output parameters to improve the local video preview quality. This option requires extra CPU and RAM usage for video pre-processing."]
267
+ */
268
+export interface CameraCapturerConfiguration {
269
+  preference: number
209 270
 }