diff --git a/FoxTube.Background/BackgroundProcessor.cs b/FoxTube.Background/BackgroundProcessor.cs index 6e06785..3819038 100644 --- a/FoxTube.Background/BackgroundProcessor.cs +++ b/FoxTube.Background/BackgroundProcessor.cs @@ -123,7 +123,7 @@ namespace FoxTube.Background { public static string ConvertEscapeSymbols(this string str) { - return str.Replace(""", "\"").Replace("'", "'").Replace("<", "<").Replace(">", ">").Replace("&", "&"); + return str.Replace(""", "\"").Replace("'", "'").Replace("<", "<").Replace(">", ">").Replace("&", "&").Replace(""", "\"").Replace("'", "'").Replace("<", "<").Replace(">", ">").Replace("&", "&"); } } } diff --git a/FoxTube/Assets/Data/Patchnotes.xml b/FoxTube/Assets/Data/Patchnotes.xml index 60b9919..9b1ed01 100644 --- a/FoxTube/Assets/Data/Patchnotes.xml +++ b/FoxTube/Assets/Data/Patchnotes.xml @@ -7,12 +7,16 @@ - Fixed ads appearance - Fixed ads watermarks on video when it was opened through notification - Fixed videos loading +- Fixed special characters appearing in toast notifications +- Cursor now hides on playback ### Что нового: - Исправлена проблема получения истории, "Посмотреть позже" и рекомендаций - Исправлен внешний вид рекламы - Исправлено появление водяных занков рекламы на видео при открытии через уведомления - Исправлена загрузка видео +- Исправлено появление особых символов в уведомлениях +- Теперь курсор скрывается при просмотре diff --git a/FoxTube/Classes/SecretsVault.cs b/FoxTube/Classes/SecretsVault.cs index ab7d4ea..e79e879 100644 --- a/FoxTube/Classes/SecretsVault.cs +++ b/FoxTube/Classes/SecretsVault.cs @@ -42,7 +42,7 @@ namespace FoxTube }; public static YouTubeService Service => IsAuthorized ? new YouTubeService(Initializer) : NoAuthService; public static HttpClient HttpClient { get; } = new HttpClient(); - private static bool TestAds => true; //Change this bool + private static bool TestAds => false; //Change this bool public static string AppId => TestAds ? "d25517cb-12d4-4699-8bdc-52040c712cab" : "9ncqqxjtdlfh"; public static string AdUnitId => TestAds ? "test" : "1100044398"; public static bool AdsDisabled { get; private set; } = true; diff --git a/FoxTube/Controls/Player/VideoPlayer.xaml b/FoxTube/Controls/Player/VideoPlayer.xaml index 3d67ab2..385ae45 100644 --- a/FoxTube/Controls/Player/VideoPlayer.xaml +++ b/FoxTube/Controls/Player/VideoPlayer.xaml @@ -8,7 +8,8 @@ mc:Ignorable="d" d:DesignHeight="1080" d:DesignWidth="1920" - RequestedTheme="Dark"> + RequestedTheme="Dark" + PointerMoved="UserControl_PointerMoved"> diff --git a/FoxTube/Controls/Player/VideoPlayer.xaml.cs b/FoxTube/Controls/Player/VideoPlayer.xaml.cs index a291506..b869bff 100644 --- a/FoxTube/Controls/Player/VideoPlayer.xaml.cs +++ b/FoxTube/Controls/Player/VideoPlayer.xaml.cs @@ -10,8 +10,7 @@ using Windows.Storage.Streams; using YoutubeExplode.Models.MediaStreams; using YoutubeExplode; using System.Diagnostics; -using Windows.Media.Playback; -using Windows.Media.Core; +using Windows.Foundation; namespace FoxTube { @@ -30,6 +29,8 @@ namespace FoxTube bool isMuxed = false; DispatcherTimer muxedTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(100) }; + DispatcherTimer cursorTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(5) }; + TimeSpan timecodeBackup; bool needUpdateTimecode = false; @@ -62,6 +63,7 @@ namespace FoxTube Controls.IsSkipBackwardButtonVisible = false; Controls.IsSkipForwardButtonVisible = false; Controls.LiveRequested += Controls_LiveRequested; + object i = await new YoutubeClient().GetVideoMediaStreamInfosAsync(item.Id); Controls.SetStream((await new YoutubeClient().GetVideoMediaStreamInfosAsync(item.Id)).HlsLiveStreamUrl); } else @@ -89,6 +91,19 @@ namespace FoxTube audioSource.Position = videoSource.Position; }; + cursorTimer.Tick += (s, e) => + { + Point cursorPoint = CoreWindow.GetForCurrentThread().PointerPosition; + cursorPoint.X -= Window.Current.Bounds.X; + cursorPoint.Y -= Window.Current.Bounds.Y; + Rect playerBounds = TransformToVisual(Methods.MainPage).TransformBounds(new Rect(0, 0, ActualWidth, ActualHeight)); + + if(cursorPoint.Y > playerBounds.Top && cursorPoint.Y < playerBounds.Bottom && + cursorPoint.X > playerBounds.Left && cursorPoint.X < playerBounds.Right) + CoreWindow.GetForCurrentThread().PointerCursor = null; + cursorTimer.Stop(); + }; + Controls.CloseRequested += Controls_CloseRequested; Controls.NextRequested += (s, e) => NextClicked?.Invoke(); Controls.QualityChanged += Controls_QualityChanged; @@ -254,5 +269,12 @@ namespace FoxTube { Controls.Advert.PushAdvert(); } + + private void UserControl_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) + { + if (CoreWindow.GetForCurrentThread().PointerCursor == null) + CoreWindow.GetForCurrentThread().PointerCursor = new CoreCursor(CoreCursorType.Arrow, 0); + cursorTimer.Start(); + } } } diff --git a/FoxTube/FoxTube.csproj b/FoxTube/FoxTube.csproj index c44016e..fb86d33 100644 --- a/FoxTube/FoxTube.csproj +++ b/FoxTube/FoxTube.csproj @@ -450,7 +450,7 @@ 4.3.2 - 4.7.0-alpha + 4.7.0-beta