mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 09:09:21 +00:00
Smarter handling of video preview start/stop on ipad
This commit is contained in:
parent
556724a32d
commit
c696f7fae1
2 changed files with 24 additions and 11 deletions
|
|
@ -106,10 +106,23 @@
|
|||
[session startRunning];
|
||||
}
|
||||
|
||||
-(void) stopPreview:(id) a {
|
||||
@synchronized (self) {
|
||||
if (!session.running)
|
||||
return;
|
||||
[self.view removeFromSuperview];
|
||||
[session stopRunning];
|
||||
}
|
||||
}
|
||||
|
||||
-(void) startPreview:(id) a {
|
||||
[window addSubview:self.view];
|
||||
[window sendSubviewToBack:self.view];
|
||||
[session startRunning];
|
||||
@synchronized (self) {
|
||||
if (session.running)
|
||||
return;
|
||||
[window addSubview:self.view];
|
||||
[window sendSubviewToBack:self.view];
|
||||
[session startRunning];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -129,13 +142,10 @@
|
|||
if (show && !session.running) {
|
||||
[self performSelectorInBackground:@selector(startPreview:) withObject:nil];
|
||||
} else if (!show && session.running) {
|
||||
[self.view removeFromSuperview];
|
||||
[session stopRunning];
|
||||
[self performSelectorInBackground:@selector(stopPreview:) withObject:nil];
|
||||
}
|
||||
} else {
|
||||
if (session != nil)
|
||||
[session stopRunning];
|
||||
[self.view removeFromSuperview];
|
||||
[self stopPreview:nil];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -135,8 +135,8 @@
|
|||
[self updateCallAndBackButtons];
|
||||
}
|
||||
|
||||
-(void) viewWillDisappear:(BOOL)animated {
|
||||
[mMainScreenWithVideoPreview showPreview:NO];
|
||||
-(void) viewDidDisappear:(BOOL)animated {
|
||||
[super viewDidDisappear:animated];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -244,7 +244,7 @@
|
|||
|
||||
|
||||
-(void) displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
|
||||
|
||||
[mMainScreenWithVideoPreview showPreview:NO];
|
||||
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
|
||||
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
|
||||
// Create a new notification
|
||||
|
|
@ -304,6 +304,7 @@
|
|||
}
|
||||
|
||||
-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
|
||||
[mMainScreenWithVideoPreview showPreview:NO];
|
||||
if (self.presentedViewController != (UIViewController*)mIncallViewController) {
|
||||
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
|
||||
}
|
||||
|
|
@ -316,6 +317,7 @@
|
|||
}
|
||||
|
||||
-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
|
||||
[mMainScreenWithVideoPreview showPreview:NO];
|
||||
if (self.presentedViewController != (UIViewController*)mIncallViewController && (call == 0x0 ||
|
||||
linphone_call_get_dir(call)==LinphoneCallIncoming)){
|
||||
[self presentModalViewController:(UIViewController*)mIncallViewController animated:true];
|
||||
|
|
@ -336,6 +338,7 @@
|
|||
|
||||
|
||||
-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
|
||||
[mMainScreenWithVideoPreview showPreview:NO];
|
||||
[mIncallViewController displayVideoCall:call FromUI:viewCtrl
|
||||
forUser:username
|
||||
withDisplayName:displayName];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue