mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
fix switch video
This commit is contained in:
parent
7e6a0f9e75
commit
f8dda2f1a7
3 changed files with 14 additions and 25 deletions
|
|
@ -417,6 +417,13 @@ import AVFoundation
|
|||
}
|
||||
}
|
||||
|
||||
@objc func acceptVideo(call: OpaquePointer, confirm: Bool) {
|
||||
let sCall = Call.getSwiftObject(cObject: call)
|
||||
let params = try? lc?.createCallParams(call: sCall)
|
||||
params?.videoEnabled = confirm
|
||||
try? sCall.acceptUpdate(params: params)
|
||||
}
|
||||
|
||||
func onGlobalStateChanged(core: Core, state: GlobalState, message: String) {
|
||||
if (state == .On) {
|
||||
actionsToPerformOnceWhenCoreIsOn.forEach {
|
||||
|
|
|
|||
|
|
@ -685,9 +685,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
onCancelClick:^() {
|
||||
LOGI(@"User declined video proposal");
|
||||
if (call == linphone_core_get_current_call(LC)) {
|
||||
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
|
||||
linphone_call_accept_update(call, params);
|
||||
linphone_call_params_unref(params);
|
||||
[CallManager.instance acceptVideoWithCall:call confirm:FALSE];
|
||||
[videoDismissTimer invalidate];
|
||||
videoDismissTimer = nil;
|
||||
}
|
||||
|
|
@ -695,10 +693,7 @@ static void hideSpinner(LinphoneCall *call, void *user_data) {
|
|||
onConfirmationClick:^() {
|
||||
LOGI(@"User accept video proposal");
|
||||
if (call == linphone_core_get_current_call(LC)) {
|
||||
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
|
||||
linphone_call_params_enable_video(params, TRUE);
|
||||
linphone_call_accept_update(call, params);
|
||||
linphone_call_params_unref(params);
|
||||
[CallManager.instance acceptVideoWithCall:call confirm:TRUE];
|
||||
[videoDismissTimer invalidate];
|
||||
videoDismissTimer = nil;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -649,21 +649,15 @@
|
|||
LOGI(@"User declined video proposal");
|
||||
if (call != linphone_core_get_current_call(LC))
|
||||
return;
|
||||
|
||||
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
|
||||
linphone_call_accept_update(call, params);
|
||||
linphone_call_params_unref(params);
|
||||
[CallManager.instance acceptVideoWithCall:call confirm:FALSE];
|
||||
} else if ([response.actionIdentifier isEqual:@"Accept"]) {
|
||||
LOGI(@"User accept video proposal");
|
||||
if (call != linphone_core_get_current_call(LC))
|
||||
return;
|
||||
|
||||
[[UNUserNotificationCenter currentNotificationCenter] removeAllDeliveredNotifications];
|
||||
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
|
||||
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
|
||||
linphone_call_params_enable_video(params, TRUE);
|
||||
linphone_call_accept_update(call, params);
|
||||
linphone_call_params_unref(params);
|
||||
[PhoneMainView.instance changeCurrentView:CallView.compositeViewDescription];
|
||||
[CallManager.instance acceptVideoWithCall:call confirm:TRUE];
|
||||
} else if ([response.actionIdentifier isEqual:@"Confirm"]) {
|
||||
if (linphone_core_get_current_call(LC) == call)
|
||||
linphone_call_set_authentication_token_verified(call, YES);
|
||||
|
|
@ -703,21 +697,14 @@
|
|||
LOGI(@"User declined video proposal");
|
||||
if (call != linphone_core_get_current_call(LC))
|
||||
return;
|
||||
|
||||
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
|
||||
linphone_call_accept_update(call, params);
|
||||
linphone_call_params_unref(params);
|
||||
[CallManager.instance acceptVideoWithCall:call confirm:FALSE];
|
||||
[videoDismissTimer invalidate];
|
||||
}
|
||||
onConfirmationClick:^() {
|
||||
LOGI(@"User accept video proposal");
|
||||
if (call != linphone_core_get_current_call(LC))
|
||||
return;
|
||||
|
||||
LinphoneCallParams *params = linphone_core_create_call_params(LC, call);
|
||||
linphone_call_params_enable_video(params, TRUE);
|
||||
linphone_call_accept_update(call, params);
|
||||
linphone_call_params_unref(params);
|
||||
[CallManager.instance acceptVideoWithCall:call confirm:TRUE];
|
||||
[videoDismissTimer invalidate];
|
||||
}
|
||||
inController:PhoneMainView.instance];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue