mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-05-08 03:06:29 +08:00
@@ -22,6 +22,7 @@ using QuickLook.Common.Plugin;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
namespace QuickLook.Plugin.VideoViewer;
|
||||
@@ -31,6 +32,7 @@ public sealed class Plugin : IViewer
|
||||
private static MediaInfoLib _mediaInfo;
|
||||
|
||||
private ViewerPanel _vp;
|
||||
private static readonly bool isArm64 = RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
||||
|
||||
public int Priority => -3;
|
||||
|
||||
@@ -38,7 +40,7 @@ public sealed class Plugin : IViewer
|
||||
{
|
||||
_mediaInfo = new MediaInfoLib(Path.Combine(
|
||||
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
|
||||
Environment.Is64BitProcess ? @"MediaInfo-x64\" : @"MediaInfo-x86\"));
|
||||
isArm64 ? @"MediaInfo-arm64\" : Environment.Is64BitProcess ? @"MediaInfo-x64\" : @"MediaInfo-x86\"));
|
||||
_mediaInfo.Option("Cover_Data", "base64");
|
||||
}
|
||||
|
||||
@@ -128,8 +130,10 @@ public sealed class Plugin : IViewer
|
||||
context.ViewerContent = _vp;
|
||||
|
||||
context.Title = $"{Path.GetFileName(path)}";
|
||||
|
||||
_vp.LoadAndPlay(path, _mediaInfo);
|
||||
if (isArm64)
|
||||
_vp.LoadAndPlayWPF(path, _mediaInfo);
|
||||
else
|
||||
_vp.LoadAndPlay(path, _mediaInfo);
|
||||
}
|
||||
|
||||
public void Cleanup()
|
||||
|
||||
Reference in New Issue
Block a user