mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 18:39:45 +00:00
Fix crash when closing preview quickly
This commit is contained in:
@@ -45,7 +45,6 @@ namespace QuickLook.Plugin.VideoViewer
|
|||||||
private readonly ContextObject _context;
|
private readonly ContextObject _context;
|
||||||
private BitmapSource _coverArt;
|
private BitmapSource _coverArt;
|
||||||
|
|
||||||
private bool _hasEnded;
|
|
||||||
private bool _hasVideo;
|
private bool _hasVideo;
|
||||||
private bool _isPlaying;
|
private bool _isPlaying;
|
||||||
private bool _wasPlaying;
|
private bool _wasPlaying;
|
||||||
@@ -147,6 +146,9 @@ namespace QuickLook.Plugin.VideoViewer
|
|||||||
|
|
||||||
private void MediaOpened(object o, RoutedEventArgs args)
|
private void MediaOpened(object o, RoutedEventArgs args)
|
||||||
{
|
{
|
||||||
|
if (mediaElement == null)
|
||||||
|
return;
|
||||||
|
|
||||||
HasVideo = mediaElement.HasVideo;
|
HasVideo = mediaElement.HasVideo;
|
||||||
|
|
||||||
_context.IsBusy = false;
|
_context.IsBusy = false;
|
||||||
@@ -164,6 +166,9 @@ namespace QuickLook.Plugin.VideoViewer
|
|||||||
|
|
||||||
private void MediaEnded(object sender, RoutedEventArgs e)
|
private void MediaEnded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
if (mediaElement == null)
|
||||||
|
return;
|
||||||
|
|
||||||
IsPlaying = false;
|
IsPlaying = false;
|
||||||
|
|
||||||
mediaElement.MediaPosition = 0;
|
mediaElement.MediaPosition = 0;
|
||||||
|
Reference in New Issue
Block a user