From 73ecc0590cb8e9045fdecee12992904f5740144d Mon Sep 17 00:00:00 2001 From: Caeden Statia Date: Fri, 21 Feb 2020 17:10:21 -0800 Subject: [PATCH] Changed to better performant video looping code --- ModAssistant/Classes/Themes.cs | 2 +- ModAssistant/MainWindow.xaml | 14 +------------- ModAssistant/MainWindow.xaml.cs | 6 ++++++ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ModAssistant/Classes/Themes.cs b/ModAssistant/Classes/Themes.cs index 56131b6..4b57135 100644 --- a/ModAssistant/Classes/Themes.cs +++ b/ModAssistant/Classes/Themes.cs @@ -127,7 +127,7 @@ namespace ModAssistant if (!sendMessage || MainWindow.Instance.BackgroundVideo.Source?.AbsoluteUri != videoUri.AbsoluteUri) { MainWindow.Instance.BackgroundVideo.Stop(); - MainWindow.Instance.BackgroundVideoSource.Source = videoUri; + MainWindow.Instance.BackgroundVideo.Source = videoUri; } MainWindow.Instance.BackgroundVideo.Play(); } diff --git a/ModAssistant/MainWindow.xaml b/ModAssistant/MainWindow.xaml index 7e70a8f..5a11a66 100644 --- a/ModAssistant/MainWindow.xaml +++ b/ModAssistant/MainWindow.xaml @@ -16,19 +16,7 @@ - - - - - - - - - - - - - + diff --git a/ModAssistant/MainWindow.xaml.cs b/ModAssistant/MainWindow.xaml.cs index b88fd23..e24a75d 100644 --- a/ModAssistant/MainWindow.xaml.cs +++ b/ModAssistant/MainWindow.xaml.cs @@ -303,5 +303,11 @@ namespace ModAssistant Mods.Instance.RefreshColumns(); } } + + private void BackgroundVideo_MediaEnded(object sender, RoutedEventArgs e) + { + BackgroundVideo.Position = TimeSpan.Zero; + BackgroundVideo.Play(); + } } }