Commit 853f460d authored by Sylvain Berfini's avatar Sylvain Berfini

Change method to disable/enable video in app

parent df1fd44f
......@@ -17,7 +17,6 @@ namespace Linphone.Agents
public const string PictureUploadScriptURL = "https://linphone.org:444/upload.php";
public const string UserAgent = "LinphoneWP8";
public const bool EnableG729 = false;
public const bool EnableVideo = false;
// Do not enable these for releases !!!
#if DEBUG
......
......@@ -23,6 +23,8 @@ dtmf_player_amp=0.1
[video]
displaytype=MSWP8Dis
capture=0
display=0
[misc]
history_max_size=30
......
......@@ -22,8 +22,6 @@ namespace Linphone.Views
public InCallModel()
: base()
{
VideoButtonVisibility = Visibility.Visible;
CameraButtonVisibility = Visibility.Visible;
}
#region Actions
......@@ -261,9 +259,9 @@ namespace Linphone.Views
return this.videoButtonVisibility;
}
set
{
if (!LinphoneManager.Instance.LinphoneCore.IsVideoSupported()
|| !LinphoneManager.Instance.LinphoneCore.IsVideoEnabled())
{
bool isVideoEnabled = LinphoneManager.Instance.LinphoneCore.IsVideoSupported() && (LinphoneManager.Instance.LinphoneCore.IsVideoDisplayEnabled() || LinphoneManager.Instance.LinphoneCore.IsVideoCaptureEnabled());
if (!isVideoEnabled)
{
value = Visibility.Collapsed;
}
......@@ -285,10 +283,9 @@ namespace Linphone.Views
return this.cameraButtonVisibility;
}
set
{
if (!LinphoneManager.Instance.LinphoneCore.IsVideoSupported()
|| !LinphoneManager.Instance.LinphoneCore.IsVideoEnabled()
|| (LinphoneManager.Instance.NumberOfCameras < 2))
{
bool isVideoEnabled = LinphoneManager.Instance.LinphoneCore.IsVideoSupported() && (LinphoneManager.Instance.LinphoneCore.IsVideoDisplayEnabled() || LinphoneManager.Instance.LinphoneCore.IsVideoCaptureEnabled());
if (!isVideoEnabled || (LinphoneManager.Instance.NumberOfCameras < 2))
{
value = Visibility.Collapsed;
}
......
......@@ -19,7 +19,6 @@ namespace Linphone.Views
public Settings()
{
InitializeComponent();
Video.Visibility = Customs.EnableVideo ? Visibility.Visible : Visibility.Collapsed;
}
/// <summary>
......@@ -31,6 +30,8 @@ namespace Linphone.Views
// Create LinphoneCore if not created yet, otherwise do nothing
await LinphoneManager.Instance.InitLinphoneCore();
bool isVideoEnabled = LinphoneManager.Instance.LinphoneCore.IsVideoSupported() && (LinphoneManager.Instance.LinphoneCore.IsVideoDisplayEnabled() || LinphoneManager.Instance.LinphoneCore.IsVideoCaptureEnabled());
Video.Visibility = isVideoEnabled ? Visibility.Visible : Visibility.Collapsed;
}
private void account_Click_1(object sender, RoutedEventArgs e)
......
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