@byteplus/react-native-rtc 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/ClassHelper.java +0 -2
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCRoomEventHandlerImpl.java +37 -3
- package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCVideoEventHandlerImpl.java +19 -1
- package/package.json +1 -1
|
@@ -30,7 +30,6 @@ import com.ss.bytertc.engine.data.VideoDenoiseModeChangedReason;
|
|
|
30
30
|
import com.ss.bytertc.engine.data.VideoFrameInfo;
|
|
31
31
|
import com.ss.bytertc.engine.data.VideoSuperResolutionMode;
|
|
32
32
|
import com.ss.bytertc.engine.data.VideoSuperResolutionModeChangedReason;
|
|
33
|
-
import com.ss.bytertc.engine.handler.IRTCVideoEventHandler;
|
|
34
33
|
import com.ss.bytertc.engine.type.AudioDeviceType;
|
|
35
34
|
import com.ss.bytertc.engine.type.AudioDumpStatus;
|
|
36
35
|
import com.ss.bytertc.engine.type.AudioRecordingErrorCode;
|
|
@@ -67,7 +66,6 @@ import com.ss.bytertc.engine.UserInfo;
|
|
|
67
66
|
import com.ss.bytertc.engine.data.AVSyncState;
|
|
68
67
|
import com.ss.bytertc.engine.data.ForwardStreamEventInfo;
|
|
69
68
|
import com.ss.bytertc.engine.data.ForwardStreamStateInfo;
|
|
70
|
-
import com.ss.bytertc.engine.handler.IRTCRoomEventHandler;
|
|
71
69
|
import com.ss.bytertc.engine.type.LocalStreamStats;
|
|
72
70
|
import com.ss.bytertc.engine.type.MediaStreamType;
|
|
73
71
|
import com.ss.bytertc.engine.type.NetworkQualityStats;
|
package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCRoomEventHandlerImpl.java
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
package com.volcengine.reactnative.vertc.events;
|
|
5
5
|
|
|
6
|
+
import android.util.Log;
|
|
7
|
+
|
|
6
8
|
import com.ss.bytertc.engine.RTCStream;
|
|
7
9
|
import com.ss.bytertc.engine.SubscribeConfig;
|
|
8
10
|
import com.ss.bytertc.engine.UserInfo;
|
|
@@ -19,11 +21,17 @@ import com.ss.bytertc.engine.type.SetRoomExtraInfoResult;
|
|
|
19
21
|
import com.ss.bytertc.engine.type.StreamRemoveReason;
|
|
20
22
|
import com.ss.bytertc.engine.type.SubtitleErrorCode;
|
|
21
23
|
import com.ss.bytertc.engine.type.SubtitleMessage;
|
|
24
|
+
import com.ss.bytertc.engine.type.SubtitleMode;
|
|
22
25
|
import com.ss.bytertc.engine.type.SubtitleState;
|
|
23
26
|
import com.ss.bytertc.engine.type.UserVisibilityChangeError;
|
|
24
27
|
import com.volcengine.VolcApiEngine.BeanFactory;
|
|
25
28
|
|
|
29
|
+
import java.lang.reflect.Array;
|
|
26
30
|
import java.nio.ByteBuffer;
|
|
31
|
+
import java.util.ArrayList;
|
|
32
|
+
import java.util.Arrays;
|
|
33
|
+
import java.util.HashMap;
|
|
34
|
+
import java.util.Map;
|
|
27
35
|
|
|
28
36
|
public class IRTCRoomEventHandlerImpl extends IRTCRoomEventHandler implements BeanFactory.EventReceiver {
|
|
29
37
|
public BeanFactory.EventEmitter ee;
|
|
@@ -184,12 +192,27 @@ public class IRTCRoomEventHandlerImpl extends IRTCRoomEventHandler implements Be
|
|
|
184
192
|
|
|
185
193
|
@Override
|
|
186
194
|
public void onForwardStreamStateChanged(ForwardStreamStateInfo[] stateInfos) {
|
|
187
|
-
|
|
195
|
+
ArrayList<Object> res = new ArrayList<>();
|
|
196
|
+
for (ForwardStreamStateInfo info : stateInfos) {
|
|
197
|
+
Map<String, Object> data = new HashMap<>();
|
|
198
|
+
data.put("roomId", info.roomId);
|
|
199
|
+
data.put("state", info.state);
|
|
200
|
+
data.put("error", info.error);
|
|
201
|
+
res.add(data);
|
|
202
|
+
}
|
|
203
|
+
this.ee.sendEvent("onForwardStreamStateChanged", res);
|
|
188
204
|
}
|
|
189
205
|
|
|
190
206
|
@Override
|
|
191
207
|
public void onForwardStreamEvent(ForwardStreamEventInfo[] eventInfos) {
|
|
192
|
-
|
|
208
|
+
ArrayList<Object> res = new ArrayList<>();
|
|
209
|
+
for (ForwardStreamEventInfo info : eventInfos) {
|
|
210
|
+
Map<String, Object> data = new HashMap<>();
|
|
211
|
+
data.put("roomId", info.roomId);
|
|
212
|
+
data.put("event", info.event);
|
|
213
|
+
res.add(data);
|
|
214
|
+
}
|
|
215
|
+
this.ee.sendEvent("onForwardStreamEvent", res);
|
|
193
216
|
}
|
|
194
217
|
|
|
195
218
|
@Override
|
|
@@ -219,6 +242,17 @@ public class IRTCRoomEventHandlerImpl extends IRTCRoomEventHandler implements Be
|
|
|
219
242
|
|
|
220
243
|
@Override
|
|
221
244
|
public void onSubtitleMessageReceived(SubtitleMessage[] subtitles) {
|
|
222
|
-
|
|
245
|
+
ArrayList<Object> res = new ArrayList<>();
|
|
246
|
+
for (SubtitleMessage subtitle : subtitles) {
|
|
247
|
+
Map<String, Object> data = new HashMap<>();
|
|
248
|
+
data.put("userId", subtitle.userId);
|
|
249
|
+
data.put("mode", subtitle.mode);
|
|
250
|
+
data.put("text", subtitle.text);
|
|
251
|
+
data.put("language", subtitle.language);
|
|
252
|
+
data.put("sequence", subtitle.sequence);
|
|
253
|
+
data.put("definite", subtitle.definite);
|
|
254
|
+
res.add(data);
|
|
255
|
+
}
|
|
256
|
+
this.ee.sendEvent("onSubtitleMessageReceived", res);
|
|
223
257
|
}
|
|
224
258
|
}
|
package/android/src/main/java/com/volcengine/reactnative/vertc/events/IRTCVideoEventHandlerImpl.java
CHANGED
|
@@ -10,6 +10,7 @@ import com.ss.bytertc.engine.data.AudioPlaybackDevice;
|
|
|
10
10
|
import com.ss.bytertc.engine.data.AudioRoute;
|
|
11
11
|
import com.ss.bytertc.engine.data.DataMessageSourceType;
|
|
12
12
|
import com.ss.bytertc.engine.data.DeadLockMsg;
|
|
13
|
+
import com.ss.bytertc.engine.data.ForwardStreamStateInfo;
|
|
13
14
|
import com.ss.bytertc.engine.data.FrameUpdateInfo;
|
|
14
15
|
import com.ss.bytertc.engine.data.LocalAudioPropertiesInfo;
|
|
15
16
|
import com.ss.bytertc.engine.data.LocalAudioStreamError;
|
|
@@ -64,6 +65,9 @@ import com.volcengine.VolcApiEngine.BeanFactory;
|
|
|
64
65
|
import org.json.JSONObject;
|
|
65
66
|
|
|
66
67
|
import java.nio.ByteBuffer;
|
|
68
|
+
import java.util.ArrayList;
|
|
69
|
+
import java.util.HashMap;
|
|
70
|
+
import java.util.Map;
|
|
67
71
|
|
|
68
72
|
public class IRTCVideoEventHandlerImpl extends IRTCVideoEventHandler implements BeanFactory.EventReceiver {
|
|
69
73
|
public BeanFactory.EventEmitter ee;
|
|
@@ -339,7 +343,21 @@ public class IRTCVideoEventHandlerImpl extends IRTCVideoEventHandler implements
|
|
|
339
343
|
|
|
340
344
|
@Override
|
|
341
345
|
public void onLocalAudioPropertiesReport(LocalAudioPropertiesInfo[] audioPropertiesInfos) {
|
|
342
|
-
|
|
346
|
+
ArrayList<Object> res = new ArrayList<>();
|
|
347
|
+
for (LocalAudioPropertiesInfo info : audioPropertiesInfos) {
|
|
348
|
+
Map<String, Object> data = new HashMap<>();
|
|
349
|
+
Map<String, Object> props = new HashMap<>();
|
|
350
|
+
data.put("streamIndex", info.streamIndex);
|
|
351
|
+
props.put("linearVolume", info.audioPropertiesInfo.linearVolume);
|
|
352
|
+
props.put("nonlinearVolume", info.audioPropertiesInfo.nonlinearVolume);
|
|
353
|
+
props.put("spectrum", info.audioPropertiesInfo.spectrum);
|
|
354
|
+
props.put("vad", info.audioPropertiesInfo.vad);
|
|
355
|
+
props.put("voicePitch", info.audioPropertiesInfo.voicePitch);
|
|
356
|
+
props.put("deviceLoopDelay", info.audioPropertiesInfo.deviceLoopDelay);
|
|
357
|
+
data.put("audioPropertiesInfo", props);
|
|
358
|
+
res.add(data);
|
|
359
|
+
}
|
|
360
|
+
this.ee.sendEvent("onLocalAudioPropertiesReport", res);
|
|
343
361
|
}
|
|
344
362
|
|
|
345
363
|
@Override
|