|
@@ -67,6 +67,14 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
|
67
|
67
|
|
68
|
68
|
}
|
69
|
69
|
|
|
70
|
+RCT_EXPORT_METHOD(enableLastmileTest) {
|
|
71
|
+ [self.rtcEngine enableLastmileTest];
|
|
72
|
+}
|
|
73
|
+
|
|
74
|
+RCT_EXPORT_METHOD(disableLastmileTest) {
|
|
75
|
+ [self.rtcEngine disableLastmileTest];
|
|
76
|
+}
|
|
77
|
+
|
70
|
78
|
//加入房间
|
71
|
79
|
RCT_EXPORT_METHOD(joinChannel:(NSString *)channelName uid:(NSInteger)uid) {
|
72
|
80
|
//保存一下uid 在自定义视图使用
|
|
@@ -74,6 +82,12 @@ RCT_EXPORT_METHOD(joinChannel:(NSString *)channelName uid:(NSInteger)uid) {
|
74
|
82
|
[self.rtcEngine joinChannelByKey:nil channelName:channelName info:nil uid:uid joinSuccess:NULL];
|
75
|
83
|
}
|
76
|
84
|
|
|
85
|
+RCT_EXPORT_METHOD(joinChannelWithToken:(NSString *)token channelName:(NSString *)channelName uid:(NSInteger)uid) {
|
|
86
|
+ //保存一下uid 在自定义视图使用
|
|
87
|
+ [AgoraConst share].localUid = uid;
|
|
88
|
+ [self.rtcEngine joinChannelByKey:token channelName:channelName info:nil uid:uid joinSuccess:NULL];
|
|
89
|
+}
|
|
90
|
+
|
77
|
91
|
//离开频道
|
78
|
92
|
RCT_EXPORT_METHOD(leaveChannel){
|
79
|
93
|
[self.rtcEngine leaveChannel:^(AgoraRtcStats *stat) {
|
|
@@ -352,12 +366,57 @@ RCT_EXPORT_METHOD(getSdkVersion:(RCTResponseSenderBlock)callback){
|
352
|
366
|
- (void)rtcEngine:(AgoraRtcEngineKit *)engine didVideoMuted:(BOOL)muted byUid:(NSUInteger)uid {
|
353
|
367
|
NSMutableDictionary *params = @{}.mutableCopy;
|
354
|
368
|
params[@"type"] = @"onUserMuteVideo";
|
355
|
|
- params[@"uid"] = [NSNumber numberWithInteger:uid];;
|
|
369
|
+ params[@"uid"] = [NSNumber numberWithInteger:uid];
|
356
|
370
|
params[@"muted"] = @(muted);
|
357
|
371
|
|
358
|
372
|
[self sendEvent:params];
|
359
|
373
|
}
|
360
|
374
|
|
|
375
|
+- (void)rtcEngine:(AgoraRtcEngineKit *)engine localVideoStats:(AgoraRtcLocalVideoStats *)stats {
|
|
376
|
+ NSMutableDictionary *params = @{}.mutableCopy;
|
|
377
|
+ params[@"type"] = @"onLocalVideoStats";
|
|
378
|
+ params[@"sentBitrate"] = @(stats.sentBitrate);
|
|
379
|
+ params[@"sentFrameRate"] = @(stats.sentFrameRate);
|
|
380
|
+
|
|
381
|
+ [self sendEvent:params];
|
|
382
|
+}
|
|
383
|
+
|
|
384
|
+- (void)rtcEngine:(AgoraRtcEngineKit *)engine remoteVideoStats:(AgoraRtcRemoteVideoStats *)stats {
|
|
385
|
+ NSMutableDictionary *params = @{}.mutableCopy;
|
|
386
|
+ params[@"type"] = @"onRemoteVideoStats";
|
|
387
|
+ params[@"delay"] = @(stats.delay);
|
|
388
|
+ params[@"reivedBitrate"] = @(stats.receivedBitrate);
|
|
389
|
+ params[@"receivedFrameRate"] = @(stats.receivedFrameRate);
|
|
390
|
+ params[@"rxStreamType"] = @(stats.rxStreamType);
|
|
391
|
+
|
|
392
|
+ [self sendEvent:params];
|
|
393
|
+}
|
|
394
|
+
|
|
395
|
+- (void)rtcEngineConnectionDidLost:(AgoraRtcEngineKit *)engine {
|
|
396
|
+ NSMutableDictionary *params = @{}.mutableCopy;
|
|
397
|
+ params[@"type"] = @"onConnectionLost";
|
|
398
|
+
|
|
399
|
+ [self sendEvent:params];
|
|
400
|
+}
|
|
401
|
+
|
|
402
|
+- (void)rtcEngine:(AgoraRtcEngineKit *)engine networkQuality:(NSUInteger)uid txQuality:(AgoraRtcQuality)txQuality rxQuality:(AgoraRtcQuality)rxQuality {
|
|
403
|
+ NSMutableDictionary *params = @{}.mutableCopy;
|
|
404
|
+ params[@"type"] = @"onNetworkQuality";
|
|
405
|
+ params[@"uid"] = @(uid);
|
|
406
|
+ params[@"txQuality"] = @(txQuality);
|
|
407
|
+ params[@"rxQuality"] = @(rxQuality);
|
|
408
|
+
|
|
409
|
+ [self sendEvent:params];
|
|
410
|
+}
|
|
411
|
+
|
|
412
|
+- (void)rtcEngine:(AgoraRtcEngineKit *)engine lastmileQuality:(AgoraRtcQuality)quality {
|
|
413
|
+ NSMutableDictionary *params = @{}.mutableCopy;
|
|
414
|
+ params[@"type"] = @"onLastmileQuality";
|
|
415
|
+ params[@"quality"] = @(quality);
|
|
416
|
+
|
|
417
|
+ [self sendEvent:params];
|
|
418
|
+}
|
|
419
|
+
|
361
|
420
|
/*
|
362
|
421
|
音量提示回调
|
363
|
422
|
需要开启enableAudioVolumeIndication
|
|
@@ -419,4 +478,3 @@ RCT_EXPORT_METHOD(getSdkVersion:(RCTResponseSenderBlock)callback){
|
419
|
478
|
//}
|
420
|
479
|
|
421
|
480
|
@end
|
422
|
|
-
|