|
@@ -81,7 +81,7 @@ class RtcEngine {
|
81
|
81
|
if (react_native_1.Platform.OS === 'android') {
|
82
|
82
|
const _uid = this.Uint32ToInt32(uid);
|
83
|
83
|
let result = yield Agora.getUserInfoByUid(_uid);
|
84
|
|
- result.uid = this.Uint32ToInt32(result.uid);
|
|
84
|
+ result.uid = this.Int32ToUint32(result.uid);
|
85
|
85
|
return result;
|
86
|
86
|
}
|
87
|
87
|
return Agora.getUserInfoByUid(uid);
|
|
@@ -98,7 +98,7 @@ class RtcEngine {
|
98
|
98
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
99
|
99
|
if (react_native_1.Platform.OS === 'android') {
|
100
|
100
|
let result = yield Agora.getUserInfoByUserAccount(userAccount);
|
101
|
|
- result.uid = this.Uint32ToInt32(result.uid);
|
|
101
|
+ result.uid = this.Int32ToUint32(result.uid);
|
102
|
102
|
return result;
|
103
|
103
|
}
|
104
|
104
|
return Agora.getUserInfoByUserAccount(userAccount);
|
|
@@ -217,14 +217,10 @@ class RtcEngine {
|
217
|
217
|
'localUserRegistered'
|
218
|
218
|
].indexOf(eventType) != -1) {
|
219
|
219
|
AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
|
220
|
|
- const uint32_uid = new Uint32Array(1);
|
221
|
|
- uint32_uid[0] = args.uid;
|
222
|
|
- args.uid = uint32_uid[0];
|
|
220
|
+ args.uid = this.Int32ToUint32(args.uid);
|
223
|
221
|
// convert int32 streamId to uint32
|
224
|
222
|
if (args.streamId) {
|
225
|
|
- const uint32_streamId = new Uint32Array(1);
|
226
|
|
- uint32_streamId[0] = args.streamId;
|
227
|
|
- args.streamId = uint32_streamId[0];
|
|
223
|
+ args.streamId = this.Int32ToUint32(args.streamId);
|
228
|
224
|
}
|
229
|
225
|
listener(args);
|
230
|
226
|
});
|
|
@@ -232,12 +228,8 @@ class RtcEngine {
|
232
|
228
|
}
|
233
|
229
|
if (['userInfoUpdated'].indexOf(eventType) != -1) {
|
234
|
230
|
AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
|
235
|
|
- const uint32_uid = new Uint32Array(1);
|
236
|
|
- uint32_uid[0] = args.uid;
|
237
|
|
- args.uid = uint32_uid[0];
|
238
|
|
- const uint32_peer_uid = new Uint32Array(1);
|
239
|
|
- uint32_peer_uid[0] = args.peer.uid;
|
240
|
|
- args.peer.uid = uint32_peer_uid[0];
|
|
231
|
+ args.uid = this.Int32ToUint32(args.uid);
|
|
232
|
+ args.peer.uid = this.Int32ToUint32(args.peer.uid);
|
241
|
233
|
listener(args);
|
242
|
234
|
});
|
243
|
235
|
return;
|
|
@@ -245,9 +237,8 @@ class RtcEngine {
|
245
|
237
|
if (['audioVolumeIndication'].indexOf(eventType) != -1) {
|
246
|
238
|
AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
|
247
|
239
|
args.speakers.map((speaker) => {
|
248
|
|
- const uint32_uid = new Uint32Array(1);
|
249
|
|
- uint32_uid[0] = speaker.uid;
|
250
|
|
- return Object.assign({}, speaker, { uid: uint32_uid[0] });
|
|
240
|
+ const uid = this.Int32ToUint32(speaker.uid);
|
|
241
|
+ return Object.assign({}, speaker, { uid });
|
251
|
242
|
});
|
252
|
243
|
listener(args);
|
253
|
244
|
});
|
|
@@ -260,9 +251,7 @@ class RtcEngine {
|
260
|
251
|
'videoTransportStatsOfUid',
|
261
|
252
|
].indexOf(eventType) != -1) {
|
262
|
253
|
AgoraEventEmitter.addListener(`${RtcEngine.AG_PREFIX}${eventType}`, (args) => {
|
263
|
|
- const uint32_uid = new Uint32Array(1);
|
264
|
|
- uint32_uid[0] = args.stats.uid;
|
265
|
|
- args.stats.uid = uint32_uid[0];
|
|
254
|
+ args.stats.uid = this.Int32ToUint32(args.stats.uid);
|
266
|
255
|
listener(args);
|
267
|
256
|
});
|
268
|
257
|
return;
|
|
@@ -469,6 +458,14 @@ class RtcEngine {
|
469
|
458
|
int32[0] = num;
|
470
|
459
|
return int32[0];
|
471
|
460
|
}
|
|
461
|
+ /**
|
|
462
|
+ * @ignore Int32ToUint32
|
|
463
|
+ */
|
|
464
|
+ static Int32ToUint32(num) {
|
|
465
|
+ const uint32 = new Uint32Array(1);
|
|
466
|
+ uint32[0] = num;
|
|
467
|
+ return uint32[0];
|
|
468
|
+ }
|
472
|
469
|
/**
|
473
|
470
|
* mute specified remote video stream.
|
474
|
471
|
*
|