From fa0824bce908cabcd54501d190cce32d80d325f5 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Sat, 27 Jan 2018 14:50:24 +0200 Subject: [PATCH] remember volume --- .../QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs index 864d82c..c600b95 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.VideoViewer/ViewerPanel.xaml.cs @@ -168,6 +168,8 @@ namespace QuickLook.Plugin.VideoViewer public void Dispose() { + _context.SetSetting("Volume", mediaElement.Volume); + try { Task.Run(() => @@ -317,7 +319,7 @@ namespace QuickLook.Plugin.VideoViewer public void LoadAndPlay(string path) { mediaElement.LoadMediaWithOptions(path, ":avcodec-hw=dxva2"); - mediaElement.Volume = 50; + mediaElement.Volume = _context.GetSetting("Volume", 50); mediaElement.Play(); }