From 4958b092a4518f74511de5484fcccb0831a19dc4 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Fri, 28 Dec 2018 11:09:09 +0300 Subject: [PATCH] Player refactoring --- FoxTube/Classes/SettingsStorage.cs | 18 ++ FoxTube/Controls/VideoPlayer.xaml | 33 ++- FoxTube/Controls/VideoPlayer.xaml.cs | 354 ++++++++++++++------------- FoxTube/Pages/VideoPage.xaml.cs | 1 + 4 files changed, 233 insertions(+), 173 deletions(-) diff --git a/FoxTube/Classes/SettingsStorage.cs b/FoxTube/Classes/SettingsStorage.cs index 6ce1403..c8ed1f9 100644 --- a/FoxTube/Classes/SettingsStorage.cs +++ b/FoxTube/Classes/SettingsStorage.cs @@ -7,6 +7,8 @@ using Windows.Storage; namespace FoxTube { + public enum MatureState { Blocked, Allowed, AllowedOnce } + public static class SettingsStorage { public static string VideoQuality @@ -139,6 +141,22 @@ namespace FoxTube storage.Values["version"] = value; } } + public static MatureState Mature + { + get + { + if (storage.Values["mature"] == null) + { + storage.Values["mature"] = MatureState.Blocked; + return MatureState.Blocked; + } + else return (MatureState)storage.Values["mature"]; + } + set + { + storage.Values["mature"] = value; + } + } //Settings storage private static readonly ApplicationDataContainer storage = ApplicationData.Current.LocalSettings; diff --git a/FoxTube/Controls/VideoPlayer.xaml b/FoxTube/Controls/VideoPlayer.xaml index 5ab4024..d14122f 100644 --- a/FoxTube/Controls/VideoPlayer.xaml +++ b/FoxTube/Controls/VideoPlayer.xaml @@ -14,7 +14,6 @@ PointerEntered="UserControl_PointerEntered"> - @@ -63,12 +62,18 @@ - + @@ -91,9 +96,15 @@ + - + @@ -103,8 +114,11 @@ -