Browse Source

移除创建默认数据流通道的参数配置

Riant 6 years ago
parent
commit
a32af64b1e
3 changed files with 7 additions and 2 deletions
  1. 1
    1
      README.md
  2. 1
    1
      android/src/main/java/com/syan/agora/AgoraModule.java
  3. 5
    0
      ios/RCTAgora/RCTAgora.m

+ 1
- 1
README.md View File

@@ -82,7 +82,7 @@ Add following to `AndroidManifest.xml`
82 82
 
83 83
 | Property                         | Type                                     | Description                           |
84 84
 | -------------------------------- | ---------------------------------------- | ------------------------------------- |
85
-| init                             | object {appid: 'agora注册的应用id', channelProfile: '频道模式', videoProfile: '视频模式', clientRole: '角色', swapWidthAndHeight: 'bool值', reliable: 'bool值 - 默认数据流通道创建参数,参考 createDataStream', ordered: 'bool值 - 默认数据流通道创建参数,参考 createDataStream'} | 初始化Agora引擎                            |
85
+| init                             | object {appid: 'agora注册的应用id', channelProfile: '频道模式', videoProfile: '视频模式', clientRole: '角色', swapWidthAndHeight: 'bool值'} | 初始化Agora引擎                            |
86 86
 | joinChannel                      | string channelName (房间名称)   number uid (用户设置的uid 传0系统会自动分配) | 加入房间                                  |
87 87
 | leaveChannel                     |                                          | 离开频道                                  |
88 88
 | destroy                          |                                          | 销毁引擎实例                                |

+ 1
- 1
android/src/main/java/com/syan/agora/AgoraModule.java View File

@@ -206,7 +206,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
206 206
     @ReactMethod
207 207
     public void init(ReadableMap options) {
208 208
         AgoraManager.getInstance().init(getReactApplicationContext(), mRtcEventHandler, options);
209
-        this.defaultStreamId = AgoraManager.getInstance().mRtcEngine.createDataStream(options.getBoolean("reliable"), options.getBoolean("ordered"));
209
+        this.defaultStreamId = AgoraManager.getInstance().mRtcEngine.createDataStream(false, false);
210 210
     }
211 211
 
212 212
     //进入房间

+ 5
- 0
ios/RCTAgora/RCTAgora.m View File

@@ -34,6 +34,8 @@ RCT_EXPORT_MODULE();
34 34
     return @{};
35 35
 }
36 36
 
37
+NSInteger defaultDataStreamId = -1;
38
+
37 39
 /**
38 40
  *  初始化AgoraKit
39 41
  *
@@ -62,6 +64,9 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
62 64
     [self.rtcEngine setVideoProfile:[options[@"videoProfile"] integerValue]swapWidthAndHeight:[options[@"swapWidthAndHeight"]boolValue]];
63 65
     [self.rtcEngine setClientRole:[options[@"clientRole"] integerValue] withKey:nil];
64 66
 
67
+    // 创建默认数据通道
68
+    [self.rtcEngine createDataStream:&dataChannelId reliable:0 ordered:0];
69
+
65 70
     //Agora Native SDK 与 Agora Web SDK 间的互通
66 71
     [self.rtcEngine enableWebSdkInteroperability:YES];
67 72