Skip to content

Commit

Permalink
Release RongCloud CallKit SDK 2.8.15
Browse files Browse the repository at this point in the history
  • Loading branch information
RongRobot committed Aug 11, 2017
1 parent 1374aa3 commit f1c7afb
Show file tree
Hide file tree
Showing 36 changed files with 2,324 additions and 417 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 @@ -145,7 +145,7 @@ - (void)viewDidLoad {
object:nil];

[self registerTelephonyEvent];

[self addProximityMonitoringObserver];
// UIVisualEffect *blurEffect = [UIBlurEffect
// effectWithStyle:UIBlurEffectStyleDark];
// self.blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
Expand Down Expand Up @@ -1134,6 +1134,7 @@ - (void)callDidDisconnect {
dispatch_get_main_queue(), ^{
[[RCCall sharedRCCall] dismissCallViewController:self];
});
[self removeProximityMonitoringObserver];
}

/*!
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,11 +143,12 @@ - (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];
}
}

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.14</string>
<string>2.8.15</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
38 changes: 2 additions & 36 deletions ios-rongcallkit/RongCallKit/RCCall.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,13 @@ - (BOOL)preCheckForStartCall:(RCCallMediaType)mediaType {
}
}

- (void)presentCallViewController:(UIViewController *)viewController {
- (void)presentCallViewController:(UIViewController *)viewController{
[[[UIApplication sharedApplication] keyWindow] endEditing:YES];
UIWindow *activityWindow =
[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
activityWindow.windowLevel = UIWindowLevelAlert;
activityWindow.rootViewController = viewController;
[activityWindow makeKeyAndVisible];
[self addProximityMonitoringObserver];
CATransition *animation = [CATransition animation];
[animation setDuration:0.3];
animation.type = kCATransitionMoveIn; //可更改为其他方式
Expand All @@ -252,9 +251,6 @@ - (void)presentCallViewController:(UIViewController *)viewController {
}

- (void)dismissCallViewController:(UIViewController *)viewController {
if (self.currentCallSession == nil) {
[self removeProximityMonitoringObserver];
}

if ([viewController isKindOfClass:[RCCallBaseViewController class]]) {
UIViewController *rootVC = viewController;
Expand Down Expand Up @@ -437,36 +433,6 @@ - (void)loadErrorAlertWithConfirm:(NSString *)title
[alert show];
}

#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];
// }
}

- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
Expand Down
31 changes: 31 additions & 0 deletions ios-rongcallkit/RongCallKit/Utility/RCCallFloatingBoard.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ - (void)initBoard {
selector:@selector(onOrientationChanged:)
name:UIApplicationDidChangeStatusBarOrientationNotification
object:nil];
[self addProximityMonitoringObserver];
}

- (void)registerTelephonyEvent {
Expand Down Expand Up @@ -418,6 +419,7 @@ - (void)callDidDisconnect {
withObject:nil
afterDelay:2];
[RCCallKitUtility clearScreenForceOnStatus];
[self removeProximityMonitoringObserver];
}

/*!
Expand Down Expand Up @@ -513,4 +515,33 @@ - (void)shouldStopAlertAndRing {
*/
- (void)errorDidOccur:(RCCallErrorCode)error {
}

- (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];
// }
}
@end
6 changes: 6 additions & 0 deletions ios-rongcallkit/RongCallKit/Utility/RCCallKitUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ + (NSString *)getReadableStringForMessageCell:
hangupReasonString = NSLocalizedStringFromTable(@"VoIPCallRemoteNoResponse",
@"RongCloudKit", nil);
break;
case RCCallDisconnectReasonAddToBlackList:
hangupReasonString = NSLocalizedStringFromTable(@"VoIPCallHasReject", @"RongCloudKit", nil);
break;
default:
hangupReasonString = [self getGeneralReadableString:hangupReason];
break;
Expand Down Expand Up @@ -146,6 +149,9 @@ + (NSString *)getReadableStringForCallViewController:
hangupReasonString = NSLocalizedStringFromTable(
@"VoIPCallRemoteBusyLineAndShowAdvice", @"RongCloudKit", nil);
break;
case RCCallDisconnectReasonAddToBlackList:
hangupReasonString = NSLocalizedStringFromTable(@"VoIP_Rejected_By_Blacklist", @"RongCloudKit", nil);
break;
default:
hangupReasonString = [self getGeneralReadableString:hangupReason];
break;
Expand Down
Binary file not shown.
Loading

0 comments on commit f1c7afb

Please sign in to comment.