Commit 2cc769e2 authored by Martin Finkel's avatar Martin Finkel Committed by Steve Lhomme

#116 remove setting and add "restart" option when appropriate

parent 60c354a2
using VLC.Model.Video;
using VLC.Utils;
using VLC.ViewModels;
namespace VLC.Commands.VideoLibrary
{
public class RestartAndPlayCommand : AlwaysExecutableCommand
{
public override void Execute(object parameter)
{
if(parameter is VideoItem video)
video.TimeWatchedSeconds = 0;
Locator.VideoLibraryVM.OpenVideo.Execute(parameter);
}
}
}
\ No newline at end of file
...@@ -18,7 +18,7 @@ namespace VLC.Commands.VideoPlayer ...@@ -18,7 +18,7 @@ namespace VLC.Commands.VideoPlayer
{ {
public override async void Execute(object parameter) public override async void Execute(object parameter)
{ {
await Locator.MediaPlaybackViewModel.UpdatePosition(); Locator.MediaPlaybackViewModel.UpdatePosition();
Locator.MediaPlaybackViewModel.PlaybackService.Stop(); Locator.MediaPlaybackViewModel.PlaybackService.Stop();
} }
......
...@@ -7,12 +7,9 @@ ...@@ -7,12 +7,9 @@
* Refer to COPYING file of the official project for license * Refer to COPYING file of the official project for license
**********************************************************************/ **********************************************************************/
using Windows.UI.Core;
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Threading.Tasks; using System.Threading.Tasks;
using SQLite;
using VLC.Commands.MusicPlayer;
using VLC.Model.Music; using VLC.Model.Music;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -20,14 +17,9 @@ using VLC.Helpers; ...@@ -20,14 +17,9 @@ using VLC.Helpers;
using VLC.Model; using VLC.Model;
using VLC.Model.Video; using VLC.Model.Video;
using VLC.Utils; using VLC.Utils;
using System.Diagnostics;
using VLC.Services.RunTime;
using VLC.Model.Stream;
using Windows.Storage; using Windows.Storage;
using System.IO;
using libVLCX; using libVLCX;
using VLC.ViewModels; using VLC.ViewModels;
using VLC.Database;
using Windows.Media.Devices; using Windows.Media.Devices;
namespace VLC.Services.RunTime namespace VLC.Services.RunTime
...@@ -271,28 +263,10 @@ namespace VLC.Services.RunTime ...@@ -271,28 +263,10 @@ namespace VLC.Services.RunTime
#region Playback methods #region Playback methods
private async Task<float> FetchPreviousPosition(IMediaItem media) float FetchPreviousPosition(IMediaItem media)
{ {
var video = media as VideoItem; if (!(media is VideoItem video))
if (video == null)
return 0; return 0;
var roamFile = await ApplicationData.Current.RoamingFolder.TryGetItemAsync("roamVideo.txt");
if (roamFile != null)
{
var roamVideos = await FileIO.ReadLinesAsync(roamFile as StorageFile);
if (roamVideos.Any())
{
if (roamVideos[0] == media.Name)
{
int leftTime = 0;
if (int.TryParse(roamVideos[1], out leftTime))
{
video.TimeWatchedSeconds = leftTime;
}
}
}
}
TileHelper.UpdateVideoTile(); TileHelper.UpdateVideoTile();
// VLC expects a start-time in seconds // VLC expects a start-time in seconds
...@@ -358,11 +332,9 @@ namespace VLC.Services.RunTime ...@@ -358,11 +332,9 @@ namespace VLC.Services.RunTime
CurrentMedia.addOption(!Locator.SettingsVM.HardwareAccelerationEnabled ? ":avcodec-hw=none" : ":avcodec-hw=d3d11va"); CurrentMedia.addOption(!Locator.SettingsVM.HardwareAccelerationEnabled ? ":avcodec-hw=none" : ":avcodec-hw=d3d11va");
if (DeviceHelper.GetDeviceType() == DeviceTypeEnum.Phone) if (DeviceHelper.GetDeviceType() == DeviceTypeEnum.Phone)
CurrentMedia.addOption(!Locator.SettingsVM.HardwareAccelerationEnabled ? ":avcodec-threads=0" : ":avcodec-threads=1"); CurrentMedia.addOption(!Locator.SettingsVM.HardwareAccelerationEnabled ? ":avcodec-threads=0" : ":avcodec-threads=1");
if (Locator.SettingsVM.ResumePreviousPosition)
{ var pos = FetchPreviousPosition(media);
var pos = await FetchPreviousPosition(media); CurrentMedia.addOption($":start-time={pos}");
CurrentMedia.addOption($":start-time={pos}");
}
if (_mediaPlayer == null) if (_mediaPlayer == null)
......
...@@ -287,7 +287,7 @@ namespace VLC.Utils ...@@ -287,7 +287,7 @@ namespace VLC.Utils
public static string NotificationWhenSongStarts => _resourcesLoader.GetString(nameof(NotificationWhenSongStarts)); public static string NotificationWhenSongStarts => _resourcesLoader.GetString(nameof(NotificationWhenSongStarts));
public static string VideoPlaybackInBackground => _resourcesLoader.GetString(nameof(VideoPlaybackInBackground)); public static string VideoPlaybackInBackground => _resourcesLoader.GetString(nameof(VideoPlaybackInBackground));
public static string CompactOverlayPiP => _resourcesLoader.GetString(nameof(CompactOverlayPiP)); public static string CompactOverlayPiP => _resourcesLoader.GetString(nameof(CompactOverlayPiP));
public static string ResumeOrRestartPlayback => _resourcesLoader.GetString(nameof(ResumeOrRestartPlayback)); public static string Restart => _resourcesLoader.GetString(nameof(Restart));
public static string EvenIfBackground => _resourcesLoader.GetString(nameof(EvenIfBackground)); public static string EvenIfBackground => _resourcesLoader.GetString(nameof(EvenIfBackground));
public static string EvenIfNotBackground => _resourcesLoader.GetString(nameof(EvenIfNotBackground)); public static string EvenIfNotBackground => _resourcesLoader.GetString(nameof(EvenIfNotBackground));
public static string NeedRestart => _resourcesLoader.GetString(nameof(NeedRestart)); public static string NeedRestart => _resourcesLoader.GetString(nameof(NeedRestart));
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\CloseFlyoutAndPlayVideoCommand.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\CloseFlyoutAndPlayVideoCommand.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\FavoriteVideoCommand.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\FavoriteVideoCommand.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\PickMediaCommand.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\PickMediaCommand.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\RestartAndPlayCommand.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\TVShowClickedCommand.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Commands\VideoLibrary\TVShowClickedCommand.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoPlayer\DownloadSubtitleCommand.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Commands\VideoPlayer\DownloadSubtitleCommand.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Commands\VideoPlayer\InitPiPCommand.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Commands\VideoPlayer\InitPiPCommand.cs" />
......
...@@ -468,26 +468,12 @@ namespace VLC.ViewModels ...@@ -468,26 +468,12 @@ namespace VLC.ViewModels
await Locator.PlaybackService.SetPlaylist(new List<IMediaItem> { video }); await Locator.PlaybackService.SetPlaylist(new List<IMediaItem> { video });
} }
public async Task UpdatePosition() public void UpdatePosition()
{ {
if (Locator.VideoPlayerVm.CurrentVideo != null) if (Locator.VideoPlayerVm.CurrentVideo != null)
{ {
Locator.VideoPlayerVm.CurrentVideo.TimeWatchedSeconds = (int)((double)Time / 1000); ; Locator.VideoPlayerVm.CurrentVideo.TimeWatchedSeconds = (int)((double)Time / 1000);
Locator.MediaLibrary.UpdateVideo(Locator.VideoPlayerVm.CurrentVideo); Locator.MediaLibrary.UpdateVideo(Locator.VideoPlayerVm.CurrentVideo);
try
{
var file = await ApplicationData.Current.RoamingFolder.CreateFileAsync("roamVideo.txt",
CreationCollisionOption.ReplaceExisting);
await FileIO.WriteLinesAsync(file, new[]
{
Locator.VideoPlayerVm.CurrentVideo.Name,
Locator.VideoPlayerVm.CurrentVideo.TimeWatchedSeconds.ToString()
});
}
catch (Exception e)
{
LogHelper.Log(e.Message);
}
} }
} }
......
...@@ -623,12 +623,6 @@ namespace VLC.ViewModels.Settings ...@@ -623,12 +623,6 @@ namespace VLC.ViewModels.Settings
public ChangeSettingsViewCommand ChangeSettingsViewCommand { get; } = new ChangeSettingsViewCommand(); public ChangeSettingsViewCommand ChangeSettingsViewCommand { get; } = new ChangeSettingsViewCommand();
public bool ResumePreviousPosition
{
get => ApplicationSettingsHelper.ReadSettingsValue(nameof(ResumePreviousPosition)) as bool? ?? true;
set => ApplicationSettingsHelper.SaveSettingsValue(nameof(ResumePreviousPosition), value);
}
public static void SwitchLanguage(Languages language) public static void SwitchLanguage(Languages language)
{ {
var currentCulture = "en-US"; var currentCulture = "en-US";
......
...@@ -100,7 +100,7 @@ namespace VLC.ViewModels.VideoVM ...@@ -100,7 +100,7 @@ namespace VLC.ViewModels.VideoVM
public static TVShowClickedCommand TVShowClickedCommand { get; private set; } = new TVShowClickedCommand(); public static TVShowClickedCommand TVShowClickedCommand { get; private set; } = new TVShowClickedCommand();
public PlayVideoCommand OpenVideo { get; private set; } = new PlayVideoCommand(); public PlayVideoCommand OpenVideo { get; private set; } = new PlayVideoCommand();
public RestartAndPlayCommand RestartAndPlayCommand { get; } = new RestartAndPlayCommand();
public CloseFlyoutAndPlayVideoCommand CloseFlyoutAndPlayVideoCommand { get; private set; } = new CloseFlyoutAndPlayVideoCommand(); public CloseFlyoutAndPlayVideoCommand CloseFlyoutAndPlayVideoCommand { get; private set; } = new CloseFlyoutAndPlayVideoCommand();
public DeleteFromLibraryCommand DeleteFromLibraryCommand { get; private set; } = new DeleteFromLibraryCommand(); public DeleteFromLibraryCommand DeleteFromLibraryCommand { get; private set; } = new DeleteFromLibraryCommand();
public ChangeVideoViewCommand ChangeVideoViewCommand { get; private set; } = new ChangeVideoViewCommand(); public ChangeVideoViewCommand ChangeVideoViewCommand { get; private set; } = new ChangeVideoViewCommand();
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -1161,9 +1161,9 @@ ...@@ -1161,9 +1161,9 @@
<source>Czech</source> <source>Czech</source>
<target state="new">Czech</target> <target state="new">Czech</target>
</trans-unit> </trans-unit>
<trans-unit id="ResumeOrRestartPlayback" translate="yes" xml:space="preserve"> <trans-unit id="Restart" translate="yes" xml:space="preserve">
<source>Resume or restart playback</source> <source>restart</source>
<target state="new">Resume or restart playback</target> <target state="new">restart</target>
</trans-unit> </trans-unit>
</group> </group>
</body> </body>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<Thickness x:Key="FrameMarginHorizontal">16,0</Thickness> <Thickness x:Key="FrameMarginHorizontal">16,0</Thickness>
<Thickness x:Key="FrameMarginTop">0,16,0,0</Thickness> <Thickness x:Key="FrameMarginTop">0,16,0,0</Thickness>
<Thickness x:Key="FrameMarginBottom">0,0,0,16</Thickness> <Thickness x:Key="FrameMarginBottom">0,0,0,16</Thickness>
<Thickness x:Key="FrameMarginBottomLeft">16,0,0,16</Thickness>
<Thickness x:Key="FrameMarginLeft">16,0,0,0</Thickness> <Thickness x:Key="FrameMarginLeft">16,0,0,0</Thickness>
<Thickness x:Key="FrameMarginRight">0,0,16,0</Thickness> <Thickness x:Key="FrameMarginRight">0,0,16,0</Thickness>
<x:Double x:Key="FrameMarginSides">16</x:Double> <x:Double x:Key="FrameMarginSides">16</x:Double>
......
...@@ -762,7 +762,6 @@ ...@@ -762,7 +762,6 @@
<data name="PolishLanguage" xml:space="preserve"> <data name="PolishLanguage" xml:space="preserve">
<value>Polish</value> <value>Polish</value>
</data> </data>
<data name="DanishLanguage" xml:space="preserve"> <data name="DanishLanguage" xml:space="preserve">
<value>Danish</value> <value>Danish</value>
</data> </data>
...@@ -811,9 +810,6 @@ ...@@ -811,9 +810,6 @@
<data name="CompactOverlayPiP" xml:space="preserve"> <data name="CompactOverlayPiP" xml:space="preserve">
<value>use windows 10 pip</value> <value>use windows 10 pip</value>
</data> </data>
<data name="ResumeOrRestartPlayback" xml:space="preserve">
<value>Resume or restart playback</value>
</data>
<data name="TvUnsafeArea" xml:space="preserve"> <data name="TvUnsafeArea" xml:space="preserve">
<value>TV unsafe area</value> <value>TV unsafe area</value>
</data> </data>
...@@ -826,4 +822,7 @@ ...@@ -826,4 +822,7 @@
<data name="NoExtraMargin" xml:space="preserve"> <data name="NoExtraMargin" xml:space="preserve">
<value>No extra margin</value> <value>No extra margin</value>
</data> </data>
<data name="Restart" xml:space="preserve">
<value>restart</value>
</data>
</root> </root>
\ No newline at end of file
...@@ -259,19 +259,12 @@ ...@@ -259,19 +259,12 @@
<ToggleSwitch Tag="WindowsOnly" <ToggleSwitch Tag="WindowsOnly"
Header="{Binding Source={StaticResource Strings}, Path=VideoPlaybackInBackground}" Header="{Binding Source={StaticResource Strings}, Path=VideoPlaybackInBackground}"
IsOn="{Binding ContinueVideoPlaybackInBackground, Mode=TwoWay}" /> IsOn="{Binding ContinueVideoPlaybackInBackground, Mode=TwoWay}" />
<ToggleSwitch Tag="WindowsOnly" <ToggleSwitch Tag="WindowsOnly"
Name="compactOverlayToggle" Name="compactOverlayToggle"
Header="{Binding Source={StaticResource Strings}, Path=CompactOverlayPiP}" Header="{Binding Source={StaticResource Strings}, Path=CompactOverlayPiP}"
IsOn="{Binding CompactOverlayPiP, Mode=TwoWay}" /> IsOn="{Binding CompactOverlayPiP, Mode=TwoWay}" />
<toolkitControls:HeaderedTextBlock Margin="{StaticResource FrameMarginTop}"
<ToggleSwitch Name="ResumeOrRestartPlayback"
Header="{Binding Source={StaticResource Strings}, Path=ResumeOrRestartPlayback}"
OffContent="Restart"
OnContent="Resume"
IsOn="{Binding ResumePreviousPosition, Mode=TwoWay}"/>
<toolkitControls:HeaderedTextBlock Margin="{StaticResource FrameMarginTop}"
Header="{Binding Source={StaticResource Strings}, Path=SubtitlesEncoding}" Header="{Binding Source={StaticResource Strings}, Path=SubtitlesEncoding}"
Text="{Binding Source={StaticResource Strings}, Path=NeedRestart}" Text="{Binding Source={StaticResource Strings}, Path=NeedRestart}"
IsTabStop="False" /> IsTabStop="False" />
......
...@@ -74,6 +74,7 @@ ...@@ -74,6 +74,7 @@
FontFamily="{StaticResource VLCFont}" /> FontFamily="{StaticResource VLCFont}" />
</AppBarButton.Icon> </AppBarButton.Icon>
</AppBarButton> </AppBarButton>
<AppBarButton Label="{Binding Source={StaticResource Strings}, Path=DeleteSelected}" <AppBarButton Label="{Binding Source={StaticResource Strings}, Path=DeleteSelected}"
Command="{Binding Source={StaticResource Locator}, Path=VideoLibraryVM.DeleteFromLibraryCommand}" Command="{Binding Source={StaticResource Locator}, Path=VideoLibraryVM.DeleteFromLibraryCommand}"
CommandParameter="{Binding}" CommandParameter="{Binding}"
...@@ -87,7 +88,21 @@ ...@@ -87,7 +88,21 @@
</AppBarButton.Icon> </AppBarButton.Icon>
</AppBarButton> </AppBarButton>
</Grid> </Grid>
<TextBlock Grid.Row="2" <AppBarButton Grid.Row="2"
Name="RestartPlayback"
Label="{Binding Source={StaticResource Strings}, Path=Restart}"
Click="ActionButton_Click"
Margin="{StaticResource FrameMarginBottomLeft}"
Command="{Binding Source={StaticResource Locator}, Path=VideoLibraryVM.RestartAndPlayCommand}"
CommandParameter="{Binding}"
Visibility="{Binding TimeWatchedSeconds, Converter={StaticResource NegatedCountToVisibilityConverter}}"
Style="{StaticResource AppBarButtonStyleHorizontal}">
<AppBarButton.Icon>
<FontIcon Glyph="&#xE777;"
FontFamily="Segoe MDL2 Assets" />
</AppBarButton.Icon>
</AppBarButton>
<TextBlock Grid.Row="3"
Margin="{StaticResource FrameMarginLeft}" Margin="{StaticResource FrameMarginLeft}"
Style="{StaticResource BodyTextBlockStyle}"> Style="{StaticResource BodyTextBlockStyle}">
<Run Text="{Binding Type}" /> <Run Text="{Binding Type}" />
...@@ -96,7 +111,7 @@ ...@@ -96,7 +111,7 @@
<Run Text="x" /> <Run Text="x" />
<Run Text="{Binding Height}" /> <Run Text="{Binding Height}" />
</TextBlock> </TextBlock>
<TextBlock Grid.Row="3" <TextBlock Grid.Row="4"
Text="{Binding Path}"