call: reset video fullscreen when reentering view

This commit is contained in:
Gautier Pelloux-Prayer 2016-01-22 16:35:12 +01:00
parent 491c4dad83
commit 07911a0d79

View file

@ -138,9 +138,6 @@ static UICompositeViewDescription *compositeDescription = nil;
[self updateUnreadMessage:FALSE]; [self updateUnreadMessage:FALSE];
// Update on show // Update on show
LinphoneCall *call = linphone_core_get_current_call(LC);
LinphoneCallState state = (call != NULL) ? linphone_call_get_state(call) : 0;
[self callUpdate:call state:state animated:FALSE];
[self hideRoutes:TRUE animated:FALSE]; [self hideRoutes:TRUE animated:FALSE];
[self hideOptions:TRUE animated:FALSE]; [self hideOptions:TRUE animated:FALSE];
[self hidePad:TRUE animated:FALSE]; [self hidePad:TRUE animated:FALSE];
@ -184,6 +181,11 @@ static UICompositeViewDescription *compositeDescription = nil;
[PhoneMainView.instance setVolumeHidden:TRUE]; [PhoneMainView.instance setVolumeHidden:TRUE];
hiddenVolume = TRUE; hiddenVolume = TRUE;
// we must wait didAppear to reset fullscreen mode because we cannot change it in viewwillappear
LinphoneCall *call = linphone_core_get_current_call(LC);
LinphoneCallState state = (call != NULL) ? linphone_call_get_state(call) : 0;
[self callUpdate:call state:state animated:FALSE];
} }
- (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated {
@ -395,7 +397,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
[self disableVideoDisplay:FALSE animated:animated]; [self disableVideoDisplay:FALSE animated:animated];
} }
- (void)displayTableCall:(BOOL)animated { - (void)displayAudioCall:(BOOL)animated {
[self disableVideoDisplay:TRUE animated:animated]; [self disableVideoDisplay:TRUE animated:animated];
} }
@ -522,6 +524,16 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
return; return;
} }
BOOL shouldDisableVideo =
(!currentCall || !linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall)));
if (videoHidden != shouldDisableVideo) {
if (!shouldDisableVideo) {
[self displayVideoCall:animated];
} else {
[self displayAudioCall:animated];
}
}
if (state != LinphoneCallPausedByRemote) { if (state != LinphoneCallPausedByRemote) {
_pausedByRemoteView.hidden = YES; _pausedByRemoteView.hidden = YES;
} }
@ -532,10 +544,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
case LinphoneCallConnected: case LinphoneCallConnected:
case LinphoneCallStreamsRunning: { case LinphoneCallStreamsRunning: {
// check video // check video
if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { if (!linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
[self displayVideoCall:animated];
} else {
[self displayTableCall:animated];
const LinphoneCallParams *param = linphone_call_get_current_params(call); const LinphoneCallParams *param = linphone_call_get_current_params(call);
const LinphoneCallAppData *callAppData = const LinphoneCallAppData *callAppData =
(__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call)); (__bridge const LinphoneCallAppData *)(linphone_call_get_user_pointer(call));
@ -567,15 +576,16 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
linphone_core_defer_call_update(LC, call); linphone_core_defer_call_update(LC, call);
[self displayAskToEnableVideoCall:call]; [self displayAskToEnableVideoCall:call];
} else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) { } else if (linphone_call_params_video_enabled(current) && !linphone_call_params_video_enabled(remote)) {
[self displayTableCall:animated]; [self displayAudioCall:animated];
} }
break; break;
} }
case LinphoneCallPausing: case LinphoneCallPausing:
case LinphoneCallPaused: case LinphoneCallPaused:
[self displayTableCall:animated]; [self displayAudioCall:animated];
break; break;
case LinphoneCallPausedByRemote: case LinphoneCallPausedByRemote:
[self displayAudioCall:animated];
if (call == linphone_core_get_current_call(LC)) { if (call == linphone_core_get_current_call(LC)) {
_pausedByRemoteView.hidden = NO; _pausedByRemoteView.hidden = NO;
} }