|
@@ -21,7 +21,6 @@ import io.agora.rtc.RtcEngine;
|
21
|
21
|
import static com.facebook.react.bridge.UiThreadUtil.runOnUiThread;
|
22
|
22
|
|
23
|
23
|
public class AgoraModule extends ReactContextBaseJavaModule {
|
24
|
|
- private int defaultStreamId = -1;
|
25
|
24
|
|
26
|
25
|
public AgoraModule(ReactApplicationContext context) {
|
27
|
26
|
|
|
@@ -206,7 +205,6 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
206
|
205
|
@ReactMethod
|
207
|
206
|
public void init(ReadableMap options) {
|
208
|
207
|
AgoraManager.getInstance().init(getReactApplicationContext(), mRtcEventHandler, options);
|
209
|
|
- this.defaultStreamId = AgoraManager.getInstance().mRtcEngine.createDataStream(false, false);
|
210
|
208
|
}
|
211
|
209
|
|
212
|
210
|
//进入房间
|
|
@@ -375,7 +373,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
|
375
|
373
|
// 发送数据
|
376
|
374
|
@ReactMethod
|
377
|
375
|
public void sendStreamMessage(int streamId, String message, Callback onError) {
|
378
|
|
- onError.invoke(AgoraManager.getInstance().mRtcEngine.sendStreamMessage(streamId > 0 ? streamId : this.defaultStreamId, message.getBytes()));
|
|
376
|
+ onError.invoke(AgoraManager.getInstance().mRtcEngine.sendStreamMessage(streamId, message.getBytes()));
|
379
|
377
|
}
|
380
|
378
|
|
381
|
379
|
//销毁引擎实例
|