admin管理员组文章数量:1418023
I am looking to incorporate a video player in one of my C# WPF project and I am planning on using MPV.
I went ahead and took a look at the NuGet packages already available and I noticed two who caught my interest:
- mpv by Frost (the library by itself, not a player)
- MPV.NET by hudec117 (an actual player based using the MPV library)
MPV.NET needs to use a compiled MPV library in the form of a .DLL and the mpv NuGet package does contain the required .DLL.
I can easily use "using MPV.NET" and then proceed with the player code:
using System.Windows;
using Mpv.NET.Player;
namespace Mpv.NET.WPFExample
{
public partial class MainWindow : Window
{
private MpvPlayer player;
public MainWindow()
{
InitializeComponent();
player = new MpvPlayer(PlayerHost.Handle, "path to the libmpv dll can be specified here")
{
Loop = true,
Volume = 50
};
player.Load(".mp4");
player.Resume();
}
private void WindowOnClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
player.Dispose();
}
}
}
But this require the previously mentioned .DLL in a folder to work correctly, for example, in "lib" in the build folder.
My question is:
How may I use the mpv NuGet package to create and/or copy said .DLL in the build folder automatically since I am not able to use it with "using" and then use the other player package to use that .DLL (probably by just proving a valid path) please?
The reason I am mainly interested with the mpv package, is that it would take care of updates more easily than me copying the .DLL every time in another folder for the player package.
In short, I need both packages to work with each other.
May you help me out with this please?
Thank you for your time and help, it is greatly appreciated!
本文标签: cQuestion regarding mpv (libmpv) use as a NuGet Package in Visual Studio 2022Stack Overflow
版权声明:本文标题:c# - Question regarding mpv (libmpv) use as a NuGet Package in Visual Studio 2022 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745282968a2651533.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论