diff --git a/projects/Demo/Demo/OnvifPage.xaml b/projects/Demo/Demo/OnvifPage.xaml index 3612a360..963f23dc 100644 --- a/projects/Demo/Demo/OnvifPage.xaml +++ b/projects/Demo/Demo/OnvifPage.xaml @@ -5,13 +5,13 @@ x:Class="Demo.OnvifPage"> - + - - - - - + + + + + @@ -23,13 +23,13 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/projects/Demo/Demo/OnvifPage.xaml.cs b/projects/Demo/Demo/OnvifPage.xaml.cs index f41d34bf..ce328034 100644 --- a/projects/Demo/Demo/OnvifPage.xaml.cs +++ b/projects/Demo/Demo/OnvifPage.xaml.cs @@ -2,6 +2,7 @@ using LibVLCSharp.Shared; using System; using System.Net.Http; +using System.Threading.Tasks; using Xamarin.Forms; using Xamarin.Forms.Xaml; @@ -69,11 +70,6 @@ namespace Demo } } - private ImageSource SetImage(string image) - { - return ImageSource.FromResource($"Demo.wwwroot.images.{image}"); - } - private void Back_Clicked(object sender, EventArgs e) { if (this.videoView.MediaPlayer.IsPlaying) @@ -100,17 +96,32 @@ namespace Demo if (this.videoView?.MediaPlayer != null) { this.videoView.MediaPlayer.Volume = (int)e.NewValue; - if (this.videoView.MediaPlayer.Volume == 0) + if (this.videoView.MediaPlayer.Volume == 0 && this.mute.Source.ClassId != "mute.png") { this.mute.Source = SetImage("mute.png"); } - else + else if (this.mute.Source.ClassId != "volume.png") { this.mute.Source = SetImage("volume.png"); } } } + private void Mute_Clicked(object sender, EventArgs e) + { + if (this.videoView?.MediaPlayer != null) + { + if (this.videoView.MediaPlayer.Volume == 0) + { + this.volume.Value = 50; + } + else + { + this.volume.Value = 0; + } + } + } + private void Control_Pressed(object sender, EventArgs e) { var videoUrl = new Url(this._url); @@ -136,5 +147,12 @@ namespace Demo var client = new HttpClient(); client.GetAsync(url).Wait(); } + + private ImageSource SetImage(string image) + { + var result = ImageSource.FromResource($"Demo.wwwroot.images.{image}"); + result.ClassId = image; + return result; + } } } \ No newline at end of file diff --git a/projects/Demo/Demo/wwwroot/images/down.png b/projects/Demo/Demo/wwwroot/images/down.png index e014e60f..30c959c7 100644 Binary files a/projects/Demo/Demo/wwwroot/images/down.png and b/projects/Demo/Demo/wwwroot/images/down.png differ diff --git a/projects/Demo/Demo/wwwroot/images/left.png b/projects/Demo/Demo/wwwroot/images/left.png index ed205546..ba0184ea 100644 Binary files a/projects/Demo/Demo/wwwroot/images/left.png and b/projects/Demo/Demo/wwwroot/images/left.png differ diff --git a/projects/Demo/Demo/wwwroot/images/right.png b/projects/Demo/Demo/wwwroot/images/right.png index e18e43e2..d95576a6 100644 Binary files a/projects/Demo/Demo/wwwroot/images/right.png and b/projects/Demo/Demo/wwwroot/images/right.png differ diff --git a/projects/Demo/Demo/wwwroot/images/up.png b/projects/Demo/Demo/wwwroot/images/up.png index 90c0f0e2..336b4ec4 100644 Binary files a/projects/Demo/Demo/wwwroot/images/up.png and b/projects/Demo/Demo/wwwroot/images/up.png differ