From cb5c3c7c7f16a3957f154c9a1d663b07475fc75a Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Tue, 1 Jan 2019 15:01:27 +0300 Subject: [PATCH] Added support of livestreams. Chat messages avatars added. Formatting live chat messages added. Few player fixes Related Work Items: #183, #184 --- FoxTube/Controls/Chat.xaml | 3 +- FoxTube/Controls/Chat.xaml.cs | 45 ++++++++++++---------------- FoxTube/Controls/VideoPlayer.xaml | 6 ++-- FoxTube/Controls/VideoPlayer.xaml.cs | 18 +++++++---- FoxTube/Pages/VideoPage.xaml.cs | 1 + 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/FoxTube/Controls/Chat.xaml b/FoxTube/Controls/Chat.xaml index 02df719..293d84a 100644 --- a/FoxTube/Controls/Chat.xaml +++ b/FoxTube/Controls/Chat.xaml @@ -36,6 +36,7 @@ + @@ -45,7 +46,7 @@ - + diff --git a/FoxTube/Controls/Chat.xaml.cs b/FoxTube/Controls/Chat.xaml.cs index 15af172..f8f5992 100644 --- a/FoxTube/Controls/Chat.xaml.cs +++ b/FoxTube/Controls/Chat.xaml.cs @@ -10,35 +10,28 @@ namespace FoxTube.Controls { public class ChatMessage { - public string Author + public string Author => message.AuthorDetails.DisplayName; + public TextBlock Message { - get { return message.AuthorDetails.DisplayName; } - } - public string Message - { - get { return message.Snippet.DisplayMessage; } - } - public string ChannelId - { - get { return message.AuthorDetails.ChannelId; } + get + { + TextBlock block = new TextBlock() + { + IsTextSelectionEnabled = true, + VerticalAlignment = VerticalAlignment.Top, + TextWrapping = TextWrapping.WrapWholeWords + }; + Methods.FormatText(ref block, message.Snippet.DisplayMessage); + return block; + } } + public string ChannelId => message.AuthorDetails.ChannelId; + public string Avatar => message.AuthorDetails.ProfileImageUrl; - public Visibility IsVerified - { - get { return message.AuthorDetails.IsVerified.Value? Visibility.Visible : Visibility.Collapsed; } - } - public Visibility IsOwner - { - get { return message.AuthorDetails.IsChatOwner.Value ? Visibility.Visible : Visibility.Collapsed; } - } - public Visibility IsSponsor - { - get { return message.AuthorDetails.IsChatSponsor.Value ? Visibility.Visible : Visibility.Collapsed; } - } - public Visibility IsModerator - { - get { return message.AuthorDetails.IsChatModerator.Value ? Visibility.Visible : Visibility.Collapsed; } - } + public Visibility IsVerified => message.AuthorDetails.IsVerified.Value ? Visibility.Visible : Visibility.Collapsed; + public Visibility IsOwner => message.AuthorDetails.IsChatOwner.Value ? Visibility.Visible : Visibility.Collapsed; + public Visibility IsSponsor => message.AuthorDetails.IsChatSponsor.Value ? Visibility.Visible : Visibility.Collapsed; + public Visibility IsModerator => message.AuthorDetails.IsChatModerator.Value ? Visibility.Visible : Visibility.Collapsed; public Brush Background { diff --git a/FoxTube/Controls/VideoPlayer.xaml b/FoxTube/Controls/VideoPlayer.xaml index fb00dd9..d804422 100644 --- a/FoxTube/Controls/VideoPlayer.xaml +++ b/FoxTube/Controls/VideoPlayer.xaml @@ -99,7 +99,7 @@ @@ -114,7 +114,7 @@ - + -