Archived
1
0

Refactored player. Refactored changelog system. Players isn't localized

Related Work Items: #161, #211, #238
This commit is contained in:
Michael Gordeev
2019-01-02 23:44:40 +03:00
parent cb5c3c7c7f
commit 088d85ddb9
69 changed files with 3871 additions and 707 deletions
+15 -15
View File
@@ -17,7 +17,7 @@
</Grid.RowDefinitions>
<Pivot SelectedIndex="0" Name="content" IsHeaderItemsCarouselEnabled="False" SelectionChanged="content_SelectionChanged">
<PivotItem Header="Videos">
<PivotItem x:Uid="/Channel/videos" Header="Videos">
<ScrollViewer>
<StackPanel Name="videos">
<Image Name="channelCover" Stretch="Uniform" Source="/Assets/ChannelCoverTemplate.png"/>
@@ -35,11 +35,11 @@
<TextBlock Name="videosCount" Foreground="Gray" Text="563,000 videos"/>
</StackPanel>
<TextBlock Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Height="50" Margin="10" TextAlignment="Center" Padding="0,16,0,0" Foreground="Gray">
<Hyperlink Click="Hyperlink_Click">Log in</Hyperlink> to manage your subscriptions
<Hyperlink Click="Hyperlink_Click"><Run x:Uid="/Cards/login">Log in</Run></Hyperlink> <Run x:Uid="/Cards/tomanage">to manage your subscriptions</Run>
</TextBlock>
<Grid Visibility="Collapsed" Grid.Column="2" VerticalAlignment="Bottom" Margin="10" Name="subscriptionPane" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button Click="subscribe_Click" Name="subscribe" Width="250" Height="50" Background="Red" Foreground="White" FontSize="18" FontWeight="SemiBold" Content="Subscirbe"/>
<Button x:Uid="/Cards/subscribe" Click="subscribe_Click" Name="subscribe" Width="250" Height="50" Background="Red" Foreground="White" FontSize="18" FontWeight="SemiBold" Content="Subscirbe"/>
</Grid>
</Grid>
<pages:VideoGrid/>
@@ -47,11 +47,11 @@
</StackPanel>
</ScrollViewer>
</PivotItem>
<PivotItem Header="Playlists">
<PivotItem x:Uid="/Channel/playlists" Header="Playlists">
<ScrollViewer>
<Grid Name="playlists">
<StackPanel Margin="10" Visibility="Visible">
<TextBlock FontSize="28" Text="Playlists"/>
<TextBlock x:Uid="/Channel/playlistTitle" FontSize="28" Text="Playlists"/>
<pages:VideoGrid/>
<controls:ShowMore Clicked="showMorePlaylists_Click"/>
</StackPanel>
@@ -59,10 +59,10 @@
</Grid>
</ScrollViewer>
</PivotItem>
<PivotItem Header="About channel">
<PivotItem x:Uid="/Channel/about" Header="About channel">
<ScrollViewer>
<StackPanel Margin="10">
<TextBlock FontSize="28" Text="About this channel"/>
<TextBlock x:Uid="/Channel/aboutTitle" FontSize="28" Text="About this channel"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -70,7 +70,7 @@
</Grid.ColumnDefinitions>
<StackPanel>
<TextBlock FontSize="24" Text="Description"/>
<TextBlock x:Uid="/Channel/desc" FontSize="24" Text="Description"/>
<TextBlock Name="description" Margin="0,10,0,0" TextWrapping="WrapWholeWords" IsTextSelectionEnabled="True"/>
</StackPanel>
@@ -85,12 +85,12 @@
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<TextBlock FontSize="24" Text="Statistics"/>
<TextBlock x:Uid="/Channel/stats" FontSize="24" Text="Statistics"/>
<TextBlock Text="Registration date:" Grid.Row="1"/>
<TextBlock x:Uid="/Channel/regDate" Text="Registration date:" Grid.Row="1"/>
<TextBlock Grid.Row="1" Grid.Column="2" Name="registration" Text="13-May-18" HorizontalAlignment="Right"/>
<TextBlock Grid.Row="2" Text="Views"/>
<TextBlock x:Uid="/Channel/views" Grid.Row="2" Text="Views"/>
<TextBlock Grid.Row="2" Grid.Column="2" Name="views" Text="1885510485" HorizontalAlignment="Right"/>
</Grid>
</Grid>
@@ -99,14 +99,14 @@
</PivotItem>
<Pivot.RightHeader>
<AutoSuggestBox VerticalAlignment="Center" Width="250" Margin="8" PlaceholderText="Search on channel" QueryIcon="Find" Name="search" QuerySubmitted="AutoSuggestBox_QuerySubmitted"/>
<AutoSuggestBox x:Uid="/Channel/search" VerticalAlignment="Center" Width="250" Margin="8" PlaceholderText="Search on channel" QueryIcon="Find" Name="search" QuerySubmitted="AutoSuggestBox_QuerySubmitted"/>
</Pivot.RightHeader>
</Pivot>
<CommandBar Grid.Row="1" VerticalAlignment="Bottom" Name="commandBar">
<AppBarButton Icon="Globe" Label="Open in browser" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton Icon="Refresh" Label="Refresh" Name="refresh" Click="refresh_Click"/>
<AppBarButton Icon="Share" Label="Share" Name="share" Click="share_Click"/>
<AppBarButton x:Uid="/Channel/openWeb" Icon="Globe" Label="Open in browser" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton x:Uid="/Channel/refresh" Icon="Refresh" Label="Refresh" Name="refresh" Click="refresh_Click"/>
<AppBarButton x:Uid="/Channel/share" Icon="Share" Label="Share" Name="share" Click="share_Click"/>
</CommandBar>
<local:LoadingPage Grid.RowSpan="2" Visibility="Collapsed"/>
+9 -6
View File
@@ -12,6 +12,7 @@ using FoxTube.Controls;
using Windows.ApplicationModel.DataTransfer;
using Windows.System;
using Windows.UI;
using Windows.ApplicationModel.Resources;
namespace FoxTube.Pages
{
@@ -20,6 +21,8 @@ namespace FoxTube.Pages
/// </summary>
public sealed partial class ChannelPage : Page
{
ResourceLoader resources = ResourceLoader.GetForCurrentView("Cards");
public string channelId;
public Channel item;
@@ -78,8 +81,8 @@ namespace FoxTube.Pages
item = (await request.ExecuteAsync()).Items[0];
title.Text = item.Snippet.Title;
subscribers.Text = $"{item.Statistics.SubscriberCount:0,0} subscribers";
videosCount.Text = $"{item.Statistics.VideoCount:0,0} videos";
subscribers.Text = $"{item.Statistics.SubscriberCount:0,0} {resources.GetString("/Cards/subscribers")}";
videosCount.Text = $"{item.Statistics.VideoCount:0,0} {resources.GetString("/Cards/videos")}";
try
{
@@ -121,7 +124,7 @@ namespace FoxTube.Pages
{
subscribe.Background = new SolidColorBrush(Colors.Transparent);
subscribe.Foreground = new SolidColorBrush(Colors.Gray);
subscribe.Content = "Subscribed";
subscribe.Content = resources.GetString("/Cards/unsubscribe");
}
subscriptionPane.Visibility = Visibility.Visible;
}
@@ -228,13 +231,13 @@ namespace FoxTube.Pages
{
subscribe.Background = new SolidColorBrush(Colors.Transparent);
subscribe.Foreground = new SolidColorBrush(Colors.Gray);
subscribe.Content = "Subscribed";
subscribe.Content = resources.GetString("/Cards/unsubscribe");
}
else
{
subscribe.Background = new SolidColorBrush(Colors.Red);
subscribe.Foreground = new SolidColorBrush(Colors.White);
subscribe.Content = "Subscribe";
subscribe.Content = resources.GetString("/Cards/subscribe/Content");
}
}
@@ -286,7 +289,7 @@ namespace FoxTube.Pages
item.Snippet.Thumbnails.Medium.Url,
item.Snippet.Title,
string.IsNullOrWhiteSpace(item.Snippet.CustomUrl) ? $"https://www.youtube.com/channel/{item.Id}" : $"https://www.youtube.com/user/{item.Snippet.CustomUrl}",
"channel");
resources.GetString("/Cards/channelShare"));
}
}
}
+2 -2
View File
@@ -29,7 +29,7 @@
<TextBlock Name="counter" Grid.Row="1" Text="[Comments count] Comments" Margin="5,0,0,0" VerticalAlignment="Center" FontWeight="SemiBold"/>
<StackPanel Padding="0" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock x:Uid="/CommentsPage/sortBy" Text="Sort by: " VerticalAlignment="Center" Margin="0,0,5,0"/>
<Button Name="orderBtn" Background="Transparent" Content="Relevance" Foreground="Red" Padding="0" VerticalAlignment="Center">
<Button Name="orderBtn" Background="Transparent" Content="Relevance" Foreground="Red" Padding="0" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,3">
<Button.Flyout>
<MenuFlyout>
@@ -44,7 +44,7 @@
<ScrollViewer Grid.Row="1" Name="scroll">
<StackPanel>
<StackPanel Name="placeholder"/>
<HyperlinkButton Visibility="Collapsed" Name="more" Click="more_Click" HorizontalAlignment="Center" Foreground="Red" Content="Show more"/>
<HyperlinkButton x:Uid="/CommentsPage/more" Visibility="Collapsed" Name="more" Click="more_Click" HorizontalAlignment="Center" Foreground="Red" Content="Show more"/>
<ProgressBar Name="moreLoading" Visibility="Collapsed" IsIndeterminate="True" Foreground="Red"/>
</StackPanel>
</ScrollViewer>
+7 -3
View File
@@ -5,6 +5,7 @@ using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using FoxTube.Controls;
using Windows.UI.Popups;
using Windows.ApplicationModel.Resources;
namespace FoxTube.Pages
{
@@ -13,6 +14,8 @@ namespace FoxTube.Pages
/// </summary>
public sealed partial class CommentsPage : Page
{
ResourceLoader resources = ResourceLoader.GetForCurrentView("CommentsPage");
string threadId;
string nextPageToken;
@@ -33,7 +36,8 @@ namespace FoxTube.Pages
else
grid.RowDefinitions[0].Height = GridLength.Auto;
counter.Text = string.Format("{0:0,0} Comments", video.Statistics.CommentCount);
counter.Text = $"{video.Statistics.CommentCount:0,0} {resources.GetString("/CommentsPage/comments")}";
orderBtn.Content = resources.GetString("/CommentsPage/relevance/Text");
var request = SecretsVault.Service.CommentThreads.List("snippet,replies");
request.Order = order;
@@ -87,7 +91,7 @@ namespace FoxTube.Pages
moreLoading.Visibility = Visibility.Visible;
order = CommentThreadsResource.ListRequest.OrderEnum.Relevance;
orderBtn.Content = "Relevance";
orderBtn.Content = resources.GetString("/CommentsPage/relevance/Text");
placeholder.Children.Clear();
@@ -114,7 +118,7 @@ namespace FoxTube.Pages
moreLoading.Visibility = Visibility.Visible;
order = CommentThreadsResource.ListRequest.OrderEnum.Time;
orderBtn.Content = "Publish date";
orderBtn.Content = resources.GetString("/CommentsPage/publish");
placeholder.Children.Clear();
+3 -3
View File
@@ -21,17 +21,17 @@
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock Name="path" IsTextSelectionEnabled="True" TextWrapping="WrapWholeWords"/>
<Button Grid.Column="1" Content="Open folder" Name="open" Click="Open_Click" VerticalAlignment="Center"/>
<Button Grid.Column="1" x:Uid="/Downloads/openFolder" Content="Open folder" Name="open" Click="Open_Click" VerticalAlignment="Center"/>
</Grid>
<ScrollViewer Grid.Row="1">
<StackPanel Name="stack"/>
</ScrollViewer>
<TextBlock Grid.Row="1" Name="empty" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="28" Text="You haven't downloaded anything yet" Margin="10" TextWrapping="WrapWholeWords" Foreground="Gray" FontWeight="SemiBold"/>
<TextBlock x:Uid="/Downloads/noItems" Grid.Row="1" Name="empty" HorizontalAlignment="Center" VerticalAlignment="Top" FontSize="28" Text="You haven't downloaded anything yet" Margin="10" TextWrapping="WrapWholeWords" Foreground="Gray" FontWeight="SemiBold"/>
<CommandBar DefaultLabelPosition="Right" Grid.Row="2">
<AppBarButton Label="Refresh" Icon="Refresh" Click="Refresh"/>
<AppBarButton x:Uid="/Downloads/refresh" Label="Refresh" Icon="Refresh" Click="Refresh"/>
</CommandBar>
</Grid>
</Page>
+4 -4
View File
@@ -16,12 +16,12 @@
</Grid.RowDefinitions>
<Pivot Name="pivot" SelectionChanged="pivot_SelectionChanged">
<PivotItem Header="Recommended" Name="recommended">
<PivotItem x:Uid="/Home/recommended" Header="Recommended" Name="recommended">
<ScrollViewer>
<StackPanel/>
</ScrollViewer>
</PivotItem>
<PivotItem Header="Trending" Name="trending">
<PivotItem x:Uid="/Home/trending" Header="Trending" Name="trending">
<ScrollViewer>
<StackPanel>
<pages:VideoGrid/>
@@ -29,7 +29,7 @@
</StackPanel>
</ScrollViewer>
</PivotItem>
<PivotItem Header="Subscriptions" Name="subscriptions">
<PivotItem x:Uid="/Home/subs" Header="Subscriptions" Name="subscriptions">
<ScrollViewer>
<StackPanel/>
</ScrollViewer>
@@ -37,7 +37,7 @@
</Pivot>
<CommandBar Grid.Row="1">
<AppBarButton Icon="Refresh" Label="Refresh page" Name="refresh" Click="refreshPage"/>
<AppBarButton x:Uid="/Home/refresh" Icon="Refresh" Label="Refresh page" Name="refresh" Click="refreshPage"/>
</CommandBar>
<local:LoadingPage Grid.RowSpan="2" Margin="0,50,0,0" Visibility="Visible" RefreshPage="refreshPage"/>
</Grid>
+10 -11
View File
@@ -2,7 +2,6 @@
x:Class="FoxTube.LoadingPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:FoxTube"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
@@ -12,25 +11,25 @@
<StackPanel Name="wifiTrouble" Visibility="Collapsed" VerticalAlignment="Center">
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xEB5E;" FontSize="100" HorizontalAlignment="Center"/>
<TextBlock Text="Check your internet connection" FontSize="48" HorizontalAlignment="Center"/>
<TextBlock Text="Please, make sure you are connected to the internet and try again." HorizontalAlignment="Center"/>
<TextBlock x:Uid="/LoadingPage/checkConnection" Text="Check your internet connection" FontSize="48" HorizontalAlignment="Center"/>
<TextBlock x:Uid="/LoadingPage/wifiDesc" Text="Please, make sure you are connected to the internet and try again." HorizontalAlignment="Center"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="Open network settings" Margin="5" Name="openWifi" Click="openWifi_Click"/>
<Button Content="Open troubleshooter" Background="Red" Foreground="White" Margin="5" Name="openTroubleshoot" Click="openTroubleshoot_Click"/>
<Button x:Uid="/LoadingPage/openWifi" Content="Open network settings" Margin="5" Name="openWifi" Click="openWifi_Click"/>
<Button x:Uid="/LoadingPage/openTroubleshooter" Content="Open troubleshooter" Background="Red" Foreground="White" Margin="5" Name="openTroubleshoot" Click="openTroubleshoot_Click"/>
</StackPanel>
<TextBlock Text="OR" FontSize="20" HorizontalAlignment="Center"/>
<Button Name="wifiRefresh" Click="wifiRefresh_Click" Content="Refresh page" HorizontalAlignment="Center" Background="Red" Foreground="White" Margin="5"/>
<TextBlock x:Uid="/LoadingPage/or" Text="OR" FontSize="20" HorizontalAlignment="Center"/>
<Button x:Uid="/LoadingPage/refresh" Name="wifiRefresh" Click="wifiRefresh_Click" Content="Refresh page" HorizontalAlignment="Center" Background="Red" Foreground="White" Margin="5"/>
<TextBlock Name="wifiException" Foreground="Gray" Text="Exception:" HorizontalAlignment="Center" IsTextSelectionEnabled="True"/>
<TextBlock Name="wifiMessage" Foreground="Gray" Text="Message:" HorizontalAlignment="Center" IsTextSelectionEnabled="True"/>
</StackPanel>
<StackPanel Name="trouble" Visibility="Collapsed" VerticalAlignment="Center">
<FontIcon FontFamily="Segoe MDL2 Assets" Glyph="&#xE7BA;" FontSize="100" HorizontalAlignment="Center"/>
<TextBlock Text="We are unable to display the page" FontSize="48" HorizontalAlignment="Center"/>
<TextBlock Text="It could be caused by YouTube internal server error or by application's bug. Please, try again later" HorizontalAlignment="Center"/>
<TextBlock x:Uid="/LoadingPage/err" Text="We are unable to display the page" FontSize="48" HorizontalAlignment="Center"/>
<TextBlock x:Uid="/LoadingPage/errDescription" Text="It could be caused by YouTube internal server error or by application's bug. Please, try again later" HorizontalAlignment="Center"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button Name="refresh" Click="wifiRefresh_Click" Content="Refresh page" Margin="5"/>
<Button Content="Leave feedback" Background="Red" Foreground="White" Margin="5" Name="feedback" Click="feedback_Click"/>
<Button x:Uid="/LoadingPage/refresh" Name="refresh" Click="wifiRefresh_Click" Content="Refresh page" Margin="5"/>
<Button x:Uid="/LoadingPage/feedback" Content="Leave feedback" Background="Red" Foreground="White" Margin="5" Name="feedback" Click="feedback_Click"/>
</StackPanel>
<TextBlock Name="exception" Foreground="Gray" Text="Exception:" HorizontalAlignment="Center" IsTextSelectionEnabled="True"/>
<TextBlock Name="message" Foreground="Gray" Text="Message:" HorizontalAlignment="Center" IsTextSelectionEnabled="True"/>
+9 -19
View File
@@ -1,35 +1,25 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.ApplicationModel.Resources;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
namespace FoxTube
{
public enum LoadingState { Loadnig, Loaded, Error, Blocked }
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// Loading sreen. Represents loading ring or error
/// </summary>
public sealed partial class LoadingPage : Page
{
ResourceLoader resources = ResourceLoader.GetForCurrentView("LoadingPage");
public event RoutedEventHandler RefreshPage;
public LoadingState State { get; private set; } = LoadingState.Loadnig;
public LoadingPage()
{
this.InitializeComponent();
InitializeComponent();
}
public void Error(string exceptionId = "Unknown", string details = "N/A", bool isWifiTrouble = false)
@@ -41,15 +31,15 @@ namespace FoxTube
if (isWifiTrouble)
{
wifiException.Text = $"ID: {exceptionId}";
wifiMessage.Text = $"Details: {details}";
wifiException.Text = $"{resources.GetString("/LoadingPage/ex")}: {exceptionId}";
wifiMessage.Text = $"{resources.GetString("/LoadingPage/details")}: {details}";
wifiTrouble.Visibility = Visibility.Visible;
}
else
{
exception.Text = $"ID: {exceptionId}";
message.Text = $"Details: {details}";
exception.Text = $"{resources.GetString("/LoadingPage/ex")}: {exceptionId}";
message.Text = $"{resources.GetString("/LoadingPage/details")}: {details}";
trouble.Visibility = Visibility.Visible;
}
+53 -38
View File
@@ -21,8 +21,9 @@ using System.Net;
using Windows.UI.Popups;
using Windows.Networking.Connectivity;
using Windows.UI.Core;
using System.Threading;
using System.Threading.Tasks;
using Windows.ApplicationModel.Resources;
using Windows.Storage;
using System.IO;
namespace FoxTube
{
@@ -34,18 +35,35 @@ namespace FoxTube
public sealed partial class MainPage : Page
{
Sender s = Sender.None;
ResourceLoader resources = ResourceLoader.GetForCurrentView("Main");
public MainPage()
{
InitializeComponent();
//Comparing current version with last recorded version. If doesn't match, poping up changelog notification
CheckVersion();
SecretsVault.AuthorizationStateChanged += AuthorizationStateChanged;
SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged;
SecretsVault.NotPurchased += () => removeAds.Visibility = Visibility.Visible;
SecretsVault.CheckAuthorization();
SecretsVault.CheckAddons();
SetTitleBar();
}
/// <summary>
/// Comparing current version with last recorded version. If doesn't match, poping up changelog notification
/// </summary>
public async void CheckVersion()
{
PackageVersion ver = Package.Current.Id.Version;
if(SettingsStorage.Version != $"{ver.Major}.{ver.Minor}")
if (SettingsStorage.Version != $"{ver.Major}.{ver.Minor}")
{
try
{
XmlDocument changelog = new XmlDocument();
changelog.Load("http://foxgame-studio.000webhostapp.com/foxtube-changelog.xml");
StorageFile file = await (await Package.Current.InstalledLocation.GetFolderAsync(@"Assets\Data")).GetFileAsync("Patchnotes.xml");
changelog.Load(await file.OpenStreamForReadAsync());
XmlElement e = changelog["items"].ChildNodes[0] as XmlElement;
ToastNotificationManager.CreateToastNotifier().Show(FoxTube.Background.Notification.GetChangelogToast(e.GetAttribute("version")));
@@ -57,14 +75,6 @@ namespace FoxTube
Debug.WriteLine("Unable to retrieve changelog");
}
}
SecretsVault.AuthorizationStateChanged += AuthorizationStateChanged;
SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged;
SecretsVault.NotPurchased += () => removeAds.Visibility = Visibility.Visible;
SecretsVault.CheckAuthorization();
SecretsVault.CheckAddons();
SetTitleBar();
}
public Video GetCurrentItem()
@@ -223,13 +233,13 @@ namespace FoxTube
}
else
{
MessageDialog dialog = new MessageDialog("We were unabled to retrieve your account information due to weak internet connection or Google servers' problems. PLease, try again later", "Failed to connect");
MessageDialog dialog = new MessageDialog(resources.GetString("/Main/connectErrContent"), resources.GetString("/Main/connectErrHeader"));
dialog.Commands.Add(new UICommand("Try again", (command) =>
dialog.Commands.Add(new UICommand(resources.GetString("/Main/tryAgain"), (command) =>
{
SecretsVault.Authorize();
}));
dialog.Commands.Add(new UICommand("Quit", (command) =>
dialog.Commands.Add(new UICommand(resources.GetString("/Main/quit"), (command) =>
{
Methods.CloseApp();
}));
@@ -298,15 +308,15 @@ namespace FoxTube
var connection = NetworkInformation.GetInternetConnectionProfile().GetConnectionCost();
if (SettingsStorage.CheckConnection && (connection.NetworkCostType == NetworkCostType.Fixed || connection.NetworkCostType == NetworkCostType.Variable))
{
MessageDialog dialog = new MessageDialog("You are on metered connection now. Additional charges may apply. Do you want to continue?")
MessageDialog dialog = new MessageDialog(resources.GetString("/Main/metered"))
{
DefaultCommandIndex = 2,
CancelCommandIndex = 1
};
dialog.Commands.Add(new UICommand("Yes"));
dialog.Commands.Add(new UICommand("No", (command) => cancel = true));
dialog.Commands.Add(new UICommand(resources.GetString("/Main/yes")));
dialog.Commands.Add(new UICommand(resources.GetString("/Main/no"), (command) => cancel = true));
if(SecretsVault.IsAuthorized)
dialog.Commands.Add(new UICommand("Add to 'Watch later' playlist", (command) =>
dialog.Commands.Add(new UICommand(resources.GetString("/Main/addLater"), (command) =>
{
try
{
@@ -338,6 +348,9 @@ namespace FoxTube
catch { }
if (cancel)
return;
if (videoPlaceholder.Content != null)
(videoPlaceholder.Content as VideoPage).player.close_Click(this, null);
videoPlaceholder.Content = null;
Fullscreen(false);
@@ -396,14 +409,14 @@ namespace FoxTube
Dictionary<Type, Action> switchCase = new Dictionary<Type, Action>()
{
{ typeof(Settings), () => nav.Header = "Settings" },
{ typeof(ChannelPage), () => nav.Header = "Channel" },
{ typeof(PlaylistPage), () => nav.Header = "Playlist" },
{ typeof(Search), () => nav.Header = "Search" },
{ typeof(Subscriptions), () => nav.Header = "Subscriptions" },
{ typeof(History), () => nav.Header = "History" },
{ typeof(Home), () => nav.Header = "Home" },
{ typeof(Downloads), () => nav.Header = "Downloads" }
{ typeof(Settings), () => nav.Header = resources.GetString("/Main/settings/Content") },
{ typeof(ChannelPage), () => nav.Header = resources.GetString("/Main/channel") },
{ typeof(PlaylistPage), () => nav.Header = resources.GetString("/Main/playlist") },
{ typeof(Search), () => nav.Header = resources.GetString("/Main/searchPlaceholder/PlaceholderText") },
{ typeof(Subscriptions), () => nav.Header = resources.GetString("/Main/subscriptions/Content") },
{ typeof(History), () => nav.Header = resources.GetString("/Main/history/Content") },
{ typeof(Home), () => nav.Header = resources.GetString("/Main/home/Content") },
{ typeof(Downloads), () => nav.Header = resources.GetString("/Main/downloads/Content") }
};
if (content.SourcePageType == typeof(Home) || content.SourcePageType == typeof(Settings) || content.SourcePageType == typeof(Subscriptions))
@@ -431,7 +444,7 @@ namespace FoxTube
if (videoPlaceholder.Content != null)
{
nav.Header = "Video";
nav.Header = resources.GetString("/Main/video");
nav.ExpandedModeThresholdWidth = short.MaxValue;
nav.IsPaneOpen = false;
}
@@ -454,7 +467,10 @@ namespace FoxTube
nav.ExpandedModeThresholdWidth = 1008;
nav.Margin = new Thickness(0);
if (videoPlaceholder.Content != null && nav.IsPaneOpen)
{
nav.IsPaneOpen = true;
nav.IsPaneOpen = false;
}
else
{
nav.OpenPaneLength = 300;
@@ -471,7 +487,6 @@ namespace FoxTube
ApplicationView.GetForCurrentView().ExitFullScreenMode();
Fullscreen(false);
}
(videoPlaceholder.Content as VideoPage).player.pointerCaptured = false;
videoPlaceholder.Content = null;
Window.Current.CoreWindow.PointerCursor = new CoreCursor(CoreCursorType.Arrow, 0);
MaximizeVideo();
@@ -551,14 +566,14 @@ namespace FoxTube
{
Dictionary<Type, Action> switchCase = new Dictionary<Type, Action>()
{
{ typeof(Settings), () => nav.Header = "Settings" },
{ typeof(ChannelPage), () => nav.Header = "Channel" },
{ typeof(PlaylistPage), () => nav.Header = "Playlist" },
{ typeof(Search), () => nav.Header = "Search" },
{ typeof(Subscriptions), () => nav.Header = "Subscriptions" },
{ typeof(History), () => nav.Header = "History" },
{ typeof(Home), () => nav.Header = "Home" },
{ typeof(Downloads), () => nav.Header = "Downloads" }
{ typeof(Settings), () => nav.Header = resources.GetString("/Main/settings/Content") },
{ typeof(ChannelPage), () => nav.Header = resources.GetString("/Main/channel") },
{ typeof(PlaylistPage), () => nav.Header = resources.GetString("/Main/playlist") },
{ typeof(Search), () => nav.Header = resources.GetString("/Main/searchPlaceholder/PlaceholderText") },
{ typeof(Subscriptions), () => nav.Header = resources.GetString("/Main/subscriptions/Content") },
{ typeof(History), () => nav.Header = resources.GetString("/Main/history/Content") },
{ typeof(Home), () => nav.Header = resources.GetString("/Main/home/Content") },
{ typeof(Downloads), () => nav.Header = resources.GetString("/Main/downloads/Content") }
};
try { switchCase[e.SourcePageType](); }
+4 -4
View File
@@ -63,16 +63,16 @@
</ScrollViewer>
<CommandBar Grid.Row="2" Grid.ColumnSpan="2">
<AppBarButton Icon="Globe" Label="Open in browser" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton Icon="Add" Label="Add to" IsEnabled="False">
<AppBarButton x:Uid="/Playlist/openWeb" Icon="Globe" Label="Open in browser" Name="inBrowser" Click="inBrowser_Click"/>
<AppBarButton x:Uid="/Playlist/addTo" Icon="Add" Label="Add to" IsEnabled="False">
<AppBarButton.Flyout>
<MenuFlyout>
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Icon="Refresh" Label="Refresh" Name="refresh" Click="refresh_Click"/>
<AppBarButton Icon="Share" Label="Share" Name="share" Click="share_Click"/>
<AppBarButton x:Uid="/Playlist/refresh" Icon="Refresh" Label="Refresh" Name="refresh" Click="refresh_Click"/>
<AppBarButton x:Uid="/Playlist/share" Icon="Share" Label="Share" Name="share" Click="share_Click"/>
</CommandBar>
<foxtube:LoadingPage Grid.RowSpan="2" Visibility="Collapsed"/>
+3 -2
View File
@@ -3,6 +3,7 @@ using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using System;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
using Windows.System;
using Windows.UI.Xaml;
@@ -57,7 +58,7 @@ namespace FoxTube.Pages
item = (await request.ExecuteAsync()).Items[0];
title.Text = item.Snippet.Title;
info.Text = $"{item.ContentDetails.ItemCount} videos";
info.Text = $"{item.ContentDetails.ItemCount} {ResourceLoader.GetForCurrentView("Playlist").GetString("/Playlist/videos")}";
description.Text = item.Snippet.Description;
channelName.Text = item.Snippet.ChannelTitle;
@@ -129,7 +130,7 @@ namespace FoxTube.Pages
item.Snippet.Thumbnails.Medium.Url,
item.Snippet.Title,
$"https://www.youtube.com/playlist?list={item.Id}",
"playlist");
ResourceLoader.GetForCurrentView("Cards").GetString("/Cards/playlistShare"));
}
}
}
+30 -30
View File
@@ -19,52 +19,52 @@
<TextBlock Name="searchTerm" Text="Search results for: [searchTerm]" FontSize="28"/>
<TextBlock Name="resultsCount" Text="Found: [resultCount] item(s)" FontSize="14" Foreground="Gray"/>
<HyperlinkButton Name="toggleFilters" Click="toggleFilters_Click" Content="Show filters &#xE71C;" FontFamily="Default, Segoe MDL2 Assets" Visibility="Visible"/>
<HyperlinkButton x:Uid="/Search/filters" Name="toggleFilters" Click="toggleFilters_Click" Content="Show filters &#xE71C;" FontFamily="Default, Segoe MDL2 Assets" Visibility="Visible"/>
<StackPanel Name="filters" Visibility="Collapsed">
<GridView Padding="5" SelectionMode="None">
<ComboBox Name="order" Header="Sort by" Width="150" SelectedIndex="0">
<ComboBoxItem Content="Relevance"/>
<ComboBoxItem Content="Upload date"/>
<ComboBoxItem Content="View count"/>
<ComboBoxItem Content="Rating"/>
<ComboBoxItem Content="Title"/>
<ComboBox x:Uid="/Search/order" Name="order" Header="Sort by" Width="150" SelectedIndex="0">
<ComboBoxItem x:Uid="/Search/relevance" Content="Relevance"/>
<ComboBoxItem x:Uid="/Search/update" Content="Upload date"/>
<ComboBoxItem x:Uid="/Search/views" Content="View count"/>
<ComboBoxItem x:Uid="/Search/rating" Content="Rating"/>
<ComboBoxItem x:Uid="/Search/title" Content="Title"/>
</ComboBox>
<ComboBox Name="type" Header="Type" Width="150" SelectedIndex="0" SelectionChanged="type_SelectionChanged">
<ComboBoxItem Content="All"/>
<ComboBoxItem Content="Video"/>
<ComboBoxItem Content="Channel"/>
<ComboBoxItem Content="Playlist"/>
<ComboBox x:Uid="/Search/type" Name="type" Header="Type" Width="150" SelectedIndex="0" SelectionChanged="type_SelectionChanged">
<ComboBoxItem x:Uid="/Search/all" Content="All"/>
<ComboBoxItem x:Uid="/Search/video" Content="Video"/>
<ComboBoxItem x:Uid="/Search/channel" Content="Channel"/>
<ComboBoxItem x:Uid="/Search/playlist" Content="Playlist"/>
</ComboBox>
<ComboBox Name="date" Header="Upload date" Width="150" SelectedIndex="0">
<ComboBoxItem Content="Anytime"/>
<ComboBoxItem Content="Last hour"/>
<ComboBoxItem Content="Today"/>
<ComboBoxItem Content="This week"/>
<ComboBoxItem Content="This month"/>
<ComboBoxItem Content="This year"/>
<ComboBox x:Uid="/Search/updateHeader" Name="date" Header="Upload date" Width="150" SelectedIndex="0">
<ComboBoxItem x:Uid="/Search/anytime" Content="Anytime"/>
<ComboBoxItem x:Uid="/Search/lasthr" Content="Last hour"/>
<ComboBoxItem x:Uid="/Search/today" Content="Today"/>
<ComboBoxItem x:Uid="/Search/week" Content="This week"/>
<ComboBoxItem x:Uid="/Search/month" Content="This month"/>
<ComboBoxItem x:Uid="/Search/year" Content="This year"/>
</ComboBox>
<ComboBox Visibility="Collapsed" Name="duration" Header="Duration" Width="150" SelectedIndex="0">
<ComboBoxItem Content="Any"/>
<ComboBoxItem Content="Long (&#x3E; 20 minutes)"/>
<ComboBoxItem Content="Medium"/>
<ComboBoxItem Content="Short (&#x3C; 4 minutes)"/>
<ComboBox x:Uid="/Search/duration" Visibility="Collapsed" Name="duration" Header="Duration" Width="150" SelectedIndex="0">
<ComboBoxItem x:Uid="/Search/any" Content="Any"/>
<ComboBoxItem x:Uid="/Search/long" Content="Long (&#x3E; 20 minutes)"/>
<ComboBoxItem x:Uid="/Search/medium" Content="Medium"/>
<ComboBoxItem x:Uid="/Search/short" Content="Short (&#x3C; 4 minutes)"/>
</ComboBox>
</GridView>
<StackPanel Orientation="Horizontal">
<Button Visibility="Collapsed" Content="Features" Name="featBtn" Margin="10,0,0,10">
<Button x:Uid="/Search/features" Visibility="Collapsed" Content="Features" Name="featBtn" Margin="10,0,0,10">
<Button.Flyout>
<Flyout>
<ListView Name="features" SelectionMode="Multiple" Header="Features">
<ListView x:Uid="/Search/featuresHeader" Name="features" SelectionMode="Multiple" Header="Features">
<TextBlock Text="HD"/>
<TextBlock Text="3D"/>
<TextBlock Text="Subtitles/CC"/>
<TextBlock Text="Live"/>
<TextBlock Text="Creative Commons"/>
<TextBlock x:Uid="/Search/subs" Text="Subtitles/CC"/>
<TextBlock x:Uid="/Search/live" Text="Live"/>
<TextBlock x:Uid="/Search/cc" Text="Creative Commons"/>
</ListView>
</Flyout>
</Button.Flyout>
</Button>
<Button Content="Apply" Margin="10,0,0,10" Name="apply" Click="apply_Click"/>
<Button x:Uid="/Search/apply" Content="Apply" Margin="10,0,0,10" Name="apply" Click="apply_Click"/>
</StackPanel>
</StackPanel>
<pages:VideoGrid/>
+7 -5
View File
@@ -8,7 +8,7 @@ using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
using Windows.System;
using System.Globalization;
using Windows.ApplicationModel.Resources;
namespace FoxTube
{
@@ -17,6 +17,8 @@ namespace FoxTube
/// </summary>
public sealed partial class Search : Page
{
ResourceLoader resources = ResourceLoader.GetForCurrentView("Search");
public SearchParameters Parameters;
SearchResource.ListRequest request;
string nextToken;
@@ -130,8 +132,8 @@ namespace FoxTube
features.SelectedItems.Add(features.Items[4]);
SearchListResponse response = await request.ExecuteAsync();
searchTerm.Text = $"Search results for: {Parameters.Term}";
resultsCount.Text = $"Found: {SetResults(response.PageInfo.TotalResults)} item(s)";
searchTerm.Text = $"{resources.GetString("/Search/header")} '{Parameters.Term}'";
resultsCount.Text = $"{resources.GetString("/Search/found")}: {SetResults(response.PageInfo.TotalResults)} {resources.GetString("/Search/items")}";
if (!string.IsNullOrWhiteSpace(response.NextPageToken))
nextToken = response.NextPageToken;
else
@@ -158,12 +160,12 @@ namespace FoxTube
if(filters.Visibility == Visibility.Collapsed)
{
filters.Visibility = Visibility.Visible;
toggleFilters.Content = "Hide filters \xE014";
toggleFilters.Content = resources.GetString("/Search/hideFilters");
}
else
{
filters.Visibility = Visibility.Collapsed;
toggleFilters.Content = "Show filters \xE015";
toggleFilters.Content = resources.GetString("/Search/filters/Content");
}
}
+1 -1
View File
@@ -36,7 +36,7 @@
<TextBlock x:Uid="/General/notifications" Text="Notifications" FontSize="22"/>
<ToggleSwitch x:Uid="/General/newVideo" Name="newVideo" OnContent="Notify when someone of your subscriptions uploaded new video" OffContent="Notify when someone of your subscriptions uploaded new video" Toggled="notification_IsEnabledChanged"/>
<ToggleSwitch Name="devNews" OnContent="Recieve messages from developers" OffContent="Recieve messages from developers" Toggled="devNews_Toggled"/>
<ToggleSwitch x:Uid="/General/devNotifications" Name="devNews" OnContent="Recieve messages from developers" OffContent="Recieve messages from developers" Toggled="devNews_Toggled"/>
<TextBlock x:Uid="/General/color" Text="Color mode" FontSize="22"/>
<RadioButton x:Uid="/General/colorLight" Content="Light" Name="light" GroupName="color" Checked="RadioButton_Checked"/>
+1 -1
View File
@@ -23,7 +23,7 @@ namespace FoxTube.Pages.SettingsPages
language.SelectedItem = language.Items.Find(i => ((ComboBoxItem)i).Tag.ToString() == SettingsStorage.Language);
safeSearch.SelectedIndex = SettingsStorage.SafeSearch;
foreach (VideoQuality i in Enum.GetValues(typeof(VideoQuality)))
foreach (VideoQuality i in Enum.GetValues(typeof(VideoQuality)).ToReversedList())
quality.Items.Add(new ComboBoxItem() { Tag = i.GetVideoQualityLabel(), Content = i.GetVideoQualityLabel() });
quality.SelectedItem = quality.Items.ToList().Find(i => ((ComboBoxItem)i).Tag.ToString() == SettingsStorage.VideoQuality);
mobileWarning.IsOn = SettingsStorage.CheckConnection;
+7 -17
View File
@@ -2,44 +2,34 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using FoxTube.Classes;
using System.Xml;
using Windows.Storage;
using System.Diagnostics;
using Windows.UI.Popups;
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
using System.Xml;
namespace FoxTube.Pages.SettingsPages
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// Page with changelogs and dev messages
/// </summary>
public sealed partial class Inbox : Page
{
List<InboxItem> items = new List<InboxItem>();
public Inbox()
{
this.InitializeComponent();
InitializeComponent();
}
public void LoadItems()
public async void LoadItems()
{
try
{
XmlDocument doc = new XmlDocument();
doc.Load("http://foxgame-studio.000webhostapp.com/foxtube-changelog.xml");
StorageFile file = await (await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFolderAsync(@"Assets\Data")).GetFileAsync("Patchnotes.xml");
doc.Load(await file.OpenStreamForReadAsync());
foreach (XmlElement e in doc["items"].ChildNodes)
items.Add(new InboxItem(
e.GetAttribute("version"),
+9 -9
View File
@@ -47,7 +47,7 @@
<StackPanel Orientation="Vertical" Grid.Column="1" Padding="5" VerticalAlignment="Center">
<TextBlock Name="channelName" Text="[Channel name]" FontSize="18"/>
<TextBlock Name="subscribers" Text="[subscribers]" Foreground="Gray" Margin="0,0,0,5"/>
<Button Click="subscribe_Click" Grid.Column="2" Height="30" Width="200" Background="Red" Foreground="White" FontSize="14" FontWeight="SemiBold" Content="Subscirbe" Name="subscribe"/>
<Button x:Uid="/Cards/subscribe" Click="subscribe_Click" Grid.Column="2" Height="30" Width="200" Background="Red" Foreground="White" FontSize="14" FontWeight="SemiBold" Content="Subscirbe" Name="subscribe"/>
</StackPanel>
</StackPanel>
</Button>
@@ -81,12 +81,12 @@
</ScrollViewer>
<CommandBar VerticalAlignment="Bottom" Name="commandbar">
<AppBarButton Icon="Download" Label="Download video" Name="download">
<AppBarButton x:Uid="/VideoPage/download" Icon="Download" Label="Download video" Name="download">
<AppBarButton.Flyout>
<MenuFlyout x:Name="downloadSelector"/>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Name="addTo" Label="Add to" Icon="Add">
<AppBarButton x:Uid="/VideoPage/addTo" Name="addTo" Label="Add to" Icon="Add">
<AppBarButton.Flyout>
<Flyout>
<ScrollViewer Margin="-12" MaxHeight="300">
@@ -127,14 +127,14 @@
</Flyout>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton Name="refresh" Click="refresh_Click" Icon="Refresh" Label="Refresh page"/>
<AppBarButton Name="share" Click="share_Click" Icon="Share" Label="Share"/>
<AppBarButton Name="openBrowser" Click="openBrowser_Click" Icon="Globe" Label="Open in browser"/>
<AppBarButton x:Uid="/VideoPage/refresh" Name="refresh" Click="refresh_Click" Icon="Refresh" Label="Refresh page"/>
<AppBarButton x:Uid="/VideoPage/share" Name="share" Click="share_Click" Icon="Share" Label="Share"/>
<AppBarButton x:Uid="/VideoPage/openWeb" Name="openBrowser" Click="openBrowser_Click" Icon="Globe" Label="Open in browser"/>
</CommandBar>
<Grid Grid.Column="1" Name="tabsPlaceholder">
<Pivot Grid.Row="1" Name="pivot" SelectedIndex="0" IsHeaderItemsCarouselEnabled="False">
<PivotItem Header="Suggestions">
<PivotItem x:Uid="/VideoPage/related" Header="Suggestions">
<ScrollViewer>
<StackPanel>
<controls1:Advert/>
@@ -142,10 +142,10 @@
</StackPanel>
</ScrollViewer>
</PivotItem>
<PivotItem Header="Comments" Name="commentsPlaceholder">
<PivotItem x:Uid="/VideoPage/comments" Header="Comments" Name="commentsPlaceholder">
<pages:CommentsPage/>
</PivotItem>
<PivotItem Header="Playlist" Name="playlist">
<PivotItem x:Uid="/VideoPage/playlist" Header="Playlist" Name="playlist">
<ScrollViewer>
<StackPanel>
<StackPanel Padding="8" Background="{ThemeResource SystemControlBackgroundChromeMediumBrush}">
+16 -15
View File
@@ -7,6 +7,7 @@ using System.Diagnostics;
using System.Globalization;
using System.Linq;
using Windows.ApplicationModel.DataTransfer;
using Windows.ApplicationModel.Resources;
using Windows.Foundation;
using Windows.Storage;
using Windows.System;
@@ -43,7 +44,7 @@ namespace FoxTube.Pages
/// </summary>
public sealed partial class VideoPage : Page
{
ApplicationDataContainer settings = ApplicationData.Current.LocalSettings;
ResourceLoader resources = ResourceLoader.GetForCurrentView("VideoPage");
public string videoId;
public string playlistId = null;
@@ -87,7 +88,7 @@ namespace FoxTube.Pages
}
}
private void Player_NextClicked(object sender, params object[] e)
private void Player_NextClicked()
{
if (playlistId != null)
playlistList.SelectedIndex++;
@@ -209,7 +210,7 @@ namespace FoxTube.Pages
channelAvatar.ProfilePicture = new BitmapImage(new Uri(item1.Snippet.Thumbnails.Medium.Url));
channelName.Text = item.Snippet.ChannelTitle;
subscribers.Text = $"{item1.Statistics.SubscriberCount:0,0} subscribers";
subscribers.Text = $"{item1.Statistics.SubscriberCount:0,0} {resources.GetString("/Cards/subscribers")}";
//Setting ratings
dislikes.Text = $"{item.Statistics.DislikeCount:0,0}";
@@ -242,7 +243,7 @@ namespace FoxTube.Pages
{
subscribe.Background = new SolidColorBrush(Colors.Transparent);
subscribe.Foreground = new SolidColorBrush(Colors.Gray);
subscribe.Content = "Subscribed";
subscribe.Content = resources.GetString("/Cards/unsubscribe");
}
}
subscribe.Visibility = Visibility.Visible;
@@ -271,7 +272,7 @@ namespace FoxTube.Pages
pivot.Items.Remove(commentsPlaceholder);
else
{
commentsPlaceholder.Header = "Chat";
commentsPlaceholder.Header = resources.GetString("/VideoPage/chat");
commentsPlaceholder.Content = new Chat(item.LiveStreamingDetails.ActiveLiveChatId);
pivot.SelectedItem = commentsPlaceholder;
}
@@ -284,12 +285,12 @@ namespace FoxTube.Pages
request.Id = videoId;
Video video = (await request.ExecuteAsync()).Items[0];
views.Text = $"{video.LiveStreamingDetails.ConcurrentViewers} viewers";
views.Text = $"{video.LiveStreamingDetails.ConcurrentViewers} {resources.GetString("/Cards/viewers")}";
}
void LoadStats()
{
views.Text = $"{item.Statistics.ViewCount:0,0} views";
views.Text = $"{item.Statistics.ViewCount:0,0} {resources.GetString("/Cards/views")}";
comments.Initialize(item);
LoadDownloads();
@@ -313,8 +314,8 @@ namespace FoxTube.Pages
MenuFlyoutItem audioItem = new MenuFlyoutItem()
{
Text = "Audio track",
Tag = new object[] { infoSet.Audio[0], "Audio only" }
Text = resources.GetString("/VideoPage/audio"),
Tag = new object[] { infoSet.Audio[0], resources.GetString("/Cards/audioOnly") }
};
audioItem.Click += downloadItemSelected;
downloadSelector.Items.Add(audioItem);
@@ -336,7 +337,7 @@ namespace FoxTube.Pages
request.RegionCode = SettingsStorage.Region;
request.RelevanceLanguage = SettingsStorage.RelevanceLanguage;
request.RelatedToVideoId = videoId;
request.SafeSearch = (SearchResource.ListRequest.SafeSearchEnum)(int)settings.Values["safeSearch"];
request.SafeSearch = (SearchResource.ListRequest.SafeSearchEnum)SettingsStorage.SafeSearch;
request.MaxResults = 20;
request.Type = "video";
@@ -380,8 +381,8 @@ namespace FoxTube.Pages
private async void openBrowser_Click(object sender, RoutedEventArgs e)
{
player.Pause();
string timecode = player.elapsed.TotalSeconds > 10 ?
"&t=" + (int)player.elapsed.TotalSeconds + "s" : string.Empty;
string timecode = player.Elapsed.TotalSeconds > 10 ?
"&t=" + (int)player.Elapsed.TotalSeconds + "s" : string.Empty;
await Launcher.LaunchUriAsync($"https://www.youtube.com/watch?v={videoId}{timecode}".ToUri());
}
@@ -433,7 +434,7 @@ namespace FoxTube.Pages
item.Snippet.Thumbnails.Medium.Url,
item.Snippet.Title,
$"https://www.youtube.com/watch?v={videoId}",
"video");
resources.GetString("/Cards/videoShare"));
}
private void share_Click(object sender, RoutedEventArgs e)
@@ -529,13 +530,13 @@ namespace FoxTube.Pages
{
subscribe.Background = new SolidColorBrush(Colors.Transparent);
subscribe.Foreground = new SolidColorBrush(Colors.Gray);
subscribe.Content = "Subscribed";
subscribe.Content = resources.GetString("/Cards/unsubscribe");
}
else
{
subscribe.Background = new SolidColorBrush(Colors.Red);
subscribe.Foreground = new SolidColorBrush(Colors.White);
subscribe.Content = "Subscribe";
subscribe.Content = resources.GetString("/Cards/subscribe/Content");
}
}
}