Skip to content

Commit

Permalink
Release RongCloud CallKit SDK 2.8.17
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Aug 31, 2017
1 parent fd58135 commit a9b4f63
Show file tree
Hide file tree
Showing 42 changed files with 2,440 additions and 420 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class RCDAudioFrameObserver : public agora::media::IAudioFrameObserver {
static RCDAudioFrameObserver *sharedObserver();
bool onRecordAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame);
bool onPlaybackAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame);
bool onMixedAudioFrame(agora::media::IAudioFrameObserver::AudioFrame &audioFrame);
bool onPlaybackAudioFrameBeforeMixing(unsigned int uid, agora::media::IAudioFrameObserver::AudioFrame& audioFrame);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
return &sharedObserver;
}


bool RCDAudioFrameObserver::onRecordAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame) {
return true;
}
bool RCDAudioFrameObserver::onPlaybackAudioFrame(agora::media::IAudioFrameObserver::AudioFrame& audioFrame) {
return true;
}
bool RCDAudioFrameObserver::onMixedAudioFrame(agora::media::IAudioFrameObserver::AudioFrame &audioFrame) {
return true;
}
bool RCDAudioFrameObserver::onPlaybackAudioFrameBeforeMixing(unsigned int uid, agora::media::IAudioFrameObserver::AudioFrame& audioFrame) {
NSString *userId = rcGetUserIdFromAgoraUID(uid);
NSLog(@"the user id is %@", userId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ - (UICollectionView *)userCollectionView {
- (void)inviteUserButtonClicked {
[self didTapInviteUserButton];

if (self.callSession.conversationType == ConversationType_DISCUSSION ||
self.callSession.conversationType == ConversationType_GROUP) {
if (self.callSession.isMultiCall) {
[self inviteNewUser];
} else {
NSLog(@"not support add user for conversation type %zd",
Expand All @@ -340,7 +339,7 @@ - (void)inviteNewUser {
[existUserIdList addObject:currentUserId];

__weak typeof(self) weakSelf = self;
RCCallSelectMemberViewController *selectViewController =
UIViewController *selectViewController =
[[RCCallSelectMemberViewController alloc]
initWithConversationType:self.conversationType
targetId:self.targetId
Expand All @@ -359,10 +358,10 @@ - (void)inviteNewUser {
});
}

- (void)resetLayout:(RCConversationType)conversationType
- (void)resetLayout:(BOOL)isMultiCall
mediaType:(RCCallMediaType)mediaType
callStatus:(RCCallStatus)callStatus {
[super resetLayout:conversationType
[super resetLayout:isMultiCall
mediaType:mediaType
callStatus:callStatus];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@
/*!
重新Layout布局
@param conversationType 会话类型
@param isMultiCall 是否多方通话
@param mediaType 通话媒体类型
@param callStatus 通话状态
@discussion 如果您需要重写并调整UI的布局,应该先调用super。
*/
- (void)resetLayout:(RCConversationType)conversationType
- (void)resetLayout:(BOOL)isMultiCall
mediaType:(RCCallMediaType)mediaType
callStatus:(RCCallStatus)callStatus;

Expand Down
73 changes: 52 additions & 21 deletions ios-rongcallkit/RongCallKit/Controller/RCCallBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ - (void)viewDidLoad {
object:nil];

[self registerTelephonyEvent];

[self addProximityMonitoringObserver];
// UIVisualEffect *blurEffect = [UIBlurEffect
// effectWithStyle:UIBlurEffectStyleDark];
// self.blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
Expand All @@ -155,7 +155,7 @@ - (void)viewDidLoad {
}

- (void)onOrientationChanged:(NSNotification *)notification {
[self resetLayout:self.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand All @@ -182,7 +182,7 @@ - (void)viewWillAppear:(BOOL)animated {
[self callDidDisconnect];
}

[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand Down Expand Up @@ -440,7 +440,7 @@ - (UIButton *)cameraCloseButton {
if (!_cameraCloseButton) {
_cameraCloseButton = [[UIButton alloc] init];

if (self.conversationType == ConversationType_PRIVATE) {
if (!self.callSession.isMultiCall) {
[_cameraCloseButton
setImage:[RCCallKitUtility imageFromVoIPBundle:@"voip/audio.png"]
forState:UIControlStateNormal];
Expand Down Expand Up @@ -486,7 +486,7 @@ - (UIButton *)cameraCloseButton {
- (void)cameraCloseButtonClicked {
[self didTapCameraCloseButton];

if (self.conversationType == ConversationType_PRIVATE) {
if (!self.callSession.isMultiCall) {
[self.callSession
setVideoView:nil
userId:[RCIMClient sharedRCIMClient].currentUserInfo.userId];
Expand All @@ -498,7 +498,7 @@ - (void)cameraCloseButtonClicked {
}

if ([self.callSession changeMediaType:RCCallMediaAudio]) {
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:RCCallMediaAudio
callStatus:self.callSession.callStatus];
}
Expand All @@ -512,7 +512,7 @@ - (UIButton *)cameraSwitchButton {
if (!_cameraSwitchButton) {
_cameraSwitchButton = [[UIButton alloc] init];

if (self.conversationType == ConversationType_PRIVATE) {
if (!self.callSession.isMultiCall) {
[_cameraSwitchButton
setImage:[RCCallKitUtility imageFromVoIPBundle:@"voip/camera.png"]
forState:UIControlStateNormal];
Expand Down Expand Up @@ -561,11 +561,11 @@ - (void)cameraSwitchButtonClicked {
}

#pragma mark - layout
- (void)resetLayout:(RCConversationType)conversationType
- (void)resetLayout:(BOOL)isMultiCall
mediaType:(RCCallMediaType)mediaType
callStatus:(RCCallStatus)callStatus {
if (mediaType == RCCallMediaAudio &&
conversationType == ConversationType_PRIVATE) {
!isMultiCall) {
self.backgroundView.backgroundColor = RongVoIPUIColorFromRGB(0x262e42);
self.backgroundView.hidden = NO;

Expand Down Expand Up @@ -686,7 +686,7 @@ - (void)resetLayout:(RCConversationType)conversationType
self.cameraSwitchButton.hidden = YES;

} else if (mediaType == RCCallMediaVideo &&
conversationType == ConversationType_PRIVATE) {
!isMultiCall) {
self.backgroundView.hidden = NO;

self.blurView.hidden = YES;
Expand Down Expand Up @@ -824,7 +824,7 @@ - (void)resetLayout:(RCConversationType)conversationType
}

} else if (mediaType == RCCallMediaAudio &&
conversationType != ConversationType_PRIVATE) {
isMultiCall) {
self.backgroundView.backgroundColor = RongVoIPUIColorFromRGB(0x262e42);
self.backgroundView.hidden = NO;

Expand Down Expand Up @@ -948,7 +948,7 @@ - (void)resetLayout:(RCConversationType)conversationType
self.cameraSwitchButton.hidden = YES;

} else if (mediaType == RCCallMediaVideo &&
conversationType != ConversationType_PRIVATE) {
isMultiCall) {
self.backgroundView.hidden = NO;

self.blurView.hidden = YES;
Expand Down Expand Up @@ -1103,7 +1103,7 @@ - (void)callDidConnect {

self.tipsLabel.text = @"";
[self startActiveTimer];
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand All @@ -1126,14 +1126,15 @@ - (void)callDidDisconnect {
self.tipsLabel.textColor = [UIColor whiteColor];

[self stopActiveTimer];
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)),
dispatch_get_main_queue(), ^{
[[RCCall sharedRCCall] dismissCallViewController:self];
});
[self removeProximityMonitoringObserver];
}

/*!
Expand All @@ -1142,7 +1143,7 @@ - (void)callDidDisconnect {
@param userId 对端的用户ID
*/
- (void)remoteUserDidRing:(NSString *)userId {
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand All @@ -1155,7 +1156,7 @@ - (void)remoteUserDidRing:(NSString *)userId {
*/
- (void)remoteUserDidInvite:(NSString *)userId
mediaType:(RCCallMediaType)mediaType {
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand All @@ -1168,7 +1169,7 @@ - (void)remoteUserDidInvite:(NSString *)userId
*/
- (void)remoteUserDidJoin:(NSString *)userId
mediaType:(RCCallMediaType)mediaType {
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand All @@ -1181,15 +1182,15 @@ - (void)remoteUserDidJoin:(NSString *)userId
*/
- (void)remoteUserDidChangeMediaType:(NSString *)userId
mediaType:(RCCallMediaType)mediaType {
if (self.callSession.conversationType == ConversationType_PRIVATE) {
if (!self.callSession.isMultiCall) {
if (mediaType == RCCallMediaAudio &&
self.callSession.mediaType != RCCallMediaAudio) {
if ([self.callSession changeMediaType:RCCallMediaAudio]) {
[self.callSession
setVideoView:nil
userId:[RCIMClient sharedRCIMClient].currentUserInfo.userId];
[self.callSession setVideoView:nil userId:self.callSession.targetId];
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:RCCallMediaAudio
callStatus:self.callSession.callStatus];
}
Expand All @@ -1207,7 +1208,7 @@ - (void)remoteUserDidChangeMediaType:(NSString *)userId
@param muted 是否关闭camera
*/
- (void)remoteUserDidDisableCamera:(BOOL)muted byUser:(NSString *)userId {
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand All @@ -1220,7 +1221,7 @@ - (void)remoteUserDidDisableCamera:(BOOL)muted byUser:(NSString *)userId {
*/
- (void)remoteUserDidLeft:(NSString *)userId
reason:(RCCallDisconnectReason)reason {
[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand Down Expand Up @@ -1304,6 +1305,36 @@ - (void)registerTelephonyEvent {
};
}

#pragma mark - proximity
- (void)addProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = YES;

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(proximityStatueChanged:)
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)removeProximityMonitoringObserver {
[UIDevice currentDevice].proximityMonitoringEnabled = NO;

[[NSNotificationCenter defaultCenter]
removeObserver:self
name:UIDeviceProximityStateDidChangeNotification
object:nil];
}

- (void)proximityStatueChanged:(NSNotificationCenter *)notification {
// if ([UIDevice currentDevice].proximityState) {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// } else {
// [[AVAudioSession sharedInstance]
// setCategory:AVAudioSessionCategoryPlayback error:nil];
// }
}

#pragma mark - outside callback
- (void)callWillConnect {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,19 @@ - (void)subVideoViewClicked {
[self.remotePortraitView
setImageURL:[NSURL URLWithString:userInfo.portraitUri]];

[self.callSession setVideoView:self.mainVideoView
userId:self.remoteUserInfo.userId];

[self.callSession
setVideoView:self.subVideoView
userId:[RCIMClient sharedRCIMClient].currentUserInfo.userId];
[self.callSession setVideoView:self.mainVideoView
userId:self.remoteUserInfo.userId];
}
}

- (void)resetLayout:(RCConversationType)conversationType
- (void)resetLayout:(BOOL)isMultiCall
mediaType:(RCCallMediaType)mediaType
callStatus:(RCCallStatus)callStatus {
[super resetLayout:conversationType
[super resetLayout:isMultiCall
mediaType:mediaType
callStatus:callStatus];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ - (void)backgroundViewClicked {
if (self.callSession.callStatus == RCCallActive) {
self.isFullScreen = !self.isFullScreen;

[self resetLayout:self.callSession.conversationType
[self resetLayout:self.callSession.isMultiCall
mediaType:self.callSession.mediaType
callStatus:self.callSession.callStatus];
}
Expand Down Expand Up @@ -360,8 +360,7 @@ - (UICollectionView *)userCollectionView {
- (void)inviteUserButtonClicked {
[self didTapInviteUserButton];

if (self.callSession.conversationType == ConversationType_DISCUSSION ||
self.callSession.conversationType) {
if (self.callSession.isMultiCall) {
[self inviteNewUser];
} else {
NSLog(@"not support add user for conversation type %zd",
Expand Down Expand Up @@ -396,10 +395,10 @@ - (void)inviteNewUser {
});
}

- (void)resetLayout:(RCConversationType)conversationType
- (void)resetLayout:(BOOL)isMultiCall
mediaType:(RCCallMediaType)mediaType
callStatus:(RCCallStatus)callStatus {
[super resetLayout:conversationType
[super resetLayout:isMultiCall
mediaType:mediaType
callStatus:callStatus];

Expand Down
2 changes: 1 addition & 1 deletion ios-rongcallkit/RongCallKit/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.8.16</string>
<string>2.8.17</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
Loading

0 comments on commit a9b4f63

Please sign in to comment.