Skip to content

Commit 3ef1d73

Browse files
authored
Merge pull request #10 from lixm1988/main
update rtc version to 4.1.0
2 parents 4911acb + 075dc4b commit 3ef1d73

File tree

3 files changed

+21
-35
lines changed

3 files changed

+21
-35
lines changed

Classes/Process/EaseCallManager.m

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ - (void)initWithConfig:(EaseCallConfig*)aConfig delegate:(id<EaseCallDelegate>)a
9191
self.agoraKit = [AgoraRtcEngineKit sharedEngineWithAppId:self.config.agoraAppId delegate:self];
9292
[self.agoraKit setChannelProfile:AgoraChannelProfileLiveBroadcasting];
9393
[self.agoraKit setClientRole:AgoraClientRoleBroadcaster];
94-
[self.agoraKit enableAudioVolumeIndication:1000 smooth:5 report_vad:NO];
94+
[self.agoraKit enableAudioVolumeIndication:1000 smooth:5 reportVad:NO];
9595
}
9696

9797
self.modal.curUserAccount = [[EMClient sharedClient] currentUsername];
@@ -240,7 +240,6 @@ - (BOOL)isBusy
240240

241241
- (void)clearRes
242242
{
243-
NSLog(@"cleraRes");
244243
if(self.modal.currentCall)
245244
{
246245
if(self.modal.currentCall.callType != EaseCallType1v1Audio)
@@ -252,8 +251,7 @@ - (void)clearRes
252251
dispatch_async(self.workQueue, ^{
253252
self.modal.hasJoinedChannel = NO;
254253
[self.agoraKit leaveChannel:^(AgoraChannelStats * _Nonnull stat) {
255-
NSLog(@"leaveChannel");
256-
//[[EMClient sharedClient] log:@"leaveChannel"];
254+
[[EMClient sharedClient] log:@"leaveChannel"];
257255
}];
258256
});
259257

@@ -402,6 +400,7 @@ - (void)setupVideo {
402400

403401
// Set up the configuration such as dimension, frame rate, bit rate and orientation
404402
[self.agoraKit setVideoEncoderConfiguration:self.config.encoderConfiguration];
403+
405404
}
406405

407406
- (EaseCallSingleViewController*)getSingleVC
@@ -444,7 +443,7 @@ - (void)callStateWillChangeTo:(EaseCallState)newState from:(EaseCallState)preSta
444443
- (void)messagesDidReceive:(NSArray *)aMessages
445444
{
446445
__weak typeof(self) weakself = self;
447-
dispatch_async(weakself.workQueue, ^{
446+
dispatch_async(dispatch_get_main_queue(), ^{
448447
for (EMChatMessage *msg in aMessages) {
449448
[weakself _parseMsg:msg];
450449
}
@@ -454,7 +453,7 @@ - (void)messagesDidReceive:(NSArray *)aMessages
454453
- (void)cmdMessagesDidReceive:(NSArray *)aCmdMessages
455454
{
456455
__weak typeof(self) weakself = self;
457-
dispatch_async(weakself.workQueue, ^{
456+
dispatch_async(dispatch_get_main_queue(), ^{
458457
for (EMChatMessage *msg in aCmdMessages) {
459458
[weakself _parseMsg:msg];
460459
}
@@ -685,10 +684,8 @@ - (void)_parseMsg:(EMChatMessage*)aMsg
685684
//[[EMClient sharedClient] log:[NSString stringWithFormat:@"parseAnswerMsgExt currentCallId:%@,state:%ld",weakself.modal.currentCall.callId,weakself.modal.state]];
686685
if(weakself.modal.currentCall && [weakself.modal.currentCall.callId isEqualToString:callId] && [weakself.modal.curDevId isEqualToString:callerDevId]) {
687686
if(weakself.modal.currentCall.callType == EaseCallTypeMulti) {
688-
dispatch_async(dispatch_get_main_queue(), ^{
689-
if(![result isEqualToString:kAcceptResult])
690-
[[weakself getMultiVC] removePlaceHolderForMember:from];
691-
});
687+
if(![result isEqualToString:kAcceptResult])
688+
[[weakself getMultiVC] removePlaceHolderForMember:from];
692689

693690
NSTimer* timer = [self.callTimerDic objectForKey:from];
694691
if(timer) {
@@ -702,9 +699,7 @@ - (void)_parseMsg:(EMChatMessage*)aMsg
702699
if([result isEqualToString:kAcceptResult]) {
703700

704701
if(isVideoToVoice && isVideoToVoice.boolValue) {
705-
dispatch_async(dispatch_get_main_queue(), ^{
706702
[weakself switchToVoice];
707-
});
708703
}
709704
weakself.modal.state = EaseCallState_Answering;
710705
}else
@@ -753,12 +748,9 @@ - (void)_parseMsg:(EMChatMessage*)aMsg
753748
// 仲裁为自己
754749
if([result isEqualToString:kAcceptResult]) {
755750
weakself.modal.state = EaseCallState_Answering;
756-
dispatch_async(dispatch_get_main_queue(), ^{
757-
758-
if(weakself.modal.currentCall.callType != EaseCallType1v1Audio)
759-
[weakself setupLocalVideo];
760-
[weakself fetchToken];
761-
});
751+
if(weakself.modal.currentCall.callType != EaseCallType1v1Audio)
752+
[weakself setupLocalVideo];
753+
[weakself fetchToken];
762754
}
763755
}else{
764756
// 已在其他端处理
@@ -775,10 +767,7 @@ - (void)_parseMsg:(EMChatMessage*)aMsg
775767
};
776768
void (^parseVideoToVoiceMsg)(NSDictionary*) = ^void (NSDictionary* ext){
777769
if(weakself.modal.currentCall && [weakself.modal.currentCall.callId isEqualToString:callId]) {
778-
dispatch_async(dispatch_get_main_queue(), ^{
779-
[weakself switchToVoice];
780-
});
781-
770+
[weakself switchToVoice];
782771
}
783772
};
784773
if([msgType isEqualToString:kMsgTypeValue]) {
@@ -1113,10 +1102,10 @@ - (void)rtcEngine:(AgoraRtcEngineKit *)engine firstRemoteAudioFrameOfUid:(NSUInt
11131102
NSLog(@"firstRemoteAudioFrameOfUid:%lu",(unsigned long)uid);
11141103
}
11151104

1116-
- (void)rtcEngine:(AgoraRtcEngineKit *)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(AgoraVideoRemoteStateReason)reason elapsed:(NSInteger)elapsed
1105+
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine
1106+
remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(AgoraVideoRemoteReason)reason elapsed:(NSInteger)elapsed
11171107
{
1118-
NSLog(@"staate:%d,reason:%d",state,reason);
1119-
if(reason == AgoraVideoRemoteStateReasonRemoteMuted && self.modal.currentCall.callType == EaseCallType1v1Video) {
1108+
if(reason == AgoraVideoRemoteReasonRemoteMuted && self.modal.currentCall.callType == EaseCallType1v1Video) {
11201109
__weak typeof(self) weakself = self;
11211110
dispatch_async(dispatch_get_main_queue(), ^{
11221111
[weakself switchToVoice];
@@ -1335,7 +1324,7 @@ - (void)joinChannel
13351324
if(weakself.modal.hasJoinedChannel)
13361325
[weakself.agoraKit leaveChannel:nil];
13371326
[weakself.agoraKit joinChannelByToken:weakself.modal.agoraRTCToken channelId:weakself.modal.currentCall.channelName info:@"" uid:self.modal.agoraUid joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) {
1338-
NSLog(@"join success");
1327+
[EMClient.sharedClient log:[NSString stringWithFormat:@"joinChannel:%@ success",channel]];
13391328
if([self.delegate respondsToSelector:@selector(callDidJoinChannel:uid:)]) {
13401329
[self.delegate callDidJoinChannel:channel uid:uid];
13411330
}

Classes/Store/EaseCallConfig.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ - (void)_initParams
6565
- (AgoraVideoEncoderConfiguration*)encoderConfiguration
6666
{
6767
if(!_encoderConfiguration) {
68-
_encoderConfiguration = [[AgoraVideoEncoderConfiguration alloc] initWithSize:AgoraVideoDimension640x360
69-
frameRate:AgoraVideoFrameRateFps15
70-
bitrate:AgoraVideoBitrateStandard
71-
orientationMode:AgoraVideoOutputOrientationModeAdaptative];
68+
_encoderConfiguration = [[AgoraVideoEncoderConfiguration alloc] initWithSize:AgoraVideoDimension640x360 frameRate:AgoraVideoFrameRateFps15 bitrate:AgoraVideoBitrateStandard orientationMode:AgoraVideoOutputOrientationModeAdaptative mirrorMode:AgoraVideoMirrorModeAuto];
7269
}
7370
return _encoderConfiguration;
7471
}

EaseCallKit.podspec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22
s.name = 'EaseCallKit'
3-
s.version = '3.9.9'
3+
s.version = '4.0.0'
44
s.summary = 'A Ease Call UIKit'
55
s.description = <<-DESC
66
‘‘一套使用环信IM以及声网SDK实现音视频呼叫的UI库,可以实现单人语音、视频呼叫,以及多人音视频通话’’
77
DESC
88
s.homepage = 'https://www.easemob.com'
9-
s.license = 'MIT'
9+
s.license = { :type => 'MIT' }
1010
s.author = { 'easemob' => '[email protected]' }
1111
s.source = { :git => 'https://github.com/easemob/easecallkitui-ios.git', :tag => s.version.to_s }
1212
s.frameworks = 'UIKit'
@@ -23,11 +23,11 @@ Pod::Spec.new do |s|
2323
s.resources = 'Assets/EaseCall.bundle'
2424
s.dependency 'HyphenateChat', '>= 3.9.0'
2525
s.dependency 'Masonry'
26-
s.dependency 'AgoraRtcEngine_iOS/RtcBasic','3.6.3'
26+
s.dependency 'AgoraRtcEngine_iOS/RtcBasic', '~>4.1.1'
2727
s.dependency 'SDWebImage'
2828

2929
s.pod_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64',
30-
'VALID_ARCHS' => 'arm64 armv7 x86_64'
30+
'VALID_ARCHS' => 'arm64 armv7 x86_64','ENABLE_BITCODE' => 'NO'
3131
}
32-
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64' }
32+
s.user_target_xcconfig = { 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64','ENABLE_BITCODE' => 'NO' }
3333
end

0 commit comments

Comments
 (0)