mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 10:19:07 +00:00
Add controls to the VideoPlayer
This commit is contained in:
@@ -34,6 +34,8 @@ namespace QuickLook.Plugin.VideoViewer
|
||||
using (var element = new MediaElement {Source = new Uri(path)})
|
||||
{
|
||||
context.SetPreferredSizeFit(new Size(element.NaturalVideoWidth, element.NaturalVideoHeight), 0.6);
|
||||
context.PreferredSize = new Size(context.PreferredSize.Width,
|
||||
context.PreferredSize.Height + 26); // add control bar
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +47,8 @@ namespace QuickLook.Plugin.VideoViewer
|
||||
|
||||
_vp.LoadAndPlay(path);
|
||||
|
||||
context.Title = $"{Path.GetFileName(path)} ({TimeSpan.FromSeconds(_vp.mediaElement.NaturalDuration).ToString(@"hh\:mm\:ss")}, {_vp.mediaElement.NaturalVideoWidth} × {_vp.mediaElement.NaturalVideoHeight} )";
|
||||
context.Title =
|
||||
$"{Path.GetFileName(path)} ({_vp.mediaElement.NaturalVideoWidth}×{_vp.mediaElement.NaturalVideoHeight})";
|
||||
context.IsBusy = false;
|
||||
}
|
||||
|
||||
@@ -54,4 +57,4 @@ namespace QuickLook.Plugin.VideoViewer
|
||||
_vp?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user