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
 
82
 
83
 | Property                         | Type                                     | Description                           |
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
 | joinChannel                      | string channelName (房间名称)   number uid (用户设置的uid 传0系统会自动分配) | 加入房间                                  |
86
 | joinChannel                      | string channelName (房间名称)   number uid (用户设置的uid 传0系统会自动分配) | 加入房间                                  |
87
 | leaveChannel                     |                                          | 离开频道                                  |
87
 | leaveChannel                     |                                          | 离开频道                                  |
88
 | destroy                          |                                          | 销毁引擎实例                                |
88
 | destroy                          |                                          | 销毁引擎实例                                |

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

206
     @ReactMethod
206
     @ReactMethod
207
     public void init(ReadableMap options) {
207
     public void init(ReadableMap options) {
208
         AgoraManager.getInstance().init(getReactApplicationContext(), mRtcEventHandler, options);
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
     return @{};
34
     return @{};
35
 }
35
 }
36
 
36
 
37
+NSInteger defaultDataStreamId = -1;
38
+
37
 /**
39
 /**
38
  *  初始化AgoraKit
40
  *  初始化AgoraKit
39
  *
41
  *
62
     [self.rtcEngine setVideoProfile:[options[@"videoProfile"] integerValue]swapWidthAndHeight:[options[@"swapWidthAndHeight"]boolValue]];
64
     [self.rtcEngine setVideoProfile:[options[@"videoProfile"] integerValue]swapWidthAndHeight:[options[@"swapWidthAndHeight"]boolValue]];
63
     [self.rtcEngine setClientRole:[options[@"clientRole"] integerValue] withKey:nil];
65
     [self.rtcEngine setClientRole:[options[@"clientRole"] integerValue] withKey:nil];
64
 
66
 
67
+    // 创建默认数据通道
68
+    [self.rtcEngine createDataStream:&dataChannelId reliable:0 ordered:0];
69
+
65
     //Agora Native SDK 与 Agora Web SDK 间的互通
70
     //Agora Native SDK 与 Agora Web SDK 间的互通
66
     [self.rtcEngine enableWebSdkInteroperability:YES];
71
     [self.rtcEngine enableWebSdkInteroperability:YES];
67
 
72