seek indicator for miniview & s char after secured links fixed
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using MyToolkit.Multimedia;
|
using MyToolkit.Multimedia;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Windows.UI;
|
using Windows.UI;
|
||||||
@@ -56,20 +57,24 @@ namespace FoxTube
|
|||||||
Regex regx = new Regex(@"(http(s)?://[\S]+|www.[\S]+|[\S]+@[\S]+)", RegexOptions.IgnoreCase);
|
Regex regx = new Regex(@"(http(s)?://[\S]+|www.[\S]+|[\S]+@[\S]+)", RegexOptions.IgnoreCase);
|
||||||
Regex isWWW = new Regex(@"(http[s]?://[\S]+|www.[\S]+)");
|
Regex isWWW = new Regex(@"(http[s]?://[\S]+|www.[\S]+)");
|
||||||
Regex isEmail = new Regex(@"[\S]+@[\S]+");
|
Regex isEmail = new Regex(@"[\S]+@[\S]+");
|
||||||
foreach (var item in regx.Split(text))
|
foreach (string item in regx.Split(text))
|
||||||
{
|
{
|
||||||
if (isWWW.IsMatch(item))
|
if (isWWW.IsMatch(item))
|
||||||
{
|
{
|
||||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri(item.ToLower().StartsWith("http") ? item : $"http://{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
Debug.WriteLine(item);
|
||||||
|
Hyperlink link = new Hyperlink { NavigateUri = new Uri(item), Foreground = new SolidColorBrush(Colors.Red) };
|
||||||
link.Inlines.Add(new Run { Text = item });
|
link.Inlines.Add(new Run { Text = item });
|
||||||
block.Inlines.Add(link);
|
block.Inlines.Add(link);
|
||||||
}
|
}
|
||||||
else if (isEmail.IsMatch(item))
|
else if (isEmail.IsMatch(item))
|
||||||
{
|
{
|
||||||
|
Debug.WriteLine(item);
|
||||||
Hyperlink link = new Hyperlink { NavigateUri = new Uri($"mailto:{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
Hyperlink link = new Hyperlink { NavigateUri = new Uri($"mailto:{item}"), Foreground = new SolidColorBrush(Colors.Red) };
|
||||||
link.Inlines.Add(new Run { Text = item });
|
link.Inlines.Add(new Run { Text = item });
|
||||||
block.Inlines.Add(link);
|
block.Inlines.Add(link);
|
||||||
}
|
}
|
||||||
|
else if (item == "s")
|
||||||
|
continue;
|
||||||
else block.Inlines.Add(new Run { Text = item });
|
else block.Inlines.Add(new Run { Text = item });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,7 @@
|
|||||||
Content=""
|
Content=""
|
||||||
Width="45" Height="45"
|
Width="45" Height="45"
|
||||||
ToolTipService.ToolTip="Maximize"/>
|
ToolTipService.ToolTip="Maximize"/>
|
||||||
|
<ProgressBar VerticalAlignment="Bottom" Foreground="Red" Name="seekIndicator" Visibility="Collapsed"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Button Name="skipAd" Visibility="Collapsed" Margin="0,0,0,25" Grid.Row="1" HorizontalAlignment="Right" Foreground="White" VerticalAlignment="Bottom" Padding="10" BorderBrush="Black" BorderThickness="2" Background="#7E000000">
|
<Button Name="skipAd" Visibility="Collapsed" Margin="0,0,0,25" Grid.Row="1" HorizontalAlignment="Right" Foreground="White" VerticalAlignment="Bottom" Padding="10" BorderBrush="Black" BorderThickness="2" Background="#7E000000">
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ namespace FoxTube
|
|||||||
|
|
||||||
total = XmlConvert.ToTimeSpan(item.ContentDetails.Duration);
|
total = XmlConvert.ToTimeSpan(item.ContentDetails.Duration);
|
||||||
seek.Maximum = total.TotalSeconds;
|
seek.Maximum = total.TotalSeconds;
|
||||||
|
seekIndicator.Maximum = total.TotalSeconds;
|
||||||
|
|
||||||
elapsed = TimeSpan.FromSeconds(seek.Value);
|
elapsed = TimeSpan.FromSeconds(seek.Value);
|
||||||
remaining = total.Subtract(elapsed);
|
remaining = total.Subtract(elapsed);
|
||||||
@@ -321,6 +322,7 @@ namespace FoxTube
|
|||||||
void SeekElapsed()
|
void SeekElapsed()
|
||||||
{
|
{
|
||||||
seek.Value = videoSource.Position.TotalSeconds;
|
seek.Value = videoSource.Position.TotalSeconds;
|
||||||
|
seekIndicator.Value = seek.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Elapsed()
|
void Elapsed()
|
||||||
@@ -332,6 +334,7 @@ namespace FoxTube
|
|||||||
touchCentral.Visibility = Visibility.Collapsed;
|
touchCentral.Visibility = Visibility.Collapsed;
|
||||||
if (pointerCaptured)
|
if (pointerCaptured)
|
||||||
Window.Current.CoreWindow.PointerCursor = null;
|
Window.Current.CoreWindow.PointerCursor = null;
|
||||||
|
seekIndicator.Visibility = Visibility.Collapsed;
|
||||||
t.Stop();
|
t.Stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,10 +414,9 @@ namespace FoxTube
|
|||||||
|
|
||||||
void ShowControls()
|
void ShowControls()
|
||||||
{
|
{
|
||||||
if(controls.Visibility == Visibility.Collapsed)
|
controls.Visibility = Visibility.Visible;
|
||||||
{
|
if (miniView)
|
||||||
controls.Visibility = Visibility.Visible;
|
seekIndicator.Visibility = Visibility.Visible;
|
||||||
}
|
|
||||||
if (pointerCaptured)
|
if (pointerCaptured)
|
||||||
Window.Current.CoreWindow.PointerCursor = cursorBackup;
|
Window.Current.CoreWindow.PointerCursor = cursorBackup;
|
||||||
t.Stop();
|
t.Stop();
|
||||||
@@ -603,6 +605,7 @@ namespace FoxTube
|
|||||||
}
|
}
|
||||||
|
|
||||||
await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay);
|
await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay);
|
||||||
|
pointerCaptured = false;
|
||||||
|
|
||||||
titleBar.ButtonBackgroundColor = Colors.Transparent;
|
titleBar.ButtonBackgroundColor = Colors.Transparent;
|
||||||
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
|
titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
|
||||||
@@ -717,6 +720,7 @@ namespace FoxTube
|
|||||||
Width = 432;
|
Width = 432;
|
||||||
Height = 243;
|
Height = 243;
|
||||||
|
|
||||||
|
miniView = true;
|
||||||
Methods.MainPage.MinimizeVideo();
|
Methods.MainPage.MinimizeVideo();
|
||||||
|
|
||||||
mainControls.Visibility = Visibility.Collapsed;
|
mainControls.Visibility = Visibility.Collapsed;
|
||||||
@@ -738,11 +742,12 @@ namespace FoxTube
|
|||||||
|
|
||||||
private void maximize_Click(object sender, RoutedEventArgs e)
|
private void maximize_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SetFullSize.Invoke(this, null);
|
SetFullSize.Invoke(this, false);
|
||||||
|
|
||||||
Width = double.NaN;
|
Width = double.NaN;
|
||||||
Height = double.NaN;
|
Height = double.NaN;
|
||||||
|
|
||||||
|
miniView = false;
|
||||||
Methods.MainPage.MaximizeVideo();
|
Methods.MainPage.MaximizeVideo();
|
||||||
|
|
||||||
mainControls.Visibility = Visibility.Visible;
|
mainControls.Visibility = Visibility.Visible;
|
||||||
|
|||||||
Reference in New Issue
Block a user