Commit 1de0c3be authored by Margaux Clerc's avatar Margaux Clerc

Fix automatically accept video call

parent a857dba2
......@@ -54,7 +54,6 @@ namespace Linphone.Controls
{
InitializeComponent();
microphone.IsChecked = LinphoneManager.Instance.Core.IsMicEnabled;
video.IsEnabled = LinphoneManager.Instance.IsVideoAvailable;
camera.IsEnabled = LinphoneManager.Instance.IsVideoAvailable && LinphoneManager.Instance.NumberOfCameras > 1;
}
......
......@@ -543,6 +543,7 @@ namespace Linphone.Model
{
Core.VideoDevice = frontCamera;
}
if (Core.IsInCall)
{
Call call = Core.CurrentCall;
......@@ -627,7 +628,14 @@ namespace Linphone.Model
else if (state == CallState.UpdatedByRemote)
{
Core.DeferCallUpdate(call);
bool remoteVideo = call.RemoteParams.IsVideoEnabled;
bool localVideo = call.CurrentParams.Copy().IsVideoEnabled;
bool autoAcceptCameraPolicy = Core.VideoPolicy.AutomaticallyAccept;
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy)
{
Core.DeferCallUpdate(call);
}
#pragma warning disable CS4014 // Dans la mesure où cet appel n'est pas attendu, l'exécution de la méthode actuelle continue avant la fin de l'appel
CoreDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
......
......@@ -195,6 +195,7 @@ namespace Linphone.Views
oneSecondTimer.Start();
statusIcon.Visibility = Visibility.Visible;
buttons.enabledVideo(false);
}
if (state == CallState.StreamsRunning)
{
......@@ -256,7 +257,7 @@ namespace Linphone.Views
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy)
{
AskVideoPopup(call);
}
}
}
}
refreshUI();
......@@ -269,7 +270,7 @@ namespace Linphone.Views
buttons.enabledVideo(false);
}
else {
if (LinphoneManager.Instance.Core.CurrentCall.CurrentParams.IsVideoEnabled)
if (LinphoneManager.Instance.Core.CurrentCall != null && LinphoneManager.Instance.Core.CurrentCall.CurrentParams.IsVideoEnabled)
{
buttons.checkedVideo(true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment