diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index 4eb0908bd..ca0751e36 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -70,6 +70,7 @@ } @property (nonatomic, retain) IBOutlet UIView* dialerView; +@property (nonatomic, retain) IBOutlet UIViewController* videoViewController; @property (nonatomic, retain) IBOutlet UITextField* address; @property (nonatomic, retain) IBOutlet UIButton* call; @property (nonatomic, retain) IBOutlet UIButton* hangup; diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 1281e71c6..789d5ac12 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -55,6 +55,7 @@ @synthesize back; @synthesize myTabBarController; +@synthesize videoViewController; //implements keypad behavior @@ -121,7 +122,7 @@ [mute initWithOnImage:[UIImage imageNamed:@"mic_muted.png"] offImage:[UIImage imageNamed:@"mic_active.png"] ]; [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; [erase initWithAddressField:address]; - mVideoViewController = [[VideoViewController alloc] initWithNibName:@"VideoViewController" + self.videoViewController = [[VideoViewController alloc] initWithNibName:@"VideoViewController" bundle:[NSBundle mainBundle]]; } @@ -153,7 +154,7 @@ [address resignFirstResponder]; [mDisplayName setText:@""]; //display name only relefvant - } + } return YES; } @@ -170,7 +171,17 @@ mIncomingCallActionSheet=nil; } } - [self dismissModalViewControllerAnimated:TRUE];//just in case + UIViewController* modalVC = self.modalViewController; + + if (modalVC != nil) { + // clear previous native window ids + if (modalVC == self.videoViewController) { + linphone_core_set_native_video_window_id([LinphoneManager getLc],0); + linphone_core_set_native_preview_window_id([LinphoneManager getLc],0); + } + + [self dismissModalViewControllerAnimated:TRUE];//just in case + } [address setHidden:false]; if (username) { @@ -235,7 +246,7 @@ } -(void) displayVideoCallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [self presentModalViewController:mVideoViewController animated:true]; + [self presentModalViewController:self.videoViewController animated:true]; } //status reporting -(void) displayStatus:(NSString*) message { diff --git a/Classes/VideoViewController.m b/Classes/VideoViewController.m index cb53434ec..6efc48580 100644 --- a/Classes/VideoViewController.m +++ b/Classes/VideoViewController.m @@ -68,6 +68,7 @@ } -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + linphone_core_set_native_video_window_id([LinphoneManager getLc],(unsigned long)mDisplay); linphone_core_set_native_preview_window_id([LinphoneManager getLc],(unsigned long)mPreview); diff --git a/submodules/linphone b/submodules/linphone index 40023c6a4..bd7e17664 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 40023c6a4d5062408604135925d908eaa15dfc5b +Subproject commit bd7e176640234d606fd4d02ad4f8c99597c940cd